From 3b3e6ec3b2a56ee4d03b6f4c84af886821bfbe84 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Tue, 15 Feb 2022 22:54:20 -0500 Subject: [PATCH] fix relative pathing for dynamic fetch --- assets/base.scss | 11 +++++- config.toml | 2 +- layouts/_default/_markup/render-link.html | 3 +- layouts/partials/head.html | 45 +++++++++++++--------- layouts/partials/popover.html | 47 ++++++++++++----------- 5 files changed, 63 insertions(+), 45 deletions(-) diff --git a/assets/base.scss b/assets/base.scss index 6f47da3..a462a33 100644 --- a/assets/base.scss +++ b/assets/base.scss @@ -470,7 +470,7 @@ header { .popover { z-index: 999; position: absolute; - width: 15em; + width: 20em; display: inline-block; visibility: hidden; background-color: var(--light); @@ -491,11 +491,18 @@ header { } & > h3 { - margin: 0.5em 0; + font-size: 1rem; + margin: 0.25em 0; + } + + & > .meta { + margin-top: 0.25em; + opacity: 0.5; } & > p { margin: 0; font-weight: 400; + user-select: none; } } diff --git a/config.toml b/config.toml index 01d8d3d..5c4dfcb 100644 --- a/config.toml +++ b/config.toml @@ -2,7 +2,7 @@ baseURL = "https://quartz.jzhao.xyz/" languageCode = "en-us" googleAnalytics = "G-XYFD95KB4J" pygmentsUseClasses = true -relativeURLs = true +relativeURLs = false disablePathToLower = true ignoreFiles = [ "/content/templates/*", diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 2bde76c..c720c45 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -5,5 +5,6 @@ {{ .Text | safeHTML }} {{- else -}} {{$fixedUrl := (cond (hasPrefix $trimmed "/") $trimmed (print "/" $trimmed)) | urlize}} -{{ .Text | safeHTML }} +{{$rooted := strings.TrimRight "/" (.Page.GetPage $fixedUrl).RelPermalink }} +{{ .Text | safeHTML }} {{- end -}} \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 7ab5aea..1afa3c6 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -26,24 +26,33 @@ {{ template "_internal/google_analytics.html" . }} diff --git a/layouts/partials/popover.html b/layouts/partials/popover.html index 35f0738..37f0db4 100644 --- a/layouts/partials/popover.html +++ b/layouts/partials/popover.html @@ -1,37 +1,38 @@ {{if $.Site.Data.config.enableLinkPreview}} {{end}} \ No newline at end of file