From 29fcd231e3da9b33c237886f3c1bb30a557ad641 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Sat, 19 Mar 2022 16:54:23 +0530 Subject: Initial Commit --- themes/PaperMod/layouts/404.html | 3 + .../layouts/_default/_markup/render-image.html | 1 + themes/PaperMod/layouts/_default/archives.html | 49 ++ themes/PaperMod/layouts/_default/baseof.html | 23 + themes/PaperMod/layouts/_default/index.json | 7 + themes/PaperMod/layouts/_default/list.html | 89 ++++ themes/PaperMod/layouts/_default/rss.xml | 50 ++ themes/PaperMod/layouts/_default/search.html | 29 ++ themes/PaperMod/layouts/_default/single.html | 59 +++ themes/PaperMod/layouts/_default/terms.html | 27 ++ .../layouts/partials/anchored_headings.html | 2 + themes/PaperMod/layouts/partials/author.html | 9 + themes/PaperMod/layouts/partials/breadcrumbs.html | 19 + themes/PaperMod/layouts/partials/comments.html | 3 + themes/PaperMod/layouts/partials/cover.html | 40 ++ themes/PaperMod/layouts/partials/edit_post.html | 8 + .../PaperMod/layouts/partials/extend_footer.html | 3 + themes/PaperMod/layouts/partials/extend_head.html | 4 + themes/PaperMod/layouts/partials/footer.html | 135 ++++++ themes/PaperMod/layouts/partials/head.html | 163 +++++++ themes/PaperMod/layouts/partials/header.html | 121 +++++ themes/PaperMod/layouts/partials/home_info.html | 13 + .../PaperMod/layouts/partials/index_profile.html | 23 + .../PaperMod/layouts/partials/post_canonical.html | 9 + themes/PaperMod/layouts/partials/post_meta.html | 21 + .../PaperMod/layouts/partials/post_nav_links.html | 19 + themes/PaperMod/layouts/partials/share_icons.html | 71 +++ themes/PaperMod/layouts/partials/social_icons.html | 7 + themes/PaperMod/layouts/partials/svg.html | 518 +++++++++++++++++++++ .../layouts/partials/templates/opengraph.html | 52 +++ .../layouts/partials/templates/schema_json.html | 119 +++++ .../layouts/partials/templates/twitter_cards.html | 33 ++ themes/PaperMod/layouts/partials/toc.html | 97 ++++ .../layouts/partials/translation_list.html | 19 + themes/PaperMod/layouts/robots.txt | 7 + themes/PaperMod/layouts/shortcodes/blockquote.html | 72 +++ themes/PaperMod/layouts/shortcodes/collapse.html | 8 + themes/PaperMod/layouts/shortcodes/figure.html | 31 ++ themes/PaperMod/layouts/shortcodes/ltr.html | 15 + themes/PaperMod/layouts/shortcodes/rawhtml.html | 2 + themes/PaperMod/layouts/shortcodes/rtl.html | 15 + 41 files changed, 1995 insertions(+) create mode 100644 themes/PaperMod/layouts/404.html create mode 100644 themes/PaperMod/layouts/_default/_markup/render-image.html create mode 100644 themes/PaperMod/layouts/_default/archives.html create mode 100644 themes/PaperMod/layouts/_default/baseof.html create mode 100644 themes/PaperMod/layouts/_default/index.json create mode 100644 themes/PaperMod/layouts/_default/list.html create mode 100644 themes/PaperMod/layouts/_default/rss.xml create mode 100644 themes/PaperMod/layouts/_default/search.html create mode 100644 themes/PaperMod/layouts/_default/single.html create mode 100644 themes/PaperMod/layouts/_default/terms.html create mode 100644 themes/PaperMod/layouts/partials/anchored_headings.html create mode 100644 themes/PaperMod/layouts/partials/author.html create mode 100644 themes/PaperMod/layouts/partials/breadcrumbs.html create mode 100644 themes/PaperMod/layouts/partials/comments.html create mode 100644 themes/PaperMod/layouts/partials/cover.html create mode 100644 themes/PaperMod/layouts/partials/edit_post.html create mode 100644 themes/PaperMod/layouts/partials/extend_footer.html create mode 100644 themes/PaperMod/layouts/partials/extend_head.html create mode 100644 themes/PaperMod/layouts/partials/footer.html create mode 100644 themes/PaperMod/layouts/partials/head.html create mode 100644 themes/PaperMod/layouts/partials/header.html create mode 100644 themes/PaperMod/layouts/partials/home_info.html create mode 100644 themes/PaperMod/layouts/partials/index_profile.html create mode 100644 themes/PaperMod/layouts/partials/post_canonical.html create mode 100644 themes/PaperMod/layouts/partials/post_meta.html create mode 100644 themes/PaperMod/layouts/partials/post_nav_links.html create mode 100644 themes/PaperMod/layouts/partials/share_icons.html create mode 100644 themes/PaperMod/layouts/partials/social_icons.html create mode 100644 themes/PaperMod/layouts/partials/svg.html create mode 100644 themes/PaperMod/layouts/partials/templates/opengraph.html create mode 100644 themes/PaperMod/layouts/partials/templates/schema_json.html create mode 100644 themes/PaperMod/layouts/partials/templates/twitter_cards.html create mode 100644 themes/PaperMod/layouts/partials/toc.html create mode 100644 themes/PaperMod/layouts/partials/translation_list.html create mode 100644 themes/PaperMod/layouts/robots.txt create mode 100644 themes/PaperMod/layouts/shortcodes/blockquote.html create mode 100644 themes/PaperMod/layouts/shortcodes/collapse.html create mode 100644 themes/PaperMod/layouts/shortcodes/figure.html create mode 100644 themes/PaperMod/layouts/shortcodes/ltr.html create mode 100644 themes/PaperMod/layouts/shortcodes/rawhtml.html create mode 100644 themes/PaperMod/layouts/shortcodes/rtl.html (limited to 'themes/PaperMod/layouts') 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" }} +
404
+{{- 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 @@ +{{ .Text }} 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" }} + + + +{{- $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" }} +
+

