Skip to content

Commit

Permalink
modify blog_title, slogan.api, ground_glass and text white space
Browse files Browse the repository at this point in the history
  • Loading branch information
mobeicanyue committed Dec 27, 2023
1 parent 4bed556 commit 8d15946
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 23 deletions.
40 changes: 20 additions & 20 deletions _config.fluid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ favicon: images/favicon.png
# Icon for Apple touch
apple_touch_icon: images/favicon.png

# 浏览器标签页中的标题分隔符,效果: 文章名 - 站点名
# 浏览器标签页中的标题分隔符,效果:文章名 - 站点名
# Title separator in browser tab, eg: article - site
tab_title_separator: " - "

Expand Down Expand Up @@ -258,7 +258,7 @@ web_analytics: # 网页访问统计
google:
measurement_id:

# 腾讯统计的 H5 App ID,开启高级功能才有cid
# 腾讯统计的 H5 App ID,开启高级功能才有 cid
# Tencent analytics, set APP ID
# See: https://mta.qq.com/h5/manage/ctr_app_manage
tencent:
Expand Down Expand Up @@ -286,7 +286,7 @@ web_analytics: # 网页访问统计
# 统计页面时获取路径的属性
# Get the attribute of the page path during statistics
path: window.location.pathname
# 开启后不统计本地路径( localhost 与 127.0.0.1 )
# 开启后不统计本地路径 (localhost 与 127.0.0.1)
# If true, ignore localhost & 127.0.0.1
ignore_local: false

Expand Down Expand Up @@ -322,12 +322,12 @@ iconfont: //at.alicdn.com/t/font_1736178_lbnruvf0jn.css
navbar:
# 导航栏左侧的标题,为空则按 hexo config 中 `title` 显示
# The title on the left side of the navigation bar. If empty, it is based on `title` in hexo config
blog_title: "漠北残月"
blog_title: "漠北残月的博客"

# 导航栏毛玻璃特效,实验性功能,可能会造成页面滚动掉帧和抖动,部分浏览器不支持会自动不生效
# Navigation bar frosted glass special animation. It is an experimental feature
ground_glass:
enable: false
enable: true

# 模糊像素,只能为数字,数字越大模糊度越高
# Number of blurred pixel. the larger the number, the higher the blur
Expand Down Expand Up @@ -422,8 +422,8 @@ footer:
content: '
<a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a>
<i class="iconfont icon-love"></i>
<a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a>
'
<a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a>'


# 展示网站的 PV、UV 统计数
# Display website PV and UV statistics
Expand All @@ -439,13 +439,13 @@ footer:
# For Chinese mainland website policy, other areas keep disable
beian:
enable: false
# ICP证号
icp_text: 京ICP证123456号
# 公安备案号,不填则只显示ICP
police_text: 京公网安备12345678号
# 公安备案的编号,用于URL跳转查询
# ICP 证号
icp_text: 京 ICP 证 123456 号
# 公安备案号,不填则只显示 ICP
police_text: 京公网安备 12345678 号
# 公安备案的编号,用于 URL 跳转查询
police_code: 12345678
# 公安备案的图片. 为空时不显示备案图片
# 公安备案的图片为空时不显示备案图片
police_icon: /img/police_beian.png


Expand All @@ -463,7 +463,7 @@ index:
# Available: 0 - 100
banner_img_height: 100

# 头图黑色蒙版的不透明度,available: 0 - 1.0, 1 是完全不透明
# 头图黑色蒙版的不透明度,available: 0 - 1 . 0,1 是完全不透明
# Opacity of the banner mask, 1.0 is completely opaque
# Available: 0 - 1.0
banner_mask_alpha: 0.3
Expand All @@ -480,11 +480,11 @@ index:
# 通过 API 接口作为首页副标题的内容,必须返回的是 JSON 格式,如果请求失败则按 text 字段显示,该功能必须先开启 typing 打字机功能
# Subtitle of the homepage through the API, must be returned a JSON. If the request fails, it will be displayed in `text` value. This feature must first enable the typing animation
api:
enable: false
enable: true

# 请求地址
# Request url
url: ""
url: "https://v1.hitokoto.cn/"

# 请求方法
# Request method
Expand All @@ -497,7 +497,7 @@ index:

# 从请求结果获取字符串的取值字段,最终必须是一个字符串,例如返回结果为 {"data": {"author": "fluid", "content": "An elegant theme"}}, 则取值字段为 ['data', 'content'];如果返回是列表则自动选择第一项
# The value field of the string obtained from the response. For example, the response content is {"data": {"author": "fluid", "content": "An elegant theme"}}, the expected `keys: ['data','content']`; if the return is a list, the first item is automatically selected
keys: []
keys: ["hitokoto"]

# 自动截取文章摘要
# Auto extract post
Expand Down Expand Up @@ -752,7 +752,7 @@ utterances:
# See: https://disqus.com
disqus:
shortname:
# 以下为 Disqusjs 支持, 国内用户如果想使用 Disqus 建议配合使用
# 以下为 Disqusjs 支持国内用户如果想使用 Disqus 建议配合使用
# The following are Disqusjs configurations, please ignore if DisqusJS is not required
# See: https://github.com/SukkaW/DisqusJS
disqusjs: false
Expand Down Expand Up @@ -977,15 +977,15 @@ page:


#---------------------------
# 404页
# 404 页
# 404 Page
#---------------------------
page404:
enable: true
banner_img: /img/default.png
banner_img_height: 85
banner_mask_alpha: 0.3
# 重定向到首页的延迟(毫秒)
# 重定向到首页的延迟(毫秒)
# Delay in redirecting to home page (milliseconds)
redirect_delay: 5000

Expand Down
28 changes: 25 additions & 3 deletions source/_posts/Modify-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ hexo new page about

创建成功后修改 `/source/about/index.md`,添加 `layout` 属性。

改后如下
添加后如下

```md
---
Expand All @@ -55,13 +55,16 @@ hexo clean && hexo g && hexo s -o

后访问 `http://localhost:4000/about/` 即可看到效果。

![localhost.jpg](/images/Modify-theme/localhost.jpg)
![ablout.jpg](/images/Modify-theme/about.jpg)

PS: 可以跟着文档把关于页面的几个 icon 一起改了。

### 4. 修改主题配置

[官方文档](https://hexo.fluid-dev.com/docs/guide/)
官方文档还算比较完善,耐心看完即可。

### 5. 修改网站图标
`修改网站图标` 文档好像没提到,我这里写一下
首先把你的图标放到 `/source/images/` 目录下,然后
打开 `_config.fluid.yml` 找到这个配置:
Expand All @@ -74,4 +77,23 @@ favicon: images/favicon.png
# Icon for Apple touch
apple_touch_icon: images/favicon.png
```
`favicon.png` 改为你的图标路径即可。
`favicon.png` 改为你的图标路径即可。

### 6. 修改 slogan 为 api 语录
效果如图所示:
![slogan-api.jpg](/images/Modify-theme/slogan-api.jpg)

在主题配置中开启:
```yml
index:
slogan:
enable: true
text: 这是一条 Slogan
api:
enable: true
url: "https://v1.hitokoto.cn/"
method: "GET"
headers: {}
keys: ['data', 'content']
```
把 `url` 改为你想要的 api 地址,`keys` 改为你想要的字段。具体参数可以看[官方文档](https://hexo.fluid-dev.com/docs/guide/#slogan-%E6%89%93%E5%AD%97%E6%9C%BA)
Binary file added source/images/Modify-theme/about.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/Modify-theme/slogan-api.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8d15946

Please sign in to comment.