# Local search # Dependencies: https://github.com/theme-next/hexo-generator-searchdb local_search: enable: true # If auto, trigger search by changing input. # If manual, trigger search by pressing enter key or search button. trigger: auto # Show top n results per article, show all results by setting to -1 top_n_per_article: 1 # Unescape html strings to the readable one. unescape: false
接着打开\themes\next\layout_macro\post.swig文件,在End post body 之后, 添加以下代码:
1 2 3 4 5 6 7 8
{#####################} {### END POST BODY ###} {#####################} <div> {% if not is_index %} <div style="text-align:center;color: #ccc;font-size:14px;">------ 文章已经结束,谢谢你的阅读 ------<br>------ article has ended,thank you for reading ------</div> {% endif %} </div>
然后打开主题配置文件(_config.yml),在末尾添加:
1 2 3
# 文章末尾添加“本文结束”标记 passage_end_tag: enabled: true
Hexo发布博客引用自带图片的方法
1
cnpm install hexo-asset-image --save
编辑站点配置文件 字段post_asset_folder
1
post_asset_folder: true
hexo new “test blog” 使用完命令之后,在source/_post文件夹里面就会出现一个“test-blog.md”的文件和一个“test-blog”的文件夹。
# Progress bar in the top during page loading. pace: ture # Themes list: #pace-theme-big-counter #pace-theme-bounce #pace-theme-barber-shop #pace-theme-center-atom #pace-theme-center-circle #pace-theme-center-radar #pace-theme-center-simple #pace-theme-corner-indicator #pace-theme-fill-left #pace-theme-flash #pace-theme-loading-bar #pace-theme-mac-osx #pace-theme-minimal # For example # pace_theme: pace-theme-center-simple pace_theme: pace-theme-flash
底部隐藏由HEXO强力驱动,主题–NexT…..
打开Blog/themes/next/_config.yml,把true改成false
1 2 3 4 5 6 7 8
# Hexo link (Powered by Hexo). powered: false
theme: # Theme & scheme info link (Theme - NexT.scheme). enable: false # Version info of NexT after scheme info (vX.X.X). version: false
footer: # Specify the date when the site was setup. If not defined, current year will be used. since: 2017
# Icon between year and copyright info. icon: # Icon name in fontawesome, see: https://fontawesome.com/v4.7.0/icons/ # `heart` is recommended with animation in red (#ff0000). name: snowflake-o # If you want to animate the icon, set it to true. animated: false # Change the color of icon, using Hex Code. color: "#808080"
# If not defined, `author` from Hexo main config will be used. copyright:
powered: # Hexo link (Powered by Hexo). enable: false # Version info of Hexo after Hexo link (vX.X.X). version: false
theme: # Theme & scheme info link (Theme - NexT.scheme). enable: false # Version info of NexT after scheme info (vX.X.X). version: false
# Beian icp information for Chinese users. In China, every legal website should have a beian icp in website footer. # http://www.beian.miit.gov.cn beian: enable: false icp:
# Uri of fonts host, e.g. //fonts.googleapis.com (Default). host: //fonts.lug.ustc.edu.cn
# Font options: # `external: true` will load this font family from `host` above. # `family: Times New Roman`. Without any quotes. # `size: xx`. Use `px` as unit.
# Global font settings used for all elements in <body>. global: external: true family: Comic Neue size: 18
# Font settings for Headlines (H1, H2, H3, H4, H5, H6). # Fallback to `global` font settings. headings: external: true family: size:
# Font settings for posts. # Fallback to `global` font settings. posts: external: true family:
# Font settings for Logo. # Fallback to `global` font settings. logo: external: true family: Lobster Two size:
# Font settings for <code> and code blocks. codes: external: true family: monospace size:
添加sitemap.xml
1
npm install hexo-generator-sitemap --save
在站点_config.yml添加
1 2 3
# 自动生成sitemap sitemap: path: sitemap.xml
------ 文章已经结束,谢谢你的阅读 ------ ------ article has ended,thank you for reading ------