+ {{- replace .Key "0001" "" }}  {{ len .Pages }} +

+ {{- range .Pages.GroupByDate "January" }} +
+

{{- .Key }}  {{ len .Pages }}

+
+ {{- range .Pages }} + {{- if eq .Kind "page" }} +
+

+ {{- .Title | markdownify }} + {{- if .Draft }}  [draft]{{- end }} +

+
+ {{- partial "post_meta.html" . -}} +
+ +
+ {{- end }} + {{- end }} +
+
+ {{- end }} +
+{{- 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 @@ + + + + + {{- partial "head.html" . }} + + + + {{- partialCached "header.html" . .Page -}} +
+ {{- block "main" . }}{{ end }} +
+ {{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") (.Param "ShowCodeCopyButtons") -}} + + + 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 }} + +{{- end }} + +{{- if .Content }} +
+ {{- if not (.Param "disableAnchoredHeadings") }} + {{- partial "anchored_headings.html" .Content -}} + {{- else }}{{ .Content }}{{ end }} +
+{{- 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 }} + +
+ {{- $isHidden := (.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInList) }} + {{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }} +
+

+ {{- .Title }} + {{- if .Draft }}  [draft]{{- end }} +

+
+ {{- if (ne (.Param "hideSummary") true) }} +
+

{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}

+
+ {{- end }} + {{- if not (.Param "hideMeta") }} + + {{- end }} + +
+{{- end }} + +{{- if gt $paginator.TotalPages 1 }} + +{{- 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 "" | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} + {{- with $.Site.Params.images }} + + {{ index . 0 | absURL }} + {{ index . 0 | absURL }} + + {{- end }} + Hugo -- gohugo.io{{ with .Site.LanguageCode }} + {{.}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}}{{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end -}} + {{ range $pages }} + {{- if and (ne .Layout `search`) (ne .Layout `archives`) }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + {{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}} + {{- if .Site.Params.ShowFullTextinRSS }} + {{ (printf "" .Content) | safeHTML }} + {{- end }} + + {{- end }} + {{ end }} + + 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" }} + + + + + +{{- 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" }} + +
+
+ {{ partial "breadcrumbs.html" . }} +

+ {{ .Title }} + {{- if .Draft }}  [draft]{{- end }} +

+ {{- if .Description }} +
+ {{ .Description }} +
+ {{- end }} + {{- if not (.Param "hideMeta") }} + + {{- end }} +
+ {{- $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 }} +
+ {{- if not (.Param "disableAnchoredHeadings") }} + {{- partial "anchored_headings.html" .Content -}} + {{- else }}{{ .Content }}{{ end }} +
+ {{- end }} + + + + {{- if (.Param "comments") }} + {{- partial "comments.html" . }} + {{- end }} +
+ +{{- 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 }} + +{{- end }} + + + +{{- 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 "()" "${1}${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") -}} + +{{- 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) }} +
+ {{- $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 }}{{ 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)) }} + {{ $alt }} + {{- else }}{{/* Unprocessable image or responsive images disabled */}} + {{ $alt }} + {{- end }} + {{- else }}{{/* For absolute urls and external links, no img processing here */}} + {{- if $addLink }}{{ end -}} + {{ $alt }} + {{- end }} + {{- if $addLink }}{{ end -}} + {{/* Display Caption */}} + {{- if not $.IsHome }} + {{ with .Params.cover.caption }}

