A hexo tag plugin for inserting post link in your post.
npm install hexo-tag-post-link bash
$ npm install hexo-tag-post-link --save
`
Usage
1. Create "_data" folder under "source" folder, if you don't have it.
2. Create "post_link.yml" in your "source/_data" folder
3. Add your own post link format in ymal
`
name: format
`
Example
`
header: The link to this post: <%= post_title %>
`
4. Add post link tag to wherever you like in your post
`
{% post_link %}
`
Example:
`
{% post_link header %}
`
$3
hexo-tag-post-link supports adding post link to all posts by setting the `_config.yml` file:
`
post_link:
insert_before_post:
insert_after_post:
`
Let's say we have template `header` and `footer` defined in our postlink.yml data file. Then we could use the following configuration to add them to all posts.
`
post_link:
insert_before_post: header
insert_after_post: footer
`
$3
hexo-tag-post-link also supports per type configurations in `_config.yml` file. For example:
`
post_link:
per_type_configs:
- type: category
name: "category-name"
insert_before_post: "header-for-category"
insert_after_post: "footer-for-catefory"
- type: tag
name: "tag-name"
insert_before_post: "header-for-tag"
insert_after_post: "header-for-tag"
`
$3
Just add `disable_global_post_link: true` in the front matter.
`
---
title: title
categories:
- category-name
tags:
- tag-name
disable_global_post_link: true
---
``