更换博客主题

主题可参考:https://hexo.io/themes/

hexo默认主题:Landscape

示例主题:Next

下载Next主题

  1. 进入Blog所在目录,输入下载命令

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

    在Blog文件夹下打开配置文件_config.yml,找到theme字段,将默认的landscape修改为next。

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

    保存。

  3. 验证

    命令行窗口输入:

    hexo s --debug

    浏览器输入:localhost:4000查看界面主题。

主题配置

  1. 主题配置文件在:/Blog/themes/next/_config.yml

  2. 打开主题配置文件,选择next提供的4种子主题,示例启动Mist

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

菜单设置

  1. 打开主题配置文件,/Blog/themes/next/_config.yml;

  2. 找到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

    关闭注释即可打开博客菜单。

  3. 创建菜单文件目录,打开菜单后需要创建菜单文件存放的目录;

    一下命令是在命令窗口,Blog目录下执行:D:\Blog>

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

    执行完上面的命令后,会在Blog/source目录下多出tags和categories文件夹,文件夹下的makedown文件即为标签和分类菜单的展示页面内容,下面为标签和分类添加配置。

    打开/tags/index.md

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

    打开/categories/index.md

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

    保存后,即可在新的文章撰写前添加标签和分类。

    标签分类示例:(新建文件参考上一篇start my blog)

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

    上面新建文件标签为:hexo,example;分类为:Example.

    其他菜单类似。

侧边栏设置

  1. 打开主题配置文件,/Blog/themes/next/_config.yml;

  2. 找到sidebar settings

    # ---------------------------------------------------------------
    # Sidebar Settings
    # --------------------------------------------------------------- # Social Links.
    #取消注释即可打开社交网络链接
    social:
    GitHub: https://github.com/yourname || github
    #E-Mail: mailto:yourname@gmail.com || 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. 头像设置

    在Blog/source目录下新建images文件夹,将自己喜欢的头像放在文件夹下,

    Blog/source/head.jpg,

    在主题配置文件中找到avatar,

    # Sidebar Avatar
    # in theme directory(source/images): /images/avatar.gif
    # in site directory(source/uploads): /uploads/avatar.gif
    avatar: /images/head.jpg
  4. 作者和简述及语言

    打开hexo配置文件,/Blog/_config.yml

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

首页文章设置

