Motivation, hope quickly release the original md
Notes that there would have been as md format, hoping to batch release. Rather than one by one hexo new page xxx, and then copy the past, too slow, and each modification requires manual md in the corresponding hexo inside the modified once.
However, due to the vnote notes and hexo format required md format is not exactly the same, so it is necessary to develop the script modifies vnote md internal format is consistent and hexo internal md format.
POST hexo standard text format addition md, more than information in the header of the following format
|
|
For existing notes
to be: hexo new post xxx template generation md => text merge template => Publish and tedious! !
Scripts to increase the use of the prefix here, md generated directly copy to hexo can be.
Script 1, consistent with the article title and modify the path md
For example: "Amy's diary .md"
first line of the inside (ie, the title), the "# Amy's diary:"
File Path and the title of the article inconsistent on hexo will result list page title and page title text inconsistent strange phenomenon. And, personally I think that this is not a good habit. Take Coke bottle holds Sprite, although can drink, but always awkward.
|
|
Md ensure consistent execution after the file name and internal header name.
Script 2, add hexo the post template prefix information
|
|
To sum up the final script: batch execution (ctrl-v) to the terminal. * .Md can process all files in a folder under.
Script 3, vnote of md format to hexo format (icarus topics applicable) (github)
Address script GitHub: https://github.com/yuanjh6/scripts
The vnote of md md format into a format hexo
vnote original file:
Path: xxx / vnote / living / diary 20200328.md
content:
|
|
Execute: python md2hexo.py xxx / vnote / living / diary 20200328.md
adds title information in the new md after conversion here
|
|
Body parts:
|
|
Title idea body part did not, because I am using icarus template, which is also recognized by the head of the title: xxxx here as the title, if the following are the title, the display is the double title, leading to confusion format
if you are using a template Next, is different, the need to change the code a little, holding the body of the first row header
using a method for file: python md2hexo.py xxxx / yyy.md
using method 2, to the directory: python md2hexo.py xxxx / yyyy / zzz /
use 3, and a plurality of files and directories: python md2hexo.py xxxx / yyy.md xxxx / yyyy / zzz / xxxx / yyyy / fff /
Special Instructions:
01, the Categories article is actually a file path segmentation, so before executing the script, md2hexo.py file location and the best md file or folder at the same level position
such as: script location: / xxx / yyy / zzz / md2hexo. py
your md file location: / fff / mmm / kkk / vnote / living / diary 20200328.md
at this point if you are in the path: execute script / xxx / yyy / zzz / under, python md2hexo.py / fff / mmm / kkk / vnote / living / diary 20200328.md
such categories, then md file is, fff, mmm, kkk, vnote , life, but in most cases, fff, mmm, may be useless, such as home / username / no, etc. meaning
it is proposed, will md2hexo.py put / fff / mmm / kkk / vnote / under execution in / fff / mmm / kkk / vnote / under: python md2hexo.py living / diary 20200328.md
such technology to produce categories of articles, compared with [ 'life'], in line with the intention of
following commands are:
1, md copy md2hexo.py to the folder / home / john / documents / vnote_notebooks / vNote /
2, where in the file folder outside the execution md md2hexo.py $ Python (LS the -I v recycle_bin)
3, delete step 1 copied md2hexo.py script file
is recommended before a single step Under execution, look at what effect the various commands, avoiding wrong, but also to modify the .md file
|
|
02, read the code can be found for the title of the article (that is, the file name) if it contains [secret] is automatically increased field password: xxxxyyyy, add a password in order to achieve the article, no password can not access (with plug-ins required hexo)