diff options
author | Indrajith K L | 2022-03-19 16:54:23 +0530 |
---|---|---|
committer | Indrajith K L | 2022-03-19 16:54:23 +0530 |
commit | 29fcd231e3da9b33c237886f3c1bb30a557ad641 (patch) | |
tree | 8eba56550b35938e7c445c9ed6d9005c14036666 /themes/PaperMod/layouts | |
download | experimentsofindrajith-29fcd231e3da9b33c237886f3c1bb30a557ad641.tar.gz experimentsofindrajith-29fcd231e3da9b33c237886f3c1bb30a557ad641.tar.bz2 experimentsofindrajith-29fcd231e3da9b33c237886f3c1bb30a557ad641.zip |
Initial Commit
Diffstat (limited to 'themes/PaperMod/layouts')
41 files changed, 1995 insertions, 0 deletions
diff --git a/themes/PaperMod/layouts/404.html b/themes/PaperMod/layouts/404.html new file mode 100644 index 0000000..a405573 --- /dev/null +++ b/themes/PaperMod/layouts/404.html @@ -0,0 +1,3 @@ +{{- define "main" }} +<div class="not-found">404</div> +{{- end }}{{/* end main */ -}} diff --git a/themes/PaperMod/layouts/_default/_markup/render-image.html b/themes/PaperMod/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000..1acb87d --- /dev/null +++ b/themes/PaperMod/layouts/_default/_markup/render-image.html @@ -0,0 +1 @@ +<img loading="lazy" src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}" {{ end }} /> diff --git a/themes/PaperMod/layouts/_default/archives.html b/themes/PaperMod/layouts/_default/archives.html new file mode 100644 index 0000000..435d2a1 --- /dev/null +++ b/themes/PaperMod/layouts/_default/archives.html @@ -0,0 +1,49 @@ +{{- define "main" }} + +<header class="page-header"> + <h1>{{ .Title }}</h1> + {{- if .Description }} + <div class="post-description"> + {{ .Description }} + </div> + {{- end }} +</header> + +{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} + +{{- if .Site.Params.ShowAllPagesInArchive }} +{{- $pages = site.RegularPages }} +{{- end }} + +{{- range $pages.GroupByPublishDate "2006" }} +{{- if ne .Key "0001" }} +<div class="archive-year"> + <h2 class="archive-year-header"> + {{- replace .Key "0001" "" }}<sup class="archive-count"> {{ len .Pages }}</sup> + </h2> + {{- range .Pages.GroupByDate "January" }} + <div class="archive-month"> + <h3 class="archive-month-header">{{- .Key }}<sup class="archive-count"> {{ len .Pages }}</sup></h3> + <div class="archive-posts"> + {{- range .Pages }} + {{- if eq .Kind "page" }} + <div class="archive-entry"> + <h3 class="archive-entry-title"> + {{- .Title | markdownify }} + {{- if .Draft }}<sup><span class="entry-isdraft"> [draft]</span></sup>{{- end }} + </h3> + <div class="archive-meta"> + {{- partial "post_meta.html" . -}} + </div> + <a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a> + </div> + {{- end }} + {{- end }} + </div> + </div> + {{- end }} +</div> +{{- end }} +{{- end }} + +{{- end }}{{/* end main */}} diff --git a/themes/PaperMod/layouts/_default/baseof.html b/themes/PaperMod/layouts/_default/baseof.html new file mode 100644 index 0000000..6dfe741 --- /dev/null +++ b/themes/PaperMod/layouts/_default/baseof.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html lang="{{ .Site.Language }}" dir="{{ .Language.LanguageDirection | default "auto" }}"> + +<head> + {{- partial "head.html" . }} +</head> + +<body class=" +{{- if (or (ne .Kind `page` ) (eq .Layout `archives`) (eq .Layout `search`)) -}} +{{- print "list" -}} +{{- end -}} +{{- if eq $.Site.Params.defaultTheme `dark` -}} +{{- print " dark" }} +{{- end -}} +" id="top"> + {{- partialCached "header.html" . .Page -}} + <main class="main"> + {{- block "main" . }}{{ end }} + </main> + {{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") (.Param "ShowCodeCopyButtons") -}} +</body> + +</html> diff --git a/themes/PaperMod/layouts/_default/index.json b/themes/PaperMod/layouts/_default/index.json new file mode 100644 index 0000000..2c86f7c --- /dev/null +++ b/themes/PaperMod/layouts/_default/index.json @@ -0,0 +1,7 @@ +{{- $.Scratch.Add "index" slice -}} +{{- range .Site.RegularPages -}} + {{- if and (not .Params.searchHidden) (ne .Layout `archives`) (ne .Layout `search`) }} + {{- $.Scratch.Add "index" (dict "title" .Title "content" .Plain "permalink" .Permalink "summary" .Summary) -}} + {{- end }} +{{- end -}} +{{- $.Scratch.Get "index" | jsonify -}} diff --git a/themes/PaperMod/layouts/_default/list.html b/themes/PaperMod/layouts/_default/list.html new file mode 100644 index 0000000..0cc1ad9 --- /dev/null +++ b/themes/PaperMod/layouts/_default/list.html @@ -0,0 +1,89 @@ +{{- define "main" }} + +{{- if (and .Site.Params.profileMode.enabled .IsHome) }} +{{- partial "index_profile.html" . }} +{{- else }} {{/* if not profileMode */}} + +{{- if not .IsHome | and .Title }} +<header class="page-header"> + {{- partial "breadcrumbs.html" . }} + <h1>{{ .Title }}</h1> + {{- if .Description }} + <div class="post-description"> + {{ .Description | markdownify }} + </div> + {{- end }} +</header> +{{- end }} + +{{- if .Content }} +<div class="post-content"> + {{- if not (.Param "disableAnchoredHeadings") }} + {{- partial "anchored_headings.html" .Content -}} + {{- else }}{{ .Content }}{{ end }} +</div> +{{- end }} + +{{- $pages := union .RegularPages .Sections }} + +{{- if .IsHome }} +{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} +{{- end }} + +{{- $paginator := .Paginate $pages }} + +{{- if and .IsHome .Site.Params.homeInfoParams (eq $paginator.PageNumber 1) }} +{{- partial "home_info.html" . }} +{{- end }} + +{{- $term := .Data.Term }} +{{- range $index, $page := $paginator.Pages }} + +{{- $class := "post-entry" }} + +{{- $user_preferred := or .Site.Params.disableSpecial1stPost .Site.Params.homeInfoParams }} +{{- if (and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) (not $user_preferred)) }} +{{- $class = "first-entry" }} +{{- else if $term }} +{{- $class = "post-entry tag-entry" }} +{{- end }} + +<article class="{{ $class }}"> + {{- $isHidden := (.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInList) }} + {{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }} + <header class="entry-header"> + <h2> + {{- .Title }} + {{- if .Draft }}<sup><span class="entry-isdraft"> [draft]</span></sup>{{- end }} + </h2> + </header> + {{- if (ne (.Param "hideSummary") true) }} + <section class="entry-content"> + <p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p> + </section> + {{- end }} + {{- if not (.Param "hideMeta") }} + <footer class="entry-footer"> + {{- partial "post_meta.html" . -}} + </footer> + {{- end }} + <a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a> +</article> +{{- end }} + +{{- if gt $paginator.TotalPages 1 }} +<footer class="page-footer"> + <nav class="pagination"> + {{- if $paginator.HasPrev }} + <a class="prev" href="{{ $paginator.Prev.URL | absURL }}">« {{ i18n "prev_page" }}</a> + {{- end }} + {{- if $paginator.HasNext }} + <a class="next" href="{{ $paginator.Next.URL | absURL }}">{{ i18n "next_page" }} »</a> + {{- end }} + </nav> +</footer> +{{- end }} + +{{- end }}{{/* end profileMode */}} + +{{- end }}{{- /* end main */ -}} diff --git a/themes/PaperMod/layouts/_default/rss.xml b/themes/PaperMod/layouts/_default/rss.xml new file mode 100644 index 0000000..eca41b7 --- /dev/null +++ b/themes/PaperMod/layouts/_default/rss.xml @@ -0,0 +1,50 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := slice -}} +{{- if or $.IsHome $.IsSection -}} +{{- $pages = $pctx.RegularPages -}} +{{- else -}} +{{- $pages = $pctx.Pages -}} +{{- end -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"> + <channel> + <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> + <link>{{ .Permalink }}</link> + <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description> + {{- with $.Site.Params.images }} + <image> + <url>{{ index . 0 | absURL }}</url> + <link>{{ index . 0 | absURL }}</link> + </image> + {{- end }} + <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }} + <language>{{.}}</language>{{end}}{{ with .Site.Author.email }} + <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} + <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} + <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} + <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} + {{- end -}} + {{ range $pages }} + {{- if and (ne .Layout `search`) (ne .Layout `archives`) }} + <item> + <title>{{ .Title }}</title> + <link>{{ .Permalink }}</link> + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} + <guid>{{ .Permalink }}</guid> + <description>{{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}}</description> + {{- if .Site.Params.ShowFullTextinRSS }} + <content:encoded>{{ (printf "<![CDATA[%s]]>" .Content) | safeHTML }}</content:encoded> + {{- end }} + </item> + {{- end }} + {{ end }} + </channel> +</rss> diff --git a/themes/PaperMod/layouts/_default/search.html b/themes/PaperMod/layouts/_default/search.html new file mode 100644 index 0000000..2349587 --- /dev/null +++ b/themes/PaperMod/layouts/_default/search.html @@ -0,0 +1,29 @@ +{{- define "main" }} + +<header class="page-header"> + <h1>{{- (printf "%s " .Title ) | htmlUnescape -}} + <svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" + stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> + <circle cx="11" cy="11" r="8"></circle> + <line x1="21" y1="21" x2="16.65" y2="16.65"></line> + </svg> + </h1> + {{- if .Description }} + <div class="post-description"> + {{ .Description }} + </div> + {{- end }} + {{- if not (.Param "hideMeta") }} + <div class="post-meta"> + {{- partial "translation_list.html" . -}} + </div> + {{- end }} +</header> + +<div id="searchbox"> + <input id="searchInput" autofocus placeholder="{{ .Params.placeholder | default (printf "%s ↵" .Title) }}" + aria-label="search" type="search" autocomplete="off"> + <ul id="searchResults" aria-label="search results"></ul> +</div> + +{{- end }}{{/* end main */}} diff --git a/themes/PaperMod/layouts/_default/single.html b/themes/PaperMod/layouts/_default/single.html new file mode 100644 index 0000000..1d983fd --- /dev/null +++ b/themes/PaperMod/layouts/_default/single.html @@ -0,0 +1,59 @@ +{{- define "main" }} + +<article class="post-single"> + <header class="post-header"> + {{ partial "breadcrumbs.html" . }} + <h1 class="post-title"> + {{ .Title }} + {{- if .Draft }}<sup><span class="entry-isdraft"> [draft]</span></sup>{{- end }} + </h1> + {{- if .Description }} + <div class="post-description"> + {{ .Description }} + </div> + {{- end }} + {{- if not (.Param "hideMeta") }} + <div class="post-meta"> + {{- partial "post_meta.html" . -}} + {{- partial "translation_list.html" . -}} + {{- partial "edit_post.html" . -}} + {{- partial "post_canonical.html" . -}} + </div> + {{- end }} + </header> + {{- $isHidden := .Params.cover.hidden | default .Site.Params.cover.hiddenInSingle | default .Site.Params.cover.hidden }} + {{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }} + {{- if (.Param "ShowToc") }} + {{- partial "toc.html" . }} + {{- end }} + + {{- if .Content }} + <div class="post-content"> + {{- if not (.Param "disableAnchoredHeadings") }} + {{- partial "anchored_headings.html" .Content -}} + {{- else }}{{ .Content }}{{ end }} + </div> + {{- end }} + + <footer class="post-footer"> + {{- if .Params.tags }} + <ul class="post-tags"> + {{- range ($.GetTerms "tags") }} + <li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li> + {{- end }} + </ul> + {{- end }} + {{- if (.Param "ShowPostNavLinks") }} + {{- partial "post_nav_links.html" . }} + {{- end }} + {{- if (and .Site.Params.ShowShareButtons (ne .Params.disableShare true)) }} + {{- partial "share_icons.html" . -}} + {{- end }} + </footer> + + {{- if (.Param "comments") }} + {{- partial "comments.html" . }} + {{- end }} +</article> + +{{- end }}{{/* end main */}} diff --git a/themes/PaperMod/layouts/_default/terms.html b/themes/PaperMod/layouts/_default/terms.html new file mode 100644 index 0000000..d5a9e66 --- /dev/null +++ b/themes/PaperMod/layouts/_default/terms.html @@ -0,0 +1,27 @@ +{{- define "main" }} + +{{- if .Title }} +<header class="page-header"> + <h1>{{ .Title }}</h1> + {{- if .Description }} + <div class="post-description"> + {{ .Description }} + </div> + {{- end }} +</header> +{{- end }} + +<ul class="terms-tags"> + {{- $type := .Type }} + {{- range $key, $value := .Data.Terms.Alphabetical }} + {{- $name := .Name }} + {{- $count := .Count }} + {{- with $.Site.GetPage (printf "/%s/%s" $type $name) }} + <li> + <a href="{{ .Permalink }}">{{ .Name }} <sup><strong><sup>{{ $count }}</sup></strong></sup> </a> + </li> + {{- end }} + {{- end }} +</ul> + +{{- end }}{{/* end main */ -}} diff --git a/themes/PaperMod/layouts/partials/anchored_headings.html b/themes/PaperMod/layouts/partials/anchored_headings.html new file mode 100644 index 0000000..377af89 --- /dev/null +++ b/themes/PaperMod/layouts/partials/anchored_headings.html @@ -0,0 +1,2 @@ +{{- /* formats .Content headings by adding an anchor */ -}} +{{ . | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" "${1}<a hidden class=\"anchor\" aria-hidden=\"true\" href=\"#${2}\">#</a>${3}" | safeHTML }} diff --git a/themes/PaperMod/layouts/partials/author.html b/themes/PaperMod/layouts/partials/author.html new file mode 100644 index 0000000..4582b12 --- /dev/null +++ b/themes/PaperMod/layouts/partials/author.html @@ -0,0 +1,9 @@ +{{- if or .Params.author .Site.Params.author }} +{{- $author := (.Params.author | default .Site.Params.author) }} +{{- $author_type := (printf "%T" $author) }} +{{- if (or (eq $author_type "[]string") (eq $author_type "[]interface {}")) }} +{{- (delimit $author ", " ) }} +{{- else }} +{{- $author }} +{{- end }} +{{- end -}} diff --git a/themes/PaperMod/layouts/partials/breadcrumbs.html b/themes/PaperMod/layouts/partials/breadcrumbs.html new file mode 100644 index 0000000..742254a --- /dev/null +++ b/themes/PaperMod/layouts/partials/breadcrumbs.html @@ -0,0 +1,19 @@ +{{- if (.Param "ShowBreadCrumbs") -}} +<div class="breadcrumbs"> + {{- $url := replace .Parent.Permalink (printf "%s" .Site.BaseURL) "" }} + {{- $lang_url := strings.TrimPrefix (printf "%s/" .Lang) $url -}} + + <a href="{{ "" | absLangURL }}">{{ i18n "home" | default "Home" }}</a> + {{- $scratch := newScratch }} + {{- range $index, $element := split $lang_url "/" }} + + {{- $scratch.Add "path" (printf "%s/" $element )}} + {{- $bc_pg := $.Site.GetPage ($scratch.Get "path") -}} + + {{- if (and ($bc_pg) (gt (len . ) 0))}} + {{- print " » " | safeHTML -}}<a href="{{ $bc_pg.Permalink }}">{{ $bc_pg.Name }}</a> + {{- end }} + + {{- end -}} +</div> +{{- end -}} diff --git a/themes/PaperMod/layouts/partials/comments.html b/themes/PaperMod/layouts/partials/comments.html new file mode 100644 index 0000000..918451a --- /dev/null +++ b/themes/PaperMod/layouts/partials/comments.html @@ -0,0 +1,3 @@ +{{- /* Comments area start */ -}} +{{- /* to add comments read => https://gohugo.io/content-management/comments/ */ -}} +{{- /* Comments area end */ -}} diff --git a/themes/PaperMod/layouts/partials/cover.html b/themes/PaperMod/layouts/partials/cover.html new file mode 100644 index 0000000..b4e7c78 --- /dev/null +++ b/themes/PaperMod/layouts/partials/cover.html @@ -0,0 +1,40 @@ +{{- with .cxt}} {{/* Apply proper context from dict */}} +{{- if (and .Params.cover.image (not $.isHidden)) }} +{{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }} +<figure class="entry-cover"> + {{- $responsiveImages := (.Params.cover.responsiveImages | default .Site.Params.cover.responsiveImages) | default true }} + {{- $addLink := (and .Site.Params.cover.linkFullImages (not $.IsHome)) }} + {{- $cover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} + {{- if $cover -}}{{/* i.e it is present in page bundle */}} + {{- if $addLink }}<a href="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" target="_blank" + rel="noopener noreferrer">{{ end -}} + {{- $sizes := (slice "360" "480" "720" "1080" "1500") }} + {{- $processableFormats := (slice "jpg" "jpeg" "png" "tif" "bmp" "gif") -}} + {{- if hugo.IsExtended -}} + {{- $processableFormats = $processableFormats | append "webp" -}} + {{- end -}} + {{- $prod := (hugo.IsProduction | or (eq .Site.Params.env "production")) }} + {{- if (and (in $processableFormats $cover.MediaType.SubType) ($responsiveImages) (eq $prod true)) }} + <img loading="lazy" srcset="{{- range $size := $sizes -}} + {{- if (ge $cover.Width $size) -}} + {{ printf "%s %s" (($cover.Resize (printf "%sx" $size)).Permalink) (printf "%sw ," $size) -}} + {{ end }} + {{- end -}}{{$cover.Permalink }} {{printf "%dw" ($cover.Width)}}" + sizes="(min-width: 768px) 720px, 100vw" src="{{ $cover.Permalink }}" alt="{{ $alt }}" + width="{{ $cover.Width }}" height="{{ $cover.Height }}"> + {{- else }}{{/* Unprocessable image or responsive images disabled */}} + <img loading="lazy" src="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" alt="{{ $alt }}"> + {{- end }} + {{- else }}{{/* For absolute urls and external links, no img processing here */}} + {{- if $addLink }}<a href="{{ (.Params.cover.image) | absURL }}" target="_blank" + rel="noopener noreferrer">{{ end -}} + <img loading="lazy" src="{{ (.Params.cover.image) | absURL }}" alt="{{ $alt }}"> + {{- end }} + {{- if $addLink }}</a>{{ end -}} + {{/* Display Caption */}} + {{- if not $.IsHome }} + {{ with .Params.cover.caption }}<p>{{ . | markdownify }}</p>{{- end }} + {{- end }} +</figure> +{{- end }}{{/* End image */}} +{{- end -}}{{/* End context */ -}} diff --git a/themes/PaperMod/layouts/partials/edit_post.html b/themes/PaperMod/layouts/partials/edit_post.html new file mode 100644 index 0000000..1d90ebd --- /dev/null +++ b/themes/PaperMod/layouts/partials/edit_post.html @@ -0,0 +1,8 @@ +{{- if or .Params.editPost.URL .Site.Params.editPost.URL -}} +{{- $fileUrlPath := path.Join .File.Path }} + +{{- if or .Params.author $.Site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated }} | {{- end -}} +<a href="{{ .Params.editPost.URL | default .Site.Params.editPost.URL }}{{ if .Params.editPost.appendFilePath | default ( .Site.Params.editPost.appendFilePath | default false ) }}/{{ $fileUrlPath }}{{ end }}" rel="noopener noreferrer" target="_blank"> + {{- .Params.editPost.Text | default (.Site.Params.editPost.Text | default (i18n "edit_post" | default "Edit")) -}} +</a> +{{- end }} diff --git a/themes/PaperMod/layouts/partials/extend_footer.html b/themes/PaperMod/layouts/partials/extend_footer.html new file mode 100644 index 0000000..0519748 --- /dev/null +++ b/themes/PaperMod/layouts/partials/extend_footer.html @@ -0,0 +1,3 @@ +{{- /* Footer custom content area start */ -}} +{{- /* Insert any custom code web-analytics, resources, etc. here */ -}} +{{- /* Footer custom content area end */ -}} diff --git a/themes/PaperMod/layouts/partials/extend_head.html b/themes/PaperMod/layouts/partials/extend_head.html new file mode 100644 index 0000000..150cbef --- /dev/null +++ b/themes/PaperMod/layouts/partials/extend_head.html @@ -0,0 +1,4 @@ +{{- /* Head custom content area start */ -}} +{{- /* Insert any custom code (web-analytics, resources, etc.) - it will appear in the <head></head> section of every page. */ -}} +{{- /* Can be overwritten by partial with the same name in the global layouts. */ -}} +{{- /* Head custom content area end */ -}} diff --git a/themes/PaperMod/layouts/partials/footer.html b/themes/PaperMod/layouts/partials/footer.html new file mode 100644 index 0000000..d6ee155 --- /dev/null +++ b/themes/PaperMod/layouts/partials/footer.html @@ -0,0 +1,135 @@ +{{- if not (.Param "hideFooter") }} +<footer class="footer"> + {{- if .Site.Copyright }} + <span>© {{ now.Year }} {{ .Site.Copyright | markdownify }}</span> + {{- else }} + <span>© {{ now.Year }} <a href="{{ "" | absLangURL }}">{{ .Site.Title }}</a></span> + {{- end }} + <span> + Powered by + <a href="https://gohugo.io/" rel="noopener noreferrer" target="_blank">Hugo</a> & + <a href="https://git.io/hugopapermod" rel="noopener" target="_blank">PaperMod</a> + </span> +</footer> +{{- end }} + +{{- if (not .Site.Params.disableScrollToTop) }} +<a href="#top" aria-label="go to top" title="Go to Top (Alt + G)" class="top-link" id="top-link" accesskey="g"> + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentColor"> + <path d="M12 6H0l6-6z" /> + </svg> +</a> +{{- end }} + +{{- partial "extend_footer.html" . }} + +<script> + let menu = document.getElementById('menu') + if (menu) { + menu.scrollLeft = localStorage.getItem("menu-scroll-position"); + menu.onscroll = function () { + localStorage.setItem("menu-scroll-position", menu.scrollLeft); + } + } + + document.querySelectorAll('a[href^="#"]').forEach(anchor => { + anchor.addEventListener("click", function (e) { + e.preventDefault(); + var id = this.getAttribute("href").substr(1); + if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) { + document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView({ + behavior: "smooth" + }); + } else { + document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView(); + } + if (id === "top") { + history.replaceState(null, null, " "); + } else { + history.pushState(null, null, `#${id}`); + } + }); + }); + +</script> + +{{- if (not .Site.Params.disableScrollToTop) }} +<script> + var mybutton = document.getElementById("top-link"); + window.onscroll = function () { + if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800) { + mybutton.style.visibility = "visible"; + mybutton.style.opacity = "1"; + } else { + mybutton.style.visibility = "hidden"; + mybutton.style.opacity = "0"; + } + }; + +</script> +{{- end }} + +{{- if (not .Site.Params.disableThemeToggle) }} +<script> + document.getElementById("theme-toggle").addEventListener("click", () => { + if (document.body.className.includes("dark")) { + document.body.classList.remove('dark'); + localStorage.setItem("pref-theme", 'light'); + } else { + document.body.classList.add('dark'); + localStorage.setItem("pref-theme", 'dark'); + } + }) + +</script> +{{- end }} + +{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (.Param "ShowCodeCopyButtons")) }} +<script> + document.querySelectorAll('pre > code').forEach((codeblock) => { + const container = codeblock.parentNode.parentNode; + + const copybutton = document.createElement('button'); + copybutton.classList.add('copy-code'); + copybutton.innerText = '{{- i18n "code_copy" | default "copy" }}'; + + function copyingDone() { + copybutton.innerText = '{{- i18n "code_copied" | default "copied!" }}'; + setTimeout(() => { + copybutton.innerText = '{{- i18n "code_copy" | default "copy" }}'; + }, 2000); + } + + copybutton.addEventListener('click', (cb) => { + if ('clipboard' in navigator) { + navigator.clipboard.writeText(codeblock.textContent); + copyingDone(); + return; + } + + const range = document.createRange(); + range.selectNodeContents(codeblock); + const selection = window.getSelection(); + selection.removeAllRanges(); + selection.addRange(range); + try { + document.execCommand('copy'); + copyingDone(); + } catch (e) { }; + selection.removeRange(range); + }); + + if (container.classList.contains("highlight")) { + container.appendChild(copybutton); + } else if (container.parentNode.firstChild == container) { + // td containing LineNos + } else if (codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "TABLE") { + // table containing LineNos and code + codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(copybutton); + } else { + // code blocks not having highlight as parent class + codeblock.parentNode.appendChild(copybutton); + } + }); +</script> +{{- end }} diff --git a/themes/PaperMod/layouts/partials/head.html b/themes/PaperMod/layouts/partials/head.html new file mode 100644 index 0000000..0d3fa72 --- /dev/null +++ b/themes/PaperMod/layouts/partials/head.html @@ -0,0 +1,163 @@ +<meta charset="utf-8"> +<meta http-equiv="X-UA-Compatible" content="IE=edge"> +<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> +{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }} +<meta name="robots" content="index, follow"> +{{- else }} +<meta name="robots" content="noindex, nofollow"> +{{- end }} + +{{- /* Title */}} +<title>{{ if .IsHome }}{{ else }}{{ if .Title }}{{ .Title }} | {{ end }}{{ end }}{{ .Site.Title }}</title> + +{{- /* Meta */}} +{{- if .IsHome }} +{{ with .Site.Params.keywords -}}<meta name="keywords" content="{{- range $i, $e := . }}{{ if $i }}, {{ end }}{{ $e }}{{ end }}" />{{ end }} +{{- else }} +<meta name="keywords" content="{{ if .Params.keywords -}} + {{- range $i, $e := .Params.keywords }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- else }} + {{- range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} {{- end -}}" /> +{{- end }} +<meta name="description" content="{{- with .Description }}{{ . }}{{- else }}{{- if or .IsPage .IsSection}} + {{- .Summary | default (printf "%s - %s" .Title .Site.Title) }}{{- else }} + {{- with .Site.Params.description }}{{ . }}{{- end }}{{- end }}{{- end -}}"> +<meta name="author" content="{{ (partial "author.html" . ) }}"> +<link rel="canonical" href="{{ if .Params.canonicalURL -}} {{ trim .Params.canonicalURL " " }} {{- else -}} {{ .Permalink }} {{- end }}" /> +{{- if .Site.Params.analytics.google.SiteVerificationTag }} +<meta name="google-site-verification" content="{{ .Site.Params.analytics.google.SiteVerificationTag }}" /> +{{- end }} +{{- if .Site.Params.analytics.yandex.SiteVerificationTag }} +<meta name="yandex-verification" content="{{ .Site.Params.analytics.yandex.SiteVerificationTag }}" /> +{{- end }} +{{- if .Site.Params.analytics.bing.SiteVerificationTag }} +<meta name="msvalidate.01" content="{{ .Site.Params.analytics.bing.SiteVerificationTag }}" /> +{{- end }} + +{{- /* Styles */}} +{{- $theme_vars := (resources.Get "css/core/theme-vars.css") }} +{{- $reset := (resources.Get "css/core/reset.css") }} +{{- $media := (resources.Get "css/core/zmedia.css") }} +{{- $common := (resources.Match "css/common/*.css") | resources.Concat "assets/css/common.css" }} + +{{- /* include `an-old-hope` if hljs is on */}} +{{- $isHLJSdisabled := (.Site.Params.assets.disableHLJS | default false) }} +{{- $hljs := (cond ($isHLJSdisabled) (" " | resources.FromString "assets/css/hljs-blank.css") (resources.Get "css/hljs/an-old-hope.min.css")) }} + +{{- /* order is important */}} +{{- $core := (slice $theme_vars $reset $common $hljs $media) | resources.Concat "assets/css/core.css" }} +{{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" }} + +{{- /* bundle all required css */}} +{{- /* Add extended css after theme style */ -}} +{{- $stylesheet := (slice $core $extended) | resources.Concat "assets/css/stylesheet.css" | minify }} + +{{- if not .Site.Params.assets.disableFingerprinting }} +{{- $stylesheet := $stylesheet | fingerprint }} +<link crossorigin="anonymous" href="{{ $stylesheet.RelPermalink }}" integrity="{{ $stylesheet.Data.Integrity }}" rel="preload stylesheet" as="style"> +{{- else }} +<link crossorigin="anonymous" href="{{ $stylesheet.RelPermalink }}" rel="preload stylesheet" as="style"> +{{- end }} + +{{- with .Site.Params.profileMode }} +{{- if and .enabled .imageUrl $.IsHome }} +<link rel="preload" href="{{ .imageUrl }}" as="image"> +{{- end }} +{{- end }} + +{{- with .Site.Params.label.icon }} +<link rel="preload" href="{{ . }}" as="image"> +{{- end }} + +{{- /* Search */}} +{{- if (eq .Layout `search`) -}} +<link crossorigin="anonymous" rel="preload" as="fetch" href="../index.json"> +{{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" .Site.Params.fuseOpts)) }} +{{- $fusejs := resources.Get "js/fuse.basic.min.js" }} +{{- if not .Site.Params.assets.disableFingerprinting }} +{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify | fingerprint }} +<script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}" integrity="{{ $search.Data.Integrity }}"></script> +{{- else }} +{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify }} +<script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}"></script> +{{- end }} +{{- end -}} + +{{- /* Highlight.js */}} +{{- $isHLJSdisabled := (.Site.Params.assets.disableHLJS | default .Params.disableHLJS ) }} +{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }} +{{- if not .Site.Params.assets.disableFingerprinting }} +{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify | fingerprint }} +<script defer crossorigin="anonymous" src="{{ $highlight.RelPermalink }}" integrity="{{ $highlight.Data.Integrity }}" + onload="hljs.initHighlightingOnLoad();"></script> +{{- else }} +{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify }} +<script defer crossorigin="anonymous" src="{{ $highlight.RelPermalink }}" onload="hljs.initHighlightingOnLoad();"></script> +{{- end }} +{{- end }} + +{{- /* Favicons */}} +<link rel="icon" href="{{ .Site.Params.assets.favicon | default "favicon.ico" | absURL }}"> +<link rel="icon" type="image/png" sizes="16x16" href="{{ .Site.Params.assets.favicon16x16 | default "favicon-16x16.png" | absURL }}"> +<link rel="icon" type="image/png" sizes="32x32" href="{{ .Site.Params.assets.favicon32x32 | default "favicon-32x32.png" | absURL }}"> +<link rel="apple-touch-icon" href="{{ .Site.Params.assets.apple_touch_icon | default "apple-touch-icon.png" | absURL }}"> +<link rel="mask-icon" href="{{ .Site.Params.assets.safari_pinned_tab | default "safari-pinned-tab.svg" | absURL }}"> +<meta name="theme-color" content="{{ .Site.Params.assets.theme_color | default "#2e2e33" }}"> +<meta name="msapplication-TileColor" content="{{ .Site.Params.assets.msapplication_TileColor | default "#2e2e33" }}"> + +{{- /* RSS */}} +{{ range .AlternativeOutputFormats -}} +<link rel="{{ .Rel }}" type="{{ .MediaType.Type | html }}" href="{{ .Permalink | safeURL }}"> +{{ end -}} +{{- range .AllTranslations -}} +<link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}" /> +{{ end -}} + +<noscript> + <style> + #theme-toggle, + .top-link { + display: none; + } + + </style> + {{- if (and (ne .Site.Params.defaultTheme "light") (ne .Site.Params.defaultTheme "dark")) }} + <style> + @media (prefers-color-scheme: dark) { + :root { + --theme: rgb(29, 30, 32); + --entry: rgb(46, 46, 51); + --primary: rgb(218, 218, 219); + --secondary: rgb(155, 156, 157); + --tertiary: rgb(65, 66, 68); + --content: rgb(196, 196, 197); + --hljs-bg: rgb(46, 46, 51); + --code-bg: rgb(55, 56, 62); + --border: rgb(51, 51, 51); + } + + .list { + background: var(--theme); + } + + .list:not(.dark)::-webkit-scrollbar-track { + background: 0 0; + } + + .list:not(.dark)::-webkit-scrollbar-thumb { + border-color: var(--theme); + } + } + + </style> + {{- end }} +</noscript> + +{{- partial "extend_head.html" . -}} + +{{- /* Misc */}} +{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }} +{{- template "_internal/google_analytics.html" . }} +{{- template "partials/templates/opengraph.html" . }} +{{- template "partials/templates/twitter_cards.html" . }} +{{- template "partials/templates/schema_json.html" . }} +{{- end -}} diff --git a/themes/PaperMod/layouts/partials/header.html b/themes/PaperMod/layouts/partials/header.html new file mode 100644 index 0000000..cc63659 --- /dev/null +++ b/themes/PaperMod/layouts/partials/header.html @@ -0,0 +1,121 @@ +{{- /* theme-toggle is enabled */}} +{{- if (not .Site.Params.disableThemeToggle) }} +{{- /* theme is light */}} +{{- if (eq .Site.Params.defaultTheme "light") }} +<script> + if (localStorage.getItem("pref-theme") === "dark") { + document.body.classList.add('dark'); + } + +</script> +{{- /* theme is dark */}} +{{- else if (eq .Site.Params.defaultTheme "dark") }} +<script> + if (localStorage.getItem("pref-theme") === "light") { + document.body.classList.remove('dark') + } + +</script> +{{- else }} +{{- /* theme is auto */}} +<script> + if (localStorage.getItem("pref-theme") === "dark") { + document.body.classList.add('dark'); + } else if (localStorage.getItem("pref-theme") === "light") { + document.body.classList.remove('dark') + } else if (window.matchMedia('(prefers-color-scheme: dark)').matches) { + document.body.classList.add('dark'); + } + +</script> +{{- end }} +{{- /* theme-toggle is disabled and theme is auto */}} +{{- else if (and (ne .Site.Params.defaultTheme "light") (ne .Site.Params.defaultTheme "dark"))}} +<script> + if (window.matchMedia('(prefers-color-scheme: dark)').matches) { + document.body.classList.add('dark'); + } + +</script> +{{- end }} + +<header class="header"> + <nav class="nav"> + <div class="logo"> + {{- $label_text := (.Site.Params.label.text | default .Site.Title) }} + {{- if .Site.Title }} + <a href="{{ "" | absLangURL }}" accesskey="h" title="{{ $label_text }} (Alt + H)"> + {{- if .Site.Params.label.icon }} + <img src="{{- .Site.Params.label.icon | absURL -}}" alt="logo" aria-label="logo" + height="{{- .Site.Params.label.iconHeight | default " 30px" -}}"> + {{- end -}} + {{- $label_text -}} + </a> + {{- end }} + <span class="logo-switches"> + {{- if (not .Site.Params.disableThemeToggle) }} + <button id="theme-toggle" accesskey="t" title="(Alt + T)"> + <svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" + fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" + stroke-linejoin="round"> + <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path> + </svg> + <svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" + fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" + stroke-linejoin="round"> + <circle cx="12" cy="12" r="5"></circle> + <line x1="12" y1="1" x2="12" y2="3"></line> + <line x1="12" y1="21" x2="12" y2="23"></line> + <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line> + <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line> + <line x1="1" y1="12" x2="3" y2="12"></line> + <line x1="21" y1="12" x2="23" y2="12"></line> + <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line> + <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line> + </svg> + </button> + {{- end }} + + {{- $lang := .Lang}} + {{- $separator := or $label_text (not .Site.Params.disableThemeToggle)}} + {{- with $.Site.Home.AllTranslations }} + <ul class="lang-switch"> + {{- if $separator }}<li>|</li>{{ end }} + {{- range . -}} + {{- if ne $lang .Lang }} + <li> + <a href="{{- .Permalink -}}" title="{{ .Language.Params.languageAltTitle | default (.Language.LanguageName | emojify) | default (.Lang | title) }}" + aria-label="{{ .Language.LanguageName | default (.Lang | title) }}"> + {{- if (and $.Site.Params.displayFullLangName (.Language.LanguageName)) }} + {{- .Language.LanguageName | emojify -}} + {{- else }} + {{- .Lang | title -}} + {{- end -}} + </a> + </li> + {{- end -}} + {{- end}} + </ul> + {{- end }} + </span> + </div> + {{- $currentPage := . }} + <ul id="menu"> + {{- range .Site.Menus.main }} + {{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absLangURL }} + {{- $page_url:= $currentPage.Permalink | absLangURL }} + {{- $is_search := eq ($.Site.GetPage .KeyName).Layout `search` }} + <li> + <a href="{{ .URL | absLangURL }}" title="{{ .Title | default .Name }} {{- cond $is_search (" (Alt + /)" | safeHTMLAttr) ("" | safeHTMLAttr ) }}" + {{- cond $is_search (" accesskey=/" | safeHTMLAttr) ("" | safeHTMLAttr ) }}> + <span {{- if eq $menu_item_url $page_url }} class="active" {{- end }}> + {{- .Pre }} + {{- .Name -}} + {{ .Post -}} + </span> + </a> + </li> + {{- end }} + </ul> + </nav> +</header> diff --git a/themes/PaperMod/layouts/partials/home_info.html b/themes/PaperMod/layouts/partials/home_info.html new file mode 100644 index 0000000..4db55d7 --- /dev/null +++ b/themes/PaperMod/layouts/partials/home_info.html @@ -0,0 +1,13 @@ +{{- with $.Site.Params.homeInfoParams }} +<article class="first-entry home-info"> + <header class="entry-header"> + <h1>{{ .Title | markdownify }}</h1> + </header> + <section class="entry-content"> + <p>{{ .Content | markdownify }}</p> + </section> + <footer class="entry-footer"> + {{ partial "social_icons.html" $.Site.Params.socialIcons }} + </footer> +</article> +{{- end -}} diff --git a/themes/PaperMod/layouts/partials/index_profile.html b/themes/PaperMod/layouts/partials/index_profile.html new file mode 100644 index 0000000..4e961ba --- /dev/null +++ b/themes/PaperMod/layouts/partials/index_profile.html @@ -0,0 +1,23 @@ +<div class="profile"> + {{- with .Site.Params.profileMode }} + <div class="profile_inner"> + {{- if .imageUrl -}} + <img src="{{ .imageUrl | absURL }}" alt="{{ .imageTitle | default "profile image" }}" + height="{{ .imageHeight | default 150 }}" width="{{ .imageWidth | default 150 }}" /> + {{- end }} + <h1>{{ .title | default $.Site.Title | markdownify }}</h1> + <span>{{ .subtitle | markdownify }}</span> + {{- partial "social_icons.html" $.Site.Params.socialIcons -}} + + {{- with .buttons }} + <div class="buttons"> + {{- range . }} + <a class="button" href="{{ trim .url " " }}" rel="noopener" title="{{ .name | title }}"> + <span class="button-inner">{{ .name | title }}</span> + </a> + {{- end }} + </div> + {{- end }} + </div> + {{- end}} +</div> diff --git a/themes/PaperMod/layouts/partials/post_canonical.html b/themes/PaperMod/layouts/partials/post_canonical.html new file mode 100644 index 0000000..9befad1 --- /dev/null +++ b/themes/PaperMod/layouts/partials/post_canonical.html @@ -0,0 +1,9 @@ +{{ if and (.Params.canonicalURL) (.Params.ShowCanonicalLink ) -}} +{{ $url := urls.Parse .Params.canonicalURL }} + +{{- if or .Params.author $.Site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated (or .Params.editPost.URL .Site.Params.editPost.URL) }} | {{- end -}} +<span> + {{- (.Site.Params.CanonicalLinkText | default .Params.CanonicalLinkText) | default "Originally published at" -}} + <a href="{{ trim .Params.canonicalURL " " }}" title="{{ trim .Params.canonicalURL " " }}" target="_blank" rel="noopener noreferrer">{{ $url.Host }}</a> +</span> +{{- end }} diff --git a/themes/PaperMod/layouts/partials/post_meta.html b/themes/PaperMod/layouts/partials/post_meta.html new file mode 100644 index 0000000..f7134fb --- /dev/null +++ b/themes/PaperMod/layouts/partials/post_meta.html @@ -0,0 +1,21 @@ +{{- $scratch := newScratch }} + +{{- if not .Date.IsZero -}} +{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default "January 2, 2006" .Site.Params.DateFormat)))) }} +{{- end }} + +{{- if (.Param "ShowReadingTime") -}} +{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }} +{{- end }} + +{{- if (.Param "ShowWordCount") -}} +{{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }} +{{- end }} + +{{- with (partial "author.html" .) }} +{{- $scratch.Add "meta" (slice .) }} +{{- end }} + +{{- with ($scratch.Get "meta") }} +{{- delimit . " · " -}} +{{- end -}} diff --git a/themes/PaperMod/layouts/partials/post_nav_links.html b/themes/PaperMod/layouts/partials/post_nav_links.html new file mode 100644 index 0000000..b988641 --- /dev/null +++ b/themes/PaperMod/layouts/partials/post_nav_links.html @@ -0,0 +1,19 @@ +{{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} +{{- if and (gt (len $pages) 1) (in $pages . ) }} +<nav class="paginav"> + {{- with $pages.Next . }} + <a class="prev" href="{{ .Permalink }}"> + <span class="title">« {{ i18n "prev_page" }}</span> + <br> + <span>{{- .Name -}}</span> + </a> + {{- end }} + {{- with $pages.Prev . }} + <a class="next" href="{{ .Permalink }}"> + <span class="title">{{ i18n "next_page" }} »</span> + <br> + <span>{{- .Name -}}</span> + </a> + {{- end }} +</nav> +{{- end }} diff --git a/themes/PaperMod/layouts/partials/share_icons.html b/themes/PaperMod/layouts/partials/share_icons.html new file mode 100644 index 0000000..85c59b3 --- /dev/null +++ b/themes/PaperMod/layouts/partials/share_icons.html @@ -0,0 +1,71 @@ +{{- $pageurl := .Permalink }} +{{- $title := .Title }} + +{{- $.Scratch.Set "tags" ""}} + +{{- with .Params.Tags }} +{{- $hashtags := newScratch}} +{{- range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}} +{{- $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }} +{{- end -}} + +{{- $custom := false }} +{{- $ShareButtons := (.Param "ShareButtons")}} +{{- with $ShareButtons }}{{ $custom = true }}{{ end }} + +<div class="share-buttons"> + {{- if (cond ($custom) (in $ShareButtons "twitter") (true)) }} + <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on twitter" + href="https://twitter.com/intent/tweet/?text={{ $title }}&url={{ $pageurl }}&hashtags={{- $.Scratch.Get "tags" -}}"> + <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve"> + <path + d="M449.446,0c34.525,0 62.554,28.03 62.554,62.554l0,386.892c0,34.524 -28.03,62.554 -62.554,62.554l-386.892,0c-34.524,0 -62.554,-28.03 -62.554,-62.554l0,-386.892c0,-34.524 28.029,-62.554 62.554,-62.554l386.892,0Zm-253.927,424.544c135.939,0 210.268,-112.643 210.268,-210.268c0,-3.218 0,-6.437 -0.153,-9.502c14.406,-10.421 26.973,-23.448 36.935,-38.314c-13.18,5.824 -27.433,9.809 -42.452,11.648c15.326,-9.196 26.973,-23.602 32.49,-40.92c-14.252,8.429 -30.038,14.56 -46.896,17.931c-13.487,-14.406 -32.644,-23.295 -53.946,-23.295c-40.767,0 -73.87,33.104 -73.87,73.87c0,5.824 0.613,11.494 1.992,16.858c-61.456,-3.065 -115.862,-32.49 -152.337,-77.241c-6.284,10.881 -9.962,23.601 -9.962,37.088c0,25.594 13.027,48.276 32.95,61.456c-12.107,-0.307 -23.448,-3.678 -33.41,-9.196l0,0.92c0,35.862 25.441,65.594 59.311,72.49c-6.13,1.686 -12.72,2.606 -19.464,2.606c-4.751,0 -9.348,-0.46 -13.946,-1.38c9.349,29.426 36.628,50.728 68.965,51.341c-25.287,19.771 -57.164,31.571 -91.8,31.571c-5.977,0 -11.801,-0.306 -17.625,-1.073c32.337,21.15 71.264,33.41 112.95,33.41Z" /> + </svg> + </a> + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "linkedin") (true)) }} + <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on linkedin" + href="https://www.linkedin.com/shareArticle?mini=true&url={{ $pageurl }}&title={{ $title }}&summary={{ $title }}&source={{ $pageurl }}"> + <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve"> + <path + d="M449.446,0c34.525,0 62.554,28.03 62.554,62.554l0,386.892c0,34.524 -28.03,62.554 -62.554,62.554l-386.892,0c-34.524,0 -62.554,-28.03 -62.554,-62.554l0,-386.892c0,-34.524 28.029,-62.554 62.554,-62.554l386.892,0Zm-288.985,423.278l0,-225.717l-75.04,0l0,225.717l75.04,0Zm270.539,0l0,-129.439c0,-69.333 -37.018,-101.586 -86.381,-101.586c-39.804,0 -57.634,21.891 -67.617,37.266l0,-31.958l-75.021,0c0.995,21.181 0,225.717 0,225.717l75.02,0l0,-126.056c0,-6.748 0.486,-13.492 2.474,-18.315c5.414,-13.475 17.767,-27.434 38.494,-27.434c27.135,0 38.007,20.707 38.007,51.037l0,120.768l75.024,0Zm-307.552,-334.556c-25.674,0 -42.448,16.879 -42.448,39.002c0,21.658 16.264,39.002 41.455,39.002l0.484,0c26.165,0 42.452,-17.344 42.452,-39.002c-0.485,-22.092 -16.241,-38.954 -41.943,-39.002Z" /> + </svg> + </a> + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "reddit") (true)) }} + <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on reddit" + href="https://reddit.com/submit?url={{ $pageurl }}&title={{ $title }}"> + <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve"> + <path + d="M449.446,0c34.525,0 62.554,28.03 62.554,62.554l0,386.892c0,34.524 -28.03,62.554 -62.554,62.554l-386.892,0c-34.524,0 -62.554,-28.03 -62.554,-62.554l0,-386.892c0,-34.524 28.029,-62.554 62.554,-62.554l386.892,0Zm-3.446,265.638c0,-22.964 -18.616,-41.58 -41.58,-41.58c-11.211,0 -21.361,4.457 -28.841,11.666c-28.424,-20.508 -67.586,-33.757 -111.204,-35.278l18.941,-89.121l61.884,13.157c0.756,15.734 13.642,28.29 29.56,28.29c16.407,0 29.706,-13.299 29.706,-29.701c0,-16.403 -13.299,-29.702 -29.706,-29.702c-11.666,0 -21.657,6.792 -26.515,16.578l-69.105,-14.69c-1.922,-0.418 -3.939,-0.042 -5.585,1.036c-1.658,1.073 -2.811,2.761 -3.224,4.686l-21.152,99.438c-44.258,1.228 -84.046,14.494 -112.837,35.232c-7.468,-7.164 -17.589,-11.591 -28.757,-11.591c-22.965,0 -41.585,18.616 -41.585,41.58c0,16.896 10.095,31.41 24.568,37.918c-0.639,4.135 -0.99,8.328 -0.99,12.576c0,63.977 74.469,115.836 166.33,115.836c91.861,0 166.334,-51.859 166.334,-115.836c0,-4.218 -0.347,-8.387 -0.977,-12.493c14.564,-6.47 24.735,-21.034 24.735,-38.001Zm-119.474,108.193c-20.27,20.241 -59.115,21.816 -70.534,21.816c-11.428,0 -50.277,-1.575 -70.522,-21.82c-3.007,-3.008 -3.007,-7.882 0,-10.889c3.003,-2.999 7.882,-3.003 10.885,0c12.777,12.781 40.11,17.317 59.637,17.317c19.522,0 46.86,-4.536 59.657,-17.321c3.016,-2.999 7.886,-2.995 10.885,0.008c3.008,3.011 3.003,7.882 -0.008,10.889Zm-5.23,-48.781c-16.373,0 -29.701,-13.324 -29.701,-29.698c0,-16.381 13.328,-29.714 29.701,-29.714c16.378,0 29.706,13.333 29.706,29.714c0,16.374 -13.328,29.698 -29.706,29.698Zm-160.386,-29.702c0,-16.381 13.328,-29.71 29.714,-29.71c16.369,0 29.689,13.329 29.689,29.71c0,16.373 -13.32,29.693 -29.689,29.693c-16.386,0 -29.714,-13.32 -29.714,-29.693Z" /> + </svg> + </a> + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "facebook") (true)) }} + <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on facebook" + href="https://facebook.com/sharer/sharer.php?u={{ $pageurl }}"> + <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve"> + <path + d="M449.446,0c34.525,0 62.554,28.03 62.554,62.554l0,386.892c0,34.524 -28.03,62.554 -62.554,62.554l-106.468,0l0,-192.915l66.6,0l12.672,-82.621l-79.272,0l0,-53.617c0,-22.603 11.073,-44.636 46.58,-44.636l36.042,0l0,-70.34c0,0 -32.71,-5.582 -63.982,-5.582c-65.288,0 -107.96,39.569 -107.96,111.204l0,62.971l-72.573,0l0,82.621l72.573,0l0,192.915l-191.104,0c-34.524,0 -62.554,-28.03 -62.554,-62.554l0,-386.892c0,-34.524 28.029,-62.554 62.554,-62.554l386.892,0Z" /> + </svg> + </a> + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "whatsapp") (true)) }} + <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on whatsapp" + href="https://api.whatsapp.com/send?text={{ $title }}%20-%20{{ $pageurl }}"> + <svg version="1.1" viewBox="0 0 512 512" xml:space="preserve"> + <path + d="M449.446,0c34.525,0 62.554,28.03 62.554,62.554l0,386.892c0,34.524 -28.03,62.554 -62.554,62.554l-386.892,0c-34.524,0 -62.554,-28.03 -62.554,-62.554l0,-386.892c0,-34.524 28.029,-62.554 62.554,-62.554l386.892,0Zm-58.673,127.703c-33.842,-33.881 -78.847,-52.548 -126.798,-52.568c-98.799,0 -179.21,80.405 -179.249,179.234c-0.013,31.593 8.241,62.428 23.927,89.612l-25.429,92.884l95.021,-24.925c26.181,14.28 55.659,21.807 85.658,21.816l0.074,0c98.789,0 179.206,-80.413 179.247,-179.243c0.018,-47.895 -18.61,-92.93 -52.451,-126.81Zm-126.797,275.782l-0.06,0c-26.734,-0.01 -52.954,-7.193 -75.828,-20.767l-5.441,-3.229l-56.386,14.792l15.05,-54.977l-3.542,-5.637c-14.913,-23.72 -22.791,-51.136 -22.779,-79.287c0.033,-82.142 66.867,-148.971 149.046,-148.971c39.793,0.014 77.199,15.531 105.329,43.692c28.128,28.16 43.609,65.592 43.594,105.4c-0.034,82.149 -66.866,148.983 -148.983,148.984Zm81.721,-111.581c-4.479,-2.242 -26.499,-13.075 -30.604,-14.571c-4.105,-1.495 -7.091,-2.241 -10.077,2.241c-2.986,4.483 -11.569,14.572 -14.182,17.562c-2.612,2.988 -5.225,3.364 -9.703,1.12c-4.479,-2.241 -18.91,-6.97 -36.017,-22.23c-13.314,-11.876 -22.304,-26.542 -24.916,-31.026c-2.612,-4.484 -0.279,-6.908 1.963,-9.14c2.016,-2.007 4.48,-5.232 6.719,-7.847c2.24,-2.615 2.986,-4.484 4.479,-7.472c1.493,-2.99 0.747,-5.604 -0.374,-7.846c-1.119,-2.241 -10.077,-24.288 -13.809,-33.256c-3.635,-8.733 -7.327,-7.55 -10.077,-7.688c-2.609,-0.13 -5.598,-0.158 -8.583,-0.158c-2.986,0 -7.839,1.121 -11.944,5.604c-4.105,4.484 -15.675,15.32 -15.675,37.364c0,22.046 16.048,43.342 18.287,46.332c2.24,2.99 31.582,48.227 76.511,67.627c10.685,4.615 19.028,7.371 25.533,9.434c10.728,3.41 20.492,2.929 28.209,1.775c8.605,-1.285 26.499,-10.833 30.231,-21.295c3.732,-10.464 3.732,-19.431 2.612,-21.298c-1.119,-1.869 -4.105,-2.99 -8.583,-5.232Z" /> + </svg> + </a> + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "telegram") (true)) }} + <a target="_blank" rel="noopener noreferrer" aria-label="share {{ $title | plainify }} on telegram" + href="https://telegram.me/share/url?text={{ $title }}&url={{ $pageurl }}"> + <svg version="1.1" xml:space="preserve" viewBox="2 2 28 28"> + <path + d="M26.49,29.86H5.5a3.37,3.37,0,0,1-2.47-1,3.35,3.35,0,0,1-1-2.47V5.48A3.36,3.36,0,0,1,3,3,3.37,3.37,0,0,1,5.5,2h21A3.38,3.38,0,0,1,29,3a3.36,3.36,0,0,1,1,2.46V26.37a3.35,3.35,0,0,1-1,2.47A3.38,3.38,0,0,1,26.49,29.86Zm-5.38-6.71a.79.79,0,0,0,.85-.66L24.73,9.24a.55.55,0,0,0-.18-.46.62.62,0,0,0-.41-.17q-.08,0-16.53,6.11a.59.59,0,0,0-.41.59.57.57,0,0,0,.43.52l4,1.24,1.61,4.83a.62.62,0,0,0,.63.43.56.56,0,0,0,.4-.17L16.54,20l4.09,3A.9.9,0,0,0,21.11,23.15ZM13.8,20.71l-1.21-4q8.72-5.55,8.78-5.55c.15,0,.23,0,.23.16a.18.18,0,0,1,0,.06s-2.51,2.3-7.52,6.8Z" /> + </svg> + </a> + {{- end }} +</div> diff --git a/themes/PaperMod/layouts/partials/social_icons.html b/themes/PaperMod/layouts/partials/social_icons.html new file mode 100644 index 0000000..7c16e30 --- /dev/null +++ b/themes/PaperMod/layouts/partials/social_icons.html @@ -0,0 +1,7 @@ +<div class="social-icons"> + {{- range . }} + <a href="{{ trim .url " " }}" target="_blank" rel="noopener noreferrer me" title="{{ .name | title }}"> + {{ partial "svg.html" . }} + </a> + {{- end }} +</div> diff --git a/themes/PaperMod/layouts/partials/svg.html b/themes/PaperMod/layouts/partials/svg.html new file mode 100644 index 0000000..f8f8963 --- /dev/null +++ b/themes/PaperMod/layouts/partials/svg.html @@ -0,0 +1,518 @@ +{{- $icon_name := ( trim .name " " | lower )}} +{{- if (eq $icon_name "123rf") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path style="font-variation-settings:normal" + d="M7.48 3.826c-.702 0-1.345.388-1.675 1.008l-.711 1.334a4.214 4.214 0 0 1-1.614 1.67l-.388.224a2.207 2.207 0 0 0-1.104 1.913v8.607c0 .878.712 1.592 1.59 1.592h1.186c.468 0 .916-.19 1.244-.524l1.478-1.504c.266-.27.628-.421 1.006-.421h7.04c.378 0 .74.151 1.005.421l1.478 1.504c.329.334.778.524 1.247.524h1.183c.879 0 1.592-.714 1.592-1.592V9.975c0-.79-.422-1.518-1.106-1.912l-.388-.225a4.214 4.214 0 0 1-1.613-1.67l-.711-1.334a1.899 1.899 0 0 0-1.676-1.008z" + stroke-linejoin="miter" /> + <circle cx="12" cy="12.467" r="2.723" /> +</svg> +{{- else if (eq $icon_name "adobestock") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path style="font-variation-settings:normal" d="M2.235 2.235h19.53v19.53H2.235z" /> + <path style="font-variation-settings:normal" + d="M6.165 16.659s3.16 1.2 4.602-.17c1.37-1.3.787-3.163-.754-4.05-1.68-.969-3.284-1.788-3.036-3.536.446-3.138 4.386-1.851 4.386-1.851M15.792 7.794v7.774c0 1.023.635 1.766 2.043 1.624M17.826 10.04h-3.582" /> +</svg> +{{- else if (eq $icon_name "behance") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path paint-order="stroke fill markers" stroke-linejoin="miter" stroke-width="2" + style="font-variation-settings:normal" + d="M1.774 18.063V5.466h5.51c1.978 0 3.116 1.326 3.055 2.806-.043 1.049-.711 2.988-2.643 2.988h-5.93H7.73c1.224 0 3.532 1.13 3.532 3.532 0 2.4-1.873 3.27-3.318 3.27zm12.57-4.459h7.89s.012-4.18-4.167-4.18c-5.237 0-5.277 9.11-.3 9.11 3.06 0 3.935-1.806 3.935-1.806M15.526 5.823h4.987" /> +</svg> +{{- else if (eq $icon_name "bilibili") -}} +<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" xmlns="http://www.w3.org/2000/svg"> + <rect x="1.3333" y="6" width="21.333" height="15.333" rx="4" ry="4"/> + <path d="m8 12.4v1.2"/> + <path d="m16 12.4v1.2"/> + <path d="m5.8853 2.6667 2.6667 2.6667"/> + <path d="m18.115 2.6667-2.6667 2.6667"/> +</svg> +{{- else if (eq $icon_name "buymeacoffee") -}} +<svg viewBox="0 0 884 1279" fill="none" stroke="currentColor" stroke-width="2" xmlns="http://www.w3.org/2000/svg"> + <path d="M791.109 297.518L790.231 297.002L788.201 296.383C789.018 297.072 790.04 297.472 791.109 297.518Z" + fill="currentColor"></path> + <path d="M803.896 388.891L802.916 389.166L803.896 388.891Z" fill="currentColor"></path> + <path + d="M791.484 297.377C791.359 297.361 791.237 297.332 791.118 297.29C791.111 297.371 791.111 297.453 791.118 297.534C791.252 297.516 791.379 297.462 791.484 297.377Z" + fill="currentColor"></path> + <path d="M791.113 297.529H791.244V297.447L791.113 297.529Z" fill="currentColor"></path> + <path + d="M803.111 388.726L804.591 387.883L805.142 387.573L805.641 387.04C804.702 387.444 803.846 388.016 803.111 388.726Z" + fill="currentColor"></path> + <path d="M793.669 299.515L792.223 298.138L791.243 297.605C791.77 298.535 792.641 299.221 793.669 299.515Z" + fill="currentColor"></path> + <path + d="M430.019 1186.18C428.864 1186.68 427.852 1187.46 427.076 1188.45L427.988 1187.87C428.608 1187.3 429.485 1186.63 430.019 1186.18Z" + fill="currentColor"></path> + <path + d="M641.187 1144.63C641.187 1143.33 640.551 1143.57 640.705 1148.21C640.705 1147.84 640.86 1147.46 640.929 1147.1C641.015 1146.27 641.084 1145.46 641.187 1144.63Z" + fill="currentColor"></path> + <path + d="M619.284 1186.18C618.129 1186.68 617.118 1187.46 616.342 1188.45L617.254 1187.87C617.873 1187.3 618.751 1186.63 619.284 1186.18Z" + fill="currentColor"></path> + <path + d="M281.304 1196.06C280.427 1195.3 279.354 1194.8 278.207 1194.61C279.136 1195.06 280.065 1195.51 280.684 1195.85L281.304 1196.06Z" + fill="currentColor"></path> + <path + d="M247.841 1164.01C247.704 1162.66 247.288 1161.35 246.619 1160.16C247.093 1161.39 247.489 1162.66 247.806 1163.94L247.841 1164.01Z" + fill="currentColor"></path> + <path + d="M472.623 590.836C426.682 610.503 374.546 632.802 306.976 632.802C278.71 632.746 250.58 628.868 223.353 621.274L270.086 1101.08C271.74 1121.13 280.876 1139.83 295.679 1153.46C310.482 1167.09 329.87 1174.65 349.992 1174.65C349.992 1174.65 416.254 1178.09 438.365 1178.09C462.161 1178.09 533.516 1174.65 533.516 1174.65C553.636 1174.65 573.019 1167.08 587.819 1153.45C602.619 1139.82 611.752 1121.13 613.406 1101.08L663.459 570.876C641.091 563.237 618.516 558.161 593.068 558.161C549.054 558.144 513.591 573.303 472.623 590.836Z" + fill="currentColor"></path> + <path d="M78.6885 386.132L79.4799 386.872L79.9962 387.182C79.5987 386.787 79.1603 386.435 78.6885 386.132Z" + fill="currentColor"></path> + <path + d="M879.567 341.849L872.53 306.352C866.215 274.503 851.882 244.409 819.19 232.898C808.711 229.215 796.821 227.633 788.786 220.01C780.751 212.388 778.376 200.55 776.518 189.572C773.076 169.423 769.842 149.257 766.314 129.143C763.269 111.85 760.86 92.4243 752.928 76.56C742.604 55.2584 721.182 42.8009 699.88 34.559C688.965 30.4844 677.826 27.0375 666.517 24.2352C613.297 10.1947 557.342 5.03277 502.591 2.09047C436.875 -1.53577 370.983 -0.443234 305.422 5.35968C256.625 9.79894 205.229 15.1674 158.858 32.0469C141.91 38.224 124.445 45.6399 111.558 58.7341C95.7448 74.8221 90.5829 99.7026 102.128 119.765C110.336 134.012 124.239 144.078 138.985 150.737C158.192 159.317 178.251 165.846 198.829 170.215C256.126 182.879 315.471 187.851 374.007 189.968C438.887 192.586 503.87 190.464 568.44 183.618C584.408 181.863 600.347 179.758 616.257 177.304C634.995 174.43 647.022 149.928 641.499 132.859C634.891 112.453 617.134 104.538 597.055 107.618C594.095 108.082 591.153 108.512 588.193 108.942L586.06 109.252C579.257 110.113 572.455 110.915 565.653 111.661C551.601 113.175 537.515 114.414 523.394 115.378C491.768 117.58 460.057 118.595 428.363 118.647C397.219 118.647 366.058 117.769 334.983 115.722C320.805 114.793 306.661 113.611 292.552 112.177C286.134 111.506 279.733 110.801 273.333 110.009L267.241 109.235L265.917 109.046L259.602 108.134C246.697 106.189 233.792 103.953 221.025 101.251C219.737 100.965 218.584 100.249 217.758 99.2193C216.932 98.1901 216.482 96.9099 216.482 95.5903C216.482 94.2706 216.932 92.9904 217.758 91.9612C218.584 90.9319 219.737 90.2152 221.025 89.9293H221.266C232.33 87.5721 243.479 85.5589 254.663 83.8038C258.392 83.2188 262.131 82.6453 265.882 82.0832H265.985C272.988 81.6186 280.026 80.3625 286.994 79.5366C347.624 73.2301 408.614 71.0801 469.538 73.1014C499.115 73.9618 528.676 75.6996 558.116 78.6935C564.448 79.3474 570.746 80.0357 577.043 80.8099C579.452 81.1025 581.878 81.4465 584.305 81.7391L589.191 82.4445C603.438 84.5667 617.61 87.1419 631.708 90.1703C652.597 94.7128 679.422 96.1925 688.713 119.077C691.673 126.338 693.015 134.408 694.649 142.03L696.732 151.752C696.786 151.926 696.826 152.105 696.852 152.285C701.773 175.227 706.7 198.169 711.632 221.111C711.994 222.806 712.002 224.557 711.657 226.255C711.312 227.954 710.621 229.562 709.626 230.982C708.632 232.401 707.355 233.6 705.877 234.504C704.398 235.408 702.75 235.997 701.033 236.236H700.895L697.884 236.649L694.908 237.044C685.478 238.272 676.038 239.419 666.586 240.486C647.968 242.608 629.322 244.443 610.648 245.992C573.539 249.077 536.356 251.102 499.098 252.066C480.114 252.57 461.135 252.806 442.162 252.771C366.643 252.712 291.189 248.322 216.173 239.625C208.051 238.662 199.93 237.629 191.808 236.58C198.106 237.389 187.231 235.96 185.029 235.651C179.867 234.928 174.705 234.177 169.543 233.397C152.216 230.798 134.993 227.598 117.7 224.793C96.7944 221.352 76.8005 223.073 57.8906 233.397C42.3685 241.891 29.8055 254.916 21.8776 270.735C13.7217 287.597 11.2956 305.956 7.64786 324.075C4.00009 342.193 -1.67805 361.688 0.472751 380.288C5.10128 420.431 33.165 453.054 73.5313 460.35C111.506 467.232 149.687 472.807 187.971 477.556C338.361 495.975 490.294 498.178 641.155 484.129C653.44 482.982 665.708 481.732 677.959 480.378C681.786 479.958 685.658 480.398 689.292 481.668C692.926 482.938 696.23 485.005 698.962 487.717C701.694 490.429 703.784 493.718 705.08 497.342C706.377 500.967 706.846 504.836 706.453 508.665L702.633 545.797C694.936 620.828 687.239 695.854 679.542 770.874C671.513 849.657 663.431 928.434 655.298 1007.2C653.004 1029.39 650.71 1051.57 648.416 1073.74C646.213 1095.58 645.904 1118.1 641.757 1139.68C635.218 1173.61 612.248 1194.45 578.73 1202.07C548.022 1209.06 516.652 1212.73 485.161 1213.01C450.249 1213.2 415.355 1211.65 380.443 1211.84C343.173 1212.05 297.525 1208.61 268.756 1180.87C243.479 1156.51 239.986 1118.36 236.545 1085.37C231.957 1041.7 227.409 998.039 222.9 954.381L197.607 711.615L181.244 554.538C180.968 551.94 180.693 549.376 180.435 546.76C178.473 528.023 165.207 509.681 144.301 510.627C126.407 511.418 106.069 526.629 108.168 546.76L120.298 663.214L145.385 904.104C152.532 972.528 159.661 1040.96 166.773 1109.41C168.15 1122.52 169.44 1135.67 170.885 1148.78C178.749 1220.43 233.465 1259.04 301.224 1269.91C340.799 1276.28 381.337 1277.59 421.497 1278.24C472.979 1279.07 524.977 1281.05 575.615 1271.72C650.653 1257.95 706.952 1207.85 714.987 1130.13C717.282 1107.69 719.576 1085.25 721.87 1062.8C729.498 988.559 737.115 914.313 744.72 840.061L769.601 597.451L781.009 486.263C781.577 480.749 783.905 475.565 787.649 471.478C791.392 467.391 796.352 464.617 801.794 463.567C823.25 459.386 843.761 452.245 859.023 435.916C883.318 409.918 888.153 376.021 879.567 341.849ZM72.4301 365.835C72.757 365.68 72.1548 368.484 71.8967 369.792C71.8451 367.813 71.9483 366.058 72.4301 365.835ZM74.5121 381.94C74.6842 381.819 75.2003 382.508 75.7337 383.334C74.925 382.576 74.4089 382.009 74.4949 381.94H74.5121ZM76.5597 384.641C77.2996 385.897 77.6953 386.689 76.5597 384.641V384.641ZM80.672 387.979H80.7752C80.7752 388.1 80.9645 388.22 81.0333 388.341C80.9192 388.208 80.7925 388.087 80.6548 387.979H80.672ZM800.796 382.989C793.088 390.319 781.473 393.726 769.996 395.43C641.292 414.529 510.713 424.199 380.597 419.932C287.476 416.749 195.336 406.407 103.144 393.382C94.1102 392.109 84.3197 390.457 78.1082 383.798C66.4078 371.237 72.1548 345.944 75.2003 330.768C77.9878 316.865 83.3218 298.334 99.8572 296.355C125.667 293.327 155.64 304.218 181.175 308.09C211.917 312.781 242.774 316.538 273.745 319.36C405.925 331.405 540.325 329.529 671.92 311.91C695.906 308.686 719.805 304.941 743.619 300.674C764.835 296.871 788.356 289.731 801.175 311.703C809.967 326.673 811.137 346.701 809.778 363.615C809.359 370.984 806.139 377.915 800.779 382.989H800.796Z" + fill="currentColor"></path> +</svg> +{{- else if (eq $icon_name "codepen") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <polygon points="12 2 22 8.5 22 15.5 12 22 2 15.5 2 8.5 12 2"></polygon> + <line x1="12" y1="22" x2="12" y2="15.5"></line> + <polyline points="22 8.5 12 15.5 2 8.5"></polyline> + <polyline points="2 15.5 12 8.5 22 15.5"></polyline> + <line x1="12" y1="2" x2="12" y2="8.5"></line> +</svg> +{{- else if (eq $icon_name "cryptohack") -}} +<svg version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 57 57" preserveAspectRatio="xMidYMid meet"> + <g transform="translate(0.000000,57.000000) scale(0.100000,-0.100000)" fill="currentColor" stroke-width="12" + stroke="currentColor"> + <path + d="M180 495 c-7 -8 -22 -15 -35 -15 -23 0 -55 -28 -55 -48 0 -6 -12 -23 -26 -37 -18 -18 -24 -33 -21 -48 3 -12 -1 -31 -9 -41 -18 -26 -18 -70 1 -86 8 -7 15 -21 15 -31 0 -36 23 -68 59 -83 21 -8 43 -21 50 -30 19 -23 74 -20 97 5 17 19 19 41 22 204 3 174 2 185 -17 204 -25 25 -63 27 -81 6z m54 -11 c14 -5 16 -32 16 -193 0 -196 -3 -211 -45 -211 -39 0 -47 20 -20 52 14 16 25 40 25 52 0 34 -37 76 -66 76 -31 0 -31 -18 0 -26 30 -7 50 -48 36 -73 -28 -54 -118 -28 -103 29 3 10 -4 27 -16 39 -26 26 -27 46 -2 68 14 12 18 24 14 48 -7 41 12 53 40 27 12 -11 32 -23 44 -26 12 -4 31 -18 42 -32 33 -41 55 -29 25 14 -15 21 -15 25 1 42 22 25 0 38 -25 15 -26 -24 -68 -12 -81 21 -12 32 3 54 36 54 12 0 28 7 35 15 14 17 21 18 44 9z" /> + <path + d="M309 489 c-19 -19 -20 -30 -17 -204 3 -163 5 -185 22 -204 23 -25 78 -28 97 -5 7 9 29 22 50 30 36 15 59 47 59 83 0 10 7 24 15 31 19 16 19 60 1 86 -8 10 -12 29 -9 41 3 15 -3 30 -19 46 -12 13 -30 37 -38 53 -10 19 -25 30 -42 32 -15 2 -32 10 -38 18 -18 20 -57 17 -81 -7z m71 -14 c7 -8 23 -15 35 -15 34 0 48 -22 34 -54 -10 -20 -19 -26 -46 -26 -34 0 -44 -13 -17 -24 28 -11 47 -7 70 15 30 28 48 16 41 -28 -4 -24 -2 -36 8 -39 20 -8 28 -40 15 -64 -11 -20 -63 -28 -86 -12 -17 11 -36 51 -29 62 3 5 1 11 -5 15 -16 10 -24 -25 -12 -57 9 -24 8 -30 -8 -38 -21 -11 -33 -37 -24 -52 4 -6 16 2 28 17 20 25 26 27 64 20 23 -4 44 -10 47 -14 9 -15 -26 -51 -49 -51 -14 0 -30 -10 -40 -25 -18 -27 -54 -33 -74 -13 -17 17 -17 384 1 391 22 9 34 7 47 -8z" /> + </g> +</svg> +{{- else if (eq $icon_name "ctftime") -}} +<svg version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 220.000000 200.000000" + preserveAspectRatio="xMidYMid meet"> + <g transform="translate(0.000000,200.000000) scale(0.100000,-0.100000)" fill="currentColor" stroke="none"> + <path d="M365 1499 c201 -275 365 -503 365 -507 0 -4 -84 -120 -188 -259 -103 + -139 -263 -355 -356 -480 -93 -125 -173 -229 -178 -231 -45 -19 101 -22 992 + -22 l1000 0 0 1000 0 1000 -1000 0 -999 0 364 -501z m1310 -509 l0 -305 -312 + -3 -313 -2 0 310 0 310 313 -2 312 -3 0 -305z" /> + <path d="M1150 1194 c0 -2 -1 -95 -1 -206 l0 -203 216 -3 215 -2 0 210 0 210 + -157 0 -158 0 98 -98 c53 -53 97 -101 97 -106 0 -4 -42 -48 -92 -97 l-93 -88 + -28 26 -27 27 65 66 65 66 -100 101 c-55 55 -100 99 -100 97z" /> + </g> +</svg> +{{- else if (eq $icon_name "cv") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path + d="M4 4v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.342a2 2 0 0 0-.602-1.43l-4.44-4.342A2 2 0 0 0 13.56 2H6a2 2 0 0 0-2 2z" /> + <path d="M9 13h6" /> + <path d="M9 17h3" /> + <path d="M14 2v4a2 2 0 0 0 2 2h4" /> +</svg> +{{- else if (eq $icon_name "dev") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none"> + <path + d="M7.42 10.05c-.18-.16-.46-.23-.84-.23H6l.02 2.44.04 2.45.56-.02c.41 0 .63-.07.83-.26.24-.24.26-.36.26-2.2 0-1.91-.02-1.96-.29-2.18zM0 4.94v14.12h24V4.94H0zM8.56 15.3c-.44.58-1.06.77-2.53.77H4.71V8.53h1.4c1.67 0 2.16.18 2.6.9.27.43.29.6.32 2.57.05 2.23-.02 2.73-.47 3.3zm5.09-5.47h-2.47v1.77h1.52v1.28l-.72.04-.75.03v1.77l1.22.03 1.2.04v1.28h-1.6c-1.53 0-1.6-.01-1.87-.3l-.3-.28v-3.16c0-3.02.01-3.18.25-3.48.23-.31.25-.31 1.88-.31h1.64v1.3zm4.68 5.45c-.17.43-.64.79-1 .79-.18 0-.45-.15-.67-.39-.32-.32-.45-.63-.82-2.08l-.9-3.39-.45-1.67h.76c.4 0 .75.02.75.05 0 .06 1.16 4.54 1.26 4.83.04.15.32-.7.73-2.3l.66-2.52.74-.04c.4-.02.73 0 .73.04 0 .14-1.67 6.38-1.8 6.68z" /> +</svg> +{{- else if (eq $icon_name "deezer") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 20" fill="currentColor" stroke="none"> + <path + d="M18.81 4.16v3.03H24V4.16h-5.19zM6.27 8.38v3.027h5.189V8.38h-5.19zm12.54 0v3.027H24V8.38h-5.19zM6.27 12.594v3.027h5.189v-3.027h-5.19zm6.271 0v3.027h5.19v-3.027h-5.19zm6.27 0v3.027H24v-3.027h-5.19zM0 16.81v3.029h5.19v-3.03H0zm6.27 0v3.029h5.189v-3.03h-5.19zm6.271 0v3.029h5.19v-3.03h-5.19zm6.27 0v3.029H24v-3.03h-5.19Z" /> +</svg> +{{- else if (eq $icon_name "discogs") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none"> + <path + d="M1.7422 11.982c0-5.6682 4.61-10.2782 10.2758-10.2782 1.8238 0 3.5372.48 5.0251 1.3175l.8135-1.4879C16.1768.588 14.2474.036 12.1908.0024h-.1944C5.4091.0144.072 5.3107 0 11.886v.1152c.0072 3.4389 1.4567 6.5345 3.7748 8.7207l1.1855-1.2814c-1.9798-1.8743-3.218-4.526-3.218-7.4585zM20.362 3.4053l-1.1543 1.2406c1.903 1.867 3.0885 4.4636 3.0885 7.3361 0 5.6658-4.61 10.2758-10.2758 10.2758-1.783 0-3.4605-.456-4.922-1.2575l-.8542 1.5214c1.7086.9384 3.6692 1.4735 5.7546 1.4759C18.6245 23.9976 24 18.6246 24 11.9988c-.0048-3.3717-1.399-6.4146-3.638-8.5935zM1.963 11.982c0 2.8701 1.2119 5.4619 3.146 7.2953l1.1808-1.2767c-1.591-1.5166-2.587-3.6524-2.587-6.0186 0-4.586 3.7293-8.3152 8.3152-8.3152 1.483 0 2.875.3912 4.082 1.0751l.8351-1.5262C15.481 2.395 13.8034 1.927 12.018 1.927 6.4746 1.9246 1.963 6.4362 1.963 11.982zm18.3702 0c0 4.586-3.7293 8.3152-8.3152 8.3152-1.4327 0-2.7837-.3648-3.962-1.0055l-.852 1.5166c1.4303.7823 3.0718 1.2287 4.814 1.2287 5.5434 0 10.055-4.5116 10.055-10.055 0-2.8077-1.1567-5.3467-3.0165-7.1729l-1.183 1.2743c1.519 1.507 2.4597 3.5924 2.4597 5.8986zm-1.9486 0c0 3.5109-2.8558 6.3642-6.3642 6.3642a6.3286 6.3286 0 01-3.0069-.756l-.8471 1.507c1.147.624 2.4597.9768 3.854.9768 4.4636 0 8.0944-3.6308 8.0944-8.0944 0-2.239-.9143-4.2692-2.3902-5.7378l-1.1783 1.267c1.1351 1.152 1.8383 2.731 1.8383 4.4732zm-14.4586 0c0 2.3014.9671 4.382 2.515 5.8578l1.1734-1.2695c-1.207-1.159-1.9606-2.786-1.9606-4.5883 0-3.5108 2.8557-6.3642 6.3642-6.3642 1.1423 0 2.215.3048 3.1437.8352l.8303-1.5167c-1.1759-.6647-2.5317-1.0487-3.974-1.0487-4.4612 0-8.092 3.6308-8.092 8.0944zm12.5292 0c0 2.4502-1.987 4.4372-4.4372 4.4372a4.4192 4.4192 0 01-2.0614-.5088l-.8351 1.4879a6.1135 6.1135 0 002.8965.727c3.3885 0 6.1434-2.7548 6.1434-6.1433 0-1.6774-.6767-3.1989-1.7686-4.3076l-1.1615 1.2503c.7559.7967 1.2239 1.8718 1.2239 3.0573zm-10.5806 0c0 1.7374.7247 3.3069 1.8886 4.4252L8.92 15.1569l.0144.0144c-.8351-.8063-1.3559-1.9366-1.3559-3.1869 0-2.4502 1.9846-4.4372 4.4372-4.4372.8087 0 1.5646.2184 2.2174.5976l.8207-1.4975a6.097 6.097 0 00-3.0381-.8063c-3.3837-.0048-6.141 2.7525-6.141 6.141zm6.681 0c0 .2952-.2424.5351-.5376.5351-.2952 0-.5375-.24-.5375-.5351 0-.2976.24-.5375.5375-.5375.2952 0 .5375.24.5375.5375zm-3.9405 0c0-1.879 1.5239-3.4029 3.4005-3.4029 1.879 0 3.4005 1.5215 3.4005 3.4029 0 1.879-1.5239 3.4005-3.4005 3.4005S8.6151 13.861 8.6151 11.982zm.1488 0c.0048 1.7974 1.4567 3.2493 3.2517 3.2517 1.795 0 3.254-1.4567 3.254-3.2517-.0023-1.7974-1.4566-3.2517-3.254-3.254-1.795 0-3.2517 1.4566-3.2517 3.254Z" /> +</svg> +{{- else if (eq $icon_name "discord") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="20 15 205 190" fill="currentColor" stroke="none"> + <path + d="M104.4 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1.1-6.1-4.5-11.1-10.2-11.1zM140.9 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1s-4.5-11.1-10.2-11.1z" /> + <path + d="M189.5 20h-134C44.2 20 35 29.2 35 40.6v135.2c0 11.4 9.2 20.6 20.5 20.6h113.4l-5.3-18.5 12.8 11.9 12.1 11.2 21.5 19V40.6c0-11.4-9.2-20.6-20.5-20.6zm-38.6 130.6s-3.6-4.3-6.6-8.1c13.1-3.7 18.1-11.9 18.1-11.9-4.1 2.7-8 4.6-11.5 5.9-5 2.1-9.8 3.5-14.5 4.3-9.6 1.8-18.4 1.3-25.9-.1-5.7-1.1-10.6-2.7-14.7-4.3-2.3-.9-4.8-2-7.3-3.4-.3-.2-.6-.3-.9-.5-.2-.1-.3-.2-.4-.3-1.8-1-2.8-1.7-2.8-1.7s4.8 8 17.5 11.8c-3 3.8-6.7 8.3-6.7 8.3-22.1-.7-30.5-15.2-30.5-15.2 0-32.2 14.4-58.3 14.4-58.3 14.4-10.8 28.1-10.5 28.1-10.5l1 1.2c-18 5.2-26.3 13.1-26.3 13.1s2.2-1.2 5.9-2.9c10.7-4.7 19.2-6 22.7-6.3.6-.1 1.1-.2 1.7-.2 6.1-.8 13-1 20.2-.2 9.5 1.1 19.7 3.9 30.1 9.6 0 0-7.9-7.5-24.9-12.7l1.4-1.6s13.7-.3 28.1 10.5c0 0 14.4 26.1 14.4 58.3 0 0-8.5 14.5-30.6 15.2z" /> +</svg> +{{- else if (eq $icon_name "dreamstime") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path + d="M19.834 20.994s4.824-4.08 2.044-12.03C19.252 1.456 6.822-1.223 2.508 7.566c-3.936 8.023 2.18 14.46 7.88 14.374 4.889-.075 8.475-3.226 7.813-8.604-.76-6.18-6.73-6.816-9.275-4.184-2.256 2.334-1.816 7.034.873 7.823 2.241.844 4.661-1.265 3.161-3.215" + style="font-variation-settings:normal" stroke="currentColor" stroke-linejoin="bevel" + paint-order="stroke fill markers" /> +</svg> +{{- else if (eq $icon_name "dribbble") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <circle style="font-variation-settings:normal" cx="12.004" cy="12" r="9.39" paint-order="stroke fill markers" /> + <path style="font-variation-settings:normal" + d="M5.858 19.136s2.343-5.79 8.161-6.422c5.818-.633 7.442.479 7.442.479M2.68 10.839s4.91.752 10.112-1.11c5.202-1.863 5.887-4.601 5.887-4.601" /> + <path style="font-variation-settings:normal" + d="M8.533 3.208s2.888 2.73 5.339 9.235c2.451 6.505 2.344 8.4 2.344 8.4" /> +</svg> +{{- else if (eq $icon_name "email") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 21" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path> + <polyline points="22,6 12,13 2,6"></polyline> +</svg> +{{- else if (eq $icon_name "facebook") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path> +</svg> +{{- else if (eq $icon_name "flickr") -}} +<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"> + <path + d="M5.334 6.666C2.3884 6.666 0 9.055 0 12c0 2.9456 2.3884 5.334 5.334 5.334 2.9456 0 5.332-2.3884 5.332-5.334 0-2.945-2.3864-5.334-5.332-5.334zm13.332 0c-2.9456 0-5.332 2.389-5.332 5.334 0 2.9456 2.3864 5.334 5.332 5.334C21.6116 17.334 24 14.9456 24 12c0-2.945-2.3884-5.334-5.334-5.334Z" /> +</svg> +{{- else if (eq $icon_name "freepik") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path + d="M5.737 17.28s3.423.84 7.61.162c4.188-.676 6.862-2.57 6.862-2.57s.28 3.943-4.967 5.33c-5.248 1.388-8.543.657-9.506-2.923zm-.62-3.104s4.491 1.361 8.728.344c4.237-1.016 5.94-2.568 5.94-2.568s-1.81-6.448-7.405-5.648c-5.597.8-8.061 4.414-7.263 7.872z" + style="font-variation-settings:normal" stroke-linejoin="round" /> + <path + d="M1.265 12.607c.159-1.98.561-3.898 2.08-5.701m5.148-3.29c2.006-.66 3.968-1.157 6.446-.844m5.202 2.98c1.192 1.275 1.963 2.163 2.594 3.815" + style="font-variation-settings:normal" stroke="currentColor" stroke-linejoin="round" /> + <circle r=".989" cy="10.404" cx="14.746" fill="currentColor" stroke="none" /> + <circle cx="9.637" cy="11.305" r="1.477" fill="currentColor" stroke="none" /> +</svg> +{{- else if (eq $icon_name "gitea") -}} +<svg role="img" viewBox="0 0 24 20" xmlns="http://www.w3.org/2000/svg" fill="currentColor"> + <path + d="M4.209 4.603c-.247 0-.525.02-.84.088-.333.07-1.28.283-2.054 1.027C-.403 7.25.035 9.685.089 10.052c.065.446.263 1.687 1.21 2.768 1.749 2.141 5.513 2.092 5.513 2.092s.462 1.103 1.168 2.119c.955 1.263 1.936 2.248 2.89 2.367 2.406 0 7.212-.004 7.212-.004s.458.004 1.08-.394c.535-.324 1.013-.893 1.013-.893s.492-.527 1.18-1.73c.21-.37.385-.729.538-1.068 0 0 2.107-4.471 2.107-8.823-.042-1.318-.367-1.55-.443-1.627-.156-.156-.366-.153-.366-.153s-4.475.252-6.792.306c-.508.011-1.012.023-1.512.027v4.474l-.634-.301c0-1.39-.004-4.17-.004-4.17-1.107.016-3.405-.084-3.405-.084s-5.399-.27-5.987-.324c-.187-.011-.401-.032-.648-.032zm.354 1.832h.111s.271 2.269.6 3.597C5.549 11.147 6.22 13 6.22 13s-.996-.119-1.641-.348c-.99-.324-1.409-.714-1.409-.714s-.73-.511-1.096-1.52C1.444 8.73 2.021 7.7 2.021 7.7s.32-.859 1.47-1.145c.395-.106.863-.12 1.072-.12zm8.33 2.554c.26.003.509.127.509.127l.868.422-.529 1.075a.686.686 0 0 0-.614.359.685.685 0 0 0 .072.756l-.939 1.924a.69.69 0 0 0-.66.527.687.687 0 0 0 .347.763.686.686 0 0 0 .867-.206.688.688 0 0 0-.069-.882l.916-1.874a.667.667 0 0 0 .237-.02.657.657 0 0 0 .271-.137 8.826 8.826 0 0 1 1.016.512.761.761 0 0 1 .286.282c.073.21-.073.569-.073.569-.087.29-.702 1.55-.702 1.55a.692.692 0 0 0-.676.477.681.681 0 1 0 1.157-.252c.073-.141.141-.282.214-.431.19-.397.515-1.16.515-1.16.035-.066.218-.394.103-.814-.095-.435-.48-.638-.48-.638-.467-.301-1.116-.58-1.116-.58s0-.156-.042-.27a.688.688 0 0 0-.148-.241l.516-1.062 2.89 1.401s.48.218.583.619c.073.282-.019.534-.069.657-.24.587-2.1 4.317-2.1 4.317s-.232.554-.748.588a1.065 1.065 0 0 1-.393-.045l-.202-.08-4.31-2.1s-.417-.218-.49-.596c-.083-.31.104-.691.104-.691l2.073-4.272s.183-.37.466-.497a.855.855 0 0 1 .35-.077z" /> +</svg> +{{- else if (eq $icon_name "github") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path + d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"> + </path> +</svg> +{{- else if (eq $icon_name "gitlab") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path + d="M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z"> + </path> +</svg> +{{- else if (eq $icon_name "goodreads") -}} +<svg xmlns="http://www.w3.org/2000/svg" role="img" fill="currentColor" viewBox="0 0 24 24"> + <path + d="M11.43 23.995c-3.608-.208-6.274-2.077-6.448-5.078.695.007 1.375-.013 2.07-.006.224 1.342 1.065 2.43 2.683 3.026 1.583.496 3.737.46 5.082-.174 1.351-.636 2.145-1.822 2.503-3.577.212-1.042.236-1.734.231-2.92l-.005-1.631h-.059c-1.245 2.564-3.315 3.53-5.59 3.475-5.74-.054-7.68-4.534-7.528-8.606.01-5.241 3.22-8.537 7.557-8.495 2.354-.14 4.605 1.362 5.554 3.37l.059.002.002-2.918 2.099.004-.002 15.717c-.193 7.04-4.376 7.89-8.209 7.811zm6.1-15.633c-.096-3.26-1.601-6.62-5.503-6.645-3.954-.017-5.625 3.592-5.604 6.85-.013 3.439 1.643 6.305 4.703 6.762 4.532.591 6.551-3.411 6.404-6.967z" /> +</svg> +{{- else if (eq $icon_name "googlescholar") -}} +<svg role="img" viewBox="0 0 24 25" xmlns="http://www.w3.org/2000/svg" fill="currentColor" stroke="none" + stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> + <path + d="M5.242 13.769L0 9.5 12 0l12 9.5-5.242 4.269C17.548 11.249 14.978 9.5 12 9.5c-2.977 0-5.548 1.748-6.758 4.269zM12 10a7 7 0 1 0 0 14 7 7 0 0 0 0-14z" /> +</svg> +{{- else if (eq $icon_name "hackerone") -}} +<svg role="img" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> + <path + d="M7.207 0c-.4836 0-.8774.1018-1.1823.3002-.3044.2003-.4592.4627-.4592.7798v21.809c0 .2766.1581.5277.4752.7609.315.2335.7031.3501 1.1664.3501.4427 0 .8306-.1166 1.1678-.3501.3352-.231.5058-.4843.5058-.761V1.0815c0-.319-.1623-.5769-.4893-.7813C8.0644.1018 7.6702 0 7.207 0zm9.5234 8.662c-.4836 0-.8717.0981-1.1683.3007l-4.439 2.7822c-.1988.1861-.2841.4687-.2473.855.0342.3826.2108.747.5238 1.0907.3145.346.6662.5626 1.0684.6547.3963.0899.6973.041.8962-.143l1.7551-1.0951v9.7817c0 .2767.1522.5278.4607.761.3007.2335.6873.3501 1.1504.3501.463 0 .863-.1166 1.1983-.3501.3371-.2332.5058-.4843.5058-.761V9.7381c0-.3193-.165-.577-.4898-.7754-.3252-.2026-.7288-.3007-1.2143-.3007z" /> +</svg> +{{- else if (eq $icon_name "hackerrank") -}} +<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" + preserveAspectRatio="xMidYMid meet" viewBox="0 0 50 35" fill="currentColor" stroke-width="0" stroke="currentColor"> + <g> + <path + d="M0 32.95L3.86 32.95L7.73 32.95L7.73 27.23L7.73 21.52L11.59 21.52L15.45 21.52L15.45 27.23L15.45 32.95L19.31 32.95L23.18 32.95L23.18 17.5L23.18 2.05L19.31 2.05L15.45 2.05L15.45 7.77L15.45 13.48L11.59 13.48L7.73 13.48L7.73 7.77L7.73 2.05L3.86 2.05L0 2.05L0 17.5L0 32.95Z" + id="i2pS2ila1d"></path> + <path + d="M27.19 32.95L38.63 32.95L50.06 32.95L50.06 17.5L50.06 2.05L38.63 2.05L27.19 2.05L27.19 17.5L27.19 32.95Z" + id="dgDKP06E5"></path> + </g> +</svg> +{{- else if (eq $icon_name "hackthebox") -}} +<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" + preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24" fill="currentColor" stroke="none"> + <g> + <path + d="M11.9959.0008a1.1187 1.1187 0 00-.057.002.8993.8993 0 00-.2358.0498.9067.9067 0 00-.1652.079L1.9357 5.675a.889.889 0 00-.4444.7699c0 .006.0004.0128.0006.0192-.0002.007 0 .014 0 .0212V17.556a.889.889 0 00.469.7837l9.5983 5.5416c.018.0102.036.0197.054.0287v.002a.8568.8568 0 00.083.0348c0 .001.01.003.012.004.028.01.056.0177.085.0245.01.001.011.003.016.004.028.006.057.0112.086.0146 0 .0005.01.0009.014.001.03.003.061.005.091.005s.061-.002.091-.005c0-.0005.01-.0009.014-.001a.6831.6831 0 00.086-.0146c.01-.001.011-.002.016-.004a.9404.9404 0 00.085-.0245c0-.001.01-.003.012-.004a.8818.8818 0 00.083-.0347v-.002a1.086 1.086 0 00.054-.0287l9.5986-5.5416a.889.889 0 00.4689-.7837V6.4786c0-.009-.0006-.0172-.0008-.0258h.0003v-.008a.8886.8886 0 00-.3117-.6755c-.01-.008-.019-.0162-.029-.0241 0-.002-.01-.005-.01-.007a.8988.8988 0 00-.1074-.0705L12.4533.1267a.8872.8872 0 00-.4646-.1266zm.01 2.2523c.072 0 .1443.0187.209.056l6.5366 3.774c.2789.161.2789.5633 0 .7243l-6.5367 3.774a.4182.4182 0 01-.4182 0L5.26 6.8074c-.2788-.1609-.2789-.5633 0-.7243l6.5368-3.774a.4193.4193 0 01.209-.056zm-8.0801 6.458a.4145.4145 0 01.215.0565l6.524 3.7666a.417.417 0 01.2086.3612v7.5326c0 .3212-.3477.522-.626.3613l-6.5237-3.7666a.4172.4172 0 01-.2086-.3613V9.1288c0-.2408.1955-.414.4107-.4177zm16.1599 0c.215.004.4107.1768.4107.4177v7.5325c0 .149-.08.2868-.2087.3614l-6.5239 3.7666c-.278.1606-.6258-.0401-.6258-.3614v-7.5325c0-.149.08-.2867.2086-.3613l6.5238-3.7666a.415.415 0 01.2152-.0565z"> + </path> + </g> +</svg> +{{- else if (eq $icon_name "instagram") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect> + <path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path> + <line x1="17.5" y1="6.5" x2="17.5" y2="6.5"></line> +</svg> +{{- else if (eq $icon_name "itchio") -}} +<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 245.371 220.736"> + <path + d="M31.99 1.365C21.287 7.72.2 31.945 0 38.298v10.516C0 62.144 12.46 73.86 23.773 73.86c13.584 0 24.902-11.258 24.903-24.62 0 13.362 10.93 24.62 24.515 24.62 13.586 0 24.165-11.258 24.165-24.62 0 13.362 11.622 24.62 25.207 24.62h.246c13.586 0 25.208-11.258 25.208-24.62 0 13.362 10.58 24.62 24.164 24.62 13.585 0 24.515-11.258 24.515-24.62 0 13.362 11.32 24.62 24.903 24.62 11.313 0 23.773-11.714 23.773-25.046V38.298c-.2-6.354-21.287-30.58-31.988-36.933C180.118.197 157.056-.005 122.685 0c-34.37.003-81.228.54-90.697 1.365zm65.194 66.217a28.025 28.025 0 0 1-4.78 6.155c-5.128 5.014-12.157 8.122-19.906 8.122a28.482 28.482 0 0 1-19.948-8.126c-1.858-1.82-3.27-3.766-4.563-6.032l-.006.004c-1.292 2.27-3.092 4.215-4.954 6.037a28.5 28.5 0 0 1-19.948 8.12c-.934 0-1.906-.258-2.692-.528-1.092 11.372-1.553 22.24-1.716 30.164l-.002.045c-.02 4.024-.04 7.333-.06 11.93.21 23.86-2.363 77.334 10.52 90.473 19.964 4.655 56.7 6.775 93.555 6.788h.006c36.854-.013 73.59-2.133 93.554-6.788 12.883-13.14 10.31-66.614 10.52-90.474-.022-4.596-.04-7.905-.06-11.93l-.003-.045c-.162-7.926-.623-18.793-1.715-30.165-.786.27-1.757.528-2.692.528a28.5 28.5 0 0 1-19.948-8.12c-1.862-1.822-3.662-3.766-4.955-6.037l-.006-.004c-1.294 2.266-2.705 4.213-4.563 6.032a28.48 28.48 0 0 1-19.947 8.125c-7.748 0-14.778-3.11-19.906-8.123a28.025 28.025 0 0 1-4.78-6.155 27.99 27.99 0 0 1-4.736 6.155 28.49 28.49 0 0 1-19.95 8.124c-.27 0-.54-.012-.81-.02h-.007c-.27.008-.54.02-.813.02a28.49 28.49 0 0 1-19.95-8.123 27.992 27.992 0 0 1-4.736-6.155zm-20.486 26.49l-.002.01h.015c8.113.017 15.32 0 24.25 9.746 7.028-.737 14.372-1.105 21.722-1.094h.006c7.35-.01 14.694.357 21.723 1.094 8.93-9.747 16.137-9.73 24.25-9.746h.014l-.002-.01c3.833 0 19.166 0 29.85 30.007L210 165.244c8.504 30.624-2.723 31.373-16.727 31.4-20.768-.773-32.267-15.855-32.267-30.935-11.496 1.884-24.907 2.826-38.318 2.827h-.006c-13.412 0-26.823-.943-38.318-2.827 0 15.08-11.5 30.162-32.267 30.935-14.004-.027-25.23-.775-16.726-31.4L46.85 124.08C57.534 94.073 72.867 94.073 76.7 94.073zm45.985 23.582v.006c-.02.02-21.863 20.08-25.79 27.215l14.304-.573v12.474c0 .584 5.74.346 11.486.08h.006c5.744.266 11.485.504 11.485-.08v-12.474l14.304.573c-3.928-7.135-25.79-27.215-25.79-27.215v-.006l-.003.002z" /> +</svg> +{{- else if (eq $icon_name "kaggle") -}} +<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" stroke="none" viewBox="0 0 32 32"> + <path transform="matrix(.527027 0 0 .527027 -30.632288 -22.45559)" clip-path="url(#A)" d="M105.75 102.968c-.06.238-.298.357-.713.357H97.1c-.477 0-.89-.208-1.248-.625L82.746 86.028l-3.655 3.477v12.93c0 .595-.298.892-.892.892h-6.152c-.595 0-.892-.297-.892-.892V43.5c0-.593.297-.89.892-.89H78.2c.594 0 .892.298.892.89v36.288l15.692-15.87c.416-.415.832-.624 1.248-.624h8.204c.356 0 .593.15.713.445.12.357.09.624-.09.803L88.274 80.588l17.297 21.488c.237.238.297.535.18.892"/> +</svg> +{{- else if (eq $icon_name "kakaotalk") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path + d="m12 0c-6.667 0-10.686 4.11-11.709 8.183-1.062 4.224.793 8.271 4.855 10.689-.903 3.276-1.45 4.376-.587 4.965.968.662 2.362-.707 4.691-2.494l.957-.733c3.749.486 7.568-.593 10.272-2.913 2.27-1.948 3.52-4.553 3.52-7.334.001-5.715-5.382-10.363-11.999-10.363zm7.504 16.558c-2.454 2.106-5.965 3.049-9.388 2.524-.479-.077-2.592 1.773-4.312 2.971.194-.735.574-1.972.943-3.353.09-.336-.063-.69-.37-.854-4.527-2.431-5.362-6.396-4.633-9.297.884-3.508 4.397-7.049 10.256-7.049 5.79 0 10.5 3.976 10.5 8.862 0 2.338-1.064 4.538-2.996 6.196z" /> + <path d="m6.5 7.75h-3c-.992 0-.993 1.5 0 1.5h.75v4.25c0 .992 1.5.993 1.5 0v-4.25h.75c.992 0 .993-1.5 0-1.5z" /> + <path + d="m10.196 8.222c-.001-.003-.004-.004-.005-.007-.246-.595-1.126-.623-1.383 0-.001.002-.003.004-.004.007l-2 5c-.154.384.033.821.418.975.958.386 1.129-.971 1.386-1.446h1.785l.411 1.028c.367.92 1.764.367 1.393-.557zm-.988 3.028.292-.731.292.731z" /> + <path d="m15.5 12.75h-1.25v-4.25c0-.992-1.5-.993-1.5 0v5c0 .414.336.75.75.75h2c.992 0 .993-1.5 0-1.5z" /> + <path + d="m18.25 9.689v-1.189c0-.992-1.5-.993-1.5 0v5c0 .992 1.5.993 1.5 0v-1.469c1.605 1.746 1.657 2.219 2.25 2.219.63 0 .991-.747.569-1.239l-1.857-2.163 1.823-1.823c.002-.003.005-.005.007-.008.001-.001.002-.002.003-.003.681-.706-.373-1.747-1.07-1.05z" /> +</svg> +{{- else if (eq $icon_name "keybase") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 71 76.3" version="1.1" fill="currentColor" stroke="none"> + <path + d="M6.68 73.99c-.6-1.3-1.4-3.1-1.8-4l-.6-1.7-2 2.2-2 2.2-.2-4.2c-.3-6 .2-12.2 1.2-16.6 2.3-9.8 9.5-18.7 18.8-23.4l2.1-1-.5-1.5c-.3-.8-.6-2.5-.7-3.6l-.2-2.1-2.1-.2c-3.2-.3-4.9-1.2-6-3.5-.6-1.2-.6-1.4-.4-4.6.2-4.2.5-5.1 1.8-6.5 1.6-1.8 2.7-2.1 6.7-1.9 2.9.2 3.5.3 4.8.9.8.4 1.5.8 1.6.8.1 0 1-1.1 2.1-2.6l1.9-2.7 1.2.7c.7.4 1.5.9 1.9 1.1l.7.4-.6 1.5c-.3.8-.7 2.2-.8 2.9l-.2 1.4 1.7.2c6.1.6 10.7 4.3 12.4 9.9.5 1.8.5 5.3 0 7-.5 1.6-.5 1.7-.1 1.7.7 0 5.4 2.3 7.3 3.5 3.7 2.4 8 6.6 10.4 10.2 4.5 6.7 6.4 14 5.6 22-.4 4.8-1.3 8.6-2.9 12.3l-.6 1.4h-5l1.2-2.4c1.3-2.6 2.3-6.2 2.8-9.4.3-2.2.4-8.2.1-9.3l-.2-.7-1.3 1.4c-3.2 3.5-7.9 4.5-14.2 2.8-5.4-1.4-7.6-1.7-12.7-1.7-3.9 0-5.2.1-7.3.6-5.8 1.3-9.9 3.2-15.6 7.3-2.1 1.5-3.8 2.7-3.9 2.7-.1 0 .2-1 .6-2.3.4-1.3 1.1-3.4 1.5-4.8l.8-2.5-.9.9c-.5.5-1.9 1.9-3.1 3.2l-2.1 2.3.5 1.9c.6 2.5 2 5.6 3.5 7.9.6 1 1.1 1.8 1.1 1.9s-1.2.1-2.6.1h-2.6l-1.1-2.1zm8.8-24.2c4.8-5.1 8.7-9.2 8.8-9.2.1.1-.4 1.6-.9 3.3-3.3 10.4-4 12.4-3.9 12.5 0 0 1.2-.4 2.5-.9 8.5-3.7 18.4-4.2 28.9-1.4 4.7 1.2 6.5 1.2 8.8 0 1.3-.7 1.8-1.1 2.4-2.1 1.1-1.7 1.2-4.1.5-6.3-1.7-4.8-8.3-11-14.5-13.7-3.2-1.4-3.4-1.4-4.1-.7l-.6.6 2.6 3.2c1.4 1.7 2.9 3.6 3.1 4.1.6 1.2.7 3.1.1 4.3-.8 1.7-3.2 2.9-5.1 2.5-.8-.2-1.1-.1-1.9.5-2.2 1.6-4.6 1.2-6.6-1.2-1.6-1.8-2-2.7-2.1-4.5 0-.9-.3-2-.5-2.4-.3-.6-.4-1.3-.4-2.2l.1-1.4-1.3-.3c-1.8-.5-3.9-1.5-5.1-2.4-.6-.4-1.1-.8-1.3-.8s-1.5.6-2.9 1.3c-9.7 5-16 14.3-17 24.8-.1 1-.2 2.3-.3 2.8l-.1.9 1.1-1.1c.5-.5 4.9-5.1 9.7-10.2zm25.9-7.4c.9-.7 1.7-1.3 1.9-1.3.1 0 .4.3.7.7.5.8 1.4.8 1.8.1.3-.5.3-.6-5.6-7.8-3.5-4.3-4.2-5-4.7-5-1.2.1-.9 1 1 3.3l1.8 2.2-1 .8c-1.1 1-1.2 1.2-.5 1.8.5.5.6.4 1.6-.3l1.1-.7.7.6c.4.3.6.8.6.9 0 .2-.8.9-1.7 1.7-.9.7-1.6 1.5-1.6 1.7 0 .3.5 1.1 1.4 2.2.3.6.8.4 2.5-.9zm-10.3-14.2c.6-1.8 2.6-3.2 4.6-3.2 1.1 0 2.7.9 3.8 2.1l1 1.2.9-1.1c2.5-2.8 2.8-6.7.8-10.1-1.5-2.5-4.3-4-8.2-4.4-2.1-.2-2.6-.4-3.7-1.5l-.8-.8-.4.6c-.8 1.2-2.5 5.1-3 6.6-.7 2.3-.4 5.9.5 7.7.9 1.7 3.3 4 4 3.7.1.1.3-.3.5-.8zm-8.9-13.6c.2-.5.7-1.8 1.2-2.8.5-1 .9-2 .9-2.3 0-.9-1-1.3-3.7-1.5-2.4-.2-2.6-.1-3.1.4-.4.4-.6.9-.6 1.6 0 .6-.1 1.7-.2 2.6-.2 2.1.1 2.5 2.2 2.8 3.1.2 3 .2 3.3-.8zm-3.1-2.4c0-1.7.2-1.9 1.6-1.9h1.3v2.8h-2.8v-.9zm6.3 58.3c-.6-.6-.8-1-.8-2 0-1.9 1.1-3 2.9-3 1.7 0 2.9 1.2 2.9 2.9 0 1.8-1.1 2.8-3 2.9-1 0-1.4-.2-2-.8zm19.3.3a2.93 2.93 0 011.8-5.3c1.8 0 2.8 1.1 2.9 3 0 1.1-.1 1.4-.8 2s-1 .8-2 .8c-.9 0-1.5-.2-1.9-.5z" /> +</svg> +{{- else if (eq $icon_name "kofi") -}} +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet" + viewBox="0 -3 23 27" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" + stroke-linejoin="round"> + <path + d="M23.881 8.948c-.773-4.085-4.859-4.593-4.859-4.593H.723c-.604 0-.679.798-.679.798s-.082 7.324-.022 11.822c.164 2.424 2.586 2.672 2.586 2.672s8.267-.023 11.966-.049c2.438-.426 2.683-2.566 2.658-3.734c4.352.24 7.422-2.831 6.649-6.916zm-11.062 3.511c-1.246 1.453-4.011 3.976-4.011 3.976s-.121.119-.31.023c-.076-.057-.108-.09-.108-.09c-.443-.441-3.368-3.049-4.034-3.954c-.709-.965-1.041-2.7-.091-3.71c.951-1.01 3.005-1.086 4.363.407c0 0 1.565-1.782 3.468-.963c1.904.82 1.832 3.011.723 4.311zm6.173.478c-.928.116-1.682.028-1.682.028V7.284h1.77s1.971.551 1.971 2.638c0 1.913-.985 2.667-2.059 3.015z" /> +</svg> +{{- else if (eq $icon_name "komoot") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"> + <path d="M24 2.5A21.5 21.5 0 0 0 7.17 37.38l10.22-10.22a7.32 7.32 0 0 1 11.79-8.34h0a7.32 7.32 0 0 1 1.43 8.34l10.22 10.22A21.5 21.5 0 0 0 24 2.5Zm0 25L10.64 40.82a21.41 21.41 0 0 0 26.72 0Z"/> +</svg> +{{- else if (eq $icon_name "lastfm") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none"> + <path + d="M10.599 17.211l-.881-2.393s-1.433 1.596-3.579 1.596c-1.9 0-3.249-1.652-3.249-4.296 0-3.385 1.708-4.596 3.388-4.596 2.418 0 3.184 1.568 3.845 3.578l.871 2.751c.871 2.672 2.523 4.818 7.285 4.818 3.41 0 5.722-1.045 5.722-3.801 0-2.227-1.276-3.383-3.635-3.935l-1.757-.384c-1.217-.274-1.577-.771-1.577-1.597 0-.936.736-1.487 1.952-1.487 1.323 0 2.028.495 2.147 1.679l2.749-.33c-.225-2.479-1.937-3.494-4.745-3.494-2.479 0-4.897.936-4.897 3.934 0 1.873.902 3.058 3.185 3.605l1.862.443c1.397.33 1.863.916 1.863 1.713 0 1.021-.992 1.441-2.869 1.441-2.779 0-3.936-1.457-4.597-3.469l-.901-2.75c-1.156-3.574-3.004-4.896-6.669-4.896C2.147 5.327 0 7.879 0 12.235c0 4.179 2.147 6.445 6.003 6.445 3.108 0 4.596-1.457 4.596-1.457v-.012z" /> +</svg> +{{- else if (eq $icon_name "letterboxd") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"fill="currentColor"> + <path d="M11.052 22.339V9.599H8.729V6.401h8.438v3.198h-2.328v12.766h5.234v-3.49h3.781v6.724H8.729v-3.26zM0 16c0 8.839 7.161 16 16 16s16-7.161 16-16S24.839 0 16 0S0 7.161 0 16z"/> +</svg> +{{- else if (eq $icon_name "liberapay") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" fill="currentColor"> + <g transform="translate(-78.37-208.06)"> + <path + d="m104.28 271.1c-3.571 0-6.373-.466-8.41-1.396-2.037-.93-3.495-2.199-4.375-3.809-.88-1.609-1.308-3.457-1.282-5.544.025-2.086.313-4.311.868-6.675l9.579-40.05 11.69-1.81-10.484 43.44c-.202.905-.314 1.735-.339 2.489-.026.754.113 1.421.415 1.999.302.579.817 1.044 1.546 1.395.729.353 1.747.579 3.055.679l-2.263 9.278" /> + <path + d="m146.52 246.14c0 3.671-.604 7.03-1.811 10.07-1.207 3.043-2.879 5.669-5.01 7.881-2.138 2.213-4.702 3.935-7.693 5.167-2.992 1.231-6.248 1.848-9.767 1.848-1.71 0-3.42-.151-5.129-.453l-3.394 13.651h-11.162l12.52-52.19c2.01-.603 4.311-1.143 6.901-1.622 2.589-.477 5.393-.716 8.41-.716 2.815 0 5.242.428 7.278 1.282 2.037.855 3.708 2.024 5.02 3.507 1.307 1.484 2.274 3.219 2.904 5.205.627 1.987.942 4.11.942 6.373m-27.378 15.461c.854.202 1.91.302 3.167.302 1.961 0 3.746-.364 5.355-1.094 1.609-.728 2.979-1.747 4.111-3.055 1.131-1.307 2.01-2.877 2.64-4.714.628-1.835.943-3.858.943-6.071 0-2.161-.479-3.998-1.433-5.506-.956-1.508-2.615-2.263-4.978-2.263-1.61 0-3.118.151-4.525.453l-5.28 21.948" /> + </g> +</svg> +{{- else if (eq $icon_name "linkedin") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"></path> + <rect x="2" y="9" width="4" height="12"></rect> + <circle cx="4" cy="4" r="2"></circle> +</svg> +{{- else if (eq $icon_name "mastodon") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path + d="M21.58 13.913c-.29 1.469-2.592 3.121-5.238 3.396-1.379.184-2.737.368-4.185.276-2.368-.092-4.237-.551-4.237-.551 0 .184.014.459.043.643.308 2.294 2.317 2.478 4.22 2.57 1.922 0 3.633-.46 3.633-.46l.079 1.653s-1.344.734-3.738.918c-1.32.091-2.96-.092-4.869-.551-4.14-1.102-4.853-5.507-4.961-10.005-.034-1.285-.013-2.57-.013-3.58 0-4.589 3-5.966 3-5.966 1.513-.734 4.11-1.01 6.808-1.01h.067c2.699 0 5.296.276 6.81 1.01 0 0 3 1.377 3 5.967 0 0 .037 3.304-.419 5.69" + stroke="currentColor" /> + <path + d="M17.832 8.633v5h-1.978V8.78c0-1.023-.43-1.542-1.29-1.542-.95 0-1.427.616-1.427 1.834v2.655H11.17V9.072c0-1.218-.476-1.834-1.427-1.834-.86 0-1.29.52-1.29 1.542v4.852H6.475V8.633c0-1.022.26-1.834.782-2.434.538-.6 1.243-.909 2.118-.909 1.012 0 1.779.39 2.286 1.169l.492.827.493-.827c.507-.78 1.274-1.169 2.286-1.169.875 0 1.58.308 2.118.909.522.6.782 1.412.782 2.434" + fill="currentColor" stroke="none" /> +</svg> +{{- else if (eq $icon_name "matrix") -}} +<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"> + <path + d="M.632.55v22.9H2.28V24H0V0h2.28v.55zm7.043 7.26v1.157h.033c.309-.443.683-.784 1.117-1.024.433-.245.936-.365 1.5-.365.54 0 1.033.107 1.481.314.448.208.785.582 1.02 1.108.254-.374.6-.706 1.034-.992.434-.287.95-.43 1.546-.43.453 0 .872.056 1.26.167.388.11.716.286.993.53.276.245.489.559.646.951.152.392.23.863.23 1.417v5.728h-2.349V11.52c0-.286-.01-.559-.032-.812a1.755 1.755 0 0 0-.18-.66 1.106 1.106 0 0 0-.438-.448c-.194-.11-.457-.166-.785-.166-.332 0-.6.064-.803.189a1.38 1.38 0 0 0-.48.499 1.946 1.946 0 0 0-.231.696 5.56 5.56 0 0 0-.06.785v4.768h-2.35v-4.8c0-.254-.004-.503-.018-.752a2.074 2.074 0 0 0-.143-.688 1.052 1.052 0 0 0-.415-.503c-.194-.125-.476-.19-.854-.19-.111 0-.259.024-.439.074-.18.051-.36.143-.53.282-.171.138-.319.337-.439.595-.12.259-.18.6-.18 1.02v4.966H5.46V7.81zm15.693 15.64V.55H21.72V0H24v24h-2.28v-.55z" /> +</svg> +{{- else if (eq $icon_name "medium") -}} +<svg version="1.0" xmlns="http://www.w3.org/2000/svg" fill="currentColor" stroke-width="2" + viewBox="0 0 76.000000 76.000000" preserveAspectRatio="xMidYMid meet"> + <g transform="translate(0.000000,76.000000) scale(0.100000,-0.100000)"> + <path + d="M0 380 l0 -380 380 0 380 0 0 380 0 380 -380 0 -380 0 0 -380z m334 85 c30 -63 57 -115 59 -115 2 0 16 30 31 68 15 37 37 88 49 115 l20 47 76 0 76 -1 -27 -20 -28 -21 0 -151 c0 -150 0 -151 27 -179 l27 -28 -109 0 -109 0 27 28 c26 27 27 32 26 143 0 131 3 134 -71 -58 -24 -62 -48 -113 -53 -113 -6 0 -17 16 -24 35 -7 19 -36 83 -64 142 l-52 108 -3 -98 c-3 -97 -2 -99 28 -133 16 -19 30 -39 30 -44 0 -6 -31 -10 -70 -10 -45 0 -70 4 -70 11 0 6 14 27 30 46 30 33 30 35 30 151 0 116 0 118 -31 155 l-30 37 75 0 76 0 54 -115z" /> + </g> +</svg> +{{- else if (eq $icon_name "mixcloud") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke-width="2"> + <path + d="M21.95 19.062c-.154 0-.31-.045-.445-.135-.369-.25-.465-.75-.225-1.11.738-1.094 1.125-2.381 1.125-3.719s-.387-2.625-1.125-3.721c-.249-.368-.145-.866.216-1.106.375-.249.87-.146 1.108.214.917 1.365 1.396 2.97 1.396 4.62 0 1.648-.479 3.254-1.396 4.619-.135.239-.39.359-.645.359l-.009-.021zM19.66 17.768c-.153 0-.308-.045-.445-.139-.369-.239-.463-.734-.215-1.094.489-.721.747-1.545.747-2.43 0-.855-.258-1.695-.747-2.431-.248-.36-.154-.854.215-1.095s.857-.15 1.106.225c.669.99 1.021 2.145 1.021 3.314 0 1.201-.352 2.34-1.021 3.315-.146.24-.406.36-.661.36v-.025zm-3.73-7.153c-.314-3.197-3.016-5.699-6.3-5.699-2.721 0-5.13 1.748-5.995 4.283C1.588 9.501 0 11.269 0 13.4c0 2.344 1.912 4.254 4.26 4.254h10.908c1.964 0 3.566-1.594 3.566-3.557 0-1.706-1.2-3.129-2.805-3.48v-.002zm-.762 5.446H4.263c-1.466 0-2.669-1.191-2.669-2.658 0-1.465 1.193-2.658 2.669-2.658.71 0 1.381.285 1.886.781.3.314.811.314 1.125 0 .3-.301.3-.811 0-1.125-.555-.542-1.231-.931-1.965-1.111.75-1.665 2.43-2.774 4.305-2.774 2.609 0 4.74 2.129 4.74 4.738 0 .512-.075 1.006-.24 1.486-.135.42.09.869.51 1.02.074.03.165.045.24.045.33 0 .645-.211.75-.54.105-.315.18-.63.225-.96.734.285 1.26 1.005 1.26 1.83 0 1.096-.885 1.979-1.965 1.979l.034-.053z" /> +</svg> +{{- else if (eq $icon_name "nuget") -}} +<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" + fill="currentColor" stroke-width="2"> + <g> + <path + d="M374.424959,454.856991 C327.675805,454.856991 289.772801,416.950177 289.772801,370.196324 C289.772801,323.463635 327.675805,285.535656 374.424959,285.535656 C421.174113,285.535656 459.077116,323.463635 459.077116,370.196324 C459.077116,416.950177 421.174113,454.856991 374.424959,454.856991 M205.565067,260.814741 C176.33891,260.814741 152.657469,237.109754 152.657469,207.901824 C152.657469,178.672728 176.33891,154.988907 205.565067,154.988907 C234.791225,154.988907 258.472666,178.672728 258.472666,207.901824 C258.472666,237.109754 234.791225,260.814741 205.565067,260.814741 M378.170817,95.6417786 L236.886365,95.6417786 C164.889705,95.6417786 106.479717,154.057639 106.479717,226.082702 L106.479717,367.360191 C106.479717,439.40642 164.889705,497.77995 236.886365,497.77995 L378.170817,497.77995 C450.209803,497.77995 508.577466,439.40642 508.577466,367.360191 L508.577466,226.082702 C508.577466,154.057639 450.209803,95.6417786 378.170817,95.6417786"> + </path> + <path + d="M84.6521577,46.0115787 C84.6521577,69.3990881 65.6900744,88.3419125 42.3260788,88.3419125 C18.9409203,88.3419125 0,69.3990881 0,46.0115787 C0,22.6452344 18.9409203,3.68124485 42.3260788,3.68124485 C65.6900744,3.68124485 84.6521577,22.6452344 84.6521577,46.0115787"> + </path> + </g> +</svg> +{{- else if (eq $icon_name "paypal") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path + d="M7.144 19.532l1.049-5.751c.11-.606.691-1.002 1.304-.948 2.155.192 6.877.1 8.818-4.002 2.554-5.397-.59-7.769-6.295-7.769H7.43a1.97 1.97 0 0 0-1.944 1.655L2.77 19.507a.857.857 0 0 0 .846.994h2.368a1.18 1.18 0 0 0 1.161-.969zM7.967 22.522a.74.74 0 0 0 .666.416h2.313c.492 0 .923-.351 1.003-.837l.759-4.601c.095-.523.597-.866 1.127-.819 1.86.166 5.567-.118 6.85-3.821.554-1.6.705-2.954.408-4.018" + style="font-variation-settings:normal" stroke="currentColor" stroke-linejoin="miter" /> +</svg> +{{- else if or (eq $icon_name "pgpkey") (eq $icon_name "key") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path d="M8 18l2-2h2l1.36-1.36a6.5 6.5 0 1 0-3.997-3.992L2 18v4h4l2-2v-2z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> + <circle cx="17" cy="7" r="1" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> +</svg> +{{- else if (eq $icon_name "phone") -}} +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> + <rect x="9" y="4" width="6" height="1" rx="0.5" fill="currentColor"/> + <path d="M12 20C12.2652 20 12.5196 19.8946 12.7071 19.7071C12.8946 19.5196 13 19.2652 13 19C13 18.7348 12.8946 18.4804 12.7071 18.2929C12.5196 18.1054 12.2652 18 12 18C11.7348 18 11.4804 18.1054 11.2929 18.2929C11.1054 18.4804 11 18.7348 11 19C11 19.2652 11.1054 19.5196 11.2929 19.7071C11.4804 19.8946 11.7348 20 12 20Z" fill="currentColor"/> + <rect x="5" y="1" width="14" height="22" rx="2" stroke="currentColor" stroke-width="2"/> +</svg> +{{- else if (eq $icon_name "polywork") -}} +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" + fill="currentColor" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"> + <path + d="M19.125 0H4.875A4.865 4.865 0 0 0 0 4.875v14.25C0 21.825 2.175 24 4.875 24h6.6c2.7 0 4.875-2.175 4.875-4.875V16.65h2.775c2.7 0 4.875-2.175 4.875-4.875v-6.9C24 2.175 21.825 0 19.125 0zM16.5 1.275h2.625a3.6 3.6 0 0 1 3.6 3.6v2.7H16.5v-6.3zM15.075 9v6.45H8.85V9h6.225zM8.85 1.2h6.225v6.375H8.85V1.2zM1.275 4.8a3.6 3.6 0 0 1 3.6-3.6H7.5v6.375H1.275V4.8zM7.5 9v6.45H1.2V9h6.3zm0 13.725H4.8a3.6 3.6 0 0 1-3.6-3.6V16.8h6.3v5.925zm7.575-3.525a3.6 3.6 0 0 1-3.6 3.6H8.85v-5.925h6.225V19.2zm7.65-7.35a3.6 3.6 0 0 1-3.6 3.6H16.5V9h6.225v2.85z" /> +</svg> +{{- else if (eq $icon_name "qq") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path transform="scale(0.04) translate(75 40)" stroke-width="50" + d="M433.754 420.445c-11.526 1.393-44.86-52.741-44.86-52.741 0 31.345-16.136 72.247-51.051 101.786 16.842 5.192 54.843 19.167 45.803 34.421-7.316 12.343-125.51 7.881-159.632 4.037-34.122 3.844-152.316 8.306-159.632-4.037-9.045-15.25 28.918-29.214 45.783-34.415-34.92-29.539-51.059-70.445-51.059-101.792 0 0-33.334 54.134-44.859 52.741-5.37-.65-12.424-29.644 9.347-99.704 10.261-33.024 21.995-60.478 40.144-105.779C60.683 98.063 108.982.006 224 0c113.737.006 163.156 96.133 160.264 214.963 18.118 45.223 29.912 72.85 40.144 105.778 21.768 70.06 14.716 99.053 9.346 99.704z"> + </path> +</svg> +{{- else if (eq $icon_name "reddit") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none" stroke-width="1"> + <path + d="M24 11.779c0-1.459-1.192-2.645-2.657-2.645-.715 0-1.363.286-1.84.746-1.81-1.191-4.259-1.949-6.971-2.046l1.483-4.669 4.016.941-.006.058c0 1.193.975 2.163 2.174 2.163 1.198 0 2.172-.97 2.172-2.163s-.975-2.164-2.172-2.164c-.92 0-1.704.574-2.021 1.379l-4.329-1.015c-.189-.046-.381.063-.44.249l-1.654 5.207c-2.838.034-5.409.798-7.3 2.025-.474-.438-1.103-.712-1.799-.712-1.465 0-2.656 1.187-2.656 2.646 0 .97.533 1.811 1.317 2.271-.052.282-.086.567-.086.857 0 3.911 4.808 7.093 10.719 7.093s10.72-3.182 10.72-7.093c0-.274-.029-.544-.075-.81.832-.447 1.405-1.312 1.405-2.318zm-17.224 1.816c0-.868.71-1.575 1.582-1.575.872 0 1.581.707 1.581 1.575s-.709 1.574-1.581 1.574-1.582-.706-1.582-1.574zm9.061 4.669c-.797.793-2.048 1.179-3.824 1.179l-.013-.003-.013.003c-1.777 0-3.028-.386-3.824-1.179-.145-.144-.145-.379 0-.523.145-.145.381-.145.526 0 .65.647 1.729.961 3.298.961l.013.003.013-.003c1.569 0 2.648-.315 3.298-.962.145-.145.381-.144.526 0 .145.145.145.379 0 .524zm-.189-3.095c-.872 0-1.581-.706-1.581-1.574 0-.868.709-1.575 1.581-1.575s1.581.707 1.581 1.575-.709 1.574-1.581 1.574z" /> +</svg> +{{- else if (eq $icon_name "researchgate") -}} +<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor" stroke="none" + stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> + <path + d="M19.586 0c-.818 0-1.508.19-2.073.565-.563.377-.97.936-1.213 1.68a3.193 3.193 0 0 0-.112.437 8.365 8.365 0 0 0-.078.53 9 9 0 0 0-.05.727c-.01.282-.013.621-.013 1.016a31.121 31.123 0 0 0 .014 1.017 9 9 0 0 0 .05.727 7.946 7.946 0 0 0 .077.53h-.005a3.334 3.334 0 0 0 .113.438c.245.743.65 1.303 1.214 1.68.565.376 1.256.564 2.075.564.8 0 1.536-.213 2.105-.603.57-.39.94-.916 1.175-1.65.076-.235.135-.558.177-.93a10.9 10.9 0 0 0 .043-1.207v-.82c0-.095-.047-.142-.14-.142h-3.064c-.094 0-.14.047-.14.141v.956c0 .094.046.14.14.14h1.666c.056 0 .084.03.084.086 0 .36 0 .62-.036.865-.038.244-.1.447-.147.606-.108.385-.348.664-.638.876-.29.212-.738.35-1.227.35-.545 0-.901-.15-1.21-.353-.306-.203-.517-.454-.67-.915a3.136 3.136 0 0 1-.147-.762 17.366 17.367 0 0 1-.034-.656c-.01-.26-.014-.572-.014-.939a26.401 26.403 0 0 1 .014-.938 15.821 15.822 0 0 1 .035-.656 3.19 3.19 0 0 1 .148-.76 1.89 1.89 0 0 1 .742-1.01c.344-.244.593-.352 1.137-.352.508 0 .815.096 1.144.303.33.207.528.492.764.925.047.094.111.118.198.07l1.044-.43c.075-.048.09-.115.042-.199a3.549 3.549 0 0 0-.466-.742 3 3 0 0 0-.679-.607 3.313 3.313 0 0 0-.903-.41A4.068 4.068 0 0 0 19.586 0zM8.217 5.836c-1.69 0-3.036.086-4.297.086-1.146 0-2.291 0-3.007-.029v.831l1.088.2c.744.144 1.174.488 1.174 2.264v11.288c0 1.777-.43 2.12-1.174 2.263l-1.088.2v.832c.773-.029 2.12-.086 3.465-.086 1.29 0 2.951.057 3.667.086v-.831l-1.49-.2c-.773-.115-1.174-.487-1.174-2.264v-4.784c.688.057 1.29.057 2.206.057 1.748 3.123 3.41 5.472 4.355 6.56.86 1.032 2.177 1.691 3.839 1.691.487 0 1.003-.086 1.318-.23v-.744c-1.031 0-2.063-.716-2.808-1.518-1.26-1.376-2.95-3.582-4.355-6.074 2.32-.545 4.04-2.722 4.04-4.9 0-3.208-2.492-4.698-5.758-4.698zm-.515 1.29c2.406 0 3.839 1.26 3.839 3.552 0 2.263-1.547 3.782-4.097 3.782-.974 0-1.404-.03-2.063-.086v-7.19c.66-.059 1.547-.059 2.32-.059z" /> +</svg> +{{- else if (eq $icon_name "rss") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path d="M4 11a9 9 0 0 1 9 9" /> + <path d="M4 4a16 16 0 0 1 16 16" /> + <circle cx="5" cy="19" r="1" /> +</svg> +{{- else if (eq $icon_name "serverfault") -}} +<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"> + <path + d="M24 18.185v2.274h-4.89v-2.274H24zm-24-.106h11.505v2.274H0v-2.279.005zm12.89 0h4.89v2.274h-4.89v-2.279.005zm6.221-3.607H24v2.274h-4.89l.001-2.274zM0 14.367h11.505v2.274H0v-2.274zm12.89 0h4.89v2.274h-4.89v-2.274zm6.221-3.346H24v2.273h-4.89l.001-2.273zM0 10.916h11.505v2.271H0v-2.271zm12.89 0h4.89v2.271h-4.89v-2.271zm6.22-3.609H24v2.279h-4.89V7.307zM0 7.206h11.505V9.48H0V7.201v.005zm12.89 0h4.89V9.48h-4.89V7.201v.005zm6.221-3.556H24v2.276h-4.89v-2.28l.001.004zM0 3.541h11.505v2.274H0V3.541zm12.89 0h4.89v2.274h-4.89V3.541z" /> +</svg> +{{- else if (eq $icon_name "soundcloud") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none"> + <path + d="M1.175 12.225c-.051 0-.094.046-.101.1l-.233 2.154.233 2.105c.007.058.05.098.101.098.05 0 .09-.04.099-.098l.255-2.105-.27-2.154c0-.057-.045-.1-.09-.1m-.899.828c-.06 0-.091.037-.104.094L0 14.479l.165 1.308c0 .055.045.094.09.094s.089-.045.104-.104l.21-1.319-.21-1.334c0-.061-.044-.09-.09-.09m1.83-1.229c-.061 0-.12.045-.12.104l-.21 2.563.225 2.458c0 .06.045.12.119.12.061 0 .105-.061.121-.12l.254-2.474-.254-2.548c-.016-.06-.061-.12-.121-.12m.945-.089c-.075 0-.135.06-.15.135l-.193 2.64.21 2.544c.016.077.075.138.149.138.075 0 .135-.061.15-.15l.24-2.532-.24-2.623c0-.075-.06-.135-.135-.135l-.031-.017zm1.155.36c-.005-.09-.075-.149-.159-.149-.09 0-.158.06-.164.149l-.217 2.43.2 2.563c0 .09.075.157.159.157.074 0 .148-.068.148-.158l.227-2.563-.227-2.444.033.015zm.809-1.709c-.101 0-.18.09-.18.181l-.21 3.957.187 2.563c0 .09.08.164.18.164.094 0 .174-.09.18-.18l.209-2.563-.209-3.972c-.008-.104-.088-.18-.18-.18m.959-.914c-.105 0-.195.09-.203.194l-.18 4.872.165 2.548c0 .12.09.209.195.209.104 0 .194-.089.21-.209l.193-2.548-.192-4.856c-.016-.12-.105-.21-.21-.21m.989-.449c-.121 0-.211.089-.225.209l-.165 5.275.165 2.52c.014.119.104.225.225.225.119 0 .225-.105.225-.225l.195-2.52-.196-5.275c0-.12-.105-.225-.225-.225m1.245.045c0-.135-.105-.24-.24-.24-.119 0-.24.105-.24.24l-.149 5.441.149 2.503c.016.135.121.24.256.24s.24-.105.24-.24l.164-2.503-.164-5.456-.016.015zm.749-.134c-.135 0-.255.119-.255.254l-.15 5.322.15 2.473c0 .15.12.255.255.255s.255-.12.255-.27l.15-2.474-.165-5.307c0-.148-.12-.27-.271-.27m1.005.166c-.164 0-.284.135-.284.285l-.103 5.143.135 2.474c0 .149.119.277.284.277.149 0 .271-.12.284-.285l.121-2.443-.135-5.112c-.012-.164-.135-.285-.285-.285m1.184-.945c-.045-.029-.105-.044-.165-.044s-.119.015-.165.044c-.09.054-.149.15-.149.255v.061l-.104 6.048.115 2.449v.008c.008.06.03.135.074.18.058.061.142.104.234.104.08 0 .158-.044.209-.09.058-.06.091-.135.091-.225l.015-.24.117-2.203-.135-6.086c0-.104-.061-.193-.135-.239l-.002-.022zm1.006-.547c-.045-.045-.09-.061-.15-.061-.074 0-.149.016-.209.061-.075.061-.119.15-.119.24v.029l-.137 6.609.076 1.215.061 1.185c0 .164.148.314.328.314.181 0 .33-.15.33-.329l.15-2.414-.15-6.637c0-.12-.074-.221-.165-.277m8.934 3.777c-.405 0-.795.086-1.139.232-.24-2.654-2.46-4.736-5.188-4.736-.659 0-1.305.135-1.889.359-.225.09-.27.18-.285.359v9.368c.016.18.15.33.33.345h8.185C22.681 17.218 24 15.914 24 14.28s-1.319-2.952-2.938-2.952" /> +</svg> +{{- else if (eq $icon_name "shutterstock") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <rect ry="5" rx="5" height="20" width="20" y="2" x="2" /> + <path d="M7.728 11.725V9.032c0-1.025.824-1.85 1.849-1.85h2.815m3.88 5.093v2.693a1.845 1.845 0 0 1-1.849 1.85h-2.815" + stroke-linecap="square" stroke-linejoin="miter" /> +</svg> +{{- else if (eq $icon_name "slack") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path d="M22.08 9C19.81 1.41 16.54-.35 9 1.92S-.35 7.46 1.92 15 7.46 24.35 15 22.08 24.35 16.54 22.08 9z"></path> + <line x1="12.57" y1="5.99" x2="16.15" y2="16.39"></line> + <line x1="7.85" y1="7.61" x2="11.43" y2="18.01"></line> + <line x1="16.39" y1="7.85" x2="5.99" y2="11.43"></line> + <line x1="18.01" y1="12.57" x2="7.61" y2="16.15"></line> +</svg> +{{- else if (eq $icon_name "snapchat") -}} +<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"> + <path + d="M12.206.793c.99 0 4.347.276 5.93 3.821.529 1.193.403 3.219.299 4.847l-.003.06c-.012.18-.022.345-.03.51.075.045.203.09.401.09.3-.016.659-.12 1.033-.301.165-.088.344-.104.464-.104.182 0 .359.029.509.09.45.149.734.479.734.838.015.449-.39.839-1.213 1.168-.089.029-.209.075-.344.119-.45.135-1.139.36-1.333.81-.09.224-.061.524.12.868l.015.015c.06.136 1.526 3.475 4.791 4.014.255.044.435.27.42.509 0 .075-.015.149-.045.225-.24.569-1.273.988-3.146 1.271-.059.091-.12.375-.164.57-.029.179-.074.36-.134.553-.076.271-.27.405-.555.405h-.03c-.135 0-.313-.031-.538-.074-.36-.075-.765-.135-1.273-.135-.3 0-.599.015-.913.074-.6.104-1.123.464-1.723.884-.853.599-1.826 1.288-3.294 1.288-.06 0-.119-.015-.18-.015h-.149c-1.468 0-2.427-.675-3.279-1.288-.599-.42-1.107-.779-1.707-.884-.314-.045-.629-.074-.928-.074-.54 0-.958.089-1.272.149-.211.043-.391.074-.54.074-.374 0-.523-.224-.583-.42-.061-.192-.09-.389-.135-.567-.046-.181-.105-.494-.166-.57-1.918-.222-2.95-.642-3.189-1.226-.031-.063-.052-.15-.055-.225-.015-.243.165-.465.42-.509 3.264-.54 4.73-3.879 4.791-4.02l.016-.029c.18-.345.224-.645.119-.869-.195-.434-.884-.658-1.332-.809-.121-.029-.24-.074-.346-.119-1.107-.435-1.257-.93-1.197-1.273.09-.479.674-.793 1.168-.793.146 0 .27.029.383.074.42.194.789.3 1.104.3.234 0 .384-.06.465-.105l-.046-.569c-.098-1.626-.225-3.651.307-4.837C7.392 1.077 10.739.807 11.727.807l.419-.015h.06z" /> +</svg> +{{- else if (eq $icon_name "sourcerer") -}} +<svg version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300.000000 360.000000" + preserveAspectRatio="xMidYMid meet" fill="currentColor" stroke="currentColor"> + <g transform="translate(0.000000,360.000000) scale(0.100000,-0.100000)"> + <path + d="M1120 3584 c-207 -30 -409 -98 -562 -191 -386 -232 -562 -581 -493 -974 42 -240 129 -385 320 -534 95 -74 165 -111 306 -160 179 -62 279 -82 781 -155 535 -77 624 -97 735 -169 33 -21 64 -44 67 -50 5 -8 116 -11 368 -11 l361 0 -5 43 c-14 120 -132 310 -255 409 -216 174 -438 246 -998 323 -589 81 -723 109 -861 184 -159 86 -218 265 -140 425 35 72 126 155 218 200 262 128 737 121 999 -15 190 -99 296 -250 314 -449 4 -41 12 -81 18 -87 11 -15 603 -19 626 -4 22 14 8 222 -23 343 -91 356 -368 646 -741 778 -123 43 -268 77 -403 95 -142 19 -499 18 -632 -1z" /> + <path + d="M163 1279 c-45 -13 -63 -44 -63 -106 l0 -53 -50 0 -50 0 0 -40 0 -40 50 0 50 0 0 -185 0 -185 45 0 45 0 0 185 0 185 75 0 75 0 0 -185 0 -185 45 0 45 0 0 225 0 225 -121 0 -120 0 3 38 c3 37 3 37 51 40 l47 3 0 45 0 44 -47 -1 c-27 0 -62 -5 -80 -10z" /> + <path + d="M2639 1279 c-96 -15 -184 -82 -224 -173 -34 -75 -39 -125 -21 -196 44 -170 202 -268 365 -226 143 37 234 152 234 296 0 185 -169 328 -354 299z" /> + <path + d="M466 595 c-36 -33 -46 -65 -46 -145 0 -80 10 -112 46 -145 38 -36 120 -36 158 0 36 33 46 65 46 146 0 122 -35 169 -126 169 -40 0 -57 -5 -78 -25z m122 -75 c17 -34 11 -135 -10 -157 -23 -23 -66 -9 -79 25 -14 34 -7 126 11 147 19 23 62 15 78 -15z" /> + <path + d="M677 315 c-103 -168 -187 -307 -187 -310 0 -3 20 -5 44 -5 l44 0 158 257 c87 142 170 277 186 300 15 23 28 46 28 52 0 6 -19 11 -43 11 l-44 0 -186 -305z" /> + <path + d="M1392 605 c-137 -38 -227 -156 -227 -295 1 -82 16 -127 66 -190 159 -201 470 -131 535 119 18 72 13 122 -20 196 -33 73 -69 111 -139 144 -77 37 -145 45 -215 26z m196 -112 c59 -36 102 -114 102 -183 0 -70 -43 -147 -103 -184 -68 -42 -138 -46 -210 -13 -115 53 -159 179 -101 295 58 116 200 155 312 85z" /> + <path + d="M1922 608 c-9 -9 -12 -90 -12 -305 l0 -293 23 -5 c12 -3 150 -4 307 -3 l285 3 3 299 c2 233 -1 301 -10 308 -22 13 -582 10 -596 -4z" /> + <path + d="M826 319 c-42 -33 -56 -71 -56 -149 0 -121 36 -170 125 -170 90 0 128 49 129 165 0 118 -43 175 -132 175 -25 0 -49 -8 -66 -21z m99 -63 c27 -19 34 -126 11 -161 -18 -27 -56 -34 -74 -12 -28 34 -26 142 4 172 19 19 35 19 59 1z" /> + </g> +</svg> +{{- else if (eq $icon_name "spotify") -}} +<svg fill="currentColor" stoke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> + <path + d="M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z" /> +</svg> +{{- else if (eq $icon_name "stackoverflow") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path + d="M2.913 16.041v6.848h17.599v-6.848M7.16 18.696h8.925M7.65 13.937l8.675 1.8M9.214 9.124l8.058 3.758M12.086 4.65l6.849 5.66M15.774 1.111l5.313 7.162" /> +</svg> +{{- else if (eq $icon_name "steam") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none"> + <path + d="M11.979 0C5.678 0 .511 4.86.022 11.037l6.432 2.658c.545-.371 1.203-.59 1.912-.59.063 0 .125.004.188.006l2.861-4.142V8.91c0-2.495 2.028-4.524 4.524-4.524 2.494 0 4.524 2.031 4.524 4.527s-2.03 4.525-4.524 4.525h-.105l-4.076 2.911c0 .052.004.105.004.159 0 1.875-1.515 3.396-3.39 3.396-1.635 0-3.016-1.173-3.331-2.727L.436 15.27C1.862 20.307 6.486 24 11.979 24c6.627 0 11.999-5.373 11.999-12S18.605 0 11.979 0zM7.54 18.21l-1.473-.61c.262.543.714.999 1.314 1.25 1.297.539 2.793-.076 3.332-1.375.263-.63.264-1.319.005-1.949s-.75-1.121-1.377-1.383c-.624-.26-1.29-.249-1.878-.03l1.523.63c.956.4 1.409 1.5 1.009 2.455-.397.957-1.497 1.41-2.454 1.012H7.54zm11.415-9.303c0-1.662-1.353-3.015-3.015-3.015-1.665 0-3.015 1.353-3.015 3.015 0 1.665 1.35 3.015 3.015 3.015 1.663 0 3.015-1.35 3.015-3.015zm-5.273-.005c0-1.252 1.013-2.266 2.265-2.266 1.249 0 2.266 1.014 2.266 2.266 0 1.251-1.017 2.265-2.266 2.265-1.253 0-2.265-1.014-2.265-2.265z" /> +</svg> +{{- else if (eq $icon_name "telegram") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path + d="M21.198 2.433a2.242 2.242 0 0 0-1.022.215l-8.609 3.33c-2.068.8-4.133 1.598-5.724 2.21a405.15 405.15 0 0 1-2.849 1.09c-.42.147-.99.332-1.473.901-.728.968.193 1.798.919 2.286 1.61.516 3.275 1.009 4.654 1.472.509 1.793.997 3.592 1.48 5.388.16.36.506.494.864.498l-.002.018s.281.028.555-.038a2.1 2.1 0 0 0 .933-.517c.345-.324 1.28-1.244 1.811-1.764l3.999 2.952.032.018s.442.311 1.09.355c.324.022.75-.04 1.116-.308.37-.27.613-.702.728-1.196.342-1.492 2.61-12.285 2.997-14.072l-.01.042c.27-1.006.17-1.928-.455-2.474a1.654 1.654 0 0 0-1.034-.407z" /> +</svg> +{{- else if (eq $icon_name "twitch") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path d="M21 2H3v16h5v4l4-4h5l4-4V2zm-10 9V7m5 4V7"></path> +</svg> +{{- else if (eq $icon_name "twitter") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path + d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"> + </path> +</svg> +{{- else if (eq $icon_name "unsplash") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 40"> + <path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="4" + d="M37.892,13.5h-4.486 l-1.143-3.306C31.707,8.581,30.189,7.5,28.483,7.5h-9.045c-1.706,0-3.224,1.081-3.781,2.694L14.515,13.5H9.108 c-2.545,0-4.608,2.063-4.608,4.608v16.785c0,2.545,2.063,4.608,4.608,4.608h28.785c2.545,0,4.608-2.063,4.608-4.608V18.108 C42.5,15.563,40.437,13.5,37.892,13.5z" /> + <circle cx="24" cy="26" r="7.5" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="4" /> +</svg> +{{- else if (eq $icon_name "xda") -}} +<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"> + <path + d="M13.84 3.052V0h7.843v17.583H13.84v-3.024h4.591V3.052zM5.569 14.53V3.024h4.592V0H2.318v17.583H6.98L10.16 24v-9.483z" /> +</svg> +{{- else if (eq $icon_name "xing") -}} +<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill="currentColor"> + <path + d="M313.8 303.9L469 32H365L209.4 303.8a1.35 1.35 0 0 0 0 1.7l98.9 173.8c.4.7.8.7 1.6.7H413l-99.3-174.7a1.74 1.74 0 0 1 .1-1.4z" + fill="currentColor" /> + <path + d="M221.9 216.2L163 113a2 2 0 0 0-2-1H65l58.9 104.4a1.13 1.13 0 0 1 .1.8L43 352h96.8a1.54 1.54 0 0 0 1.6-.9l80.5-133.7a2.44 2.44 0 0 0 0-1.2z" /> +</svg> +{{- else if (eq $icon_name "ycombinator") -}} +<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor" stroke="none" stroke-width="1"> + <path + d="M0 24V0h24v24H0zM6.951 5.896l4.112 7.708v5.064h1.583v-4.972l4.148-7.799h-1.749l-2.457 4.875c-.372.745-.688 1.434-.688 1.434s-.297-.708-.651-1.434L8.831 5.896h-1.88z" /> +</svg> +{{- else if (eq $icon_name "youtube") -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path + d="M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z"> + </path> + <polygon points="9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02"></polygon> +</svg> +{{- else if $icon_name -}} +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" + stroke-linecap="round" stroke-linejoin="round"> + <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path> + <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path> +</svg> +{{- end -}} diff --git a/themes/PaperMod/layouts/partials/templates/opengraph.html b/themes/PaperMod/layouts/partials/templates/opengraph.html new file mode 100644 index 0000000..9bbd90b --- /dev/null +++ b/themes/PaperMod/layouts/partials/templates/opengraph.html @@ -0,0 +1,52 @@ +<meta property="og:title" content="{{ .Title }}" /> +<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" /> +<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" /> +<meta property="og:url" content="{{ .Permalink }}" /> +{{- if .Params.cover.image -}} +{{- if (ne .Params.cover.relative true) }} +<meta property="og:image" content="{{ .Params.cover.image | absURL }}" /> +{{- else}} +<meta property="og:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" /> +{{- end}} +{{- else }} + +{{- with $.Params.images -}} +{{- range first 6 . }}<meta property="og:image" content="{{ . | absURL }}" />{{ end -}} +{{- else -}} +{{- $images := $.Resources.ByType "image" -}} +{{- $featured := $images.GetMatch "*feature*" -}} +{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} +{{- with $featured -}} +<meta property="og:image" content="{{ $featured.Permalink }}"/> +{{- else -}} +{{- with $.Site.Params.images }}<meta property="og:image" content="{{ index . 0 | absURL }}"/>{{ end -}} +{{- end -}} +{{- end -}} +{{- end }} + +{{- if .IsPage }} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} +<meta property="article:section" content="{{ .Section }}" /> +{{ with .PublishDate }}<meta property="article:published_time" content="{{ .Format $iso8601 }}" />{{ end }} +{{ with .Lastmod }}<meta property="article:modified_time" content="{{ .Format $iso8601 }}" />{{ end }} +{{- end -}} + +{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }} +{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }} +{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }} +{{- with .Params.videos }}{{- range . }} +<meta property="og:video" content="{{ . | absURL }}" /> +{{ end }}{{ end }} + +{{- /* If it is part of a series, link to related articles */}} +{{- $permalink := .Permalink }} +{{- $siteSeries := .Site.Taxonomies.series }} +{{ with .Params.series }}{{- range $name := . }} + {{- $series := index $siteSeries ($name | urlize) }} + {{- range $page := first 6 $series.Pages }} + {{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }} + {{- end }} +{{ end }}{{ end }} + +{{- /* Facebook Page Admin ID for Domain Insights */}} +{{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }} diff --git a/themes/PaperMod/layouts/partials/templates/schema_json.html b/themes/PaperMod/layouts/partials/templates/schema_json.html new file mode 100644 index 0000000..5cf3857 --- /dev/null +++ b/themes/PaperMod/layouts/partials/templates/schema_json.html @@ -0,0 +1,119 @@ +{{ if .IsHome }} +<script type="application/ld+json"> +{ + "@context": "https://schema.org", + "@type": "{{- ( .Site.Params.schema.publisherType | default "Organization") | title -}}", + "name": {{ .Site.Title }}, + "url": {{ .Site.BaseURL }}, + "description": {{ .Site.Params.description | plainify | truncate 180 | safeHTML }}, + "thumbnailUrl": {{ .Site.Params.assets.favicon | default "favicon.ico" | absURL }}, + "sameAs": [ + {{- if .Site.Params.schema.sameAs }} + {{ range $i, $e := .Site.Params.schema.sameAs }}{{ if $i }}, {{ end }}{{ trim $e " " }}{{ end }} + {{- else}} + {{ range $i, $e := .Site.Params.SocialIcons }}{{ if $i }}, {{ end }}{{ trim $e.url " " }}{{ end }} + {{- end}} + ] +} +</script> +{{- else if (or .IsPage .IsSection) }} +{{/* BreadcrumbList */}} +{{- $url := replace .Parent.Permalink ( printf "%s" .Site.BaseURL) "" }} +{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }} +{{- $bc_list := (split $lang_url "/")}} + +{{- $scratch := newScratch }} +<script type="application/ld+json"> +{ + "@context": "https://schema.org", + "@type": "BreadcrumbList", + "itemListElement": [ + {{- range $index, $element := $bc_list }} + + {{- $scratch.Add "path" (printf "%s/" $element ) | safeJS }} + {{- $bc_pg := $.Site.GetPage ($scratch.Get "path") -}} + + {{- if (and ($bc_pg) (gt (len . ) 0))}} + {{- if (and $index)}}, {{end }} + { + "@type": "ListItem", + "position": {{ add 1 $index }}, + "name": {{ $bc_pg.Name }}, + "item": {{ $bc_pg.Permalink | safeHTML }} + } + {{- end }} + + {{- end }} + {{- /* self-page addition */ -}} + {{- if (ge (len $bc_list) 2) }}, {{end }} + { + "@type": "ListItem", + "position": {{len $bc_list}}, + "name": {{ .Name }}, + "item": {{ .Permalink | safeHTML }} + } + ] +} +</script> +{{- if .IsPage }} +<script type="application/ld+json"> +{ + "@context": "https://schema.org", + "@type": "BlogPosting", + "headline": {{ .Title | plainify}}, + "name": "{{ .Title | plainify }}", + "description": {{ with .Description | plainify }}{{ . }}{{ else }}{{ .Summary | plainify }}{{ end -}}, + "keywords": [ + {{- if .Params.keywords }} + {{ range $i, $e := .Params.keywords }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} + {{- else }} + {{ range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} + {{- end }} + ], + "articleBody": {{ .Content | safeJS | htmlUnescape | plainify }}, + "wordCount" : "{{ .WordCount }}", + "inLanguage": {{ .Language.Lang | default "en-us" }}, + {{ if .Params.cover.image -}} + "image": + {{- if (ne .Params.cover.relative true) -}} + {{ .Params.cover.image | absURL }}, + {{- else -}} + {{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}, + {{- end}} + {{- end -}} + "datePublished": {{ .PublishDate }}, + "dateModified": {{ .Lastmod }}, + {{- with (.Params.author | default .Site.Params.author) }} + "author": + {{- if (or (eq (printf "%T" .) "[]string") (eq (printf "%T" .) "[]interface {}")) -}} + [{{- range $i, $v := . -}} + {{- if $i }}, {{end -}} + { + "@type": "Person", + "name": {{ $v }} + } + {{- end }}], + {{- else -}} + { + "@type": "Person", + "name": {{ . }} + }, + {{- end -}} + {{- end }} + "mainEntityOfPage": { + "@type": "WebPage", + "@id": {{ .Permalink | safeHTML }} + }, + "publisher": { + "@type": "{{- ( .Site.Params.schema.publisherType | default "Organization") | title -}}", + "name": {{ .Site.Title }}, + "logo": { + "@type": "ImageObject", + "url": {{ .Site.Params.assets.favicon | default "favicon.ico" | absURL }} + } + } +} +</script> +{{- end }}{{/* .IsPage end */}} + +{{- end -}} diff --git a/themes/PaperMod/layouts/partials/templates/twitter_cards.html b/themes/PaperMod/layouts/partials/templates/twitter_cards.html new file mode 100644 index 0000000..02270de --- /dev/null +++ b/themes/PaperMod/layouts/partials/templates/twitter_cards.html @@ -0,0 +1,33 @@ +{{- if .Params.cover.image -}} +<meta name="twitter:card" content="summary_large_image" /> +{{- if (ne $.Params.cover.relative true) }} +<meta name="twitter:image" content="{{ .Params.cover.image | absURL }}" /> +{{- else }} +<meta name="twitter:image" content="{{ (path.Join .RelPermalink .Params.cover.image ) | absURL }}" /> +{{- end}} +{{- else }} +{{- with $.Params.images -}} +<meta name="twitter:card" content="summary_large_image"/> +<meta name="twitter:image" content="{{ index . 0 | absURL }}"/> +{{ else -}} +{{- $images := $.Resources.ByType "image" -}} +{{- $featured := $images.GetMatch "*feature*" -}} +{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} +{{- with $featured -}} +<meta name="twitter:card" content="summary_large_image"/> +<meta name="twitter:image" content="{{ $featured.Permalink }}"/> +{{- else -}} +{{- with $.Site.Params.images -}} +<meta name="twitter:card" content="summary_large_image"/> +<meta name="twitter:image" content="{{ index . 0 | absURL }}"/> +{{ else -}} +<meta name="twitter:card" content="summary"/> +{{- end -}} +{{- end -}} +{{- end }} +{{- end }} +<meta name="twitter:title" content="{{ .Title }}"/> +<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/> +{{ with .Site.Social.twitter -}} +<meta name="twitter:site" content="@{{ . }}"/> +{{ end -}} diff --git a/themes/PaperMod/layouts/partials/toc.html b/themes/PaperMod/layouts/partials/toc.html new file mode 100644 index 0000000..d9b8b23 --- /dev/null +++ b/themes/PaperMod/layouts/partials/toc.html @@ -0,0 +1,97 @@ +{{- $headers := findRE "<h[1-6].*?>(.|\n])+?</h[1-6]>" .Content -}} +{{- $has_headers := ge (len $headers) 1 -}} +{{- if $has_headers -}} +<div class="toc"> + <details {{if (.Param "TocOpen") }} open{{ end }}> + <summary accesskey="c" title="(Alt + C)"> + <span class="details">{{- i18n "toc" | default "Table of Contents" }}</span> + </summary> + + <div class="inner"> + {{- if (.Param "UseHugoToc") }} + {{- .TableOfContents -}} + {{- else }} + {{- $largest := 6 -}} + {{- range $headers -}} + {{- $headerLevel := index (findRE "[1-6]" . 1) 0 -}} + {{- $headerLevel := len (seq $headerLevel) -}} + {{- if lt $headerLevel $largest -}} + {{- $largest = $headerLevel -}} + {{- end -}} + {{- end -}} + + {{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}} + + {{- $.Scratch.Set "bareul" slice -}} + <ul> + {{- range seq (sub $firstHeaderLevel $largest) -}} + <ul> + {{- $.Scratch.Add "bareul" (sub (add $largest .) 1) -}} + {{- end -}} + {{- range $i, $header := $headers -}} + {{- $headerLevel := index (findRE "[1-6]" . 1) 0 -}} + {{- $headerLevel := len (seq $headerLevel) -}} + + {{/* get id="xyz" */}} + {{- $id := index (findRE "(id=\"(.*?)\")" $header 9) 0 }} + + {{- /* strip id="" to leave xyz, no way to get regex capturing groups in hugo */ -}} + {{- $cleanedID := replace (replace $id "id=\"" "") "\"" "" }} + {{- $header := replaceRE "<h[1-6].*?>((.|\n])+?)</h[1-6]>" "$1" $header -}} + + {{- if ne $i 0 -}} + {{- $prevHeaderLevel := index (findRE "[1-6]" (index $headers (sub $i 1)) 1) 0 -}} + {{- $prevHeaderLevel := len (seq $prevHeaderLevel) -}} + {{- if gt $headerLevel $prevHeaderLevel -}} + {{- range seq $prevHeaderLevel (sub $headerLevel 1) -}} + <ul> + {{/* the first should not be recorded */}} + {{- if ne $prevHeaderLevel . -}} + {{- $.Scratch.Add "bareul" . -}} + {{- end -}} + {{- end -}} + {{- else -}} + </li> + {{- if lt $headerLevel $prevHeaderLevel -}} + {{- range seq (sub $prevHeaderLevel 1) -1 $headerLevel -}} + {{- if in ($.Scratch.Get "bareul") . -}} + </ul> + {{/* manually do pop item */}} + {{- $tmp := $.Scratch.Get "bareul" -}} + {{- $.Scratch.Delete "bareul" -}} + {{- $.Scratch.Set "bareul" slice}} + {{- range seq (sub (len $tmp) 1) -}} + {{- $.Scratch.Add "bareul" (index $tmp (sub . 1)) -}} + {{- end -}} + {{- else -}} + </ul> + </li> + {{- end -}} + {{- end -}} + {{- end -}} + {{- end }} + <li> + <a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify -}}">{{- $header | safeHTML -}}</a> + {{- else }} + <li> + <a href="#{{- $cleanedID -}}" aria-label="{{- $header | plainify -}}">{{- $header | safeHTML -}}</a> + {{- end -}} + {{- end -}} + <!-- {{- $firstHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers 0) 1) 0)) -}} --> + {{- $firstHeaderLevel := $largest }} + {{- $lastHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers (sub (len $headers) 1)) 1) 0)) }} + </li> + {{- range seq (sub $lastHeaderLevel $firstHeaderLevel) -}} + {{- if in ($.Scratch.Get "bareul") (add . $firstHeaderLevel) }} + </ul> + {{- else }} + </ul> + </li> + {{- end -}} + {{- end }} + </ul> + {{- end }} + </div> + </details> +</div> +{{- end }} diff --git a/themes/PaperMod/layouts/partials/translation_list.html b/themes/PaperMod/layouts/partials/translation_list.html new file mode 100644 index 0000000..e1c34e1 --- /dev/null +++ b/themes/PaperMod/layouts/partials/translation_list.html @@ -0,0 +1,19 @@ +{{- if .IsTranslated -}} +{{- if (ne .Layout "search") }} +{{- if or .Params.author $.Site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }} | {{- end -}} +{{- end }} +<ul class="i18n_list"> + {{- i18n "translations" | default "Translations" }}: + {{- range .Translations }} + <li> + <a href="{{ .Permalink }}"> + {{- if (and $.Site.Params.displayFullLangName (.Language.LanguageName)) }} + {{- .Language.LanguageName | emojify -}} + {{- else }} + {{- .Lang | title -}} + {{- end -}} + </a> + </li> + {{- end }} +</ul> +{{- end -}} diff --git a/themes/PaperMod/layouts/robots.txt b/themes/PaperMod/layouts/robots.txt new file mode 100644 index 0000000..da3e7e0 --- /dev/null +++ b/themes/PaperMod/layouts/robots.txt @@ -0,0 +1,7 @@ +User-agent: * +{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }} +Disallow: +{{- else }} +Disallow: / +{{- end }} +Sitemap: {{ "sitemap.xml" | absURL }} diff --git a/themes/PaperMod/layouts/shortcodes/blockquote.html b/themes/PaperMod/layouts/shortcodes/blockquote.html new file mode 100644 index 0000000..14bb107 --- /dev/null +++ b/themes/PaperMod/layouts/shortcodes/blockquote.html @@ -0,0 +1,72 @@ + +<!-- Author: Parsia Hakimian https://github.com/parsiya/Hugo-Shortcodes --> +<!-- port of Octopress blockquote plugin http://octopress.org/docs/plugins/blockquote/ to Hugo + see readme for usage --> + +<!-- reset scratch variables at the start --> +{{ $.Scratch.Set "bl_author" false }} +{{ $.Scratch.Set "bl_source" false }} +{{ $.Scratch.Set "bl_link" false }} +{{ $.Scratch.Set "bl_title" false }} + +{{ if .IsNamedParams }} + {{ $.Scratch.Set "bl_author" (.Get "author") }} + {{ $.Scratch.Set "bl_source" (.Get "source") }} + {{ $.Scratch.Set "bl_link" (.Get "link") }} + {{ $.Scratch.Set "bl_title" (.Get "title") }} +{{ else }} + <!-- for the positional version if any --> +{{ end }} + +<!-- if title is not set explicitly then we need to beautify the link + if length of link is more than 32 chars, we will cut it off by 32 and + then drop everything after the last / if any and put it in into title --> + +{{ with $.Scratch.Get "bl_title" }} + <!-- do nothing --> +{{ else }} + {{ with $.Scratch.Get "bl_link" }} <!-- if link is given --> + {{ range last 1 (split ($.Scratch.Get "bl_link" ) "://") }} <!-- split by :// and then only take the items after it to remove protocol:// --> + {{ $.Scratch.Set "title_without_protocol" . }} + {{ end }} + {{ range last 1 (split ($.Scratch.Get "title_without_protocol" ) "www.") }} <!-- also remove the www. at the start if any. we are using a second split because all URLS may not start with it --> + {{ $.Scratch.Set "title_without_protocol" . }} + {{ end }} + {{ $.Scratch.Set "bl_title" ($.Scratch.Get "title_without_protocol") }} + + <!-- if link is longer than 32 bytes we should trim it --> + {{ if (gt (len ($.Scratch.Get "title_without_protocol") ) 32) }} + {{ $title := (slicestr ($.Scratch.Get "title_without_protocol") 0 32) }} <!-- get the first 32 characters of title_without_protocol --> + {{ $split_by_fw_slash := split $title "/" }} <!-- now split on / because we want to stop after the last forward slash --> + {{ $count := (sub (len $split_by_fw_slash) 1) }} <!-- we want everything but the last part so we adjust the count accordingly --> + + {{ $.Scratch.Set "tempstring" "" }} <!-- temp variable to hold the concatinated string --> + {{ range first $count $split_by_fw_slash }} <!-- loop through all parts except last and concat them (add / between halves) --> + {{ $.Scratch.Set "tempstring" ( . | printf "%s%s/" ($.Scratch.Get "tempstring") | printf "%s" ) }} + {{ end }} + {{ $.Scratch.Set "bl_title" ( printf "%s..." ($.Scratch.Get "tempstring") | printf "%s" ) }} + {{ end }} + {{ end }} +{{ end }} + +<blockquote> + <p>{{ .Inner | markdownify }}</p> + <footer> + <strong>{{ with $.Scratch.Get "bl_author" }}{{ . }}{{ end }}</strong> + {{ with $.Scratch.Get "bl_source" }} + <cite>{{ . }}</cite> + {{ else }} + {{ with $.Scratch.Get "bl_link" }} + <cite> + <a href="{{ . }}" title="{{ . }}">{{ $.Scratch.Get "bl_title" }}</a> <!-- can't have new lines here --> + </cite> + {{ else }} + {{ with $.Scratch.Get "bl_title" }} + <cite> + {{ $.Scratch.Get "bl_title" }}</a> + </cite> + {{ end }} + {{ end }} + {{ end }} + </footer> +</blockquote> diff --git a/themes/PaperMod/layouts/shortcodes/collapse.html b/themes/PaperMod/layouts/shortcodes/collapse.html new file mode 100644 index 0000000..17d8d3b --- /dev/null +++ b/themes/PaperMod/layouts/shortcodes/collapse.html @@ -0,0 +1,8 @@ +{{ if .Get "summary" }} +{{ else }} +{{ warnf "missing value for param 'summary': %s" .Position }} +{{ end }} +<p><details {{ if (eq (.Get "openByDefault") true) }} open=true {{ end }}> + <summary markdown="span">{{ .Get "summary" | markdownify }}</summary> + {{ .Inner | markdownify }} +</details></p> diff --git a/themes/PaperMod/layouts/shortcodes/figure.html b/themes/PaperMod/layouts/shortcodes/figure.html new file mode 100644 index 0000000..8c93eff --- /dev/null +++ b/themes/PaperMod/layouts/shortcodes/figure.html @@ -0,0 +1,31 @@ +<figure{{ if or (.Get "class") (eq (.Get "align") "center") }} class=" + {{- if eq (.Get "align") "center" }}align-center {{ end }} + {{- with .Get "class" }}{{ . }}{{- end }}" +{{- end -}}> + {{- if .Get "link" -}} + <a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}> + {{- end }} + <img loading="lazy" src="{{ .Get "src" }}{{- if eq (.Get "align") "center" }}#center{{- end }}" + {{- if or (.Get "alt") (.Get "caption") }} + alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}" + {{- end -}} + {{- with .Get "width" }} width="{{ . }}"{{ end -}} + {{- with .Get "height" }} height="{{ . }}"{{ end -}} + /> <!-- Closing img tag --> + {{- if .Get "link" }}</a>{{ end -}} + {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} + <figcaption> + {{ with (.Get "title") -}} + {{ . }} + {{- end -}} + {{- if or (.Get "caption") (.Get "attr") -}}<p> + {{- .Get "caption" | markdownify -}} + {{- with .Get "attrlink" }} + <a href="{{ . }}"> + {{- end -}} + {{- .Get "attr" | markdownify -}} + {{- if .Get "attrlink" }}</a>{{ end }}</p> + {{- end }} + </figcaption> + {{- end }} +</figure> diff --git a/themes/PaperMod/layouts/shortcodes/ltr.html b/themes/PaperMod/layouts/shortcodes/ltr.html new file mode 100644 index 0000000..4ad7682 --- /dev/null +++ b/themes/PaperMod/layouts/shortcodes/ltr.html @@ -0,0 +1,15 @@ +{{ $.Scratch.Set "md" false }} + +{{ if .IsNamedParams }} +{{ $.Scratch.Set "md" (.Get "md") }} +{{ else }} +{{ $.Scratch.Set "md" (.Get 0) }} +{{ end }} + +<div dir="ltr"> + {{ if eq ($.Scratch.Get "md") false }} + {{ .Inner }} + {{ else }} + {{ .Inner | markdownify }} + {{ end }} +</div> diff --git a/themes/PaperMod/layouts/shortcodes/rawhtml.html b/themes/PaperMod/layouts/shortcodes/rawhtml.html new file mode 100644 index 0000000..520ec17 --- /dev/null +++ b/themes/PaperMod/layouts/shortcodes/rawhtml.html @@ -0,0 +1,2 @@ +<!-- raw html --> +{{.Inner}}
\ No newline at end of file diff --git a/themes/PaperMod/layouts/shortcodes/rtl.html b/themes/PaperMod/layouts/shortcodes/rtl.html new file mode 100644 index 0000000..a69b8ce --- /dev/null +++ b/themes/PaperMod/layouts/shortcodes/rtl.html @@ -0,0 +1,15 @@ +{{ $.Scratch.Set "md" false }} + +{{ if .IsNamedParams }} +{{ $.Scratch.Set "md" (.Get "md") }} +{{ else }} +{{ $.Scratch.Set "md" (.Get 0) }} +{{ end }} + +<div dir="rtl"> + {{ if eq ($.Scratch.Get "md") false }} + {{ .Inner }} + {{ else }} + {{ .Inner | markdownify }} + {{ end }} +</div> |