mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-16 14:33:10 +00:00
Support configuration of internal links validation
This commit is contained in:
@@ -10,6 +10,8 @@
|
|||||||
footerBelowFold = false
|
footerBelowFold = false
|
||||||
loading = "lazy"
|
loading = "lazy"
|
||||||
breakpoint = "md"
|
breakpoint = "md"
|
||||||
|
[main.internalLinks]
|
||||||
|
validate = true
|
||||||
[main.externalLinks]
|
[main.externalLinks]
|
||||||
cue = false
|
cue = false
|
||||||
tab = false
|
tab = false
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
footerBelowFold = false
|
footerBelowFold = false
|
||||||
loading = "lazy"
|
loading = "lazy"
|
||||||
breakpoint = "md"
|
breakpoint = "md"
|
||||||
|
[main.internalLinks]
|
||||||
|
validate = true
|
||||||
[main.externalLinks]
|
[main.externalLinks]
|
||||||
cue = true
|
cue = true
|
||||||
tab = true
|
tab = true
|
||||||
|
@@ -52,11 +52,12 @@
|
|||||||
{{- $page := "" }}
|
{{- $page := "" }}
|
||||||
{{- if .path }}
|
{{- if .path }}
|
||||||
{{ $page = partial "utilities/GetPage.html" (dict "url" .path "page" page) }}
|
{{ $page = partial "utilities/GetPage.html" (dict "url" .path "page" page) }}
|
||||||
{{- if not $page }}
|
{{ $validate := site.Params.main.internalLinks.validate | default true }}
|
||||||
|
{{- if and $validate (not $page) }}
|
||||||
{{ if page.File }}
|
{{ if page.File }}
|
||||||
{{- errorf "partial [assets/card.html] - Cannot find target page '%s', see '%s'" .path page.File.Path -}}
|
{{- warnf "partial [assets/card.html] - Cannot find target page '%s', see '%s'" .path page.File.Path -}}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{- errorf "partial [assets/card.html] - Cannot find target page '%s'" .path -}}
|
{{- warnf "partial [assets/card.html] - Cannot find target page '%s'" .path -}}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
Reference in New Issue
Block a user