hal
hexo-asset-link
npm i hexo-asset-link
hal

hexo-asset-link

A Hexo plugin to convert Markdown style asset links to HTML style ones

by 李皓奇

2.2.1 (see all)License:MITTypeScript:Not Found
npm i hexo-asset-link
Readme

hexo-asset-link NPM version

Convert Markdown style asset links to HTML style ones.

Install

In Hexo blog instance directory:

$ npm i -s hexo-asset-link

or if you prefer yarn:

$ yarn add hexo-asset-link

Config

Find (not add) and enable Post Asset Folders feature in _config.yml:

# Writing
...
post_asset_folder: true
...

Usage

For example, if you have these files in source/_post/:

+-- _posts/
|   +-- 2019-02-14-Test-Post.md
|   +-- 2019-02-14-Test-Post/
|       +-- Test-Image.png
|       +-- Test-Other-File.pdf

Then in 2019-02-14-Test-Post.md:

Images

![Alt Text](./2019-02-14-Test-Post/Test-Image.png "Title Text")
![Alt Text](2019-02-14-Test-Post/Test-Image.png "Title Text")

Other Files

[Text](./2019-02-14-Test-Post/Test-Other-File.pdf)
[Text](2019-02-14-Test-Post/Test-Other-File.pdf)

After this we'll get the right asset path result in:

  • Blog home page of hexo server preview;
  • Blog post page of hexo server preview;
  • Blog home page of online website;
  • Blog post page of online website;
  • Markdown preview of editors like VS Code.

Now shall we just have fun writing!

Reference

Downloads/wk

104

GitHub Stars

19

LAST COMMIT

10mos ago

MAINTAINERS

1

CONTRIBUTORS

4

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
2.2.1
latest
6mos ago
1.0.0
beta
4yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate