Skip to content

Conversation

ziheng5
Copy link

@ziheng5 ziheng5 commented May 24, 2025

pic1

(感觉把友链放在小卡片上有点怪怪的,所以加了一个 Page 来放友链,具体效果如图所示)

原本的思路是专门写一个 page.ejs,但是后来因为 hexo 的 _config.yml 中有一个 default_layout: post,折腾了好久都没法正常用上 page.ejs,所以干脆直接把 Page 界面的设计写到 post.ejs 文件里了(

⚠️所以:使用本方案的时候,除了将代码同步之外,需要专门建立一个页面,操作如下:

1. 新建 friends 页面

hexo new page friends 

2. 修改页面类型

修改 source/friends/index.md 文件,内容如下:

---
title: Here are my friends~
layout: friends
type: friend_links
---

3. 添加友链信息

友链信息部分的话,在 themes/particlex/_config.yml 文件的末尾可以配置,结构如下:

my_friends:
    ColdRain:
        url: https://ziheng5.github.io/
        avatar: https://ziheng5.github.io/images/head.jpg
        desc: 理想主义重症患者

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant