-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
284 additions
and
10 deletions.
There are no files selected for viewing
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html lang="{{ with .Site.Params.isoCode | default (.Site.LanguageCode | default " en") }} {{- . -}} {{ end }}" dir="{{ if .Site.Params.rtl | default false -}} | ||
rtl | ||
{{- else -}} | ||
ltr | ||
{{- end }}" class="scroll-smooth" data-default-appearance="{{ .Site.Params.defaultAppearance | default " light" }}" | ||
data-auto-appearance="{{ .Site.Params.autoSwitchAppearance | default " true" }}"> | ||
{{- partial "head.html" . -}} | ||
|
||
<body | ||
class="flex flex-col h-screen m-auto text-lg bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600"> | ||
<div id="the-top" class="absolute flex self-center"> | ||
<a class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 focus:translate-y-0 dark:bg-neutral-600" | ||
href="#main-content"><span | ||
class="font-bold text-primary-600 ltr:pr-2 rtl:pl-2 dark:text-primary-400">↓</span>{{ i18n | ||
"nav.skip_to_main" }}</a> | ||
</div> | ||
{{ $header := print "partials/header/" .Site.Params.header.layout ".html" }} | ||
{{ if templates.Exists $header }} | ||
{{ partial $header . }} | ||
{{ else }} | ||
{{ partial "partials/header/basic.html" . }} | ||
{{ end }} | ||
<div class="relative flex flex-col grow"> | ||
<main id="main-content" class="grow"> | ||
{{ block "main" . }}{{ end }} | ||
{{ if and (.Site.Params.footer.showScrollToTop | default true) (gt .WordCount 1) }} | ||
{{- partial "scroll-to-top.html" . -}} | ||
{{ end }} | ||
</main> | ||
{{- partial "footer.html" . -}} | ||
{{ if .Site.Params.enableSearch | default false }} | ||
{{- partial "search.html" . -}} | ||
{{ end }} | ||
</div> | ||
</body> | ||
{{ if .Site.Params.buymeacoffee.globalWidget | default false }} | ||
<script data-name="BMC-Widget" data-cfasync="false" src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js" | ||
data-id="{{ .Site.Params.buymeacoffee.identifier }}" data-description="Support me on Buy me a coffee!" data-message="{{ .Site.Params.buymeacoffee.globalWidgetMessage | default "" }}" | ||
data-color="{{ .Site.Params.buymeacoffee.globalWidgetColor | default "#FFDD00" }}" data-position="{{ .Site.Params.buymeacoffee.globalWidgetPosition | default "Left" }}" data-x_margin="18" data-y_margin="18"></script> | ||
{{ end }} | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
{{ define "main" }} | ||
{{ .Scratch.Set "scope" "single" }} | ||
|
||
<article class="sm:px-14 md:px-24 lg:px-32 grid place-items-center"> | ||
{{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }} | ||
{{ $heroStyle := .Params.heroStyle }} | ||
{{ if not $heroStyle }}{{ $heroStyle = .Site.Params.article.heroStyle }}{{ end }} | ||
{{ $heroStyle := print "partials/hero/" $heroStyle ".html" }} | ||
{{ if templates.Exists $heroStyle }} | ||
{{ partial $heroStyle . }} | ||
{{ else }} | ||
{{ partial "partials/hero/basic.html" . }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
<header id="single_header" class="mt-5 max-w-prose"> | ||
{{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }} | ||
{{ partial "breadcrumbs.html" . }} | ||
{{ end }} | ||
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral"> | ||
{{ .Title | emojify }} | ||
</h1> | ||
<div class="mt-1 mb-6 text-base text-neutral-500 dark:text-neutral-400 print:hidden justify-center"> | ||
{{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }} | ||
</div> | ||
|
||
{{ $authorsData := .Site.Data.authors }} | ||
{{ $taxonomies := .Site.Taxonomies.authors }} | ||
{{ $baseURL := .Site.BaseURL }} | ||
{{ $taxonomyLink := 0 }} | ||
{{ $showAuthor := 0 }} | ||
|
||
{{ if not (strings.HasSuffix $baseURL "/") }} | ||
{{ $baseURL = delimit (slice $baseURL "/") "" }} | ||
{{ end }} | ||
|
||
{{ if not (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }} | ||
|
||
{{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }} | ||
{{ $showAuthor = 1 }} | ||
{{ partial "author.html" . }} | ||
{{ end }} | ||
|
||
{{ range $author := .Page.Params.authors }} | ||
{{ $authorData := index $authorsData $author }} | ||
{{- if $authorData -}} | ||
{{ range $taxonomyname, $taxonomy := $taxonomies }} | ||
{{ if (eq $taxonomyname $author) }} | ||
{{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }} | ||
{{ end }} | ||
{{ end }} | ||
{{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $taxonomyLink) }} | ||
{{- end -}} | ||
{{ end }} | ||
|
||
{{ if or $taxonomyLink $showAuthor }} | ||
<div class="mb-5"></div> | ||
{{ end }} | ||
|
||
{{ end }} | ||
|
||
</header> | ||
|
||
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row"> | ||
|
||
{{ if or (and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in | ||
.TableOfContents "<ul")) (.Site.Params.article.showRelatedPosts | default false) }} <div | ||
class="order-first lg:ml-auto px-0 lg:order-last ltr:lg:pl-8 rtl:lg:pr-8"> | ||
<div class="toc ltr:pl-5 rtl:pr-5 print:hidden lg:sticky {{ if hasPrefix .Site.Params.header.layout "fixed" -}} | ||
lg:top-[140px]{{ else }}lg:top-10{{ end }}"> | ||
|
||
{{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in | ||
.TableOfContents "<ul") }} {{ partial "toc.html" . }} {{ end }} {{ if .Site.Params.article.showRelatedPosts | | ||
default false }} sd {{ end }} </div> | ||
</div> | ||
{{ end }} | ||
|
||
<div class="min-w-0 min-h-0 max-w-fit"> | ||
|
||
{{ partial "series/series.html" . }} | ||
|
||
<div class="article-content max-w-prose mb-20"> | ||
{{ .Content }} | ||
{{ $defaultReplyByEmail := .Site.Params.replyByEmail }} | ||
{{ $replyByEmail := default $defaultReplyByEmail .Params.replyByEmail }} | ||
{{ if $replyByEmail }} | ||
<strong class="block mt-8"> | ||
<a target="_blank" | ||
class="m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 hover:bg-primary-500 hover:text-neutral dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800" | ||
href="mailto:{{ .Site.Params.Author.email }}?subject={{ replace (printf "Reply to %s" .Title) "\"" "'" }}"> | ||
Reply by Email | ||
</a> | ||
</strong> | ||
{{ end }} | ||
</div> | ||
|
||
{{ if (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }} | ||
|
||
{{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }} | ||
{{ $showAuthor = 1 }} | ||
{{ partial "author.html" . }} | ||
{{ end }} | ||
|
||
{{ range $author := .Page.Params.authors }} | ||
{{ $authorData := index $authorsData $author }} | ||
{{- if $authorData -}} | ||
{{ range $taxonomyname, $taxonomy := $taxonomies }} | ||
{{ if (eq $taxonomyname $author) }} | ||
{{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }} | ||
{{ end }} | ||
{{ end }} | ||
{{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $taxonomyLink) }} | ||
{{- end -}} | ||
{{ end }} | ||
|
||
{{ if or $taxonomyLink $showAuthor }} | ||
<div class="mb-10"></div> | ||
{{ end }} | ||
|
||
{{ end }} | ||
|
||
{{ partial "series/series-closed.html" . }} | ||
{{ partial "sharing-links.html" . }} | ||
{{ partial "related.html" . }} | ||
</div> | ||
|
||
{{ $translations := .AllTranslations }} | ||
{{ with .File }} | ||
{{ $path := .Path }} | ||
{{range $translations}} | ||
{{ $lang := print "." .Lang ".md" }} | ||
{{ $path = replace $path $lang ".md" }} | ||
{{end}} | ||
<script> | ||
var oid = "views_{{ $path }}" | ||
var oid_likes = "likes_{{ $path }}" | ||
</script> | ||
{{ $jsPage := resources.Get "js/page.js" }} | ||
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }} | ||
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script> | ||
{{ end }} | ||
|
||
</section> | ||
<footer class="pt-8 max-w-prose print:hidden"> | ||
|
||
{{ partial "article-pagination.html" . }} | ||
{{ if .Params.showComments | default (.Site.Params.article.showComments | default false) }} | ||
{{ if templates.Exists "partials/comments.html" }} | ||
<div class="pt-3"> | ||
<hr class="border-dotted border-neutral-300 dark:border-neutral-600" /> | ||
<div class="pt-3"> | ||
{{ partial "comments.html" . }} | ||
</div> | ||
</div> | ||
{{ else }} | ||
{{ warnf "[BLOWFISH] Comments are enabled for %s but no comments partial exists." .File.Path }} | ||
{{ end }} | ||
{{ end }} | ||
</footer> | ||
</article> | ||
{{ end }} |
Oops, something went wrong.