前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Next -21- 添加相册系列 - 1- 框架设置

Next -21- 添加相册系列 - 1- 框架设置

作者头像
为为为什么
发布2022-08-04 14:32:20
2760
发布2022-08-04 14:32:20
举报
文章被收录于专栏:又见苍岚

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

Next设置

  • 新建hexo page
代码语言:javascript
复制
hexo new page photos

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

  • 在index.md中添加type: photos
代码语言:javascript
复制
title: photos
date: 2020-03-22 23:03:55
type: photos

  • 修改主题配置文件,在menu字段中加入photos: /photos/ || image
代码语言:javascript
复制
# 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字段
代码语言:javascript
复制
menu:
  home: 首页
  archives: 归档
  categories: 分类
  tags: 标签
  about: 关于
  search: 搜索
  commonweal: 公益404
  something: 有料
  sitemap: 站点地图
  photos: 相册

  • 此时效果
相册
相册
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020年3月29日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Next设置
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档