{{ . | markdownify }}

{{- end }} + {{- end }} +
+{{- 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 -}} + + {{- .Params.editPost.Text | default (.Site.Params.editPost.Text | default (i18n "edit_post" | default "Edit")) -}} + +{{- 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 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") }} + +{{- end }} + +{{- if (not .Site.Params.disableScrollToTop) }} + + + + + +{{- end }} + +{{- partial "extend_footer.html" . }} + + + +{{- if (not .Site.Params.disableScrollToTop) }} + +{{- end }} + +{{- if (not .Site.Params.disableThemeToggle) }} + +{{- end }} + +{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (.Param "ShowCodeCopyButtons")) }} + +{{- 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 @@ + + + +{{- if hugo.IsProduction | or (eq .Site.Params.env "production") }} + +{{- else }} + +{{- end }} + +{{- /* Title */}} +{{ if .IsHome }}{{ else }}{{ if .Title }}{{ .Title }} | {{ end }}{{ end }}{{ .Site.Title }} + +{{- /* Meta */}} +{{- if .IsHome }} +{{ with .Site.Params.keywords -}}{{ end }} +{{- else }} + +{{- end }} + + + +{{- if .Site.Params.analytics.google.SiteVerificationTag }} + +{{- end }} +{{- if .Site.Params.analytics.yandex.SiteVerificationTag }} + +{{- end }} +{{- if .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 }} + +{{- else }} + +{{- end }} + +{{- with .Site.Params.profileMode }} +{{- if and .enabled .imageUrl $.IsHome }} + +{{- end }} +{{- end }} + +{{- with .Site.Params.label.icon }} + +{{- end }} + +{{- /* Search */}} +{{- if (eq .Layout `search`) -}} + +{{- $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 }} + +{{- else }} +{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify }} + +{{- 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 }} + +{{- else }} +{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify }} + +{{- end }} +{{- end }} + +{{- /* Favicons */}} + + + + + + + + +{{- /* RSS */}} +{{ range .AlternativeOutputFormats -}} + +{{ end -}} +{{- range .AllTranslations -}} + +{{ end -}} + + + +{{- 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") }} + +{{- /* theme is dark */}} +{{- else if (eq .Site.Params.defaultTheme "dark") }} + +{{- else }} +{{- /* theme is auto */}} + +{{- end }} +{{- /* theme-toggle is disabled and theme is auto */}} +{{- else if (and (ne .Site.Params.defaultTheme "light") (ne .Site.Params.defaultTheme "dark"))}} + +{{- end }} + +
+ +
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 }} +
+
+

