Hexo日常管理

复制MD文件

# 清空文件夹
# rm -rf /home/_post/*
find /home/_post/ -name "*.md" -exec rm {} \;
# 导出3天前改动的文件到博客目录
find /Users/mai/NutstoreFiles/我的坚果云/blog_posts/ -mtime -3d -type f -name "*.md" -exec cp {} /Users/mai/Projects/hexo/source/_posts/ \;
# 再复制到Hexo的Post目录
# cp /home/_post/* /home/hexo_debug/source/_posts/
rsync --exclude=README.* /home/_post/* /home/hexo_debug/source/_posts/
view raw hexo-管理 hosted with ❤ by GitHub

查找最新文件

1
2
3
4
ls -t /Users/mai/Projects/hexo/source/_posts/*.md | head -1 | xargs ls -l | awk '{print  $6 "-" $7 "-" $8 }'

# 最旧的文件就应该是
ls -t /Users/mai/Projects/hexo/source/_posts/*.md | tail -1 | xargs ls -l | awk '{print $6 "-" $7 "-" $8 }'

其它

Hexo 代码折叠

1
2
3
{% fold 点击显/隐内容 %}
需要隐藏的内容。。。
{% endfold %}

参考文件

有用的shell命令

会导致编译奔溃的错误

大括号和井号连在一起

1
2
3
{#、 #}、{#} 这三种情况都会导致系统奔溃
{} 和 # 之间如果有别的字符就不会。如 { # }
或者放在代码段内也不会。行内代码不能避免这种情形。
-----------------------本文结束感谢您的阅读-----------------------