美文网首页
Hexo主题设置

Hexo主题设置

作者: spicychocolate | 来源:发表于2017-03-27 23:39 被阅读0次

    hexo默认主题是landscape,hexo官方也提供了许多主题。推荐使用NextYelee。Next简洁美观,支持三种不同风格。Yelee基于Yilia修改而来,改变了大量样式,集成了一些新功能,相较于Next更华丽一些。我的博客就是采用的这个主题。接下来,主要讲解Yelee主题的配置。

    安装主题

    使用git下载主题,切换到项目根目录,执行以下命令

    git clone https://github.com/MOxFIVE/hexo-theme-yelee.git themes/yelee
    

    下载完成后,会在项目themes目录下生成yelle文件夹


    Paste_Image.png

    主题切换

    修改项目根目录配置文件<code>_config.yml</code>,即可切换至Yelle主题

    theme: yelee
    
    Paste_Image.png

    主题预览

    执行以下命令预览主题

    hexo clean && hexo s
    

    语言设置

    Paste_Image.png

    目前支持的语言有以下几项:

    code language
    en 英语
    zh-Hans 大陆简体
    zh-Hant-HK 港澳繁體
    zh-Hant-TW 台灣正體

    头像设置

    默认头像存储于 <code>yelee/source/img/avatar.png</code>,替换图片即可设置头像

    评论设置

    打开主题配置文件<code>_config.yml</code>
    <code>Yelee</code>默认评论插件有<code>disqus</code>,<code>duoshuo</code>,<code>youyan</code>,去除<code>on</code>前的注释,并填写相关配置信息,即可添加评论功能。


    Paste_Image.png

    tips: 多说即将关闭进行业务调整,请转战youyan或disqus

    文章摘要

    目前主题可使用两种方式在首页显示文章摘要而不是全文。
    1. 在摘要和正文之间插入<code></code>

    title: Hello World
    date: 2015-12-03 00:00:00
    ---
    <Excerpt in index | 首页摘要> 
    <!-- more -->
    <The rest of contents | 余下全文>
    

    2. 用 <code>description</code>添加摘要

    title: Hello World
    date: 2015-12-03 00:00:00
    description: "Welcome to Hexo! This is your very first post."
    ---
    <Contents>
    

    主菜单设置

    按下面格式添加边栏菜单,菜单前的 # 表示注释掉该行,即隐藏掉该条目

    menu:
      主页: /
      所有文章: /archives/
      #随笔: /tags/随笔
      标签云: /tags/
      关于我: /about/
    

    更多详细设置请参考作者博客

    相关文章

      网友评论

          本文标题:Hexo主题设置

          本文链接:https://www.haomeiwen.com/subject/dkrdottx.html