mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-11-08 03:59:20 +00:00
Merge branch 'main' into feature/client-language-redirect
This commit is contained in:
90 files changed
+2214
-1641
No files matched your search
@@ -17,7 +17,7 @@
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
<language>{{ site.LanguageCode }}</language>{{ with .Site.Params.Author.email }}
|
||||
<language>{{ site.Language.Locale }}</language>{{ with .Site.Params.Author.email }}
|
||||
<managingEditor>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Params.Author.email }}
|
||||
<webMaster>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</webMaster>{{end}}
|
||||
{{ if .Site.Params.footer.showCopyright | default true -}}
|
||||
|
||||
@@ -51,12 +51,13 @@
|
||||
{{ $defaultReplyByEmail := site.Params.replyByEmail }}
|
||||
{{ $replyByEmail := default $defaultReplyByEmail .Params.replyByEmail }}
|
||||
{{ if $replyByEmail }}
|
||||
{{ $replySubject := i18n "article.reply_to" (dict "Title" .Title) | default (printf "Reply to %s" .Title) }}
|
||||
<strong class="block mt-8">
|
||||
<a
|
||||
class="email-link m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 hover:bg-primary-500 hover:text-neutral dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800"
|
||||
href="#"
|
||||
data-email="{{ site.Params.Author.email | base64Encode }}"
|
||||
data-subject="{{ replace (printf "Reply to %s" .Title) "\"" "'" }}">
|
||||
data-subject="{{ replace $replySubject "\"" "'" }}">
|
||||
{{ i18n "article.reply_by_email" | default "Reply by Email" }}
|
||||
</a>
|
||||
<noscript>
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Language.LanguageCode }}"
|
||||
hreflang="{{ .Language.Locale }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>{{ end }}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Language.LanguageCode }}"
|
||||
hreflang="{{ .Language.Locale }}"
|
||||
href="{{ $link }}"
|
||||
/>{{ end }}
|
||||
</url>
|
||||
|
||||
@@ -17,8 +17,18 @@
|
||||
{{ end }}
|
||||
|
||||
{{/* Metadata */}}
|
||||
{{ with (.Params.Summary | default .Params.Description) | default .Site.Params.description }}
|
||||
<meta name="description" content="{{ . }}">
|
||||
{{ $metaDescriptionOrder := .Site.Params.seo.metaDescriptionOrder | default (slice "summary" "description" "site") }}
|
||||
{{ $metaDescriptionSources := dict
|
||||
"summary" .Params.Summary
|
||||
"description" .Params.Description
|
||||
"site" .Site.Params.description
|
||||
}}
|
||||
{{ $metaDescription := "" }}
|
||||
{{ range $metaDescriptionOrder }}
|
||||
{{ $metaDescription = $metaDescription | default (index $metaDescriptionSources (lower .)) }}
|
||||
{{ end }}
|
||||
{{ with $metaDescription }}
|
||||
<meta name="description" content="{{ . | plainify }}">
|
||||
{{ end }}
|
||||
{{ with .Params.Tags | default .Site.Params.keywords }}
|
||||
<meta name="keywords" content="{{ range . }}{{ . }},{{ end }}">
|
||||
@@ -32,7 +42,7 @@
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
{{ if .IsTranslated }}
|
||||
{{ range .AllTranslations }}
|
||||
{{ $hreflang := .Language.LanguageCode | default .Language.Lang }}
|
||||
{{ $hreflang := .Language.Locale | default .Language.Lang }}
|
||||
{{ if $hreflang }}
|
||||
<link rel="alternate" hreflang="{{ $hreflang }}" href="{{ .Permalink }}">
|
||||
{{ end }}
|
||||
@@ -155,7 +165,9 @@
|
||||
{{ $jsResources = $jsResources | append (resources.Get "js/scroll-to-top.js") }}
|
||||
{{ end }}
|
||||
{{ if .Site.Params.enableSearch | default false }}
|
||||
{{ $jsResources = $jsResources | append (resources.Get "lib/fuse/fuse.min.js") | append (resources.Get "js/search.js") }}
|
||||
{{ $fuseRaw := resources.Get "lib/fuse/fuse.min.cjs" }}
|
||||
{{ $fuse := resources.FromString "lib/fuse/fuse.min.js" (replace $fuseRaw.Content "module.exports=" "window.Fuse=") }}
|
||||
{{ $jsResources = $jsResources | append $fuse | append (resources.Get "js/search.js") }}
|
||||
{{ end }}
|
||||
{{ if .Site.Params.enableCodeCopy | default false }}
|
||||
{{ $jsResources = $jsResources | append (resources.Get "js/code.js") }}
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
{{- $role := .Get "role" -}}
|
||||
{{- $collection := .Get "collection" -}}
|
||||
{{- $apiURL := "" -}}
|
||||
{{- $repoLink := "" -}}
|
||||
{{- $type := "" -}}
|
||||
{{- $namespace := "" -}}
|
||||
{{- $name := "" -}}
|
||||
|
||||
{{- if $role -}}
|
||||
{{- $parts := split $role "." -}}
|
||||
{{- $namespace = index $parts 0 -}}
|
||||
{{- $name = index $parts 1 -}}
|
||||
{{- $apiURL = print "https://galaxy.ansible.com/api/v1/roles/?owner__username=" $namespace "&name=" $name -}}
|
||||
{{- $repoLink = print "https://galaxy.ansible.com/ui/standalone/roles/" $namespace "/" $name "/" -}}
|
||||
{{- $type = "role" -}}
|
||||
{{- else if $collection -}}
|
||||
{{- $parts := split $collection "." -}}
|
||||
{{- $namespace = index $parts 0 -}}
|
||||
{{- $name = index $parts 1 -}}
|
||||
{{- $apiURL = print "https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/index/" $namespace "/" $name "/" -}}
|
||||
{{- $repoLink = print "https://galaxy.ansible.com/ui/repo/published/" $namespace "/" $name "/" -}}
|
||||
{{- $type = "collection" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ $id := delimit (slice "ansible" (partial "functions/uid.html" .)) "-" }}
|
||||
|
||||
{{- $title := "" -}}
|
||||
{{- $description := "" -}}
|
||||
{{- $downloads := 0 -}}
|
||||
{{- $version := "" -}}
|
||||
{{- $tags := slice -}}
|
||||
{{- $license := "" -}}
|
||||
{{- $dataAvailable := false -}}
|
||||
|
||||
{{- /* Formats an integer with comma thousand separators (lang.NumFmt is unavailable in this template context). */ -}}
|
||||
{{- define "_format-int" -}}
|
||||
{{- $n := printf "%d" (int .) -}}
|
||||
{{- $out := "" -}}
|
||||
{{- $len := len $n -}}
|
||||
{{- range $i := seq $len -}}
|
||||
{{- $idx := sub $i 1 -}}
|
||||
{{- $c := substr $n $idx 1 -}}
|
||||
{{- if and (gt $idx 0) (eq (mod (sub $len $idx) 3) 0) -}}
|
||||
{{- $out = print $out "," $c -}}
|
||||
{{- else -}}
|
||||
{{- $out = print $out $c -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $out -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with try (resources.GetRemote $apiURL) -}}
|
||||
{{- with .Err -}}
|
||||
{{- warnf "ansible shortcode: failed to fetch remote resource from %q: %s" $apiURL $.Position -}}
|
||||
{{- else with .Value -}}
|
||||
{{- $resp := . | transform.Unmarshal -}}
|
||||
{{- if eq $type "role" -}}
|
||||
{{- with index ($resp.results | default slice) 0 -}}
|
||||
{{- $title = print $namespace "." .name -}}
|
||||
{{- $description = .description -}}
|
||||
{{- $downloads = .download_count -}}
|
||||
{{- with .summary_fields -}}
|
||||
{{- with index (.versions | default slice) 0 -}}
|
||||
{{- $version = .name -}}
|
||||
{{- end -}}
|
||||
{{- $tags = .tags -}}
|
||||
{{- end -}}
|
||||
{{- $dataAvailable = true -}}
|
||||
{{- end -}}
|
||||
{{- else if eq $type "collection" -}}
|
||||
{{- $title = print $namespace "." $name -}}
|
||||
{{- $downloads = $resp.download_count -}}
|
||||
{{- with $resp.highest_version -}}
|
||||
{{- $version = .version -}}
|
||||
{{- end -}}
|
||||
{{- if $version -}}
|
||||
{{- $versionURL := print $apiURL "versions/" $version "/" -}}
|
||||
{{- with try (resources.GetRemote $versionURL) -}}
|
||||
{{- with .Value -}}
|
||||
{{- $verResp := . | transform.Unmarshal -}}
|
||||
{{- with $verResp.metadata -}}
|
||||
{{- $description = .description -}}
|
||||
{{- $tags = .tags -}}
|
||||
{{- with .license -}}
|
||||
{{- $license = index . 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $dataAvailable = true -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- warnf "ansible shortcode: unable to get remote resource from %q: %s" $apiURL $.Position -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $dataAvailable -}}
|
||||
<div class="ansible-card-wrapper">
|
||||
<a id="{{ $id }}" target="_blank" href="{{ $repoLink }}" class="cursor-pointer">
|
||||
<div
|
||||
class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
|
||||
<div class="flex items-center">
|
||||
<span class="text-2xl text-neutral-800 dark:text-neutral mr-2">
|
||||
{{ partial "icon.html" "ansible" }}
|
||||
</span>
|
||||
<div
|
||||
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ $title }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{- if $description }}
|
||||
<p class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ $description | markdownify }}
|
||||
</p>
|
||||
{{- end }}
|
||||
|
||||
<div class="m-0 mt-2 flex items-center flex-wrap">
|
||||
<span class="rounded-md border border-primary-400 px-1 py-[1px] mr-3 text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400">
|
||||
{{ $type }}
|
||||
</span>
|
||||
|
||||
<span class="text-md mr-2 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "download" }}
|
||||
</span>
|
||||
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ template "_format-int" $downloads }}
|
||||
</div>
|
||||
|
||||
{{- if $version }}
|
||||
<span class="text-md mr-2 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "tag" }}
|
||||
</span>
|
||||
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ $version }}
|
||||
</div>
|
||||
{{- end }}
|
||||
|
||||
{{- if $license }}
|
||||
<span class="text-md mr-2 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "scale-balanced" }}
|
||||
</span>
|
||||
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ $license }}
|
||||
</div>
|
||||
{{- end }}
|
||||
</div>
|
||||
|
||||
{{- if $tags }}
|
||||
<div class="m-0 mt-2 flex flex-wrap gap-1">
|
||||
{{- range first 5 $tags }}
|
||||
<span
|
||||
class="rounded-md border border-neutral-300 px-1 py-[1px] text-xs font-normal text-neutral-700 dark:border-neutral-600 dark:text-neutral-300">
|
||||
{{ . }}
|
||||
</span>
|
||||
{{- end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{{- else if $apiURL -}}
|
||||
{{ warnf "ansible shortcode: unable to fetch %q: %s" $apiURL .Position }}
|
||||
{{- end -}}
|
||||
@@ -1,6 +1,12 @@
|
||||
{{- $href := "" -}}
|
||||
{{- with .Get "pageRef" -}}
|
||||
{{- $href = relref $.Page . -}}
|
||||
{{- else -}}
|
||||
{{- $href = $.Get "href" -}}
|
||||
{{- end -}}
|
||||
<a
|
||||
class="!rounded-md bg-primary-600 px-4 py-2 !text-neutral !no-underline hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700"
|
||||
{{ with .Get "href" }}href="{{ . }}"{{ end }}
|
||||
{{ with $href }}href="{{ . }}"{{ end }}
|
||||
{{ with .Get "target" }}target="{{ . }}"{{ end }}
|
||||
{{ with .Get "rel" }}rel="{{ . }}"{{ end }}
|
||||
role="button">
|
||||
|
||||
Reference in new issue
Block a user