Skip to content

Commit

Permalink
docs: update sticky widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Jul 27, 2022
1 parent 2326a77 commit 3cf43bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -25,14 +25,14 @@ images = []

## 创建一个新的粘性小部件

首先,在 `layouts/parials` 文件夹下创建一个 partial,我们以 `layouts/partials/custom/sticky-info.html` 为例。
首先,在 `layouts/parials` 文件夹下创建一个模板,我们以 `layouts/partials/custom/sticky-info.html` 为例。

{{% code/sticky-widgets-partial %}}

> 文件名 `custom/sticky-info` 可以随意改变,但我们建议使用一些更具体的名字,以避免以后覆盖主题的 partials
> 文件名 `custom/sticky-info` 可以随意改变,但我们建议使用一些更具体的名字,以避免以后覆盖主题的模板
> 比如 `custom``mywidgets`
然后使用 `layouts/partials/hooks/sidebar-end.html` 钩子来包含粘性 partial
然后使用 `layouts/partials/hooks/sidebar-end.html` 钩子来包含粘性模板

```html { title="layouts/partials/hooks/sidebar-end.html" }
{{- partial "custom/sticky-info" . }}
Expand Down
Expand Up @@ -25,14 +25,14 @@ images = []

## 創建一個新的粘性小部件

首先,在 `layouts/parials` 文件夾下創建一個 partial,我們以 `layouts/partials/custom/sticky-info.html` 為例。
首先,在 `layouts/parials` 文件夾下創建一個模板,我們以 `layouts/partials/custom/sticky-info.html` 為例。

{{% code/sticky-widgets-partial %}}

> 文件名 `custom/sticky-info` 可以隨意改變,但我們建議使用一些更具體的名字,以避免以後覆蓋主題的 partials
> 文件名 `custom/sticky-info` 可以隨意改變,但我們建議使用一些更具體的名字,以避免以後覆蓋主題的模板
> 比如 `custom``mywidgets`
然後使用 `layouts/partials/hooks/sidebar-end.html` 鉤子來包含粘性 partial
然後使用 `layouts/partials/hooks/sidebar-end.html` 鉤子來包含粘性模板

```html { title="layouts/partials/hooks/sidebar-end.html" }
{{- partial "custom/sticky-info" . }}
Expand Down

0 comments on commit 3cf43bf

Please sign in to comment.