mirror of
https://github.com/Vimux/Binario.git
synced 2024-11-11 01:38:28 +00:00
Add related param
It is possible to turn on/off related content block
This commit is contained in:
parent
f53302e360
commit
ad7478c905
2 changed files with 3 additions and 2 deletions
|
@ -89,6 +89,7 @@ googleAnalytics = "" # Enable Google Analytics by entering your tracking id
|
||||||
toc = true # Enable Table of Contents for all site pages
|
toc = true # Enable Table of Contents for all site pages
|
||||||
tocOpen = true # Open Table of Contents block. Optional
|
tocOpen = true # Open Table of Contents block. Optional
|
||||||
comments = true # Enable comments for all site pages
|
comments = true # Enable comments for all site pages
|
||||||
|
related = true # Enable Related content for single pages
|
||||||
mathjax = true # Enable MathJax for all site pages
|
mathjax = true # Enable MathJax for all site pages
|
||||||
mathjaxPath = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" # Specify MathJax path. Optional
|
mathjaxPath = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" # Specify MathJax path. Optional
|
||||||
mathjaxConfig = "TeX-AMS-MML_HTMLorMML" # Specify MathJax config. Optional
|
mathjaxConfig = "TeX-AMS-MML_HTMLorMML" # Specify MathJax config. Optional
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{{ $related := .Site.RegularPages.Related . | first 5 }}
|
{{ $related := .Site.RegularPages.Related . | first 5 }}
|
||||||
{{ with $related }}
|
{{ if and ($related) (.Param "related") }}
|
||||||
<div class="related block">
|
<div class="related block">
|
||||||
<h3 class="related__title">{{ T "related_title" }}</h3>
|
<h3 class="related__title">{{ T "related_title" }}</h3>
|
||||||
<ul class="related__list">
|
<ul class="related__list">
|
||||||
{{ range . }}
|
{{ range $related }}
|
||||||
<li class="related__item"><a class="related__link" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
<li class="related__item"><a class="related__link" href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in a new issue