本文最后更新于:2024年1月14日 晚上

Next 主题原生没有相册功能,我又是摄影爱好者,不得不下点功夫在这了。本系列介绍添加相册的方法,本文是开篇,记录Next主题下开启相册按钮和开启相应页面,后面的一边研究一边发。

Next设置

  • 新建hexo page
1
hexo new page photos

将会在source/下创建photos/index.md

  • 在index.md中添加type: photos
1
2
3
title: photos
date: 2020-03-22 23:03:55
type: photos
  • 修改主题配置文件,在menu字段中加入photos: /photos/ || image
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Usage: `Key: /link/ || icon`
# Key is the name of menu item. If the translation for this item is available, the translated text will be loaded, otherwise the Key name will be used. Key is case-senstive.
# Value before `||` delimiter is the target link, value after `||` delimiter is the name of Font Awesome icon.
# When running the site in a subdirectory (e.g. yoursite.com/blog), remove the leading slash from link value (/archives -> archives).
# External url should start with http:// or https://
menu:
home: / || home
about: /about/ || user
tags: /tags/ || tags
categories: /categories/ || th
archives: /archives/ || archive
photos: /photos/ || image
#schedule: /schedule/ || calendar
sitemap: /sitemap.xml || sitemap
#commonweal: /404/ || heartbeat
  • 修改 themes/next/languages/zh-Hans.yml,添加photos字段
1
2
3
4
5
6
7
8
9
10
11
menu:
home: 首页
archives: 归档
categories: 分类
tags: 标签
about: 关于
search: 搜索
commonweal: 公益404
something: 有料
sitemap: 站点地图
photos: 相册
  • 此时效果

相册



文章链接:
https://www.zywvvd.com/notes/hexo/theme/next/21-add-photos/add-photos/


“觉得不错的话,给点打赏吧 ୧(๑•̀⌄•́๑)૭”

微信二维码

微信支付

支付宝二维码

支付宝支付

Next -21- 添加相册系列 - 1- 框架设置
https://www.zywvvd.com/notes/hexo/theme/next/21-add-photos/add-photos/
作者
Yiwei Zhang
发布于
2020年3月29日
许可协议