update the theme
This commit is contained in:
parent
b1a7697b03
commit
58e2c9ae87
166 changed files with 326580 additions and 582 deletions
|
@ -1,29 +1,29 @@
|
|||
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
|
||||
{{ $url := urls.Parse .Destination }}
|
||||
{{ $altText := .Text }}
|
||||
{{ $caption := .Title }}
|
||||
{{ if findRE "^https?" $url.Scheme }}
|
||||
{{- $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
|
||||
{{- $url := urls.Parse .Destination }}
|
||||
{{- $altText := .Text }}
|
||||
{{- $caption := .Title }}
|
||||
{{- if findRE "^https?" $url.Scheme }}
|
||||
<figure>
|
||||
<img class="my-0 rounded-md" loading="lazy" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
{{ else }}
|
||||
{{ $resource := "" }}
|
||||
{{ if $.Page.Resources.GetMatch ($url.String) }}
|
||||
{{ $resource = $.Page.Resources.GetMatch ($url.String) }}
|
||||
{{ else if resources.GetMatch ($url.String) }}
|
||||
{{ $resource = resources.Get ($url.String) }}
|
||||
{{ end }}
|
||||
{{ with $resource }}
|
||||
{{- else }}
|
||||
{{- $resource := "" }}
|
||||
{{- if $.Page.Resources.GetMatch ($url.String) }}
|
||||
{{- $resource = $.Page.Resources.GetMatch ($url.String) }}
|
||||
{{- else if resources.GetMatch ($url.String) }}
|
||||
{{- $resource = resources.Get ($url.String) }}
|
||||
{{- end }}
|
||||
{{- with $resource }}
|
||||
<figure>
|
||||
{{ if $disableImageOptimization }}
|
||||
{{- if or $disableImageOptimization (eq .MediaType.SubType "svg")}}
|
||||
<img
|
||||
class="my-0 rounded-md"
|
||||
loading="lazy"
|
||||
src="{{ .RelPermalink }}"
|
||||
alt="{{ $altText }}"
|
||||
/>
|
||||
{{ else }}
|
||||
{{- else }}
|
||||
<img
|
||||
class="my-0 rounded-md"
|
||||
loading="lazy"
|
||||
|
@ -35,13 +35,13 @@
|
|||
src="{{ (.Resize "660x").RelPermalink }}"
|
||||
alt="{{ $altText }}"
|
||||
/>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
{{ else }}
|
||||
{{- else }}
|
||||
<figure>
|
||||
<img class="my-0 rounded-md" loading="lazy" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
@ -1,2 +1,7 @@
|
|||
<a href="{{ .Destination | safeURL }}" {{ with .Title}} title="{{ . }}"{{ end }} {{ if or (strings.HasPrefix .Destination "http:") (strings.HasPrefix .Destination "https:") }} target="_blank"{{ end }}>
|
||||
{{ .Text | safeHTML }}</a>
|
||||
<a href="{{ .Destination | safeURL }}"
|
||||
{{- with .Title -}}
|
||||
title="{{ . }}"
|
||||
{{- end }}
|
||||
{{- if or (strings.HasPrefix .Destination "http:") (strings.HasPrefix .Destination "https:") }} target="_blank"{{ end }}>
|
||||
{{- .Text | safeHTML -}}
|
||||
</a>
|
|
@ -8,7 +8,7 @@
|
|||
{{- partial "head.html" . -}}
|
||||
|
||||
<body
|
||||
class="flex flex-col h-screen px-6 m-auto text-lg leading-7 max-w-7xl bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32">
|
||||
class="flex flex-col h-screen px-6 m-auto text-lg leading-7 max-w-7xl bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32 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
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
"date" (.Date | time.Format (.Site.Language.Params.dateFormat | default ":date_long"))
|
||||
"title" (.Title | emojify | safeJS)
|
||||
"section" ($section.Title | emojify | safeJS)
|
||||
"summary" (.Summary | emojify | safeJS)
|
||||
"content" (.Plain | emojify | safeJS)
|
||||
"summary" (.Summary | safeJS)
|
||||
"content" (.Plain | safeJS)
|
||||
"permalink" .RelPermalink
|
||||
"externalUrl" .Params.externalUrl
|
||||
"type" .Type
|
||||
) -}}
|
||||
{{- end -}}
|
||||
{{- $index | jsonify -}}
|
||||
{{- $index | jsonify -}}
|
|
@ -49,9 +49,9 @@
|
|||
</div>
|
||||
{{ end }}
|
||||
<div class="min-w-0 min-h-0 max-w-prose">
|
||||
{{ .Content | emojify }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -61,80 +61,73 @@
|
|||
{{ $cardView := .Params.cardView | default (.Site.Params.list.cardView | default false) }}
|
||||
{{ $cardViewScreenWidth := .Params.cardViewScreenWidth | default (.Site.Params.list.cardViewScreenWidth | default false) }}
|
||||
{{ $groupByYear := .Params.groupByYear | default ($.Site.Params.list.groupByYear | default false) }}
|
||||
{{ $orderByWeight := .Params.orderByWeight | default ($.Site.Params.list.orderByWeight | default false) }}
|
||||
{{ $groupByYear := and (not $orderByWeight) $groupByYear }}
|
||||
|
||||
{{ if not $cardView }}
|
||||
|
||||
<section class="space-y-10 w-full">
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
{{ if $groupByYear }}
|
||||
<h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
|
||||
{{ .Key }}
|
||||
</h2>
|
||||
{{ end }}
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
{{ if not $orderByWeight }}
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
{{ if $groupByYear }}
|
||||
<h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
|
||||
{{ .Key }}
|
||||
</h2>
|
||||
{{ end }}
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ range (.Paginate (.Pages.ByWeight)).Pages }}
|
||||
{{ partial "article-link/simple.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
{{ else if and $cardView (not $cardViewScreenWidth) }}
|
||||
{{ else }}
|
||||
|
||||
{{ if $groupByYear }}
|
||||
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
<h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
|
||||
{{ .Key }}
|
||||
</h2>
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
|
||||
{{ if $cardViewScreenWidth }}
|
||||
<div class="relative w-screen max-w-[1600px] px-[30px]" style="left: calc(max(-50vw,-800px) + 50%);">
|
||||
{{ end }}
|
||||
<h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
|
||||
{{ .Key }}
|
||||
</h2>
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 {{ if $cardViewScreenWidth }} xl:grid-cols-4 2xl:grid-cols-5 {{ end }}">
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ if $cardViewScreenWidth }} </div> {{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ else }}
|
||||
{{ else }}
|
||||
|
||||
{{ if $cardViewScreenWidth }}
|
||||
<div class="relative w-screen max-w-[1600px] px-[30px]" style="left: calc(max(-50vw,-800px) + 50%);">
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
|
||||
{{ else }}
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
|
||||
{{ end }}
|
||||
{{ if not $orderByWeight }}
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ range (.Paginate (.Pages.ByWeight)).Pages }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ if $cardViewScreenWidth }} </div> {{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ else if and $cardView $cardViewScreenWidth }}
|
||||
|
||||
{{ if $groupByYear }}
|
||||
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
<div class="relative w-screen max-w-[1600px] px-[30px]" style="left: calc(max(-50vw,-800px) + 50%);">
|
||||
<h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
|
||||
{{ .Key }}
|
||||
</h2>
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ else }}
|
||||
|
||||
<div class="relative w-screen max-w-[1600px] px-[30px]" style="left: calc(max(-50vw,-800px) + 50%);">
|
||||
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
|
||||
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-link/card.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{ else }}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</h1>
|
||||
</header>
|
||||
<section class="max-w-full mt-6 prose dark:prose-invert">
|
||||
{{ .Content | emojify }}
|
||||
{{ .Content }}
|
||||
</section>
|
||||
<footer class="pt-8">
|
||||
{{ partial "sharing-links.html" . }}
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
{{ partial "series/series.html" . }}
|
||||
|
||||
<div class="article-content max-w-prose mb-20">
|
||||
{{ .Content | emojify }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
{{ if (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }}
|
||||
|
@ -147,4 +147,4 @@
|
|||
{{ end }}
|
||||
</footer>
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
{{ if .Content }}
|
||||
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
|
||||
<div class="min-w-0 min-h-0 max-w-prose">
|
||||
{{ .Content | emojify }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<section class="flex flex-col max-w-full mt-0 mb-5 prose dark:prose-invert lg:flex-row">
|
||||
{{ if .Content }}
|
||||
<div class="min-w-0 min-h-0 max-w-prose">
|
||||
{{ .Content | emojify }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<script>
|
||||
|
@ -128,4 +128,4 @@
|
|||
|
||||
{{ partial "pagination.html" . }}
|
||||
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
|
||||
<div class="py-1 prose dark:prose-invert">
|
||||
{{ .Summary | emojify }}
|
||||
{{ .Summary }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
@ -73,4 +73,4 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</a>
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
|
||||
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
|
||||
<div class="py-1 prose dark:prose-invert">
|
||||
{{ .Summary | emojify }}
|
||||
{{ .Summary }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
@ -74,4 +74,4 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</a>
|
||||
|
|
|
@ -94,8 +94,8 @@
|
|||
</div>
|
||||
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
|
||||
<div class="py-1 max-w-fit prose dark:prose-invert">
|
||||
{{ .Summary | emojify }}
|
||||
{{ .Summary }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</a>
|
||||
</a>
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
{{ $link := .link}}
|
||||
{{ with .data.name | markdownify | emojify }}
|
||||
<div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400">
|
||||
{{ i18n "author.byline_title" | markdownify | emojify }}
|
||||
{{ i18n "author.byline_title" | markdownify }}
|
||||
</div>
|
||||
<a {{ if $link }} href="{{ $link }}" {{ end }} class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
|
||||
{{ . }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ with .data.bio | markdownify | emojify }}
|
||||
{{ with .data.bio | markdownify }}
|
||||
<div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . }}</div>
|
||||
{{ end }}
|
||||
<div class="text-2xl sm:text-lg">
|
||||
|
@ -41,4 +41,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -23,15 +23,15 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
<div class="place-self-center">
|
||||
{{ with .Site.Author.name | markdownify | emojify }}
|
||||
{{ with .Site.Author.name | markdownify }}
|
||||
<div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400">
|
||||
{{ i18n "author.byline_title" | markdownify | emojify }}
|
||||
{{ i18n "author.byline_title" | markdownify }}
|
||||
</div>
|
||||
<div class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
|
||||
{{ . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ with .Site.Author.bio | markdownify | emojify }}
|
||||
{{ with .Site.Author.bio | markdownify }}
|
||||
<div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . }}</div>
|
||||
{{ end }}
|
||||
<div class="text-2xl sm:text-lg">{{ partialCached "author-links.html" . }}</div>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
{{ partial "icon.html" .Pre }}
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ .Name | markdownify | emojify }}
|
||||
{{ .Name | markdownify }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
@ -27,11 +27,11 @@
|
|||
{{ if .Site.Params.footer.showCopyright | default true }}
|
||||
<p class="text-sm text-neutral-500 dark:text-neutral-400">
|
||||
{{- with replace .Site.Params.copyright "{ year }" now.Year }}
|
||||
{{ . | emojify | markdownify }}
|
||||
{{ . | markdownify }}
|
||||
{{- else }}
|
||||
©
|
||||
{{ now.Format "2006" }}
|
||||
{{ .Site.Author.name | markdownify | emojify }}
|
||||
{{ .Site.Author.name | markdownify }}
|
||||
{{- end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
|
@ -65,4 +65,4 @@
|
|||
{{ if templates.Exists "partials/extend-footer.html" }}
|
||||
{{ partialCached "extend-footer.html" . }}
|
||||
{{ end }}
|
||||
</footer>
|
||||
</footer>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{{ if $logo }}
|
||||
<div>
|
||||
<a href="{{ "" | relLangURL }}" class="flex">
|
||||
<span class="sr-only">{{ .Site.Title | markdownify | emojify }}</span>
|
||||
<span class="sr-only">{{ .Site.Title | markdownify }}</span>
|
||||
|
||||
<img src="{{ $logo.RelPermalink }}" width="{{ div $logo.Width 2 }}" height="{{ div $logo.Height 2 }}"
|
||||
class="logo max-h-[5rem] max-w-[5rem] object-scale-down object-left nozoom" alt="{{ .Site.Title }}" />
|
||||
|
@ -20,7 +20,7 @@
|
|||
{{ if not .Site.Params.disableTextInHeader | default true }}
|
||||
<a href="{{ "" | relLangURL }}" class="text-base font-medium text-gray-500 hover:text-gray-900">{{
|
||||
.Site.Title | markdownify
|
||||
| emojify }}</a>
|
||||
}}</a>
|
||||
{{ end }}
|
||||
|
||||
</nav>
|
||||
|
@ -129,7 +129,7 @@
|
|||
</span>
|
||||
{{ end }}
|
||||
<p class="text-sm font-sm text-gray-500 hover:text-gray-900" title="{{ .Title }}">
|
||||
{{ .Name | markdownify | emojify }}
|
||||
{{ .Name | markdownify }}
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
|
@ -157,7 +157,7 @@
|
|||
</span>
|
||||
{{ end }}
|
||||
<p class="text-xs font-light text-gray-500 hover:text-gray-900" title="{{ .Title }}">
|
||||
{{ .Name | markdownify | emojify }}
|
||||
{{ .Name | markdownify }}
|
||||
</p>
|
||||
</a>
|
||||
{{ end }}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</span>
|
||||
{{ end }}
|
||||
<p class="text-bg font-bg" title="{{ .Title }}">
|
||||
{{ .Name | markdownify | emojify }}
|
||||
{{ .Name | markdownify }}
|
||||
</p>
|
||||
<span>
|
||||
{{ partial "icon.html" "chevron-down" }}
|
||||
|
@ -23,9 +23,9 @@
|
|||
</span>
|
||||
{{ end }}
|
||||
<p class="text-sm font-small" title="{{ .Title }}">
|
||||
{{ .Name | markdownify | emojify }}
|
||||
{{ .Name | markdownify }}
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
<li class="mb-2"></li>
|
||||
<li class="mb-2"></li>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
</div>
|
||||
{{ end }}
|
||||
<p class="text-bg font-bg" title="{{ .Title }}">
|
||||
{{ .Name | markdownify | emojify }}
|
||||
{{ .Name | markdownify }}
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
</li>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
{{ end }}
|
||||
<a {{ if .URL }} href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
|
||||
target="_blank" {{ end }} {{ end }} class="text-base font-medium text-gray-500 hover:text-primary-600 dark:hover:text-primary-400" title="{{ .Title }}">
|
||||
{{ .Name | markdownify | emojify }}
|
||||
{{ .Name | markdownify }}
|
||||
</a>
|
||||
<span>
|
||||
{{ partial "icon.html" "chevron-down" }}
|
||||
|
@ -25,7 +25,7 @@
|
|||
</span>
|
||||
{{ end }}
|
||||
<p class="text-sm font-sm" title="{{ .Title }}">
|
||||
{{ .Name | markdownify | emojify }}
|
||||
{{ .Name | markdownify }}
|
||||
</p>
|
||||
</a>
|
||||
{{ end }}
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
</span>
|
||||
{{ end }}
|
||||
<p class="text-base font-medium" title="{{ .Title }}">
|
||||
{{ .Name | markdownify | emojify }}
|
||||
{{ .Name | markdownify }}
|
||||
</p>
|
||||
</a>
|
||||
</a>
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
</h1>
|
||||
{{ with .Site.Author.headline }}
|
||||
<h2 class="mt-0 mb-0 text-xl text-neutral-800 dark:text-neutral-300">
|
||||
{{ . | markdownify | emojify }}
|
||||
{{ . | markdownify }}
|
||||
</h2>
|
||||
{{ end }}
|
||||
<div class="mt-3 mb-10 text-2xl">
|
||||
|
@ -67,7 +67,7 @@
|
|||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<section class="prose dark:prose-invert">{{ .Content | emojify }}</section>
|
||||
<section class="prose dark:prose-invert">{{ .Content }}</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<h1>{{ . | emojify }}</h1>
|
||||
</header>
|
||||
{{ end }}
|
||||
<section>{{ .Content | emojify }}</section>
|
||||
<section>{{ .Content }}</section>
|
||||
</article>
|
||||
</div>
|
||||
<div class="mt-6 sm:mt-16 lg:mt-0 mx-auto max-w-xl px-4 sm:px-6 lg:mx-0 lg:max-w-none lg:py-16 lg:px-0">
|
||||
|
@ -40,4 +40,4 @@
|
|||
</div>
|
||||
<section>
|
||||
{{ partial "recent-articles/main.html" . }}
|
||||
</section>
|
||||
</section>
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
</h1>
|
||||
{{ with .Site.Author.headline }}
|
||||
<h2 class="mt-0 mb-0 text-xl text-neutral-300">
|
||||
{{ . | markdownify | emojify }}
|
||||
{{ . | markdownify }}
|
||||
</h2>
|
||||
{{ end }}
|
||||
<div class="mt-3 mb-10 text-2xl">
|
||||
|
@ -64,7 +64,7 @@
|
|||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
<section class="prose prose-invert">{{ .Content | emojify }}</section>
|
||||
<section class="prose prose-invert">{{ .Content }}</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<h1>{{ . | emojify }}</h1>
|
||||
</header>
|
||||
{{ end }}
|
||||
<section>{{ .Content | emojify }}</section>
|
||||
<section>{{ .Content }}</section>
|
||||
</article>
|
||||
<section>
|
||||
{{ partial "recent-articles/main.html" . }}
|
||||
|
|
|
@ -23,15 +23,15 @@
|
|||
</h1>
|
||||
{{ with .Site.Author.headline }}
|
||||
<h2 class="text-xl text-neutral-500 dark:text-neutral-400">
|
||||
{{ . | markdownify | emojify }}
|
||||
{{ . | markdownify }}
|
||||
</h2>
|
||||
{{ end }}
|
||||
<div class="mt-1 text-2xl">
|
||||
{{ partialCached "author-links.html" . }}
|
||||
</div>
|
||||
</header>
|
||||
<section class="prose dark:prose-invert">{{ .Content | emojify }}</section>
|
||||
<section class="prose dark:prose-invert">{{ .Content }}</section>
|
||||
</article>
|
||||
<section>
|
||||
{{ partial "recent-articles/main.html" . }}
|
||||
</section>
|
||||
</section>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<time datetime="{{ . }}">
|
||||
{{- i18n "article.date_updated" (dict "Date" (partial "functions/date.html" .)) | markdownify | emojify -}}
|
||||
{{- i18n "article.date_updated" (dict "Date" (partial "functions/date.html" .)) | markdownify -}}
|
||||
</time>
|
||||
{{- /* Trim EOF */ -}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<time datetime="{{ . }}">
|
||||
{{- i18n "article.date" (dict "Date" (partial "functions/date.html" .)) | markdownify | emojify -}}
|
||||
{{- i18n "article.date" (dict "Date" (partial "functions/date.html" .)) | markdownify -}}
|
||||
</time>
|
||||
{{- /* Trim EOF */ -}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<span>
|
||||
{{- i18n "article.word_count" .WordCount | markdownify | emojify -}}
|
||||
{{- i18n "article.word_count" .WordCount | markdownify -}}
|
||||
</span>
|
||||
{{- /* Trim EOF */ -}}
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
<a href="{{ $showMoreLinkDest }}">
|
||||
<button
|
||||
class="bg-transparent hover:text-primary-500 prose dark:prose-invert font-semibold hover:text-white py-2 px-4 border border-primary-500 hover:border-transparent rounded">
|
||||
{{ i18n "recent.show_more" | markdownify | emojify }}
|
||||
{{ i18n "recent.show_more" | markdownify }}
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<details open class="toc-right mt-0 overflow-hidden rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 hidden lg:block">
|
||||
<details open id="TOCView"
|
||||
class="toc-right mt-0 overflow-y-scroll overscroll-contain scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600 rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 hidden lg:block">
|
||||
<summary
|
||||
class="block py-1 text-lg font-semibold cursor-pointer bg-neutral-100 text-neutral-800 ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 dark:bg-neutral-700 dark:text-neutral-100 lg:hidden">
|
||||
{{ i18n "article.table_of_contents" }}
|
||||
</summary>
|
||||
<div
|
||||
class="min-w-[220px] py-2 border-dotted border-neutral-300 ltr:-ml-5 ltr:border-l ltr:pl-5 rtl:-mr-5 rtl:border-r rtl:pr-5 dark:border-neutral-600">
|
||||
class="min-w-[220px] py-2 border-dotted ltr:-ml-5 ltr:border-l ltr:pl-5 rtl:-mr-5 rtl:border-r rtl:pr-5 dark:border-neutral-600">
|
||||
{{ .TableOfContents | emojify }}
|
||||
</div>
|
||||
</details>
|
||||
|
@ -19,8 +20,33 @@
|
|||
</div>
|
||||
</details>
|
||||
|
||||
{{ if .Site.Params.smartTOC }}
|
||||
<script>
|
||||
|
||||
var margin = 200;
|
||||
var marginError = 50;
|
||||
|
||||
(function () {
|
||||
var $window = $(window);
|
||||
var $toc = $('#TOCView');
|
||||
var tocHeight = $toc.height();
|
||||
|
||||
function onResize() {
|
||||
var windowAndMarginHeight = $window.height() - margin;
|
||||
if(tocHeight >= windowAndMarginHeight) {
|
||||
$toc.css("overflow-y", "scroll")
|
||||
$toc.css("max-height", (windowAndMarginHeight + marginError) + "px")
|
||||
} else {
|
||||
$toc.css("overflow-y", "hidden")
|
||||
$toc.css("max-height", "9999999px")
|
||||
}
|
||||
}
|
||||
|
||||
$window.on('resize', onResize);
|
||||
$(document).ready(onResize);
|
||||
})();
|
||||
|
||||
{{ if .Site.Params.smartTOC }}
|
||||
|
||||
(function () {
|
||||
var $toc = $('#TableOfContents');
|
||||
if ($toc.length > 0) {
|
||||
|
@ -33,7 +59,7 @@
|
|||
h.each(function (i, e) {
|
||||
e = $(e);
|
||||
if (e.offset().top - $(window).height()/3 <= currentScroll) {
|
||||
id = e.attr('id');
|
||||
id = decodeURIComponent(e.attr('id'));
|
||||
}
|
||||
});
|
||||
var active = $toc.find('a.active');
|
||||
|
@ -61,5 +87,6 @@
|
|||
});
|
||||
}
|
||||
})();
|
||||
{{ end }}
|
||||
|
||||
</script>
|
||||
{{ end }}
|
|
@ -5,7 +5,7 @@
|
|||
{{ partial "icon.html" "language" }}
|
||||
</span>
|
||||
<div class="text-sm font-medium text-gray-500 hover:text-primary-600 dark:hover:text-primary-400" title="{{ .Title }}">
|
||||
{{- i18n "global.language" | markdownify | emojify -}}
|
||||
{{- i18n "global.language" | markdownify -}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="absolute menuhide">
|
||||
|
|
67
themes/blowfish/layouts/shortcodes/codeberg.html
Normal file
67
themes/blowfish/layouts/shortcodes/codeberg.html
Normal file
|
@ -0,0 +1,67 @@
|
|||
{{ $id := delimit (slice "codeberg" (partial "functions/uid.html" .)) "-" }}
|
||||
{{- $codebergURL := print "https://codeberg.org/api/v1/repos/" (.Get "repo") -}}
|
||||
{{- $codebergData := getJSON ($codebergURL) -}}
|
||||
{{- $codebergColors := .Site.Data.codebergColors -}}
|
||||
{{- with $codebergData -}}
|
||||
|
||||
<a id="{{ $id }}" target="_blank" href="{{ .html_url }}" class="cursor-pointer">
|
||||
<div
|
||||
class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">
|
||||
|
||||
<div class="flex items-center">
|
||||
<span class="text-2xl text-neutral-800 dark:text-neutral" style="margin-right:10px;">
|
||||
{{ partial "icon.html" "codeberg" }}
|
||||
</span>
|
||||
<div
|
||||
id="{{ $id }}-full_name"
|
||||
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ .full_name | markdownify }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .description | markdownify }}
|
||||
</p>
|
||||
|
||||
<div class="m-0 mt-2 flex items-center">
|
||||
|
||||
<span class="mr-1 inline-block h-3 w-3 rounded-full"
|
||||
style="background-color: {{ if .language }} {{- index $codebergColors .language -}} {{ else }} #0077b6 {{ end }}"></span>
|
||||
<div class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ if .language }} {{ .language }} {{ else }} null {{ end }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "star" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-stargazers" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .stars_count }}
|
||||
</div>
|
||||
|
||||
<span class="text-md mr-1 text-neutral-800 dark:text-neutral">
|
||||
{{ partial "icon.html" "fork" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-forks" class="m-0 mr-5 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .forks_count }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
fetch({{ $codebergURL }}, {
|
||||
headers: new Headers({
|
||||
'User-agent': 'Mozilla/4.0 Custom User Agent'
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
document.getElementById('{{ $id }}-full_name').innerHTML = data.full_name;
|
||||
document.getElementById('{{ $id }}-description').innerHTML = data.description;
|
||||
document.getElementById('{{ $id }}-stars_count').innerHTML = data.starts_count;
|
||||
document.getElementById('{{ $id }}-forks_count').innerHTML = data.forks_count;
|
||||
})
|
||||
.catch(error => console.error(error))
|
||||
</script>
|
||||
</a>
|
||||
{{- end -}}
|
8
themes/blowfish/layouts/shortcodes/codeimporter.html
Normal file
8
themes/blowfish/layouts/shortcodes/codeimporter.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
{{ $url := .Get "url" }}
|
||||
{{ $type := .Get "type" }}
|
||||
{{ with resources.GetRemote (urls.Parse $url) }}
|
||||
{{ $codeBlock := printf "```%s\n%s\n```" $type .Content }}
|
||||
{{ $codeBlock | markdownify }}
|
||||
{{ else }}
|
||||
{{ errorf "Code Importer Shortcode - Unable to get remote resource" . }}
|
||||
{{ end }}
|
|
@ -2,54 +2,49 @@
|
|||
{{ if .Get "default" }}
|
||||
{{ template "_internal/shortcodes/figure.html" . }}
|
||||
{{ else }}
|
||||
{{ $url := urls.Parse (.Get "src") }}
|
||||
{{ $altText := .Get "alt" }}
|
||||
{{ $caption := .Get "caption" }}
|
||||
{{ $href := .Get "href" }}
|
||||
{{ $class := .Get "class" }}
|
||||
{{ $target := .Get "target" }}
|
||||
{{ $nozoom := .Get "nozoom" | default false }}
|
||||
{{ if findRE "^https?" $url.Scheme }}
|
||||
<figure>
|
||||
<img class="my-0 rounded-md" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
{{ else }}
|
||||
{{ $resource := "" }}
|
||||
{{ if $.Page.Resources.GetMatch ($url.String) }}
|
||||
{{ $resource = $.Page.Resources.GetMatch ($url.String) }}
|
||||
{{ else if resources.GetMatch ($url.String) }}
|
||||
{{ $resource = resources.Get ($url.String) }}
|
||||
{{ end }}
|
||||
{{ with $resource }}
|
||||
<figure {{ with $class }}class="{{ . }}"{{ end }}>
|
||||
{{ with $href }}<a href="{{ . }}" {{ with $target }}target="{{ . }}"{{ end }}>{{ end }}
|
||||
{{ if $disableImageOptimization }}
|
||||
<img
|
||||
class="my-0 rounded-md{{ if $nozoom }} nozoom{{ end }}"
|
||||
src="{{ .RelPermalink }}"
|
||||
alt="{{ $altText }}"
|
||||
/>
|
||||
{{ else }}
|
||||
<img
|
||||
class="my-0 rounded-md{{ if $nozoom }} nozoom{{ end }}"
|
||||
srcset="
|
||||
{{ (.Resize "330x").RelPermalink }} 330w,
|
||||
{{ (.Resize "660x").RelPermalink }} 660w,
|
||||
{{ (.Resize "1024x").RelPermalink }} 1024w,
|
||||
{{ (.Resize "1320x").RelPermalink }} 2x"
|
||||
src="{{ (.Resize "660x").RelPermalink }}"
|
||||
alt="{{ $altText }}"
|
||||
/>
|
||||
{{ end }}
|
||||
{{ if $href }}</a>{{ end }}
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
{{ else }}
|
||||
<figure>
|
||||
<img class="my-0 rounded-md{{ if $nozoom }} nozoom{{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- $url := urls.Parse (.Get "src") }}
|
||||
{{- $altText := .Get "alt" }}
|
||||
{{- $caption := .Get "caption" }}
|
||||
{{- $href := .Get "href" }}
|
||||
{{- $class := .Get "class" }}
|
||||
{{- $target := .Get "target" | default "_blank" }}
|
||||
{{- $nozoom := .Get "nozoom" | default false -}}
|
||||
|
||||
<figure>
|
||||
{{- with $href }}<a href="{{ . }}" {{ with $target }}target="{{ . }}"{{ end }}>{{ end -}}
|
||||
{{- if findRE "^https?" $url.Scheme }}
|
||||
<img class="my-0 rounded-md{{ with $nozoom }} nozoom{{ end }}{{ with $class }} {{ . }}{{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
{{- else }}
|
||||
{{- $resource := "" }}
|
||||
{{- if $.Page.Resources.GetMatch ($url.String) }}
|
||||
{{- $resource = $.Page.Resources.GetMatch ($url.String) }}
|
||||
{{- else if resources.GetMatch ($url.String) }}
|
||||
{{- $resource = resources.Get ($url.String) }}
|
||||
{{- end }}
|
||||
{{- with $resource }}
|
||||
{{- if or $disableImageOptimization (eq .MediaType.SubType "svg")}}
|
||||
<img
|
||||
class="my-0 rounded-md{{ with $nozoom }} nozoom{{ end }}{{ with $class }} {{ . }}{{ end }}"
|
||||
src="{{ .RelPermalink }}"
|
||||
alt="{{ $altText }}"
|
||||
/>
|
||||
{{- else }}
|
||||
<img
|
||||
class="my-0 rounded-md{{ with $nozoom }} nozoom{{ end }}{{ with $class }} {{ . }}{{ end }}"
|
||||
srcset="
|
||||
{{ (.Resize "330x").RelPermalink }} 330w,
|
||||
{{ (.Resize "660x").RelPermalink }} 660w,
|
||||
{{ (.Resize "1024x").RelPermalink }} 1024w,
|
||||
{{ (.Resize "1320x").RelPermalink }} 2x"
|
||||
src="{{ (.Resize "660x").RelPermalink }}"
|
||||
alt="{{ $altText }}"
|
||||
/>
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
<img class="my-0 rounded-md{{ with $nozoom }} nozoom{{ end }}{{ with $class }} {{ . }}{{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
{{ if $href }}</a>{{ end }}
|
||||
</figure>
|
||||
{{- end -}}
|
||||
|
|
|
@ -15,12 +15,12 @@
|
|||
<div
|
||||
id="{{ $id }}-full_name"
|
||||
class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ .full_name | markdownify | emojify }}
|
||||
{{ .full_name | markdownify }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .description | markdownify | emojify }}
|
||||
{{ .description | markdownify }}
|
||||
</p>
|
||||
|
||||
<div class="m-0 mt-2 flex items-center">
|
||||
|
@ -64,4 +64,4 @@
|
|||
.catch(error => console.error(error))
|
||||
</script>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
{{ partial "icon.html" "gitlab" }}
|
||||
</span>
|
||||
<div id="{{ $id }}-name_with_namespace" class="m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
||||
{{ .name_with_namespace | markdownify | emojify }}
|
||||
{{ .name_with_namespace | markdownify }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p id="{{ $id }}-description" class="m-0 mt-2 text-md text-neutral-800 dark:text-neutral">
|
||||
{{ .description | markdownify | emojify }}
|
||||
{{ .description | markdownify }}
|
||||
</p>
|
||||
|
||||
<div class="m-0 mt-2 flex items-center">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ $url := .Get "url"}}
|
||||
{{ with resources.GetRemote (printf $url) }}
|
||||
{{ with resources.GetRemote (urls.Parse $url) }}
|
||||
{{ .Content | markdownify }}
|
||||
{{ else }}
|
||||
{{ errorf "Mardown Importer Shortcode - Unable to get remote resource" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<ol class="border-l-2 list-none border-primary-500 dark:border-primary-300">
|
||||
<ol class="border-l-2 border-primary-500 dark:border-primary-300 list-none">
|
||||
{{- .Inner -}}
|
||||
</ol>
|
|
@ -3,7 +3,7 @@
|
|||
{{ $badge := .Get "badge" }}
|
||||
{{ $subheader := .Get "subheader" }}
|
||||
{{ $text := .Get "text" }}
|
||||
<li class="list-none">
|
||||
<li>
|
||||
<div class="flex flex-start">
|
||||
<div class="bg-primary-500 dark:bg-primary-300 text-neutral-50 dark:text-neutral-700 min-w-[30px] h-8 text-2xl flex items-center justify-center rounded-full -ml-12 mt-5">
|
||||
{{ partial "icon" $icon }}
|
||||
|
@ -26,7 +26,9 @@
|
|||
{{ $subheader }}
|
||||
</h4>
|
||||
{{ end }}
|
||||
<p class="text-gray-700 mb-6">{{- .Inner -}}</p>
|
||||
<div class="mb-6">
|
||||
{{- .Inner -}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue