Skip to content

Commit

Permalink
style(footer, toc) & feat(toc)
Browse files Browse the repository at this point in the history
Style:
1. Fix footer style sheet.
2. Make toc slower to come back when close sidebar.

Feat:
1. Hide toc in specified post. (fi3ework#244)
  • Loading branch information
LolipopJ committed Jul 28, 2021
1 parent 35384ff commit f803525
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ z=\dfrac{3\pi}{2}(1+2t)\sin(\dfrac{3\pi}{2}(1+2t)), &
Archer 主题为您撰写的文章提供了一些增强的展示内容,这需要您手动在文章的 Front-matter 处配置。包括如下:

- [置顶文章](#置顶文章)
- [隐藏文章目录](#隐藏文章目录)

### 置顶文章

Expand Down Expand Up @@ -292,6 +293,26 @@ top: true
---
```

### 隐藏文章目录

在默认情况下,使用宽屏幕阅读文章时,会在文章右侧显示其目录信息。

您可以通过配置 Archer 主题目录下的 `_config.yml` 以**全局**关闭文章目录:

```yml
toc: false
```

或者,您也可以指定某些文章不显示目录。只需要在文章的 Front-matter 部分设置 `toc` 属性即可:

```md
---
title: Hello World
date: 2013/7/13 20:46:25
toc: false
---
```

## 更新主题

提供两种方法供参考:
Expand Down
2 changes: 1 addition & 1 deletion layout/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<%- partial('_partial/base-footer', {}, {cache: true}) %>
</div>
<!-- toc -->
<% if(is_post() && theme.toc) { %>
<% if(is_post() && theme.toc && page.toc !== false) { %>
<div class="toc-wrapper" style=<%- partial('_partial/intro-height', {attr: 'top'}) %>>
<div class="toc-catalog">
<span class="iconfont-archer catalog-icon">&#xe613;</span><span>CATALOG</span>
Expand Down
2 changes: 1 addition & 1 deletion source/css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion source/css/style.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/scss/_partial/_partial/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
flex-direction: column;
justify-content: flex-end;
padding: 4rem 0 1.5rem 0;
background-color: $body-background-color;
max-width: calc(50% + 200px);
margin: 0 auto;
width: 100%;
background-color: $body-background-color;
.social {
width: 50%;
min-width: 42.8125rem;
Expand Down
2 changes: 1 addition & 1 deletion src/scss/_partial/_post-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@
z-index: 9999;
margin: calc(#{$header-height} + 1rem) 0 0 0;
transform: translate3d(0, 0, 0);
transition: transform 0.3s ease-out 0s;
transition: transform 0.4s ease-out;
.toc-active {
color: $feature-color;
}
Expand Down

0 comments on commit f803525

Please sign in to comment.