generate Hugo structure add the theme and firsts contents

This commit is contained in:
2025-01-05 18:25:29 +01:00
parent ea0a13253b
commit 53dfed0093
124 changed files with 859 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
{{- $baseurl := urls.Parse site.BaseURL -}}
{{- $url := urls.Parse .Destination -}}
{{- $getpage := site.GetPage .Destination -}}
{{- $internal := lt (len $url.Host) 1 -}} {{/* NOTE: internal links will always have an empty $url.Host */}}
{{- $fragment := $url.Fragment -}}
{{- with $fragment -}}{{ $fragment = printf "#%s" $fragment }}{{- end -}}
{{- $destination := "" -}}
{{- if $internal -}}
{{- if (strings.HasPrefix $url.Path "./") -}}
{{/* NOTE: for links starting with ./ */}}
{{- $urltrimmed := strings.TrimPrefix "./" $url -}}
{{- $destination = printf "%s://%s/%s%s" $baseurl.Scheme $baseurl.Host $urltrimmed $fragment -}}
{{- else -}}
{{/* NOTE: for internal links */}}
{{- $destination = printf "%s%s" $getpage.RelPermalink $fragment -}}
{{- end -}}
{{- else -}}
{{- $destination = .Destination -}}
{{- end -}}
<a href="{{ $destination | safeURL }}"{{ with or .Title $getpage.LinkTitle .Text }} title="{{ . }}"{{ end }}{{ if not $internal }} rel="noopener external"{{ end }}>{{ or .Text .Title $getpage.LinkTitle | safeHTML }}</a>