|
| 1 | +{% import "macros/prose.html" as macros %} |
| 2 | +{% extends "_base.html" %} |
| 3 | + |
| 4 | +{% block page %}post{% endblock page %} |
| 5 | +{% block lang -%} |
| 6 | +{%- set blog_section_path = config.extra.blog_section_path | trim_start_matches(pat="/") -%} |
| 7 | +{%- set section_md_path = blog_section_path ~ "/_index.md" -%} |
| 8 | +{%- set section = get_section(path=section_md_path, metadata_only=true) -%} |
| 9 | +{%- if page.extra.lang %}{{page.extra.lang}}{% elif section.extra.lang %}{{section.extra.lang}}{% else %}{{page.lang}}{% endif -%} |
| 10 | +{%- endblock lang %} |
| 11 | +{% block title %}{{ page.title }}{% endblock title %} |
| 12 | +{% block desc %} |
| 13 | + {% if page.summary %} |
| 14 | + {% set desc = page.summary %} |
| 15 | + {% elif page.description %} |
| 16 | + {% set desc = page.description %} |
| 17 | + {% elif section.description %} |
| 18 | + {% set desc = section.description %} |
| 19 | + {% else %} |
| 20 | + {% set desc = config.description %} |
| 21 | + {% endif %} |
| 22 | + <meta name="description" content="{{ desc }}"> |
| 23 | +{% endblock desc %} |
| 24 | + |
| 25 | +{% block head %} |
| 26 | +{% if config.markdown.highlighting.style == "class" %} |
| 27 | +<link id="hl" rel="stylesheet" type="text/css" href="/giallo-{% if config.extra.force_theme == "dark" %}dark{% else %}light{% endif %}.css" /> |
| 28 | +{% endif %} |
| 29 | +{% if page.extra.math %} |
| 30 | +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" crossorigin="anonymous"> |
| 31 | +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js" integrity="sha384-7zkQWkzuo3B5mTepMUcHkMB5jZaolc2xDwL6VFqjFALcbeS9Ggm/Yr2r3Dy4lfFg" crossorigin="anonymous"></script> |
| 32 | +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous"></script> |
| 33 | +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/copy-tex.min.js" integrity="sha384-HORx6nWi8j5/mYA+y57/9/CZc5z8HnEw4WUZWy5yOn9ToKBv1l58vJaufFAn9Zzi" crossorigin="anonymous"></script> |
| 34 | +<script> |
| 35 | + document.addEventListener("DOMContentLoaded", function () { |
| 36 | + renderMathInElement(document.body, { |
| 37 | + delimiters: [ |
| 38 | + { left: '$$', right: '$$', display: true }, |
| 39 | + { left: '$', right: '$', display: false }, |
| 40 | + { left: '\\(', right: '\\)', display: false }, |
| 41 | + { left: '\\[', right: '\\]', display: true } |
| 42 | + ], |
| 43 | + throwOnError: false |
| 44 | + }); |
| 45 | + }); |
| 46 | +</script> |
| 47 | +{% endif %} |
| 48 | +{% endblock head %} |
| 49 | + |
| 50 | +{% block content %} |
| 51 | +<div id="wrapper"> |
| 52 | + <div id="blank"></div> |
| 53 | + <aside> |
| 54 | + {% if page.extra.toc is defined %}{% set show_toc = page.extra.toc %}{% else %}{% set show_toc = section.extra.toc %}{% endif %} |
| 55 | + {% if show_toc and page.toc %} |
| 56 | + <nav> |
| 57 | + <ul> |
| 58 | + {% for h2 in page.toc %} |
| 59 | + <li> |
| 60 | + <a class="h2" href="#{{ h2.id | safe }}">{{ h2.title }}</a> |
| 61 | + {% if h2.children %} |
| 62 | + <ul> |
| 63 | + {% for h3 in h2.children %} |
| 64 | + <li> |
| 65 | + <a class="h3" href="#{{ h3.id | safe }}">{{ h3.title }}</a> |
| 66 | + </li> |
| 67 | + {% endfor %} |
| 68 | + </ul> |
| 69 | + {% endif %} |
| 70 | + </li> |
| 71 | + {% endfor %} |
| 72 | + </ul> |
| 73 | + </nav> |
| 74 | + {% endif %} |
| 75 | + {% if section.extra.back_to_top %} |
| 76 | + <button id="back-to-top" aria-label="back to top"> |
| 77 | + {% set icon = load_data(path="icon/arrow-up.svg") %} |
| 78 | + {{ icon | safe }} |
| 79 | + </button> |
| 80 | + {% endif %} |
| 81 | + </aside> |
| 82 | + <main> |
| 83 | + {{ macros::back_link(path = get_url(path=section.path)) }} |
| 84 | + |
| 85 | + <div> |
| 86 | + {% if page.extra.copy is defined %}{% set allow_copy = page.extra.copy %}{% else %}{% set allow_copy = section.extra.copy %}{% endif %} |
| 87 | + {% if allow_copy %} |
| 88 | + {% set copy_icon = load_data(path="icon/copy.svg") %} |
| 89 | + {% set check_icon = load_data(path="icon/check.svg") %} |
| 90 | + <div id="copy-cfg" style="display: none;" data-copy-icon="{{ copy_icon }}" data-check-icon="{{ check_icon }}"></div> |
| 91 | + {% endif %} |
| 92 | + <article class="prose"> |
| 93 | + <h1>{{ page.title }}</h1> |
| 94 | + <div id="post-info"> |
| 95 | + <div id="date"> |
| 96 | + <span id="publish">{{ page.date | date(format=section.extra.date_format) }}</span> |
| 97 | + {% if page.updated and page.updated != page.date -%} |
| 98 | + <span>Updated on <span id="updated">{{ page.updated | date(format=section.extra.date_format) }}</span></span> |
| 99 | + {% endif -%} |
| 100 | + </div> |
| 101 | + |
| 102 | + {% if page.taxonomies.tags is defined %} |
| 103 | + <div id="tags"> |
| 104 | + {% for tag in page.taxonomies.tags -%} |
| 105 | + {% set tag_slugify = tag | slugify -%} |
| 106 | + <a class="instant" href="{{ config.base_url ~ '/tags/' ~ tag_slugify }}"><span>#</span>{{ tag }}</a> |
| 107 | + {%- endfor %} |
| 108 | + </div> |
| 109 | + {% endif %} |
| 110 | + </div> |
| 111 | + |
| 112 | + {% if page.extra.outdate_alert is defined %}{% set show_outdate_alert = page.extra.outdate_alert %}{% else %}{% set show_outdate_alert = section.extra.outdate_alert %}{% endif %} |
| 113 | + {% if page.extra.outdate_alert_days is defined %}{% set outdate_alert_days = page.extra.outdate_alert_days %}{% else %}{% set outdate_alert_days = section.extra.outdate_alert_days %}{% endif %} |
| 114 | + |
| 115 | + {% if show_outdate_alert -%} |
| 116 | + <blockquote id="outdate_alert" class="callout caution hidden" data-days="{{ outdate_alert_days }}" |
| 117 | + data-alert-text-before="{{ section.extra.outdate_alert_text_before }}" |
| 118 | + data-alert-text-after="{{ section.extra.outdate_alert_text_after }}"> |
| 119 | + <div class="content"></div> |
| 120 | + </blockquote> |
| 121 | + {% endif %} |
| 122 | + |
| 123 | + {{ page.content | safe }} |
| 124 | + </article> |
| 125 | + |
| 126 | + {% if page.extra.reaction is defined %}{% set show_reaction = page.extra.reaction %}{% else %}{% set show_reaction = config.extra.reaction %}{% endif %} |
| 127 | + {% if show_reaction %} |
| 128 | + <div class="reaction {{ config.extra.reaction_align }}" data-endpoint="{{ config.extra.reaction_endpoint }}"></div> |
| 129 | + {% endif %} |
| 130 | + |
| 131 | + {% if page.extra.comment is defined %}{% set show_comment = page.extra.comment %}{% else %}{% set show_comment = section.extra.comment %}{% endif %} |
| 132 | + {% if show_comment %} |
| 133 | + <div class="giscus"></div> |
| 134 | + {% include "_giscus_script.html" %} |
| 135 | + {% endif %} |
| 136 | + </div> |
| 137 | + |
| 138 | + {% include "_footer.html" %} |
| 139 | + </main> |
| 140 | +</div> |
| 141 | +{% endblock content %} |
| 142 | + |
| 143 | +{% block script %} |
| 144 | +<script src="/js/lightense.min.js"></script> |
| 145 | +{% if page.extra.mermaid %} |
| 146 | +<script type="module"> |
| 147 | + import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs'; |
| 148 | + mermaid.initialize({ startOnLoad: true }); |
| 149 | +</script> |
| 150 | +{% endif %} |
| 151 | +{% endblock script %} |
0 commit comments