Merge remote-tracking branch 'upstream/dev' into fix/772/set-to-top-elem-on-scrollable-height

This commit is contained in:
Wen Junhua
2024-04-30 22:35:04 +08:00
51 changed files with 1422 additions and 280 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
>
{{- partial "head.html" . -}}
<body
class="m-auto flex h-screen max-w-7xl flex-col bg-neutral px-6 text-lg leading-7 text-neutral-900 sm:px-14 md:px-24 lg:px-32 dark:bg-neutral-800 dark:text-neutral"
class="m-auto flex h-screen max-w-7xl flex-col bg-neutral px-6 text-lg leading-7 text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32"
>
<div id="the-top" class="absolute flex self-center">
<a
+4 -4
View File
@@ -7,7 +7,7 @@
{{ 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">
<h1 class="mb-8 mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
{{ .Title | emojify }}
</h1>
{{ if or
@@ -17,14 +17,14 @@
(and (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true)) (ne .ReadingTime 0))
(.Params.showEdit | default (.Site.Params.article.showEdit | default false))
}}
<div class="mb-12 mt-8 text-base text-neutral-500 print:hidden dark:text-neutral-400">
<div class="mb-10 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta.html" (dict "context" . "scope" "single") }}
</div>
{{ end }}
{{ with $feature }}
<div class="prose">
{{ $altText := $.Params.featureAlt | default $.Params.coverAlt | default "" }}
{{ $class := "mb-6 -mt-4 rounded-md" }}
{{ $class := "mb-6 rounded-md" }}
{{ $webp := $.Page.Site.Params.enableImageWebp | default true }}
{{ partial "picture.html" (dict "img" . "alt" $altText "class" $class "lazy" false "webp" $webp) }}
{{ with $.Params.coverCaption }}
@@ -36,7 +36,7 @@
<section class="prose mt-0 flex max-w-full flex-col dark:prose-invert lg:flex-row">
{{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in .TableOfContents "<ul") }}
<div class="order-first px-0 lg:order-last lg:max-w-xs lg:ps-8">
<div class="toc pe-5 print:hidden lg:sticky lg:top-10">
<div class="toc pe-5 lg:sticky lg:top-10 print:hidden">
{{ partial "toc.html" . }}
</div>
</div>
+11
View File
@@ -10,5 +10,16 @@
src="{{ default "https://plausible.io/js/script.js" site.Params.plausibleAnalytics.script }}"
></script>
{{ end }}
{{ with site.Params.umamiAnalytics }}
{{- $region := "eu" }}
{{- if isset . "region" }}
{{- $region = .region }}
{{- end }}
<script
defer
src="https://{{ $region }}.umami.is/script.js"
data-website-id="{{ .site }}"
></script>
{{ end }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}
+1 -1
View File
@@ -1,4 +1,4 @@
<ol class="text-sm text-neutral-500 print:hidden dark:text-neutral-400">
<ol class="text-sm text-neutral-500 dark:text-neutral-400 print:hidden">
{{ template "crumb" (dict "p1" . "p2" .) }}
</ol>
{{ define "crumb" }}
+1 -1
View File
@@ -1,7 +1,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="rgb(255,255,255)" />
<meta name="theme-color" content="{{ .Site.Params.defaultThemeColor | default "#ffffff" }}" />
{{/* Title */}}
{{ if .IsHome -}}
<title>{{ .Site.Title | emojify }}</title>
+1 -1
View File
@@ -1,4 +1,4 @@
<header class="py-6 font-semibold text-neutral-900 print:hidden sm:py-10 dark:text-neutral">
<header class="py-6 font-semibold text-neutral-900 dark:text-neutral sm:py-10 print:hidden">
<nav class="flex items-start justify-between sm:items-center">
{{/* Site logo/title */}}
<div class="flex flex-row items-center">
+1 -1
View File
@@ -1,4 +1,4 @@
<header class="py-6 font-semibold text-neutral-900 print:hidden sm:py-10 dark:text-neutral">
<header class="py-6 font-semibold text-neutral-900 dark:text-neutral sm:py-10 print:hidden">
<nav class="flex items-start justify-between sm:items-center">
{{/* Site logo/title */}}
<div class="z-40 flex flex-row items-center">
+1 -1
View File
@@ -1,4 +1,4 @@
<header class="py-6 font-semibold text-neutral-900 print:hidden sm:py-10 dark:text-neutral">
<header class="py-6 font-semibold text-neutral-900 dark:text-neutral sm:py-10 print:hidden">
<nav class="flex items-start justify-between sm:items-center">
{{/* Site logo/title */}}
<div class="z-40 flex flex-row items-center">
+1 -1
View File
@@ -1,6 +1,6 @@
<div
id="search-wrapper"
class="invisible fixed inset-0 z-50 flex h-screen w-screen cursor-default flex-col bg-neutral-500/50 p-4 backdrop-blur-sm sm:p-6 md:p-[10vh] lg:p-[12vh] dark:bg-neutral-900/50"
class="invisible fixed inset-0 z-50 flex h-screen w-screen cursor-default flex-col bg-neutral-500/50 p-4 backdrop-blur-sm dark:bg-neutral-900/50 sm:p-6 md:p-[10vh] lg:p-[12vh]"
data-url="{{ "" | absLangURL }}"
>
<div
+2 -2
View File
@@ -1,10 +1,10 @@
<details open class="-ms-5 mt-0 overflow-hidden rounded-lg ps-5">
<summary
class="-ms-5 block cursor-pointer bg-neutral-100 py-1 ps-5 text-lg font-semibold text-neutral-800 lg:hidden dark:bg-neutral-700 dark:text-neutral-100"
class="block cursor-pointer bg-neutral-100 py-1 ps-5 text-lg font-semibold text-neutral-800 dark:bg-neutral-700 dark:text-neutral-100 lg:hidden"
>
{{ i18n "article.table_of_contents" }}
</summary>
<div class="-ms-5 border-s border-dotted border-neutral-300 py-2 ps-5 dark:border-neutral-600">
<div class="border-s border-dotted border-neutral-300 py-2 ps-5 dark:border-neutral-600">
{{ .TableOfContents | emojify }}
</div>
</details>
+1 -1
View File
@@ -5,7 +5,7 @@
{{ $altText := .Get "alt" }}
{{ $caption := .Get "caption" }}
{{ $href := .Get "href" }}
{{ $class := .Get "class" }}
{{ $class := default "mx-auto my-0 rounded-md" (.Get "class") }}
{{ $file := $url.Path }}
{{ $img := .Page.Resources.GetMatch $file }}