From 9d64dfdfe0a8169d9e391eba0f1f3d2a7fcfe67b Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Mon, 30 Mar 2020 19:31:17 -0700 Subject: [PATCH] Make site mostly compatible with hugo v0.69.0 through criminal hacks --- site/config.toml | 48 +++++++-------------- site/layouts/partials/sidebar-tree.html | 57 +++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 32 deletions(-) create mode 100644 site/layouts/partials/sidebar-tree.html diff --git a/site/config.toml b/site/config.toml index c241a41581..4b9529f580 100644 --- a/site/config.toml +++ b/site/config.toml @@ -29,43 +29,27 @@ pygmentsStyle = "tango" # First one is picked as the Twitter card image if not set on page. #images = ["images/project-illustration.png"] +# Auto-generate the menu +# sectionPagesMenu = "main" + # Configure how URLs look like per section. [permalinks] blog = "/:section/:year/:month/:day/:slug/" -[module] - [[module.mounts]] - source = "../deploy/addons/gvisor/" - target = "content/gvisor/" - [[module.mounts]] - source = "../deploy/addons/helm-tiller/" - target = "content/helm-tiller/" - [[module.mounts]] - source = "../deploy/addons/istio/" - target = "content/istio/" - [[module.mounts]] - source = "../deploy/addons/ingress-dns/" - target = "content/ingress-dns/" - [[module.mounts]] - source = "../deploy/addons/storage-provisioner-gluster/" - target = "content/storage-provisioner-gluster/" - [[module.mounts]] - source = "../deploy/addons/layouts/" - target = "layouts" +[markup] + [markup.highlight] + codeFences = true + hl_Lines = "" + lineNoStart = 1 + lineNos = false + lineNumbersInTable = true + noClasses = true + style = "vs" + tabWidth = 4 - [[module.mounts]] - source = "content/en" - target = "content" - [[module.mounts]] - source = "layouts" - target = "layouts" - -## Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday -[blackfriday] -plainIDAnchors = true -hrefTargetBlank = true -angledQuotes = false -latexDashes = true +# allow html in markdown +[markup.goldmark.renderer] + unsafe=true # Image processing configuration. [imaging] diff --git a/site/layouts/partials/sidebar-tree.html b/site/layouts/partials/sidebar-tree.html new file mode 100644 index 0000000000..9b4dfa3503 --- /dev/null +++ b/site/layouts/partials/sidebar-tree.html @@ -0,0 +1,57 @@ +{{/* We cache this partial for bigger sites and set the active class client side. */}} +{{ $shouldDelayActive := ge (len .Site.Pages) 2000 }} +
+ {{ if not .Site.Params.ui.sidebar_search_disable }} + + {{ end }} + +
+{{ define "section-tree-nav-section" }} +{{ $s := .section }} +{{ $p := .page }} +{{ $shouldDelayActive := .delayActive }} +{{ $active := eq $p.CurrentSection $s }} +{{ $show := or (and (not $p.Site.Params.ui.sidebar_menu_compact) ($p.IsAncestor $s)) ($p.IsDescendant $s) }} + +{{/* minikube hack: Override $show due to a Hugo upgrade bug */}} +{{ $show = true }} +{{/* end minikube hack */}} + +{{ $sid := $s.RelPermalink | anchorize }} + +{{ end }}