Three, hexo + github to build a personal blog theme configuration

Replace the blog theme

Theme may refer to: https: //hexo.io/themes/

hexo default theme: Landscape

Sample topic: Next

Download Next theme

  1. Enter the directory Blog, download command input

    #进入Blog所在目录
    d:
    cd Blog
    #下载
    git clone https://github.com/iissnan/hexo-theme-next themes/next
  2. Enable Next topic

    Open the folder under Blog Profile _config.yml, find theme field, the default landscape changed to next.

    # Extensions
    ## Plugins: https://hexo.io/plugins/
    ## Themes: https://hexo.io/themes/
    theme: next

    Save.

  3. verification

    Command line window, type:

    hexo s --debug

    Browser enter: localhost: 4000 View interface theme.

Theme configuration

  1. Theme configuration file: /Blog/themes/next/_config.yml

  2. Open the theme configuration file, select the topic next 4 seed provided example starts Mist

    # ---------------------------------------------------------------
    # Scheme Settings
    # ---------------------------------------------------------------
    
    # Schemes
    #scheme: Muse
    scheme: Mist
    #scheme: Pisces
    #scheme: Gemini

Menu Settings

  1. Open the theme configuration file, / Blog / themes / next / _config.yml;

  2. Find the menu settings

    # ---------------------------------------------------------------
    # Menu Settings
    # ---------------------------------------------------------------
    
    menu:
      home: / || home
      about: /about/ || user
      tags: /tags/ || tags
      categories: /categories/ || th
      archives: /archives/ || archive
      schedule: /schedule/ || calendar
      sitemap: /sitemap.xml || sitemap
     # commonweal: /404/ || heartbeat
    
    # Enable/Disable menu icons.
    #icon name(和http://fontawesome.io/icons/ 上面图标name对应) 
    #上方||后面的即为menu_icon名称,不许在下面重复定义
    menu_icons:
      enable: true

    Close notes menu to open the blog.

  3. Create a menu file directory, create a directory to store the file menu open menu;

    The following command in the command window, Blog directory execute: D: \ Blog>

    #标签菜单
    hexo new page tags
    #分类菜单
    hexo new page categories
    #关于菜单
    hexo new page about

    After the above command after executing, will be more of tags and categories folder under Blog / source directory, folder makedown file is the show page content tags and categories menu, add the following configuration to labeling and classification.

    Open /tags/index.md

    ---
    title: tags
    date: 2019-05-30 14:07:09
    type: "tags"
    ---

    Open /categories/index.md

    ---
    title: categories
    date: 2019-05-30 14:07:09
    type: "categories"
    ---

    Once saved, you can add tags and categories before the new articles written.

    Examples of label classification :( New File Reference Previous start my blog)

    ---
    title: my first blog
    date: 2019-05-30 14:07:09
    tags:
    - hexo
    - example
    categories:
    - Example
    ---
    
    the blog content.

    The above new file tagged as: hexo, example; classified as: Example.

    Similar to other menus.

Sidebar settings

  1. Open the theme configuration file, / Blog / themes / next / _config.yml;

  2. Found sidebar settings

    # ---------------------------------------------------------------
    # Sidebar Settings
    # ---------------------------------------------------------------
    
    # Social Links.
    #取消注释即可打开社交网络链接
    social:
      GitHub: https://github.com/yourname || github
      #E-Mail: mailto:[email protected] || envelope
      #Google: https://plus.google.com/yourname || google
      #Twitter: https://twitter.com/yourname || twitter
      #FB Page: https://www.facebook.com/yourname || facebook
      #VK Group: https://vk.com/yourname || vk
      #StackOverflow: https://stackoverflow.com/yourname || stack-overflow
      #YouTube: https://youtube.com/yourname || youtube
      #Instagram: https://instagram.com/yourname || instagram
      #Skype: skype:yourname?call|chat || skype
    
    #上方||后面的即为social_icon名称,不许在下面重复定义
    social_icons:
      enable: true
      GitHub: github
      icons_only: false
      transition: false
  3. Head Set

    New images folder under Blog / source directory, head over to your favorite folder,

    Blog/source/head.jpg,

    Found in theme profile avatar,

    # Sidebar Avatar
    # in theme directory(source/images): /images/avatar.gif
    # in site  directory(source/uploads): /uploads/avatar.gif
    avatar: /images/head.jpg
  4. And author and brief language

    Open hexo configuration file, / Blog / _config.yml

    # Site
    title: Tassel   #网站标题
    description: welcome to my blog. #描述
    author: tassel #作者
    language: zh-Hans #语言:简体中文

Home Articles Settings

Control the display of words, next theme default display all the contents of the article can be achieved by the following configuration thumbnail display, and gives more buttons displayed on the home page article.

  1. method one:

    Add in any article every one position

    <!-- more -->
  2. Method Two:

    Add in the article front-matter (ie, add tags and categories where the head) in the description, and provide article excerpts.

  3. Method three:

    Automatic summary form, modified as follows relating to the configuration file (/Blog/themes/next/config.yml)

    # Automatically Excerpt. Not recommend.
    # Please use <!-- more --> in the post to control excerpt accurately.
    auto_excerpt:
      enable: true
      length: 150

Need to regenerate and deployed to github After changing the configuration

hexo clean
hexo generate
hexo deploy

For other more advanced configuration reference next topic official website: the Next

Guess you like

Origin www.cnblogs.com/tassel/p/10961912.html