Mac下配置NexT主题


      详细内容请看 NexT官网文档

  • <blog name>/_config.yml:站点配置文件

  • themes/next/_config.yml:主题配置文件

安装

注意⚠️:查看NexT的Github仓库 hexo-themes-next 确定NexT主题的克隆地址是否正确。
* **使用Git安装** 将NexT主题克隆到themes/next中
$ git clone https://github.com/theme-next/hexo-theme-next.git themes/next 
  • 修改站点配置文件 注意next内容前面需要使用空格隔开,hexo可能会识别不到
theme: next

设置更多精彩样式请看 CodeHeap-快速使用Hexo搭建个人博客

  • 启动项目
$ hexo s

NexT主题优化

设置背景

  • 在主题配置文件中搜索custom_file_path,在source/_data下创建styles.styl。添加以下代码
// 添加背景图片
body {
      background: url(/images/images.jpeg);//自己喜欢的图片地址
      background-size: cover;
      background-repeat: no-repeat;
      background-attachment: fixed;
      background-position: 50% 50%;
}

//博客内容透明化
//文章内容的透明度设置
.content-wrap {
  opacity: 0.85;
}

//侧边框的透明度设置
.sidebar {
  opacity: 0.85;
}

//菜单栏的透明度设置
.header-inner {
  background: rgba(255,255,255,0.85);
}

//搜索框(local-search)的透明度设置
.popup {
  opacity: 0.85;
}

.post {
   margin-top: 60px;
   margin-bottom: 60px;
   padding: 25px;
}

设置头像

  • 在主题配置文件中搜索avatar
avatar:
  url: /images/avatar.gif
  rounded: false    # 如果为true,则图片为正方形,头像将显示为圆形。为长方形,头像显示椭圆
  rotated: false    # 如果为true,则头像将随着光标旋转。

配置评论

  1. 配置Hexo NexT Utteranc 详细内容请查看 Hexo NexT Utteranc配置
$ npm install theme-next/hexo-next-utteranc
  1. 安装成功后,在主题配置文件中配置,根据username/username.github.io配置repo,其他可按默认配置
# Demo: https://utteranc.es/ http://trumandu.github.io/about/ 
utteranc: 
  enable: true 
  repo: #Github repo such as :TrumanDu/comments #根据username/username/github.io配置 
  pathname: pathname # theme: github-light,github-dark,github-dark-orange 
  theme: github-light 
  cdn: https://utteranc.es/client.js 
  # If you want to modify priority, please config in **hexo** 
  #priority:
  1. 安装utterances。打开 utterances,点击Install,Select repositories选择自己搭建博客的仓库。

参考

配置更详细更好看的NexT主题请查看 CodeHeap-快速使用Hexo搭建个人博客-主题美化


 上一篇
mac下安装maven mac下安装maven
在终端使用mvn -v显示zsh: command not found: mvn 在maven官网下载maven压缩包 下载并解压到/usr/local文件夹下。检查maven的目录是否和下图一致 注:如果maven文件不存在bin
2020-08-08
下一篇 
Github+Hexo搭建个人博客 Github+Hexo搭建个人博客
前言:最近自己用markdown写了一些博客,想着把自己写的东西也放在Github上。然后……自己的博客搭建了三天才完成。这过程也是蛮丰富的,一步一个脚印,一步一个坑啊。我把自己遇到的比较烦人的问题记下来,方便自己也方便大家 搭建环境
2020-08-02
  目录