chore: update layouts

This commit is contained in:
2024-11-12 22:56:23 +09:00
parent 746023e0b7
commit b8d0068e6d
2 changed files with 57 additions and 16 deletions

View File

@@ -2,17 +2,10 @@
<!-- commons --> <!-- commons -->
{% assign urls = site.data.origin[type].jquery.js {% assign urls = site.data.origin[type].search.js %}
| append: ','
| append: site.data.origin[type].bootstrap.js
| append: ','
| append: site.data.origin[type].search.js
%}
<!-- layout specified --> <!-- layout specified -->
{% assign js_dist = '/assets/js/dist/' %}
{% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' %} {% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' %}
{% assign urls = urls | append: ',' | append: site.data.origin[type]['lazy-polyfill'].js %} {% assign urls = urls | append: ',' | append: site.data.origin[type]['lazy-polyfill'].js %}
@@ -20,7 +13,7 @@
<!-- image lazy-loading & popup & clipboard --> <!-- image lazy-loading & popup & clipboard -->
{% assign urls = urls {% assign urls = urls
| append: ',' | append: ','
| append: site.data.origin[type]['magnific-popup'].js | append: site.data.origin[type].glightbox.js
| append: ',' | append: ','
| append: site.data.origin[type].clipboard.js | append: site.data.origin[type].clipboard.js
%} %}
@@ -33,7 +26,7 @@
or page.layout == 'category' or page.layout == 'category'
or page.layout == 'tag' or page.layout == 'tag'
%} %}
{% assign locale = site.lang | split: '-' | first %} {% assign locale = include.lang | split: '-' | first %}
{% assign urls = urls {% assign urls = urls
| append: ',' | append: ','
@@ -67,11 +60,13 @@
{% assign js = 'commons' %} {% assign js = 'commons' %}
{% endcase %} {% endcase %}
{% capture script %}{{ js_dist }}{{ js }}.min.js{% endcapture %} {% capture script %}/assets/js/dist/{{ js }}.min.js{% endcapture %}
<script defer src="{{ script | relative_url }}"></script>
<script src="{{ script | relative_url }}"></script>
{% if page.math %} {% if page.math %}
<!-- MathJax --> <!-- MathJax -->
<script src="{{ '/assets/js/data/mathjax.js' | relative_url }}"></script>
<script> <script>
/* see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options> */ /* see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options> */
MathJax = { MathJax = {
@@ -148,7 +143,7 @@
} }
}; };
</script> </script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> <script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="{{ site.data.origin[type].mathjax.js | relative_url }}"></script> <script id="MathJax-script" async src="{{ site.data.origin[type].mathjax.js | relative_url }}"></script>
{% endif %} {% endif %}
@@ -166,10 +161,17 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if page.mermaid %}
{% include mermaid.html %}
{% endif %}
{% if jekyll.environment == 'production' %} {% if jekyll.environment == 'production' %}
<!-- PWA --> <!-- PWA -->
{% if site.pwa.enabled %} {% if site.pwa.enabled %}
<script defer src="{{ 'app.min.js' | prepend: js_dist | relative_url }}"></script> <script
defer
src="{{ 'app.min.js' | relative_url }}?baseurl={{ site.baseurl | default: '' }}&register={{ site.pwa.cache.enabled }}"
></script>
{% endif %} {% endif %}
<!-- Web Analytics --> <!-- Web Analytics -->

View File

@@ -9,9 +9,9 @@ tail_includes:
- comments - comments
--- ---
{% include lang.html %} {% include lang.html %} {% include toc-status.html %}
<article class="px-1"> <article class="px-1" data-toc="{{ enable_toc }}">
<header> <header>
<h1 data-toc-skip>{{ page.title }}</h1> <h1 data-toc-skip>{{ page.title }}</h1>
{% if page.description %} {% if page.description %}
@@ -75,6 +75,45 @@ tail_includes:
</div> </div>
</header> </header>
{% if enable_toc %}
<div
id="toc-bar"
class="d-flex align-items-center justify-content-between invisible"
>
<span class="label text-truncate">{{ page.title }}</span>
<button type="button" class="toc-trigger btn me-1">
<i class="fa-solid fa-list-ul fa-fw"></i>
</button>
</div>
<button
id="toc-solo-trigger"
type="button"
class="toc-trigger btn btn-outline-secondary btn-sm"
>
<span class="label ps-2 pe-1"
>{{- site.data.locales[lang].panel.toc -}}</span
>
<i class="fa-solid fa-angle-right fa-fw"></i>
</button>
<dialog id="toc-popup" class="p-0">
<div
class="header d-flex flex-row align-items-center justify-content-between"
>
<div class="label text-truncate py-2 ms-4">{{- page.title -}}</div>
<button
id="toc-popup-close"
type="button"
class="btn mx-1 my-1 opacity-75"
>
<i class="fas fa-close"></i>
</button>
</div>
<div id="toc-popup-content" class="px-4 py-3 pb-4"></div>
</dialog>
{% endif %}
<div class="content">{{ content }}</div> <div class="content">{{ content }}</div>
<div class="post-tail-wrapper text-muted"> <div class="post-tail-wrapper text-muted">