​ 控制在首页文章显示字数,next主题默认显示文章所有内容,可以通过以下配置实现缩略显示,并给出显示更多按钮。

  1. 方法一:

    在每一篇文章任意位置添加

    <!-- more -->
  2. 方法二:

    在文章的front-matter(即头部添加标签和分类的地方)中添加description,并提供文章摘录。

  3. 方法三:

    自动形成摘要,在主题配置文件中(/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

修改完配置后需要重新生成并部署到github

hexo clean
hexo generate
hexo deploy

其他更多更高级配置参考next主题官方网站:Next

【3】hexo+github搭建个人博客的主题配置的更多相关文章

  1. 三、hexo+github搭建个人博客的主题配置

    更换博客主题 主题可参考:https://hexo.io/themes/ hexo默认主题:Landscape 示例主题:Next 下载Next主题 进入Blog所在目录,输入下载命令 #进入Blog ...

  2. 《Hexo+github搭建个人博客》

    <Hexo+github搭建个人博客> 文/冯皓林 完稿:2016.4.22-2016.4.23 注意:本节教程只针对Windows用户.本教程由无人赞助,赞助写出. <Hexo+g ...

  3. 使用Node.js+Hexo+Github搭建个人博客(续)

    一.写在前面 在我的上一篇博客<使用Nodejs+Hexo+Github搭建个人博客>中,已经介绍了如何使用 Hexo 在 Github Pages 上搭建一个简单的个人博客.该篇博文将在 ...

  4. Mac上基于hexo+GitHub搭建个人博客(一)

    原文地址: http://fanjiajia.cn/2018/11/23/Mac%E4%B8%8A%E5%9F%BA%E4%BA%8Ehexo+GitHub%E6%90%AD%E5%BB%BA%E4% ...

  5. 如何用hexo+github搭建个人博客

    搭建环境 1.安装 Node.js: https://nodejs.org/en/ windows下点击链接,下载安装即可;Linux下更加简单,在终端下输入sudo apt-get install ...

  6. Ubuntu+Hexo+Github搭建个人博客

    Ubuntu+Hexo+Github搭建个人博客 目录 目录 目录 1. 简介 环境 2. Git安装及配置 2.1 安装Git 2.2 创建Git仓库 2.3 配置git仓库 2.4 添加公钥 3. ...

  7. hexo+github搭建个人博客

    最近用hexo+github搭建了自己的个人博客-https://liuyfl.github.io,其中碰到了一些问题,记录下来,以便查阅. hexo+github在win7环境下搭建个人博客:hex ...

  8. Hexo + GitHub 搭建个人博客

    对于程序员来说,搭建和维护一个个人博客十分必要​,写博客既是对所学知识的整理和总结,同时也能向他人展现自己的学习成果.这篇教程就是基于 Hexo 和 GitHub 来搭建属于自己的个人博客,简单快捷, ...

  9. 使用Node.js+Hexo+Github搭建个人博客

    一.为什么要花时间去搭建个人博客? 首先说说为什么我想要尝试着去搭建属于自己的Blog,古人云:“好记性不如烂笔头”.一开始我把笔记做在本子上.电脑上,发现要用的时候特别地不方便,而且越记越多.越多越 ...

随机推荐

  1. linux系统下安装配置Jenkins

    准备java 环境 安装java sdk yum -y install java 验证是否安装成功 java -version 下载安装jenkins 官网:https://wiki.jenkins- ...

  2. MySql常用操作【基础且详细(●'◡'●)】

    有那么挺长段时间没有敲代码了,今敲起来竟然有些sql都想不起来了

  3. <转>WPF 中的绑定

    在WPF应用的开发过程中Binding是一个非常重要的部分. 在实际开发过程中Binding的不同种写法达到的效果相同但事实是存在很大区别的. 这里将实际中碰到过的问题做下汇总记录和理解. 1. so ...

  4. Python Scrapy在windows上的安装方法

    如果想要学习爬虫,肯定会了解Scrapy,但安装Scrapy的方法相对于安装其他第三方库麻烦一点. 下面总结一下在我的电脑上安装Scrapy的方法,我的电脑是Windows10,32位操作系统.有如下 ...

  5. CentOS7 安装FastDFS单机版

    1. 下载 FastDFS https://github.com/happyfish100/fastdfs/releases libfastcommon https://github.com/happ ...

  6. C# Winform ProgressBar+Labe 联动显示进度

    private void btnCount_Click(object sender, EventArgs e) { label1.Visible=true; progressBar.Visible = ...

  7. [TCP/IP] TCP关闭连接为什么四次挥手

    1.建立连接的时候, 服务器在LISTEN状态下,收到建立连接请求的SYN报文后,把ACK和SYN放在一个报文里发送给客户端. 2.而关闭连接时,服务器收到对方的FIN报文时,仅仅表示对方不再发送数据 ...

  8. Linux中断管理 (1)Linux中断管理机制【转】

    转自:https://www.cnblogs.com/arnoldlu/p/8659981.html 目录: <Linux中断管理> <Linux中断管理 (1)Linux中断管理机 ...

  9. 出现org.springframework.beans.factory.NoSuchBeanDefinitionException 的解决思路

    Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: privat ...

  10. 三种MPM在工作时的属性

    l  prefork:域fork,一个进程一个请求 l  worker:一个线程一个请求,一个进程生成多个线程 l  event:事件模型,单线程响应多个请求,基于事件驱动 在主配置文件当中,在htt ...