我的结构在content:
content
|-post
| |-00.md
| |-01.md
| |-02.md
|-about.md
Run Code Online (Sandbox Code Playgroud)
在帖子的单个模板中,我希望有一个页脚:
在伪模板代码中,这意味着:
{{ if nextpost.exists }} #. becomes nexpost here
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ end }}
Run Code Online (Sandbox Code Playgroud)
nextpostcurrentpost + 1 在哪里
如何创建这种链接?
Jac*_*lor 13
听起来您想要.NextInSection变量。如果你使用with函数,你可以让它像你想要的那样工作。
{{ with .NextInSection }}
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ end }}
Run Code Online (Sandbox Code Playgroud)
您也可以.PrevInSection以类似的方式使用。