npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hexo-auto-front-matter

v0.1.3

Published

Generate front matter automatically for each post in Hexo

Downloads

2

Readme

hexo-auto-front-matter

NPM version GitHub license

Generate hexo front-matter for every post automatically.

As a Hexo user, you must be troubled with front matter setting for each post. With this plugin, you don't need to set title, date, categories, tags, cover one by one. hexo-auto-front-matter generates static post front-matter automatically based on directory/folder name, date of now and customized configuration.

Features

  • Fully integrated all the functions of hexo-auto-category.
  • Automatically generate front-matter title from filename when it's empty.
  • Automatically generate front-matter date from now when it's empty.
  • Automatically append all categories to tags when the tags field is empty.
  • Automatically generate front-matter cover image path from the customized list by choose deepest nested category.
  • Flexible control: every sub module has independent swith.
  • Support keep original front-matter order or sort by customized order list.

Installation

npm install hexo-auto-front-matter --save

Configuration

You can configure this plugin in Hexo _config.yml

# https://github.com/RayKr/hexo-auto-front-matter
auto_front_matter:
  enable: true
  # Whether to keep the original front-matter order
  # `order` is a list, which is empty by default. In this case, the updated front-matter field keeps the order in the original text.
  # When order is not empty, front-matter will be sort by the order, support less or more than the real nums of original post front-matter.
  order:
    # - title
    # - date
    # - categories
    # - tags
    # - cover
    # - description

  # Auto add title from filename
  auto_title:
    enable: true
    # Use `mode` to control Write only if title is empty, or overwrite allways.
    # 1: auto add title only empty (default) 
    # 2: overwrite allways
    mode: 1

  # Auto add date of now if empty
  auto_date:
    enable: true
  
  # Logic same as auto_category
  # https://github.com/xu-song/hexo-auto-category
  auto_categories:
    enable: true
    multiple: false
    depth:

  # Auto append categories list to tags when tags is empty
  auto_tags:
    enable: true

  # Auto add cover image path from `per_category` list
  auto_cover:
    enable: true
    # define per category's cover image path
    # It will choose the deepest category match when exist nested categories.
    per_category:
      # - Hexo: /img/xxxx.png

Build & preview

hexo clean && hexo g && hexo s

Demo

All the front-matter in 天澄拾光 are generated automatically by hexo-auto-front-matter.

Thanks