update the theme
This commit is contained in:
parent
008abb31c3
commit
3988dc59f8
50 changed files with 6947 additions and 6547 deletions
|
@ -32,6 +32,7 @@
|
|||
{{ (.Resize "660x").RelPermalink }} 660w,
|
||||
{{ (.Resize "1024x").RelPermalink }} 1024w,
|
||||
{{ (.Resize "1320x").RelPermalink }} 2x"
|
||||
data-zoom-src="{{ (.Resize "1320x").RelPermalink }}"
|
||||
src="{{ (.Resize "660x").RelPermalink }}"
|
||||
alt="{{ $altText }}"
|
||||
/>
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
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 }}
|
||||
{{ $header := print "header/" .Site.Params.header.layout ".html" }}
|
||||
{{ if templates.Exists ( printf "partials/%s" $header ) }}
|
||||
{{ partial $header . }}
|
||||
{{ else }}
|
||||
{{ partial "partials/header/basic.html" . }}
|
||||
{{ partial "header/basic.html" . }}
|
||||
{{ end }}
|
||||
<div class="relative flex flex-col grow">
|
||||
<main id="main-content" class="grow">
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
{{ .Scratch.Set "scope" "list" }}
|
||||
{{ if .Site.Params.list.showHero | default false }}
|
||||
{{ $heroStyle := print "partials/hero/" .Site.Params.list.heroStyle ".html" }}
|
||||
{{ if templates.Exists $heroStyle }}
|
||||
{{ $heroStyle := print "hero/" .Site.Params.list.heroStyle ".html" }}
|
||||
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
|
||||
{{ partial $heroStyle . }}
|
||||
{{ else }}
|
||||
{{ partial "partials/hero/basic.html" . }}
|
||||
{{ partial "hero/basic.html" . }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
{{ 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 }}
|
||||
{{ $heroStyle := print "hero/" $heroStyle ".html" }}
|
||||
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
|
||||
{{ partial $heroStyle . }}
|
||||
{{ else }}
|
||||
{{ partial "partials/hero/basic.html" . }}
|
||||
{{ partial "hero/basic.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
@ -49,7 +49,16 @@
|
|||
{{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $taxonomyLink) }}
|
||||
|
||||
{{ $finalLink := $taxonomyLink }}
|
||||
{{ $currentLang := $.Site.Language.Lang }}
|
||||
{{ if eq $.Site.LanguagePrefix "" }}
|
||||
{{ $finalLink = printf "%sauthors/%s/" $baseURL $author }}
|
||||
{{ else }}
|
||||
{{ $finalLink = printf "%s%s/authors/%s/" $baseURL $currentLang $author }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $finalLink) }}
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
{{ .Scratch.Set "scope" "term" }}
|
||||
{{ if .Site.Params.term.showHero | default false }}
|
||||
{{ $heroStyle := print "partials/hero/" .Site.Params.term.heroStyle ".html" }}
|
||||
{{ if templates.Exists $heroStyle }}
|
||||
{{ $heroStyle := print "hero/" .Site.Params.term.heroStyle ".html" }}
|
||||
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
|
||||
{{ partial $heroStyle . }}
|
||||
{{ else }}
|
||||
{{ partial "partials/hero/basic.html" . }}
|
||||
{{ partial "hero/basic.html" . }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
{{ .Scratch.Set "scope" "list" }}
|
||||
{{ if .Site.Params.taxonomy.showHero | default false }}
|
||||
{{ $heroStyle := print "partials/hero/" .Site.Params.taxonomy.heroStyle ".html" }}
|
||||
{{ if templates.Exists $heroStyle }}
|
||||
{{ $heroStyle := print "hero/" .Site.Params.taxonomy.heroStyle ".html" }}
|
||||
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
|
||||
{{ partial $heroStyle . }}
|
||||
{{ else }}
|
||||
{{ partial "partials/hero/basic.html" . }}
|
||||
{{ partial "hero/basic.html" . }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
{{ define "main" }}
|
||||
{{ $partial := print "partials/home/" .Site.Params.homepage.layout ".html" }}
|
||||
{{ if templates.Exists $partial }}
|
||||
{{ $partial := print "home/" .Site.Params.homepage.layout ".html" }}
|
||||
{{ if templates.Exists ( printf "partials/%s" $partial ) }}
|
||||
{{ partial $partial . }}
|
||||
{{ else }}
|
||||
{{ partial "partials/home/profile.html" . }}
|
||||
{{ partial "home/profile.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ $constrainItemsWidth := .Page.Site.Params.list.constrainItemsWidth | default false }}
|
||||
|
||||
{{ $articleClasses := "flex flex-wrap article" }}
|
||||
{{ $articleClasses := "flex flex-wrap md:flex-nowrap article" }}
|
||||
{{ if .Site.Params.list.showCards }}
|
||||
{{ $articleClasses = delimit (slice $articleClasses "border border-neutral-200 dark:border-neutral-700 border-2 rounded-md overflow-hidden") " " }}
|
||||
{{ else }}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
{{ else if not .p1.IsHome }}
|
||||
{{ template "crumb" (dict "p1" .p1.Site.Home "p2" .p2 ) }}
|
||||
{{ end }}
|
||||
<li class="inline {{ if or (eq .p1 .p2) (.p1.IsHome) }}hidden{{ end }}">
|
||||
<li class="{{ if or (eq .p1 .p2) (.p1.IsHome) }}hidden{{else}}inline{{ end }}">
|
||||
<a
|
||||
class="hover:underline decoration-neutral-300 dark:underline-neutral-600"
|
||||
href="{{ .p1.RelPermalink }}"
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
{{ $bundleJS := $assets.Get "js" | resources.Concat "js/main.bundle.js" | resources.Minify | resources.Fingerprint
|
||||
"sha512" }}
|
||||
<script defer type="text/javascript" id="script-bundle" src="{{ $bundleJS.RelPermalink }}"
|
||||
integrity="{{ $bundleJS.Data.Integrity }}" data-copy="{{ i18n " code.copy" }}" data-copied="{{ i18n " code.copied"
|
||||
integrity="{{ $bundleJS.Data.Integrity }}" data-copy="{{ i18n "code.copy" }}" data-copied="{{ i18n "code.copied"
|
||||
}}"></script>
|
||||
{{ end }}
|
||||
{{ if not .Site.Params.disableImageZoom | default true }}
|
||||
|
@ -115,9 +115,11 @@
|
|||
{{ with .Site.Params.Author.links }}
|
||||
{{ range $links := . }}
|
||||
{{ range $name, $url := $links }}
|
||||
{{ if not (strings.HasPrefix $url "mailto:") }}
|
||||
<link href="{{ $url }}" rel="me" />{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{/* Vendor */}}
|
||||
{{ partial "vendor.html" . }}
|
||||
{{/* Analytics */}}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div style="padding-left:0;padding-right:0;padding-top:2px;padding-bottom:3px"
|
||||
class="main-menu flex items-center justify-between px-4 py-6 sm:px-6 md:justify-start space-x-3">
|
||||
class="main-menu flex items-center justify-between px-4 py-6 sm:px-6 md:justify-start gap-x-3">
|
||||
{{ if .Site.Params.Logo }}
|
||||
{{ $logo := resources.Get .Site.Params.Logo }}
|
||||
{{ if $logo }}
|
||||
|
@ -30,7 +30,7 @@
|
|||
{{ end }}
|
||||
|
||||
</nav>
|
||||
<nav class="hidden md:flex items-center space-x-5 md:ml-12 h-12">
|
||||
<nav class="hidden md:flex items-center gap-x-5 md:ml-12 h-12">
|
||||
|
||||
{{ if .Site.Menus.main }}
|
||||
{{ range .Site.Menus.main }}
|
||||
|
@ -51,7 +51,7 @@
|
|||
{{/* Appearance switch */}}
|
||||
{{ if .Site.Params.footer.showAppearanceSwitcher | default false }}
|
||||
<div
|
||||
class="{{ if .Site.Params.footer.showScrollToTop | default true -}} ltr:mr-14 rtl:ml-14 {{- end }} flex items-center">
|
||||
class="{{ if .Site.Params.footer.showScrollToTop | default true -}} {{- end }} flex items-center">
|
||||
<button id="appearance-switcher" aria-label="Dark mode switcher" type="button" class="text-base hover:text-primary-600 dark:hover:text-primary-400">
|
||||
<div class="flex items-center justify-center dark:hidden">
|
||||
{{ partial "icon.html" "moon" }}
|
||||
|
@ -64,7 +64,7 @@
|
|||
{{ end }}
|
||||
|
||||
</nav>
|
||||
<div class="flex md:hidden items-center space-x-5 md:ml-12 h-12">
|
||||
<div class="flex md:hidden items-center gap-x-5 md:ml-12 h-12">
|
||||
|
||||
<span></span>
|
||||
|
||||
|
@ -79,7 +79,7 @@
|
|||
|
||||
{{/* Appearance switch */}}
|
||||
{{ if .Site.Params.footer.showAppearanceSwitcher | default false }}
|
||||
<button id="appearance-switcher-mobile" aria-label="Dark mode switcher" type="button" class="text-base hover:text-primary-600 dark:hover:text-primary-400" style="margin-right:5px">
|
||||
<button id="appearance-switcher-mobile" aria-label="Dark mode switcher" type="button" class="text-base hover:text-primary-600 dark:hover:text-primary-400 ltr:mr-1 rtl:ml-1">
|
||||
<div class="flex items-center justify-center dark:hidden">
|
||||
{{ partial "icon.html" "moon" }}
|
||||
</div>
|
||||
|
@ -91,7 +91,7 @@
|
|||
|
||||
</div>
|
||||
</div>
|
||||
<div class="-my-2 -mr-2 md:hidden">
|
||||
<div class="-my-2 md:hidden">
|
||||
|
||||
<label id="menu-button" class="block">
|
||||
{{ if .Site.Menus.main }}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="fixed inset-x-0 pl-[24px] pr-[24px]" style="z-index:100">
|
||||
<div id="menu-blur" class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom bg-neutral dark:bg-neutral-800"></div>
|
||||
<div class="relative max-w-[64rem] ml-auto mr-auto">
|
||||
{{ partial "partials/header/basic.html" . }}
|
||||
{{ partial "header/basic.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="min-h-[148px]"></div>
|
||||
<div class="fixed inset-x-0 pl-[24px] pr-[24px] bg-neutral dark:bg-neutral-800" style="z-index:100">
|
||||
<div class="relative max-w-[64rem] ml-auto mr-auto">
|
||||
{{ partial "partials/header/basic.html" . }}
|
||||
{{ partial "header/basic.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="fixed inset-x-0 pl-[24px] pr-[24px]" style="z-index:100">
|
||||
<div id="menu-blur" class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl shadow-2xl"></div>
|
||||
<div class="relative max-w-[64rem] ml-auto mr-auto">
|
||||
{{ partial "partials/header/basic.html" . }}
|
||||
{{ partial "header/basic.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="fixed inset-x-0 pl-[24px] pr-[24px]" style="z-index:100">
|
||||
<div id="menu-blur" class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl shadow-2xl"></div>
|
||||
<div class="relative max-w-[64rem] ml-auto mr-auto">
|
||||
{{ partial "partials/header/basic.html" . }}
|
||||
{{ partial "header/basic.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if $homepageImage }}
|
||||
<img class="w-full h-[1000px] object-cover m-0 nozoom" src="{{ $homepageImage.RelPermalink }}" role="presentation">
|
||||
<img class="w-full h-[1000px] object-cover m-0 nozoom" src="{{ $homepageImage.RelPermalink }}" role="presentation" style="margin: 0">
|
||||
<div
|
||||
class="absolute inset-0 h-[1000px] bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal">
|
||||
</div>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if $homepageImage }}
|
||||
<img class="h-full w-full object-cover m-0 nozoom" src="{{ $homepageImage.RelPermalink }}">
|
||||
<img class="h-full w-full object-cover m-0 nozoom" src="{{ $homepageImage.RelPermalink }}" style="margin: 0">
|
||||
<div
|
||||
class="absolute inset-0 bg-gradient-to-r from-primary-500 to-secondary-600 dark:from-primary-600 dark:to-secondary-800 mix-blend-multiply">
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
{{ else }}
|
||||
<div
|
||||
class="py-1 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">
|
||||
<a href="{{$post.Permalink}}">
|
||||
<a href="{{$post.RelPermalink}}">
|
||||
{{ i18n "article.part" }} {{ $post.Params.series_order }}: {{ $post.Params.title}}
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{ if .IsTranslated }}
|
||||
<div>
|
||||
<div class="cursor-pointer flex items-center nested-menu">
|
||||
<span class="mr-1">
|
||||
<span class="ltr:mr-1 rtl:ml-1">
|
||||
{{ 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 }}">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
|
||||
{{ if .Get "default" }}
|
||||
{{ template "_internal/shortcodes/figure.html" . }}
|
||||
{{ partial "shortcodes/figure.html" . }}
|
||||
{{ else }}
|
||||
{{- $url := urls.Parse (.Get "src") }}
|
||||
{{- $altText := .Get "alt" }}
|
||||
|
@ -37,6 +37,7 @@
|
|||
{{ (.Resize "1024x").RelPermalink }} 1024w,
|
||||
{{ (.Resize "1320x").RelPermalink }} 2x"
|
||||
src="{{ (.Resize "660x").RelPermalink }}"
|
||||
data-zoom-src="{{ (.Resize "1320x").RelPermalink }}"
|
||||
alt="{{ $altText }}"
|
||||
/>
|
||||
{{- end }}
|
||||
|
|
|
@ -1,5 +1,31 @@
|
|||
{{ $id := delimit (slice "gallery" (partial "functions/uid.html" .)) "-" }}
|
||||
|
||||
<div id="{{ $id }}" class="gallery">
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
{{ $page := .Page }}
|
||||
|
||||
{{/* find all img tags */}}
|
||||
{{ $imgTagRegex := `<img\s+[^>]*>` }}
|
||||
{{ $imgTags := findRE $imgTagRegex .Inner }}
|
||||
{{ $newContent := .Inner }}
|
||||
|
||||
{{ range $imgTags }}
|
||||
{{ $imgTag := . }}
|
||||
{{/* extract src attribute */}}
|
||||
{{ $srcRegex := `src=['"]([^'"]+)['"]` }}
|
||||
{{ $srcMatches := findRESubmatch $srcRegex $imgTag }}
|
||||
|
||||
{{ if $srcMatches }}
|
||||
{{ $srcFull := index (index $srcMatches 0) 0 }}
|
||||
{{ $src := index (index $srcMatches 0) 1 }}
|
||||
|
||||
{{ $resource := $page.Resources.GetMatch $src }}
|
||||
{{ if $resource }}
|
||||
{{ $newSrc := printf `src="%s"` $resource.RelPermalink }}
|
||||
{{ $newImg := replace $imgTag $srcFull $newSrc }}
|
||||
{{ $newContent = replace $newContent $imgTag $newImg }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $newContent | safeHTML }}
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
{{- $githubColors := .Site.Data.githubColors -}}
|
||||
{{- with $githubData -}}
|
||||
|
||||
<div class="github-card-wrapper">
|
||||
<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">
|
||||
|
@ -64,4 +65,5 @@
|
|||
.catch(error => console.error(error))
|
||||
</script>
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<div class="mermaid" align="center">
|
||||
{{ .Inner }}
|
||||
<pre>{{ .Inner | safeHTML }}</pre>
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
{{ $header := .Get "header" }}
|
||||
{{ $badge := .Get "badge" }}
|
||||
{{ $subheader := .Get "subheader" }}
|
||||
{{ $text := .Get "text" }}
|
||||
<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">
|
||||
|
@ -17,7 +16,7 @@
|
|||
{{ end }}
|
||||
{{ if $badge }}
|
||||
<h3 class="">
|
||||
{{ partial "badge" $badge}}
|
||||
{{ partial "badge" $badge}}
|
||||
</h3>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue