Skip to content

EqualMa/hexo-plugin-permalink-pathed-title

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 

hexo-plugin-permalink-pathed-title

What do permalink-pathed-title do

Suppose you have a hexo site, including several posts in directory source/_posts. The posts' file structure is like:

- source
  |- _posts
     |- china
     |  |- beijing
     |  |  |- food.md
     |  |  |- entertainment.md
     |  |  |- tourist-sites.md
     |  |- shanghai
     |     |- food.md
     |     |- entertainment.md
     |     |- tourist-sites.md
     |- japan
        |- tokyo
        |- food.md
        |- entertainment.md
        |- tourist-sites.md

In your site config (/_config.yml), suppose you are using:

permalink: :title/

Then the permalink of post china/beijing/food.md will be xxx.com/china-beijing-food . This is because post' title is its slug.

If you enable this plugin, then its permalink will be xxx.com/china/beijing/food/. You can also add prefix or postfix into it. For example: xxx.com/post/china/beijing/food , xxx.com/post/china/beijing/food/content, etc..

How to use

Installation

In your hexo project, install hexo-plugin-permalink-pathed-title

npm install --save hexo-plugin-permalink-pathed-title

Then serve the site

hexo server

Usage

In your hexo site config (/_config.yml), Make Sure permalink_pathed_title.us is set to true . For example:

permalink_pathed_title:
  use: true,
  prefix: "post", # optional
  postfix: "" # optional

Then, **Make Sure permalink config is set to :id/ **

permalink: :id/

Then, permalinks with pathed title will be used to anchor posts.

About

A plugin to show permalinks of posts according to their relative path, like '/dir1/dir2/post3'.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published