diff options
author | Xiao-Le Deng <xldeng@whu.edu.cn> | 2020-06-05 10:17:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-05 10:17:50 +0300 |
commit | 09bf9ee51d0d8a1d52955e1d06e34111371b0912 (patch) | |
tree | 7d59bcccd40c4aaf180b0d82de8e8be1a57cc662 | |
parent | 12a3abfa2c2e6c2b67a8c8a9ae33a2f4834d4800 (diff) |
add search and content
add the function of search and content
-rw-r--r-- | layouts/_default/single.html | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index fe6be00..d9425f9 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -5,14 +5,21 @@ <h2>{{ . }}</h2> {{ end -}} </div> +<div style="position: fixed; right:-30px; max-width:300px; overflow:auto; top: 1px; width: 300px; bottom:100px"> +{{ partial "search.html" . }} +</div> <div class="meta"> {{ if .Date -}} <div>{{ .Date.Format "2006-01-02 15:04" }}</div> {{ end -}} - {{ if .Params.tags -}} + {{ $taxo := "tags" -}} + {{ if .Param $taxo -}} <div> - {{ range .Params.tags -}} - <span><a href="{{ "/tags/" | relURL }}{{ . | urlize }}">#{{ . }}</a></span> + {{ range .Param $taxo -}} + {{ $name := . -}} + {{ with $.Site.GetPage (printf "/%s/%s" $taxo ($name | urlize)) -}} + <span><a href="{{ .Permalink }}">#{{ $name }}</a></span> + {{ end -}} {{ end -}} </div> {{ end -}} @@ -20,4 +27,7 @@ <div class="content"> {{ .Content -}} </div> +<div style="position: fixed; right:50px; max-width:255px; overflow:auto; top: 120px; width: 220px; bottom:90px"> +{{ partial "toc.html" . }} +</div> {{ end -}} |