Skip to content

Commit

Permalink
fix: 调整
Browse files Browse the repository at this point in the history
  • Loading branch information
hai-zou committed Jan 24, 2025
1 parent 846e7a3 commit b977c0e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ menu:

### 首页配置

> 主页可配置展示 “推荐文章” 或者 “最近文章”
> 主页可配置展示 “推荐文章” 或者 “最近文章”
> 注意:展示的推荐文章需要在文章的 `Front-matter` 中加上 `recommend: true`

```yml
Expand All @@ -63,7 +63,7 @@ home:

```yml
articles:
path: '' # 路由,默认为 articles
path: 'articles' # 路由
per_page: 10 # 分页数
order_by: -date # 文章排序
```
Expand Down
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ home:
name: # 名称
intro: # 个人简介
avatar: # 头像
posts: recent | recommend # recent: 最新文章 | recommend: 推荐文章
posts: recent # recent: 最新文章 | recommend: 推荐文章

# 所有文章
articles:
path: '' # 路由,默认为 articles
path: 'articles' # 路由
per_page: 10 # 分页数
order_by: -date # 文章排序

Expand Down
16 changes: 9 additions & 7 deletions layout/_partial/main/hero.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
{% endfor %}
</div>
</div>
<div class="sea-hero-info__right">
<img
class="sea-hero-info__avatar"
src="{{ theme.home.hero.avatar }}"
alt="{{ theme.home.hero.name }}"
/>
</div>
{% if theme.home.hero.avatar %}
<div class="sea-hero-info__right">
<img
class="sea-hero-info__avatar"
src="{{ theme.home.hero.avatar }}"
alt="{{ theme.home.hero.name }}"
/>
</div>
{% endif %}
</section>
2 changes: 1 addition & 1 deletion layout/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{% endif %}

<div class="sea-index-all-posts">
<a class="sea-index-all-posts__link" href="{{ url_for("/articles") }}">
<a class="sea-index-all-posts__link" href="{{ url_for(theme.articles.path) }}">
{{ __('home.allPosts') }}
{{ partial('svg/arrow_right') }}
</a>
Expand Down

0 comments on commit b977c0e

Please sign in to comment.