{# MaatLog page shell — banner and a two-column layout, with a third column only when the page renders a right rail (an author summary, a TOC, or both). Overrides ``header``, ``content``, ``relbar1`` and ``relbar2`` of Sphinx' basic theme. Both Sphinx related bars are blanked; visible navigation is provided by the MaatLog banner, sidebars, post neighbors and pagination. #} {%- extends "basic/layout.html" -%} {#- 右列の有無はレイアウトの状態。派生テンプレートが root-level で ``maatlog_has_toc`` / ``maatlog_has_author_summary`` を定義していれば その値を使い、未定義ならここで一度だけ評価する。 列グリッドと実際の right rail がずれないようにする。 -#} {%- set maatlog_has_toc = maatlog_has_toc if maatlog_has_toc is defined else ( (display_toc and toc) or (maatlog.posts and maatlog.page_kind in ("home", "archive")) ) -%} {%- set maatlog_has_author_summary = maatlog_has_author_summary if maatlog_has_author_summary is defined else (maatlog.author_summaries | length > 0) -%} {%- set maatlog_has_rail = maatlog_has_toc or maatlog_has_author_summary -%} {#- 設定由来の :root トークンはここで一度だけ出す。Sphinx の basic/layout.html は css() より後に extrahead を置くので、同一詳細度の :root 宣言はソース順で テーマ CSS とパレット CSS に勝つ。 {%- endif -%} {%- endblock maatlog_config_style -%} {%- endblock extrahead -%} {#- テーマ JS は head 内で同期読み込みする。保存済みのライト/ダーク設定を
の描画前に へ反映するため、defer も type="module" も付けない。 -#} {%- block scripts -%} {{ super() }} {%- endblock scripts -%} {%- block header -%} {{ _('Skip to content') }} {%- block maatlog_banner -%} {%- include "maatlog/components/banner.html" -%} {%- endblock maatlog_banner -%} {%- endblock header -%} {%- block content -%} {#- 固定 UI はレイアウト要素の外側に置く。祖先が transform / filter / contain を 持つと position: fixed の containing block がそこへ移るため。 -#} {%- block maatlog_back_to_top -%} {%- include "maatlog/components/back-to-top.html" -%} {%- endblock maatlog_back_to_top -%} {%- endblock content -%} {%- block relbar1 -%}{%- endblock relbar1 -%} {%- block relbar2 -%}{%- endblock relbar2 -%}