blog搭建

title: blog搭建
categories: blog
toc: true
mathjax: true
tags: 
- blog
widgets:
-
    type: toc
    position: left
-
    type: profile
    position: left
    author: Runope
    # Author title
    author_title: 不知不论,不做不论
    # Author's current location
    location: Nanjin,jiangsu
    # URL or path to the avatar image
    avatar: https://en.gravatar.com/userimage/194935117/7129e2095de79a9dd97e5cc344acaba2?size=200
    # Whether show the rounded avatar image
    avatar_rounded: false
    # Email address for the Gravatar
    gravatar: 275358499@qq.com
    # URL or path for the follow button
    follow_link: 'https://github.com/runope'
-
    type: recent_posts
    position: left

安装hexo

添加国内镜像源
安装hexo: npm i hexo-cli -g
初始化文件夹: hexo init
安装必备组件: npm install

hexo常用命令

hexo g  # 生成博客网页文件
hexo s  # 本地预览博客
hexo d  # 上传网页文件到github
hexo new post "article title" # 新建一篇文章(需要插件)
hexo clean # 清除默认缓存

icarus主题

安装

https://github.com/ppoffice/hexo-theme-icarus

参考链接

https://big-news.cn/2019/08/12/hexo%E4%B8%BB%E9%A2%98Icarus%E6%B5%85%E5%BA%A6%E4%BF%AE%E6%94%B9%E6%95%99%E7%A8%8B/#%E7%AB%99%E7%82%B9%E6%8E%A8%E9%80%81
https://www.cnblogs.com/KongkOngL/p/10449269.html
https://susreal.com/article/2019/hexo-theme-icarus-3/
https://www.imaegoo.com/2019/icarus-night-mode-2/
https://blog.csdn.net/qq_41793001/article/details/103055201

next-Gemini主题配置

下载next主题

$ cd hexo-site
$ git clone https://github.com/next-theme/hexo-theme-next themes/next
icarus 主题https://github.com/ppoffice/hexo-theme-icarus

启用next

​ (1)打开博客根目录下的_config.yml文件,将Theme修改为next--> theme: next

​ (2)修改hexo默认风格,在themes/next/_config.yml中修改配置scheme: Gemini

添加社交帐号

themes/next/_config.yml中修改配置

# ---------------------------------------------------------------
# Sidebar Settings
# ---------------------------------------------------------------

# Social Links.
# Usage: `Key: permalink || icon`
# Key is the link label showing to end users.
# Value before `||` delimeter is the target permalink.
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_icons:
  enable: true
  icons_only: false
  transition: false

文章字数统计

安装插件:

npm i --save hexo-wordcount

themes/next/_config.yml中修改配置,

# Post wordcount display settings
# Dependencies: https://github.com/willin/hexo-wordcount
post_wordcount:
  item_text: true
  wordcount: true
  min2read: true
  totalcount: true
  separated_meta: true

打开 post.swig 文件,/themes/next/layout/_macro/post.swig,在对应数字后增加单位:
字数:

<span title="{{ __('post.wordcount') }}">
    {{ wordcount(post.content) }} 字
</span>

阅读时长:

<span title="{{ __('post.min2read') }}">
    {{ min2read(post.content) }} 分钟
</span>

添加站内搜索

安装插件:

npm install hexo-generator-search --save

themes/next/_config.yml中修改配置:

# Local search
# Dependencies: https://github.com/flashlab/hexo-generator-search
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

页面底部主题信息删除

打开themes中的next文件夹,找到_config.yml文件,修改footer下面的配置为false即可。

copyright:
# -------------------------------------------------------------
# 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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值