From c626ecdc562f99fbaf2130f7136d7f9b0ea7b58a Mon Sep 17 00:00:00 2001 From: clsr Date: Fri, 25 Aug 2017 16:02:01 +0200 Subject: Implement draft/cnm-selector hash fragment anchors --- templates/content.html | 14 +++++++++----- templates/page.html | 7 ++++++- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/templates/content.html b/templates/content.html index 4616a10..9b6d508 100644 --- a/templates/content.html +++ b/templates/content.html @@ -4,11 +4,15 @@ {{- inc .Title -}} {{- with .Title -}} - {{- if $l := lanchor -}} - {{.}} - {{- if $s := sanchor}}{{if ne $s $l}}{{end}}{{end -}} - - {{- end -}} + {{.}} + {{- if $l := lanchor -}} + + {{- if $s := sanchor}}{{if ne $s $l}}{{end}}{{end -}} + + {{- else -}} + + {{- end -}} + {{- end -}} {{- range .Children -}} diff --git a/templates/page.html b/templates/page.html index 0f89e2d..4a356cb 100644 --- a/templates/page.html +++ b/templates/page.html @@ -60,7 +60,11 @@ {{- block "toc" . -}} {{- inc .Title -}}
  • - {{.Title}} + {{- if $l := lanchor -}} + {{.Title}} + {{- else -}} + {{.Title}} + {{- end -}} {{- with .Children -}} -- cgit