1.2.14 • Published 3 months ago
hexo-post-parser v1.2.14
hexo-post-parser
Parse Hexo Posts To Object
Features
- Parsing HexoJS markdown post
- Parsing Jekyll markdown post
- Post Asset Folder Auto Fix for HexoJS
- Parse shortcodes - (Show all Shortcodes)
- Include partials files with html comments
- Get all images from post body and push them to metadata.photos
- Auto find meta description when not set
Configuration needed
- file
_config.yml
generator:
type: 'hexo' # or jekyll
cache: true # enable caching
verbose: false # enable verbose
amp: false # transform shortcodes to amp html
parse post overriden options
const { parsePost } = require('hexo-post-parser');
parsePost('/path/to/file.md', {
shortcodes: {
youtube: true,
css: true,
include: true,
link: true,
now: true,
script: true,
text: true,
codeblock: true
},
config: {
generator: {
cache: false,
verbose: false,
amp: false,
type: 'hexo'
}
},
formatDate: true,
fix: true,
sourceFile: file.path
})
Shortcodes
Shortcode | Description |
---|---|
<!-- include folder/path.txt --> | Include partial files |
<!-- script folder/script.js --> | Include JS file as html script <script>codes</script> |
{% youtube video_id %} | transform youtube tag (AMP Supported) |
Usage Sample
const fs = require('fs');
(async function(){
const { parsePost, buildPost } = require('hexo-post-parser');
const parse = await parsePost('path/to/markdown/file.md');
// dump parsed post to json
fs.writeFileSync('path/to/file.json', JSON.stringify(parse, null, 2));
// build parsed post
fs.writeFileSync('path/to/file.md', buildPost(parse));
})();
Project Sample
https://github.com/dimaslanjaka/static-blog-generator-hexo
https://github.com/dimaslanjaka/chimeraland
deployed to: www.webmanajemen.com
Argument Parameters
--nocache
: disable cache--verbose
: show all console on verbose
Reference Repositories
1.2.14
3 months ago
1.2.12
7 months ago
1.2.11
7 months ago
1.2.10
12 months ago
1.2.8
1 year ago
1.2.7
1 year ago
1.2.9
12 months ago
1.2.6
1 year ago
1.2.5
1 year ago
1.2.4
1 year ago
1.2.3
1 year ago
1.2.0
1 year ago
1.1.9
1 year ago
1.1.8
1 year ago
1.2.2
1 year ago
1.2.1
1 year ago
1.1.12
1 year ago
1.1.11
1 year ago
1.1.10
1 year ago
1.1.16
1 year ago
1.1.15
1 year ago
1.1.18-undefined-16ed478
1 year ago
1.1.14
1 year ago
1.1.13
1 year ago
1.1.19
1 year ago
1.1.18
1 year ago
1.1.17
1 year ago
1.1.22
1 year ago
1.1.21
1 year ago
1.1.20
1 year ago
1.1.7
2 years ago
1.1.6
2 years ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1-beta-a874596
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago