From c414042c405993903f5bd5fb990bf727b4df39aa Mon Sep 17 00:00:00 2001 From: wlh Date: Wed, 25 Nov 2020 21:33:12 +0800 Subject: add highlight margin-bottom and move js to cdn --- README.md | 7 +++++-- assets/css/common.scss | 3 +++ layouts/partials/anchor.html | 4 ++++ layouts/partials/backtotop.html | 4 ++++ layouts/partials/math.html | 6 ++++++ layouts/partials/toc.html | 4 ++++ .../scss/css/hulga.scss_9bf5c66c09e96bec64afc24368a71dec.content | 2 +- 7 files changed, 27 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 88bbda6..b8ced1f 100644 --- a/README.md +++ b/README.md @@ -66,13 +66,13 @@ theme = "hulga" # copyright text on footer copyright = "Copyright © 2020 wlh. All rights reserved." - # enable katex rendering + # enable katex rendering on every post page math = true # enable postcss, mainly for css purge (129kB->20kB->4.8kB gzipped, but this makes build slower) postcss = true - # enable toc on post page + # enable toc on every post page toc = true # enable TOC auto collapse @@ -87,6 +87,9 @@ theme = "hulga" # enable PWA, prepare your icons and DON'T forget to modify manifest.json pwa = true + # disable jsdelivr cdn, default false + noCDN = false + # to enable different hightlight themes in light/dark mode [markup] [markup.highlight] diff --git a/assets/css/common.scss b/assets/css/common.scss index 82ba77b..2b5e2e4 100644 --- a/assets/css/common.scss +++ b/assets/css/common.scss @@ -78,6 +78,9 @@ body { .highlight { position: relative; } +.highlight:not(:last-child) { + margin-bottom: 1em; +} .chroma code:before { content: attr(data-lang); position: absolute; diff --git a/layouts/partials/anchor.html b/layouts/partials/anchor.html index 8e2f36a..313277d 100644 --- a/layouts/partials/anchor.html +++ b/layouts/partials/anchor.html @@ -1,4 +1,8 @@ +{{- if .Site.Params.noCDN -}} +{{- else -}} + +{{- end -}} +{{- else -}} + +{{- end -}} +{{- else -}} + + + +{{- end -}} +{{- else -}} + +{{- end -}} {{ $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default false }}