diff --git a/layouts/partials/edit_metadata.html b/layouts/partials/edit_metadata.html new file mode 100644 index 00000000000..59d2f51e457 --- /dev/null +++ b/layouts/partials/edit_metadata.html @@ -0,0 +1,44 @@ +{{- if ne (.Param "editme") false -}} + {{- $filePath := "" -}} + {{- $sourcePath := "" -}} + {{- with .File -}} + {{- $filePath = .Path -}} + {{- $filename := replace .Filename "\\" "/" -}} + {{- $sourcePath = replaceRE `^.*/(content|imported)/` `$1/` $filename -}} + {{- $sourcePath = replaceRE `^.*/pkg/mod/(github\.com/[^/]+/[^/@]+)(@[^/]+)?/(.*)$` `$1/$3` $sourcePath -}} + {{- if eq $sourcePath $filename -}} + {{- $sourcePath = replaceRE `^.*/([^/]+\.[^/.]+)$` `$1` $filename -}} + {{- end -}} + {{- if eq $sourcePath "" -}} + {{- $sourcePath = $filePath -}} + {{- end -}} + {{- end -}} + {{- $editBase := site.Params.github_editme_path -}} + {{- $editPath := $sourcePath -}} + + {{- range $prefix, $base := site.Params.github_editme_paths -}} + {{- if hasPrefix $sourcePath (printf "%s/" $prefix) -}} + {{- $editBase = $base -}} + {{- if ne $prefix "content" -}} + {{- $editPath = strings.TrimPrefix (printf "%s/" $prefix) $sourcePath -}} + {{- end -}} + {{- end -}} + {{- end -}} + + {{- with .Params.github_editme_path -}} + {{- $editBase = . -}} + {{- end -}} + + {{- if and $editBase $editPath -}} + + {{- end -}} +{{- end -}} diff --git a/layouts/partials/funding.html b/layouts/partials/funding.html new file mode 100644 index 00000000000..7ee143b956a --- /dev/null +++ b/layouts/partials/funding.html @@ -0,0 +1,25 @@ +
+ {{- range hugo.Data.funding }} +
+
+
+ + {{ .title }} + +
+
+ + {{ .alt | default + +
+
+ {{- with .description }}

{{ . }}

{{ end }} + {{- with .number }}

Funding number: {{ . }}

{{ end }} + {{- with .period }}

Years running: {{ . }}

{{ end }} +
+
+
+
+
+ {{- end }} +
diff --git a/layouts/partials/image.html b/layouts/partials/image.html new file mode 100644 index 00000000000..e10ad2f7ca0 --- /dev/null +++ b/layouts/partials/image.html @@ -0,0 +1 @@ +{{- /* Jekyll include is currently empty; keep this partial as a no-op for parity. */ -}} diff --git a/layouts/partials/initialize_shuffle.html b/layouts/partials/initialize_shuffle.html new file mode 100644 index 00000000000..3379bf9259d --- /dev/null +++ b/layouts/partials/initialize_shuffle.html @@ -0,0 +1 @@ +{{- /* Legacy shuffle.js initializer. The current Hugo Bootstrap pass keeps this as a no-op until the logowall/testimonial components are ported. */ -}} diff --git a/layouts/partials/inline_image.html b/layouts/partials/inline_image.html new file mode 100644 index 00000000000..cc5d28f4472 --- /dev/null +++ b/layouts/partials/inline_image.html @@ -0,0 +1,3 @@ +{{- $file := .file | default "" -}} +{{- $alt := .alt | default "" -}} +{{ $alt }} diff --git a/layouts/partials/links.html b/layouts/partials/links.html new file mode 100644 index 00000000000..cb2d5cce721 --- /dev/null +++ b/layouts/partials/links.html @@ -0,0 +1,16 @@ +{{- range $sidebarName := site.Params.sidebars -}} + {{- with (index hugo.Data.sidebars $sidebarName) -}} + {{- range .entries -}} + {{- range (.folders | default slice) -}} + {{- partial "links_entry.html" . -}} + {{- end -}} + {{- end -}} + {{- end -}} +{{- end -}} +{{- range hugo.Data.topnav.topnav -}} + {{- range .items -}} + {{- if and .url (not .external_url) -}} +[{{ .url | strings.TrimPrefix "/" | strings.TrimSuffix ".html" }}]: {{ .url | strings.TrimPrefix "/" }} + {{- end -}} + {{- end -}} +{{- end -}} diff --git a/layouts/partials/links_entry.html b/layouts/partials/links_entry.html new file mode 100644 index 00000000000..e768da8a008 --- /dev/null +++ b/layouts/partials/links_entry.html @@ -0,0 +1,12 @@ +{{- with .url -}} +[{{ . | strings.TrimPrefix "/" | strings.TrimSuffix ".html" }}]: {{ . | strings.TrimPrefix "/" }} +{{ end -}} +{{- range (.folderitems | default slice) -}} +{{ partial "links_entry.html" . }} +{{- end -}} +{{- range (.subfolders | default slice) -}} +{{ partial "links_entry.html" . }} +{{- end -}} +{{- range (.subfolderitems | default slice) -}} +{{ partial "links_entry.html" . }} +{{- end -}} diff --git a/layouts/partials/news_banner.html b/layouts/partials/news_banner.html new file mode 100644 index 00000000000..80cb8d21591 --- /dev/null +++ b/layouts/partials/news_banner.html @@ -0,0 +1 @@ +{{- /* Disabled in the current Jekyll include. Keep the partial for parity. */ -}} diff --git a/layouts/partials/newsletter.html b/layouts/partials/newsletter.html new file mode 100644 index 00000000000..ef62f61b375 --- /dev/null +++ b/layouts/partials/newsletter.html @@ -0,0 +1,9 @@ + + diff --git a/layouts/partials/url.html b/layouts/partials/url.html new file mode 100644 index 00000000000..ab2ef4fd7c6 --- /dev/null +++ b/layouts/partials/url.html @@ -0,0 +1,6 @@ +{{- $url := . -}} +{{- if hasPrefix $url "http" -}} + {{- $url -}} +{{- else -}} + {{- $url | relURL -}} +{{- end -}} diff --git a/layouts/partials/xmlreference.html b/layouts/partials/xmlreference.html new file mode 100644 index 00000000000..dc72b3484fd --- /dev/null +++ b/layouts/partials/xmlreference.html @@ -0,0 +1,2 @@ +{{- $raw := readFile "_includes/xmlreference.md" -}} +{{- .RenderString $raw -}}