diff --git a/hugo_stats.json b/hugo_stats.json index 44e0e4d53..794d35e3c 100644 --- a/hugo_stats.json +++ b/hugo_stats.json @@ -2,7 +2,6 @@ "htmlElements": { "tags": [ "a", - "annotation", "body", "button", "div", @@ -16,29 +15,13 @@ "label", "li", "link", - "math", "meta", - "mfrac", - "mi", - "mn", - "mo", - "mpadded", - "mphantom", - "mrow", - "mspace", - "msqrt", - "mstyle", - "msub", - "msup", - "mtext", - "munder", "nav", "noscript", "ol", "p", "path", "script", - "semantics", "small", "span", "strong", @@ -76,12 +59,10 @@ "col-6", "col-lg-2", "col-lg-8", - "col-md-2", "col-md-3", "col-md-4", "col-md-8", "col-md-9", - "col-sm-12", "collapse", "collapsed", "container-fluid", @@ -92,16 +73,14 @@ "d-md-block", "d-md-none", "d-none", - "display-1", "display-4", "emphasis", "end-0", - "fa", - "fa-10x", "fa-2x", + "fa-arrow-left", + "fa-arrow-right", "fa-book-open", "fa-ellipsis", - "fa-face-frown", "fa-facebook", "fa-fw", "fa-github", @@ -137,7 +116,6 @@ "justify-content-center", "justify-content-end", "justify-content-start", - "katex", "label", "lead", "link-bg-footer", @@ -145,7 +123,6 @@ "main-content", "main-nav-toggler", "mb-3", - "mb-4", "mb-5", "mb-lg-5", "me-auto", @@ -172,6 +149,7 @@ "navbar-mode-selector", "navbar-nav", "navbar-toggler", + "next", "no-js", "offcanvas", "offcanvas-body", @@ -186,11 +164,13 @@ "p-2", "p-3", "p-4", + "p-auto", "pb-4", "pb-5", "pb-md-0", "position-fixed", "position-relative", + "previous", "ps-1", "pt-5", "pt-md-3", @@ -205,7 +185,6 @@ "row-cols-md-2", "row-cols-md-3", "row-cols-sm-2", - "row-cols-sm-3", "search", "search-input", "search-suggestions", @@ -219,7 +198,6 @@ "text-decoration-none", "text-end", "text-muted", - "text-secondary", "text-sm-start", "text-start", "text-uppercase", @@ -233,7 +211,6 @@ "top-bar" ], "ids": [ - "blogs", "btn-webshare", "navbar-0-collapse", "navbar-mode", diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 5aeb584fc..720d9d038 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,8 +1,10 @@ {{ if gt (findRE `^HAHAHUGO` .Destination 1) 0 }} {{ errorf "Invalid markdown link destination, use '%s' syntax when using shortcodes as input. See '%s'" ("{{% %}}" | htmlUnescape) - .Page.File.Filename + .Page.File.Path }} +{{ else if not .Destination }} + {{ errorf "Missing markdown link destination, see '%s'" .Page.File.Path }} {{ else }} {{ partial "assets/link.html" (dict "destination" .Destination @@ -10,4 +12,4 @@ "text" .Text "title" .Title ) }} -{{ end }} \ No newline at end of file +{{- end }} \ No newline at end of file diff --git a/layouts/partials/assets/link.html b/layouts/partials/assets/link.html index be9d452df..a95470585 100644 --- a/layouts/partials/assets/link.html +++ b/layouts/partials/assets/link.html @@ -22,6 +22,7 @@ {{- $cue := .cue | default site.Params.main.externalLinks.cue -}} {{- $tab := .tab | default site.Params.main.externalLinks.tab -}} {{- $isExternal := or (ne (urls.Parse (absURL $destination)).Host (urls.Parse site.BaseURL).Host) $external -}} +{{- $isLocal := hasPrefix $destination "#" -}} {{- $page := .page -}} {{- $anchor := "" -}} {{- $text := .text -}} @@ -54,32 +55,37 @@ {{ end }} {{ end }} - {{ $ref := partial "utilities/GetPage.html" (dict "url" $destination "page" $page) }} - {{- if not $ref -}} - {{- errorf "partial [assets/link.html] - Cannot find page: %s" $destination -}} - {{- $error = true -}} - {{- else -}} - {{- $destination = $ref.RelPermalink -}} - {{- with $anchor }}{{ $destination = printf "%s#%s" (strings.TrimSuffix "/" $destination) . -}}{{ end -}} + {{ if not $isLocal }} + {{ $ref := partial "utilities/GetPage.html" (dict "url" $destination "page" $page) }} + {{- if not $ref -}} + {{- errorf "partial [assets/link.html] - Cannot find page: %s" $destination -}} + {{- $error = true -}} + {{- else -}} + {{- $destination = $ref.RelPermalink -}} + {{- with $anchor }}{{ $destination = printf "%s#%s" (strings.TrimSuffix "/" $destination) . -}}{{ end -}} + {{- end -}} + {{- if not $text -}} - {{- if $anchor -}} - {{- $text = $anchor -}} - {{- else -}} - {{- $text = $ref.LinkTitle -}} - {{- end -}} + {{ if $anchor }}{{ $text = $anchor }}{{ else }}{{ $text = $ref.LinkTitle }}{{ end }} {{ end -}} - {{- if not $case }}{{ $text = lower $text }}{{ end -}} - {{- end -}} + {{ else }} + {{ with $anchor }} + {{ $destination = printf "#%s" . }} + {{ if not $text }}{{ $text = . }}{{ end }} + {{ end }} + {{ end }} + + {{- if not $case }}{{ $text = lower $text }}{{ end -}} {{- end -}} {{ if not $error -}} - {{- $text -}} + {{- $text | safeHTML -}} -{{- end }} \ No newline at end of file +{{- end -}} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 6ec688c1a..a22187b9b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gethinode/hinode", - "version": "0.26.0", + "version": "0.26.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gethinode/hinode", - "version": "0.26.0", + "version": "0.26.1", "license": "MIT", "dependencies": { "@fullhuman/postcss-purgecss": "^6.0.0", diff --git a/package.json b/package.json index 301927aef..cdaae240b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gethinode/hinode", - "version": "0.26.0", + "version": "0.26.1", "description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator", "keywords": [ "hugo",