diff options
| author | Eltrac <hi@guhub.cn> | 2025-09-10 15:54:14 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-09-10 15:54:14 +0800 |
| commit | 4c6b558d89ca33b4e57f31be2c1eb68a59e41038 (patch) | |
| tree | 965950ca9e0befa79d78b986c1ee9f9edd39bfdd /layouts | |
| parent | 3d8c42f80bc0cfea9722d99e236d46d075648544 (diff) | |
feat: add settings page and text altering options
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/_partials/home/home-nav.html | 5 | ||||
| -rw-r--r-- | layouts/_partials/scripts.html | 12 | ||||
| -rw-r--r-- | layouts/settings.html | 20 |
3 files changed, 33 insertions, 4 deletions
diff --git a/layouts/_partials/home/home-nav.html b/layouts/_partials/home/home-nav.html index d6e8960e..32d32644 100644 --- a/layouts/_partials/home/home-nav.html +++ b/layouts/_partials/home/home-nav.html @@ -19,6 +19,11 @@ (strings.HasPrefix $.Page.RelPermalink "/categories/") (strings.HasPrefix $.Page.RelPermalink "/tags/")) ) }} + {{ partial "home/home-nav-item" (dict + "text" (T "postNav.settings") + "link" "settings" + "active" (strings.HasPrefix $.Page.RelPermalink "/settings/") + ) }} {{ end }} <li class="absolute right-0 dark:invert"> diff --git a/layouts/_partials/scripts.html b/layouts/_partials/scripts.html index 7c000323..414b4216 100644 --- a/layouts/_partials/scripts.html +++ b/layouts/_partials/scripts.html @@ -1,3 +1,11 @@ +{{ with resources.Get "js/settings.js" }} +<script>{{ .Content | safeJS }}</script> +{{ end }} + +{{ with resources.Get "js/tooltip.js" }} +<script>{{ .Content | safeJS }}</script> +{{ end }} + {{- range .Site.Params.externalJSFiles }} <script src="{{ $.Site.Params.staticPrefix }}{{ . | relURL }}"></script> {{- end }} @@ -10,7 +18,3 @@ {{ if .File }} {{ partial "scripts/action-menu-js" (.File.UniqueID | urlize) }} {{ end }} - -{{ with resources.Get "js/tooltip.js" }} -<script>{{ .Content | safeJS }}</script> -{{ end }} diff --git a/layouts/settings.html b/layouts/settings.html new file mode 100644 index 00000000..862fd64e --- /dev/null +++ b/layouts/settings.html @@ -0,0 +1,20 @@ +{{ define "main" }} + <article id="settings"> + {{ partial "header" . }} + {{ partial "home/home-nav" . }} + + <h2>{{ T "settings.fontSize" . }}</h2> + <section class="shadow"> + <div id="text-alter-buttons" class="grid grid-cols-3"> + {{ $buttonClass := "font-extrabold bg-neutral-100 hover:bg-neutral-200/50 rounded py-5" }} + <button data-text-size="small" class="{{ $buttonClass }} text-sm md:text-base">{{ T "settings.sampleText" }}</button> + <button data-text-size="medium" class="{{ $buttonClass }} text-base md:text-lg">{{ T "settings.sampleText" }}</button> + <button data-text-size="large" class="{{ $buttonClass }} text-lg md:text-xl">{{ T "settings.sampleText" }}</button> + </div> + <div class="leading-relaxed bg-neutral-200/50 py-1 px-4 rounded"> + <p class="markdown-body">{{ T "settings.loremIpsum" . }}</p> + </div> + </section> + </article> +{{ partial "footer.html" . }} +{{ end }} |