{{ .Title | markdownify }}

+
+
+

{{ .Content | markdownify }}

+
+
+ {{ partial "social_icons.html" $.Site.Params.socialIcons }} +
+
+{{- 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 @@ +
+ {{- with .Site.Params.profileMode }} +
+ {{- if .imageUrl -}} + {{ .imageTitle | default + {{- end }} +

{{ .title | default $.Site.Title | markdownify }}

+ {{ .subtitle | markdownify }} + {{- partial "social_icons.html" $.Site.Params.socialIcons -}} + + {{- with .buttons }} +
+ {{- range . }} + + {{ .name | title }} + + {{- end }} +
+ {{- end }} +
+ {{- end}} +
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 -}} + + {{- (.Site.Params.CanonicalLinkText | default .Params.CanonicalLinkText) | default "Originally published at" -}} +  {{ $url.Host }} + +{{- 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 "%s" (.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 . ) }} + +{{- 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 }} + +
+ {{- if (cond ($custom) (in $ShareButtons "twitter") (true)) }} + + + + + + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "linkedin") (true)) }} + + + + + + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "reddit") (true)) }} + + + + + + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "facebook") (true)) }} + + + + + + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "whatsapp") (true)) }} + + + + + + {{- end }} + {{- if (cond ($custom) (in $ShareButtons "telegram") (true)) }} + + + + + + {{- end }} +
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 @@ +
+ {{- range . }} + + {{ partial "svg.html" . }} + + {{- end }} +
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") -}} + + + + +{{- else if (eq $icon_name "adobestock") -}} + + + + +{{- else if (eq $icon_name "behance") -}} + + + +{{- else if (eq $icon_name "bilibili") -}} + + + + + + + +{{- else if (eq $icon_name "buymeacoffee") -}} + + + + + + + + + + + + + + + + +{{- else if (eq $icon_name "codepen") -}} + + + + + + + +{{- else if (eq $icon_name "cryptohack") -}} + + + + + + +{{- else if (eq $icon_name "ctftime") -}} + + + + + + +{{- else if (eq $icon_name "cv") -}} + + + + + + +{{- else if (eq $icon_name "dev") -}} + + + +{{- else if (eq $icon_name "deezer") -}} + + + +{{- else if (eq $icon_name "discogs") -}} + + + +{{- else if (eq $icon_name "discord") -}} + + + + +{{- else if (eq $icon_name "dreamstime") -}} + + + +{{- else if (eq $icon_name "dribbble") -}} + + + + + +{{- else if (eq $icon_name "email") -}} + + + + +{{- else if (eq $icon_name "facebook") -}} + + + +{{- else if (eq $icon_name "flickr") -}} + + + +{{- else if (eq $icon_name "freepik") -}} + + + + + + +{{- else if (eq $icon_name "gitea") -}} + + + +{{- else if (eq $icon_name "github") -}} + + + + +{{- else if (eq $icon_name "gitlab") -}} + + + + +{{- else if (eq $icon_name "goodreads") -}} + + + +{{- else if (eq $icon_name "googlescholar") -}} + + + +{{- else if (eq $icon_name "hackerone") -}} + + + +{{- else if (eq $icon_name "hackerrank") -}} + + + + + + +{{- else if (eq $icon_name "hackthebox") -}} + + + + + + +{{- else if (eq $icon_name "instagram") -}} + + + + + +{{- else if (eq $icon_name "itchio") -}} + + + +{{- else if (eq $icon_name "kaggle") -}} + + + +{{- else if (eq $icon_name "kakaotalk") -}} + + + + + + + +{{- else if (eq $icon_name "keybase") -}} + + + +{{- else if (eq $icon_name "kofi") -}} + + + +{{- else if (eq $icon_name "komoot") -}} + + + +{{- else if (eq $icon_name "lastfm") -}} + + + +{{- else if (eq $icon_name "letterboxd") -}} + + + +{{- else if (eq $icon_name "liberapay") -}} + + + + + + +{{- else if (eq $icon_name "linkedin") -}} + + + + + +{{- else if (eq $icon_name "mastodon") -}} + + + + +{{- else if (eq $icon_name "matrix") -}} + + + +{{- else if (eq $icon_name "medium") -}} + + + + + +{{- else if (eq $icon_name "mixcloud") -}} + + + +{{- else if (eq $icon_name "nuget") -}} + + + + + + + + +{{- else if (eq $icon_name "paypal") -}} + + + +{{- else if or (eq $icon_name "pgpkey") (eq $icon_name "key") -}} + + + + +{{- else if (eq $icon_name "phone") -}} + + + + + +{{- else if (eq $icon_name "polywork") -}} + +{{- else if (eq $icon_name "qq") -}} + + + + +{{- else if (eq $icon_name "reddit") -}} + + + +{{- else if (eq $icon_name "researchgate") -}} + + + +{{- else if (eq $icon_name "rss") -}} + + + + + +{{- else if (eq $icon_name "serverfault") -}} + + + +{{- else if (eq $icon_name "soundcloud") -}} + + + +{{- else if (eq $icon_name "shutterstock") -}} + + + + +{{- else if (eq $icon_name "slack") -}} + + + + + + + +{{- else if (eq $icon_name "snapchat") -}} + + + +{{- else if (eq $icon_name "sourcerer") -}} + + + + + + + + + + + + +{{- else if (eq $icon_name "spotify") -}} + + + +{{- else if (eq $icon_name "stackoverflow") -}} + + + +{{- else if (eq $icon_name "steam") -}} + + + +{{- else if (eq $icon_name "telegram") -}} + + + +{{- else if (eq $icon_name "twitch") -}} + + + +{{- else if (eq $icon_name "twitter") -}} + + + + +{{- else if (eq $icon_name "unsplash") -}} + + + + +{{- else if (eq $icon_name "xda") -}} + + + +{{- else if (eq $icon_name "xing") -}} + + + + +{{- else if (eq $icon_name "ycombinator") -}} + + + +{{- else if (eq $icon_name "youtube") -}} + + + + + +{{- else if $icon_name -}} + + + + +{{- 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 @@ + + + + +{{- if .Params.cover.image -}} +{{- if (ne .Params.cover.relative true) }} + +{{- else}} + +{{- end}} +{{- else }} + +{{- with $.Params.images -}} +{{- range first 6 . }}{{ end -}} +{{- else -}} +{{- $images := $.Resources.ByType "image" -}} +{{- $featured := $images.GetMatch "*feature*" -}} +{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} +{{- with $featured -}} + +{{- else -}} +{{- with $.Site.Params.images }}{{ end -}} +{{- end -}} +{{- end -}} +{{- end }} + +{{- if .IsPage }} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} + +{{ with .PublishDate }}{{ end }} +{{ with .Lastmod }}{{ end }} +{{- end -}} + +{{- with .Params.audio }}{{ end }} +{{- with .Params.locale }}{{ end }} +{{- with .Site.Params.title }}{{ end }} +{{- with .Params.videos }}{{- range . }} + +{{ 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 }}{{ end }} + {{- end }} +{{ end }}{{ end }} + +{{- /* Facebook Page Admin ID for Domain Insights */}} +{{- with .Site.Social.facebook_admin }}{{ 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 }} + +{{- 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 }} + +{{- if .IsPage }} + +{{- 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 -}} + +{{- if (ne $.Params.cover.relative true) }} + +{{- else }} + +{{- end}} +{{- else }} +{{- with $.Params.images -}} + + +{{ else -}} +{{- $images := $.Resources.ByType "image" -}} +{{- $featured := $images.GetMatch "*feature*" -}} +{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} +{{- with $featured -}} + + +{{- else -}} +{{- with $.Site.Params.images -}} + + +{{ else -}} + +{{- end -}} +{{- end -}} +{{- end }} +{{- end }} + + +{{ with .Site.Social.twitter -}} + +{{ 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 "(.|\n])+?
" .Content -}} +{{- $has_headers := ge (len $headers) 1 -}} +{{- if $has_headers -}} +
+
+ + {{- i18n "toc" | default "Table of Contents" }} + + +
+ {{- 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 -}} +
    + {{- range seq (sub $firstHeaderLevel $largest) -}} +
      + {{- $.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 "((.|\n])+?)" "$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) -}} +
        + {{/* the first should not be recorded */}} + {{- if ne $prevHeaderLevel . -}} + {{- $.Scratch.Add "bareul" . -}} + {{- end -}} + {{- end -}} + {{- else -}} + + {{- if lt $headerLevel $prevHeaderLevel -}} + {{- range seq (sub $prevHeaderLevel 1) -1 $headerLevel -}} + {{- if in ($.Scratch.Get "bareul") . -}} +
      + {{/* 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 -}} +
    + + {{- end -}} + {{- end -}} + {{- end -}} + {{- end }} +
  • + {{- $header | safeHTML -}} + {{- else }} +
  • + {{- $header | safeHTML -}} + {{- end -}} + {{- end -}} + + {{- $firstHeaderLevel := $largest }} + {{- $lastHeaderLevel := len (seq (index (findRE "[1-6]" (index $headers (sub (len $headers) 1)) 1) 0)) }} +
  • + {{- range seq (sub $lastHeaderLevel $firstHeaderLevel) -}} + {{- if in ($.Scratch.Get "bareul") (add . $firstHeaderLevel) }} +
+ {{- else }} + + + {{- end -}} + {{- end }} + + {{- end }} +
+
+
+{{- 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 }} + +{{- 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 @@ + + + + + +{{ $.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 }} + +{{ end }} + + + +{{ with $.Scratch.Get "bl_title" }} + +{{ else }} + {{ with $.Scratch.Get "bl_link" }} + {{ range last 1 (split ($.Scratch.Get "bl_link" ) "://") }} + {{ $.Scratch.Set "title_without_protocol" . }} + {{ end }} + {{ range last 1 (split ($.Scratch.Get "title_without_protocol" ) "www.") }} + {{ $.Scratch.Set "title_without_protocol" . }} + {{ end }} + {{ $.Scratch.Set "bl_title" ($.Scratch.Get "title_without_protocol") }} + + + {{ if (gt (len ($.Scratch.Get "title_without_protocol") ) 32) }} + {{ $title := (slicestr ($.Scratch.Get "title_without_protocol") 0 32) }} + {{ $split_by_fw_slash := split $title "/" }} + {{ $count := (sub (len $split_by_fw_slash) 1) }} + + {{ $.Scratch.Set "tempstring" "" }} + {{ range first $count $split_by_fw_slash }} + {{ $.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 }} + +
+

{{ .Inner | markdownify }}

+ +
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 }} +

+ {{ .Get "summary" | markdownify }} + {{ .Inner | markdownify }} +

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 @@ + + {{- if .Get "link" -}} + + {{- end }} + {{ with .Get + {{- if .Get "link" }}{{ end -}} + {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} +
+ {{ with (.Get "title") -}} + {{ . }} + {{- end -}} + {{- if or (.Get "caption") (.Get "attr") -}}

+ {{- .Get "caption" | markdownify -}} + {{- with .Get "attrlink" }} + + {{- end -}} + {{- .Get "attr" | markdownify -}} + {{- if .Get "attrlink" }}{{ end }}

+ {{- end }} +
+ {{- end }} + 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 }} + +
+ {{ if eq ($.Scratch.Get "md") false }} + {{ .Inner }} + {{ else }} + {{ .Inner | markdownify }} + {{ end }} +
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 @@ + +{{.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 }} + +
+ {{ if eq ($.Scratch.Get "md") false }} + {{ .Inner }} + {{ else }} + {{ .Inner | markdownify }} + {{ end }} +
-- cgit v1.2.3