From 4eb6954c7d7b5327c59dfbd86cebfc3ea10c1033 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 20 Mar 2018 23:41:24 +0100 Subject: various docs improvements - add clickable anchors for headers - add "outdated" warning for archived docs - add "edit on github" button - beautify template --- docs/src/layouts/partials/add-anchors.html | 1 + docs/src/layouts/partials/edit-on-github.html | 9 +++++++ docs/src/layouts/partials/outdated.html | 9 +++++++ docs/src/layouts/partials/sidebar.html | 38 +++++++++++++-------------- 4 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 docs/src/layouts/partials/add-anchors.html create mode 100644 docs/src/layouts/partials/edit-on-github.html create mode 100644 docs/src/layouts/partials/outdated.html (limited to 'docs/src/layouts/partials') diff --git a/docs/src/layouts/partials/add-anchors.html b/docs/src/layouts/partials/add-anchors.html new file mode 100644 index 00000000..f7050f7f --- /dev/null +++ b/docs/src/layouts/partials/add-anchors.html @@ -0,0 +1 @@ +{{ . | replaceRE "()(.+?)" "${1}#  ${3}" | safeHTML }} diff --git a/docs/src/layouts/partials/edit-on-github.html b/docs/src/layouts/partials/edit-on-github.html new file mode 100644 index 00000000..d2c3098c --- /dev/null +++ b/docs/src/layouts/partials/edit-on-github.html @@ -0,0 +1,9 @@ +{{ if and .IsPage (not (getenv "DOCS_ARCHIVE")) }} + + Edit on GitHub + +{{ end }} + diff --git a/docs/src/layouts/partials/outdated.html b/docs/src/layouts/partials/outdated.html new file mode 100644 index 00000000..5b3dd6ed --- /dev/null +++ b/docs/src/layouts/partials/outdated.html @@ -0,0 +1,9 @@ +{{- if (getenv "DOCS_ARCHIVE") -}} +
+
+ You are not viewing the most up to date version of the documentation. + Click here + to view the latest version. +
+
+{{- end -}} diff --git a/docs/src/layouts/partials/sidebar.html b/docs/src/layouts/partials/sidebar.html index ef853fc6..5ea41c12 100644 --- a/docs/src/layouts/partials/sidebar.html +++ b/docs/src/layouts/partials/sidebar.html @@ -1,24 +1,22 @@ - \ No newline at end of file + + {{ partial "sidemenu" (dict "ctx" . "menuname" "howto") }} + + + {{ partial "sidemenu" (dict "ctx" . "menuname" "tutes") }} + -- cgit v1.2.3