blog_building

记录博客配置过程

philosophy: use the default theme and record the change, to make sure the change is controllable. - that’s the reason why I choose landscape theme.

基础信息设置

why can’t I find landscape folder in theme folder
landscape 主题是通过 npm 安装的,在 package.json 中可以看到

站点配置文件的_config.yml 配置

站点配置文件在站点根目录下,是整个博客的配置文件,用来配置整个博客的站点信息,如网站标题、副标题、作者、语言、时区等。

1
2
3
4
5
6
7
8
# Site
title: LIke's blog
subtitle: 'Write down my thoughts'
description: 'Knowledege is not free, you have to pay attention.'
keywords:
author: Like Cai
language: zh-CN
timezone: 'Asia/Shanghai'

留意到改变descriptionkeywords,网站的渲染效果没变化:作用是什么?

it is used for search engine optimization(SEO)

  • description: This field provides a brief summary of the site’s content. It is often used in the meta description tag in the HTML head section, which search engines use to display a snippet of the page in search results.
    • in next tutorial, description is used for display sentence you like
  • keywords: This field lists relevant keywords for the site. These keywords can be used in the meta keywords tag in the HTML head section, which some search engines use to understand the content of the page.
    • However, note that many modern search engines do not heavily rely on the meta keywords tag anymore.

url setting

1
2
3
# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: https://humble-learner006.github.io/

this makes the default share link become correct

add table of content [ToC] for theme landscape

如何添加文章目录

next 主题设置

pin/rank the post to the top of the page

npm install hexo-generator-index-pin-top --save
这里解决

add search function

npm install hexo-generator-searchdb --save
这里解决
官网上也有,但是按照官网的写法,我部署后搜索还是有渲染问题。

add comment function

暂时不加,没写有用的东西

add RSS function to the theme: next

掘金上看到一篇
在NexT主题文档官网看到一篇
讨厌需要登陆复制的网站,我有可能只用你一次你还让我登录。还是记住老一点一定优先查看官网

add latex renderer function to the theme: next

config.next.yml主题配置文件中,你可以找到对应的设置方式以及能指导你配置的选项。官网就是好用啊。2024-10-20 11:23:29
而且在更新完渲染部分后,我的网页在部署后可以正常渲染。
这告诉我一个道理:如果这个东西只是膈应你,并不影响使用,那就不需要改,以后可能在升级的时候会自己解决。

至此,博客配置差不多完成了,以后学了前端再看看能玩出什么花样

reference

[from landscape to all](教你定制Hexo的landscape打造自己的主题 - 代码先锋网 (codeleading.com))
[sample of fluid theme](认识 LLVM - zkqiang’s blog)
[git tutorial from next builder](Pro Git 简体中文版 (iissnan.com))
it is same as the book from official website
[Next startup](开始使用 - NexT 使用文档 (iissnan.com))
[Hexo + GitHub = Blog](使用 Hexo+GitHub 搭建个人免费博客教程(小白向) - 知乎 (zhihu.com))
依然在更新的next geminie主题的博客,有DDIA精读系列作品