mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-04-24 19:44:09 +02:00
Compare commits
1 commit
635bbcd0b0
...
1df058a909
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1df058a909 |
9
.github/workflows/main.yml
vendored
9
.github/workflows/main.yml
vendored
|
|
@ -1,9 +1,8 @@
|
||||||
name: "Spec"
|
name: "Spec"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
HUGO_VERSION: 0.153.3
|
HUGO_VERSION: 0.148.1
|
||||||
PYTHON_VERSION: 3.13
|
PYTHON_VERSION: 3.13
|
||||||
NODE_VERSION: 24
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
@ -28,7 +27,7 @@ jobs:
|
||||||
- name: "➕ Setup Node"
|
- name: "➕ Setup Node"
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: '20'
|
||||||
- name: "🔎 Run validator"
|
- name: "🔎 Run validator"
|
||||||
run: |
|
run: |
|
||||||
npx @redocly/cli@latest lint data/api/*/*.yaml
|
npx @redocly/cli@latest lint data/api/*/*.yaml
|
||||||
|
|
@ -202,7 +201,7 @@ jobs:
|
||||||
- name: "➕ Setup Node"
|
- name: "➕ Setup Node"
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: '20'
|
||||||
- name: "➕ Setup Hugo"
|
- name: "➕ Setup Hugo"
|
||||||
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
|
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
|
||||||
with:
|
with:
|
||||||
|
|
@ -289,7 +288,7 @@ jobs:
|
||||||
- name: "➕ Setup Node"
|
- name: "➕ Setup Node"
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: '20'
|
||||||
- name: "➕ Setup Hugo"
|
- name: "➕ Setup Hugo"
|
||||||
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
|
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ function getHeadings() {
|
||||||
let headings = [];
|
let headings = [];
|
||||||
|
|
||||||
// First get the anchors in the ToC.
|
// First get the anchors in the ToC.
|
||||||
const toc_anchors = document.querySelectorAll("#TableOfContents a");
|
const toc_anchors = document.querySelectorAll("#toc nav a");
|
||||||
|
|
||||||
for (const anchor of toc_anchors) {
|
for (const anchor of toc_anchors) {
|
||||||
// Then get the heading from its selector in the anchor's href.
|
// Then get the heading from its selector in the anchor's href.
|
||||||
|
|
@ -59,7 +59,7 @@ function getHeadings() {
|
||||||
console.error("Got ToC anchor without href");
|
console.error("Got ToC anchor without href");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const heading = document.querySelector(selector);
|
const heading = document.querySelector(selector);
|
||||||
if (!heading) {
|
if (!heading) {
|
||||||
console.error("Heading not found for selector:", selector);
|
console.error("Heading not found for selector:", selector);
|
||||||
|
|
@ -122,13 +122,13 @@ function getCurrentHeading(headings, headerOffset) {
|
||||||
*/
|
*/
|
||||||
function selectTocEntry(id) {
|
function selectTocEntry(id) {
|
||||||
// Deselect previously selected entries.
|
// Deselect previously selected entries.
|
||||||
const activeEntries = document.querySelectorAll("#TableOfContents a.active");
|
const activeEntries = document.querySelectorAll("#toc nav a.active");
|
||||||
for (const activeEntry of activeEntries) {
|
for (const activeEntry of activeEntries) {
|
||||||
activeEntry.classList.remove('active');
|
activeEntry.classList.remove('active');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the new entry and select it.
|
// Find the new entry and select it.
|
||||||
const newEntry = document.querySelector(`#TableOfContents a[href="#${id}"]`);
|
const newEntry = document.querySelector(`#toc nav a[href="#${id}"]`);
|
||||||
if (!newEntry) {
|
if (!newEntry) {
|
||||||
console.error("ToC entry not found for ID:", id);
|
console.error("ToC entry not found for ID:", id);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -76,126 +76,52 @@ Custom SCSS for the Matrix spec
|
||||||
scroll-behavior: smooth;
|
scroll-behavior: smooth;
|
||||||
overscroll-behavior: contain;
|
overscroll-behavior: contain;
|
||||||
|
|
||||||
& > .td-sidebar-nav__section {
|
&>.td-sidebar-nav__section {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
|
|
||||||
.ul-1 ul {
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This is to make the width of the items that have sub-items (like room versions)
|
|
||||||
the same as the width of items that don't (like changelog) */
|
|
||||||
.pr-md-3, .px-md-3 {
|
|
||||||
padding-right: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ul-1 > li > a {
|
|
||||||
padding-left: 1rem !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ul-2 > li > a {
|
|
||||||
padding-left: 2rem !important;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Styles for the table of contents */
|
.td-sidebar-nav__section .ul-1 ul {
|
||||||
& > .td-toc {
|
padding-left: 0;
|
||||||
padding-top: 1rem;
|
|
||||||
padding-left: 1.5rem;
|
|
||||||
/* Add border above the toc */
|
|
||||||
border-top: 1px solid var(--bs-tertiary-color);
|
|
||||||
|
|
||||||
ol {
|
|
||||||
padding-left: 1rem;
|
|
||||||
counter-reset: section;
|
|
||||||
list-style-type: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#TableOfContents {
|
|
||||||
/* Remove the space between the title and the ToC */
|
|
||||||
margin-top: 0;
|
|
||||||
|
|
||||||
&>ol>li {
|
|
||||||
margin-bottom: .5rem;
|
|
||||||
|
|
||||||
&>a {
|
|
||||||
font-weight: $font-weight-bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ol {
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&>ol>li>a {
|
|
||||||
padding-left: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&>ol>li>ol>li>a {
|
|
||||||
padding-left: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&>ol>li>ol>li>ol>li>a {
|
|
||||||
padding-left: 3rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&>ol>li>ol>li>ol>li>ol>li>a {
|
|
||||||
padding-left: 4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
&>ol>li>ol>li>ol>li>ol>li>ol>li>a {
|
|
||||||
padding-left: 5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
li a:before {
|
|
||||||
counter-increment: section;
|
|
||||||
content: counters(section, ".") " ";
|
|
||||||
}
|
|
||||||
|
|
||||||
.td-toc-title {
|
|
||||||
font-weight: $font-weight-bold;
|
|
||||||
font-size: 1.3rem;
|
|
||||||
|
|
||||||
/* Remove the border under the title */
|
|
||||||
border-bottom: 0;
|
|
||||||
/* Remove the space under the title */
|
|
||||||
margin-bottom: 0;
|
|
||||||
|
|
||||||
/* Fix the top of page link color */
|
|
||||||
a, a:hover {
|
|
||||||
color: $secondary;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Apply the same style to links in the navigation and in the ToC */
|
/* This is to make the width of the items that have sub-items (like room versions)
|
||||||
& > .td-sidebar-nav__section, & > .td-toc #TableOfContents {
|
the same as the width of items that don't (like changelog) */
|
||||||
li a.td-sidebar-link.tree-root {
|
.pr-md-3, .px-md-3 {
|
||||||
|
padding-right: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ul-1 > li > a {
|
||||||
|
padding-left: 1rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ul-2 > li > a {
|
||||||
|
padding-left: 2rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.td-sidebar-link.tree-root {
|
||||||
|
color: $gray-800;
|
||||||
|
font-weight: $font-weight-bold;
|
||||||
|
font-size: 1.3rem;
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a, a.td-sidebar-link {
|
||||||
|
color: $gray-800;
|
||||||
|
font-weight: $font-weight-normal;
|
||||||
|
padding-top: .2rem;
|
||||||
|
padding-bottom: .2rem;
|
||||||
|
|
||||||
|
display: block;
|
||||||
|
transition: all 100ms ease-in-out;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: $secondary-lighter-background;
|
||||||
color: $gray-800;
|
color: $gray-800;
|
||||||
font-weight: $font-weight-bold;
|
|
||||||
font-size: 1.3rem;
|
|
||||||
margin-bottom: 0;
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
li a, li a.td-sidebar-link {
|
&.active, &active:hover {
|
||||||
color: $gray-800;
|
background-color: $secondary-background;
|
||||||
font-weight: $font-weight-normal;
|
|
||||||
padding-top: .2rem;
|
|
||||||
padding-bottom: .2rem;
|
|
||||||
|
|
||||||
transition: all 100ms ease-in-out;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: $secondary-lighter-background;
|
|
||||||
color: $gray-800;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.active, &active:hover {
|
|
||||||
background-color: $secondary-background;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -273,6 +199,64 @@ Custom SCSS for the Matrix spec
|
||||||
scroll-margin-top: 5.5rem;
|
scroll-margin-top: 5.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Styles for the table of contents */
|
||||||
|
#toc {
|
||||||
|
padding-top: .5rem;
|
||||||
|
padding-left: 1.5rem;
|
||||||
|
|
||||||
|
ol {
|
||||||
|
padding-left: 1rem;
|
||||||
|
counter-reset: section;
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#TableOfContents {
|
||||||
|
&>ol>li {
|
||||||
|
margin-bottom: .5rem;
|
||||||
|
|
||||||
|
&>a {
|
||||||
|
font-weight: $font-weight-bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ol {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&>ol>li>a {
|
||||||
|
padding-left: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&>ol>li>ol>li>a {
|
||||||
|
padding-left: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&>ol>li>ol>li>ol>li>a {
|
||||||
|
padding-left: 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&>ol>li>ol>li>ol>li>ol>li>a {
|
||||||
|
padding-left: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&>ol>li>ol>li>ol>li>ol>li>ol>li>a {
|
||||||
|
padding-left: 5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
li a:before {
|
||||||
|
counter-increment: section;
|
||||||
|
content: counters(section, ".") " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
#toc-title {
|
||||||
|
font-weight: $font-weight-bold;
|
||||||
|
font-size: 1.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.endpoints-toc {
|
.endpoints-toc {
|
||||||
summary {
|
summary {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ $primary: #FFF;
|
||||||
$secondary: #0098D4;
|
$secondary: #0098D4;
|
||||||
$dark: #333;
|
$dark: #333;
|
||||||
$gray-100: #FBFBFB;
|
$gray-100: #FBFBFB;
|
||||||
$code-color: #005b7f;
|
|
||||||
|
|
||||||
$secondary-background: #E5F5FB;
|
$secondary-background: #E5F5FB;
|
||||||
$secondary-lighter-background: #F4FAFC;
|
$secondary-lighter-background: #F4FAFC;
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Upgrade to docsy v0.13.0.
|
|
||||||
|
|
@ -166,11 +166,3 @@ sidebar_menu_compact = true
|
||||||
mediaType = "text/markdown"
|
mediaType = "text/markdown"
|
||||||
isPlainText = true
|
isPlainText = true
|
||||||
baseName = "checklist"
|
baseName = "checklist"
|
||||||
|
|
||||||
# Add font media types for downloading KaTeX fonts.
|
|
||||||
# See: https://www.docsy.dev/docs/content/diagrams-and-formulae/#create-media-types-for-katex-fonts
|
|
||||||
[mediaTypes]
|
|
||||||
[mediaTypes.'font/woff']
|
|
||||||
suffixes = ['woff']
|
|
||||||
[mediaTypes.'font/woff2']
|
|
||||||
suffixes = ['woff2']
|
|
||||||
|
|
|
||||||
2
go.mod
2
go.mod
|
|
@ -2,4 +2,4 @@ module github.com/matrix-org/matrix-spec
|
||||||
|
|
||||||
go 1.12
|
go 1.12
|
||||||
|
|
||||||
require github.com/matrix-org/docsy v0.0.0-20260106184755-71d103ebb20a // indirect
|
require github.com/matrix-org/docsy v0.0.0-20250722140156-5df72519f5af // indirect
|
||||||
|
|
|
||||||
6
go.sum
6
go.sum
|
|
@ -1,4 +1,4 @@
|
||||||
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
|
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
|
||||||
github.com/matrix-org/docsy v0.0.0-20260106184755-71d103ebb20a h1:WB3unuZJy7ewAf33sxbtEwYnC+i+Jt1sJpAR3BtzvEo=
|
github.com/matrix-org/docsy v0.0.0-20250722140156-5df72519f5af h1:XghgUC0H5BoGrvtT9/oWBUi+5Zux875qRHhpAZ0RURI=
|
||||||
github.com/matrix-org/docsy v0.0.0-20260106184755-71d103ebb20a/go.mod h1:mdn1m5HJug6ZddQgrOyCrXNegbtdl5evHiqqbEQLzdI=
|
github.com/matrix-org/docsy v0.0.0-20250722140156-5df72519f5af/go.mod h1:4/t21g/nPraob/DVMm3jrk26k0CDL5I7Mxf+ar0IAgs=
|
||||||
github.com/twbs/bootstrap v5.3.8+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
|
github.com/twbs/bootstrap v5.3.6+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,15 @@
|
||||||
We use it to send the delimited passthrough element through KaTeX to render maths
|
We use it to send the delimited passthrough element through KaTeX to render maths
|
||||||
in the Olm / Megolm spec.
|
in the Olm / Megolm spec.
|
||||||
|
|
||||||
See: https://www.docsy.dev/docs/content/diagrams-and-formulae/#add-passthrough-render-hook
|
See: https://gohugo.io/functions/transform/tomath/#step-2
|
||||||
|
|
||||||
*/ -}}
|
*/ -}}
|
||||||
{{ partial "scripts/math.html" . }}
|
{{- $opts := dict "output" "htmlAndMathml" "displayMode" (eq .Type "block") }}
|
||||||
|
{{- with try (transform.ToMath .Inner $opts) }}
|
||||||
|
{{- with .Err }}
|
||||||
|
{{- errorf "Unable to render mathematical markup to HTML using the transform.ToMath function. The KaTeX display engine threw the following error: %s: see %s." . $.Position }}
|
||||||
|
{{- else }}
|
||||||
|
{{- .Value }}
|
||||||
|
{{- $.Page.Store.Set "hasMath" true }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,28 @@
|
||||||
{{/*
|
{{/*
|
||||||
|
|
||||||
A copy of the breadcrumb.html partial in Docsy, modified to:
|
A copy of the breadcrumb.html partial in Docsy, modified
|
||||||
|
to:
|
||||||
* show the breadcrumbs by default by removing the `td-breadcrumbs__single`
|
|
||||||
class
|
|
||||||
* omit breadcrumbs when this is the homepage
|
* omit breadcrumbs when this is the homepage
|
||||||
* otherwise, include the homepage in the breadcrumbs
|
* otherwise, include the homepage in the breadcrumbs
|
||||||
|
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{ if not .IsHome -}}
|
{{ if not .IsHome }}
|
||||||
<nav aria-label="breadcrumb" class="td-breadcrumbs">
|
<nav aria-label="breadcrumb" class="td-breadcrumbs">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
{{- template "breadcrumbnav" (dict "p1" . "p2" .) }}
|
{{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav >
|
||||||
{{ end -}}
|
{{ end }}
|
||||||
|
|
||||||
{{- define "breadcrumbnav" -}}
|
{{ define "breadcrumbnav" }}
|
||||||
{{ if .p1.Parent -}}
|
{{ if .p1.Parent }}
|
||||||
{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 ) -}}
|
{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 ) }}
|
||||||
{{ else if not .p1.IsHome -}}
|
{{ else if not .p1.IsHome }}
|
||||||
{{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) -}}
|
{{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) }}
|
||||||
{{ end -}}
|
{{ end }}
|
||||||
{{ $isActive := eq .p1 .p2 }}
|
{{ $isActive := eq .p1 .p2 }}
|
||||||
<li class="breadcrumb-item{{ if $isActive }} active{{ end }}"
|
<li class="breadcrumb-item{{ if $isActive }} active{{ end }}" {{ if $isActive }}aria-current="page"{{ end }}>
|
||||||
{{- if $isActive }}aria-current="page"{{ end }}>
|
<a href="{{ .p1.RelPermalink }}">{{ .p1.LinkTitle }}</a>
|
||||||
{{ if $isActive -}}
|
</li>
|
||||||
{{ .p1.LinkTitle -}}
|
{{ end }}
|
||||||
{{ else -}}
|
|
||||||
<a href="{{ .p1.RelPermalink }}">{{ .p1.LinkTitle }}</a>
|
|
||||||
{{- end -}}
|
|
||||||
</li>
|
|
||||||
{{- end -}}
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,8 @@
|
||||||
{{- /*
|
{{- /*
|
||||||
|
|
||||||
A copy of the navbar.html partial in Docsy, modified to:
|
A version of the navbar.html partial in Docsy, only modified
|
||||||
|
to include the spec version, which is calculated using an
|
||||||
* remove `data-bs-theme` at L20, otherwise the title disappears on hover.
|
inline `version-string` partial.
|
||||||
* replace the site title with "specification" at L31.
|
|
||||||
* include the spec version from the config at L34-35, which is calculated
|
|
||||||
using an inline `version-string` partial.
|
|
||||||
|
|
||||||
*/ -}}
|
*/ -}}
|
||||||
|
|
||||||
|
|
@ -16,8 +13,8 @@
|
||||||
{{ $baseURL := urls.Parse $.Site.Params.Baseurl -}}
|
{{ $baseURL := urls.Parse $.Site.Params.Baseurl -}}
|
||||||
|
|
||||||
<nav class="td-navbar js-navbar-scroll
|
<nav class="td-navbar js-navbar-scroll
|
||||||
{{- if $cover }} td-navbar-cover {{- end }}">
|
{{- if $cover }} td-navbar-cover {{- end }}" data-bs-theme="light">
|
||||||
<div class="td-navbar-container container-fluid flex-column flex-md-row">
|
<div class="container-fluid flex-column flex-md-row">
|
||||||
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
|
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
|
||||||
{{- /**/ -}}
|
{{- /**/ -}}
|
||||||
<span class="navbar-brand__logo navbar-logo">
|
<span class="navbar-brand__logo navbar-logo">
|
||||||
|
|
@ -35,8 +32,7 @@
|
||||||
<span class="navbar-version"> — {{ partial "version-string" . }}</span>
|
<span class="navbar-version"> — {{ partial "version-string" . }}</span>
|
||||||
{{- /**/ -}}
|
{{- /**/ -}}
|
||||||
</a>
|
</a>
|
||||||
<div class="td-navbar-nav-scroll td-navbar-nav-scroll--indicator" id="main_navbar">
|
<div class="td-navbar-nav-scroll ms-md-auto" id="main_navbar">
|
||||||
<div class="scroll-indicator scroll-left"></div>
|
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
{{ $p := . -}}
|
{{ $p := . -}}
|
||||||
{{ range .Site.Menus.main -}}
|
{{ range .Site.Menus.main -}}
|
||||||
|
|
@ -62,41 +58,39 @@
|
||||||
</li>
|
</li>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ if .Site.Params.versions -}}
|
{{ if .Site.Params.versions -}}
|
||||||
<li class="nav-item dropdown d-none d-lg-block td-navbar__version-menu">
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
{{ partial "navbar-version-selector.html" . -}}
|
{{ partial "navbar-version-selector.html" . -}}
|
||||||
</li>
|
</li>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ if (gt (len .Site.Home.Translations) 0) -}}
|
{{ if (gt (len .Site.Home.Translations) 0) -}}
|
||||||
<li class="nav-item td-navbar__lang-menu">
|
<li class="nav-item dropdown d-none d-lg-block">
|
||||||
{{ partial "navbar-lang-selector.html" . -}}
|
{{ partial "navbar-lang-selector.html" . -}}
|
||||||
</li>
|
</li>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{- $darkMode := partialCached "dark-mode-config.html" "dark-mode-global" -}}
|
{{ if .Site.Params.ui.showLightDarkModeMenu -}}
|
||||||
{{ if $darkMode.showMenu -}}
|
<li class="td-light-dark-menu nav-item dropdown">
|
||||||
<li class="nav-item td-navbar__light-dark-menu">
|
|
||||||
{{ partial "theme-toggler" . }}
|
{{ partial "theme-toggler" . }}
|
||||||
</li>
|
</li>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
</ul>
|
</ul>
|
||||||
<div class="scroll-indicator scroll-right"></div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="d-none d-lg-block td-navbar__search">
|
<div class="d-none d-lg-block">
|
||||||
{{ partial "search-input.html" . }}
|
{{ partial "search-input.html" . }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
{{- define "_partials/version-string" -}}
|
{{ define "_partials/version-string" }}
|
||||||
{{ $ret := "unstable version" -}}
|
{{ $ret := "unstable version"}}
|
||||||
|
|
||||||
{{ $status := .Site.Params.version.status -}}
|
{{ $status := .Site.Params.version.status }}
|
||||||
|
|
||||||
{{ if ne $status "unstable" -}}
|
{{ if ne $status "unstable"}}
|
||||||
{{ $path := path.Join "changelogs" -}}
|
{{ $path := path.Join "changelogs" }}
|
||||||
|
|
||||||
{{/* produces a string similar to "version v1.5" */ -}}
|
{{/* produces a string similar to "version v1.5" */}}
|
||||||
{{ $ret = delimit (slice "version v" .Site.Params.version.major "." .Site.Params.version.minor) "" -}}
|
{{ $ret = delimit (slice "version v" .Site.Params.version.major "." .Site.Params.version.minor) "" }}
|
||||||
{{ end -}}
|
{{ end }}
|
||||||
|
|
||||||
{{ return $ret -}}
|
{{ return $ret }}
|
||||||
{{- end -}}
|
{{ end }}
|
||||||
|
|
|
||||||
|
|
@ -1,57 +1,37 @@
|
||||||
{{- /*
|
{{- /*
|
||||||
|
|
||||||
A copy of the siderbar-tree.html partial in Docsy, modified to:
|
A modified version of the siderbar-tree.html partial in Docsy, adding:
|
||||||
|
|
||||||
* Ignore the `sidebarRoot` parameter, because of this regression:
|
* The "toc.html" partial at L45.
|
||||||
<https://github.com/google/docsy/issues/2426>
|
|
||||||
* Add the "toc.html" partial at L68.
|
|
||||||
|
|
||||||
*/ -}}
|
*/ -}}
|
||||||
|
|
||||||
{{ $context := .context -}}
|
{{/* We cache this partial for bigger sites and set the active class client side. */ -}}
|
||||||
{{ $sidebarRoot := .sidebarRoot -}}
|
{{ $sidebarCacheLimit := .Site.Params.ui.sidebar_cache_limit | default 2000 -}}
|
||||||
{{ $sidebarRootID := .sidebarRootID -}}
|
{{ $shouldDelayActive := ge (len .Site.Pages) $sidebarCacheLimit -}}
|
||||||
{{ $cacheSidebar := .cacheSidebar -}}
|
|
||||||
|
|
||||||
{{ with $context -}}
|
|
||||||
{{/* When the sidebar is cached, "active" class is set client side. */ -}}
|
|
||||||
{{ $shouldDelayActive := $cacheSidebar -}}
|
|
||||||
|
|
||||||
<div id="td-sidebar-menu" class="td-sidebar__inner{{ if $shouldDelayActive }} d-none{{ end }}">
|
<div id="td-sidebar-menu" class="td-sidebar__inner{{ if $shouldDelayActive }} d-none{{ end }}">
|
||||||
{{ if not .Site.Params.ui.sidebar_search_disable -}}
|
{{ if not .Site.Params.ui.sidebar_search_disable -}}
|
||||||
|
|
||||||
<form class="td-sidebar__search d-flex align-items-center">
|
<form class="td-sidebar__search d-flex align-items-center">
|
||||||
{{ partial "search-input.html" . }}
|
{{ partial "search-input.html" . }}
|
||||||
<button class="btn btn-link td-sidebar__toggle" type="button" {{/**/ -}}
|
<button class="btn btn-link td-sidebar__toggle d-md-none p-0 ms-3 fas fa-bars" type="button" data-bs-toggle="collapse" data-bs-target="#td-section-nav" aria-controls="td-section-nav" aria-expanded="false" aria-label="Toggle section navigation">
|
||||||
data-bs-toggle="collapse" data-bs-target="#td-section-nav" {{/**/ -}}
|
|
||||||
aria-controls="td-section-nav" aria-expanded="false" aria-label="Toggle section navigation">
|
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
{{ else -}}
|
||||||
{{- else -}}
|
|
||||||
|
|
||||||
<div id="content-mobile">
|
<div id="content-mobile">
|
||||||
<form class="td-sidebar__search d-flex align-items-center">
|
<form class="td-sidebar__search d-flex align-items-center">
|
||||||
{{ partial "search-input.html" . }}
|
{{ partial "search-input.html" . }}
|
||||||
<button class="btn btn-link td-sidebar__toggle" type="button" {{/**/ -}}
|
<button class="btn btn-link td-sidebar__toggle d-md-none p-0 ms-3 fas fa-bars" type="button" data-bs-toggle="collapse" data-bs-target="#td-section-nav" aria-controls="td-section-nav" aria-expanded="false" aria-label="Toggle section navigation">
|
||||||
data-bs-toggle="collapse" data-bs-target="#td-section-nav" {{/**/ -}}
|
|
||||||
aria-controls="td-section-nav" aria-expanded="false" aria-label="Toggle section navigation">
|
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div id="content-desktop"></div>
|
<div id="content-desktop"></div>
|
||||||
|
{{ end -}}
|
||||||
{{- end }}
|
|
||||||
{{/* */ -}}
|
|
||||||
|
|
||||||
<nav class="td-sidebar-nav collapse
|
<nav class="td-sidebar-nav collapse
|
||||||
{{- if .Site.Params.ui.sidebar_search_disable }} td-sidebar-nav--search-disabled{{ end -}}
|
{{- if .Site.Params.ui.sidebar_search_disable }} td-sidebar-nav--search-disabled{{ end -}}
|
||||||
{{- if .Site.Params.ui.sidebar_menu_foldable }} foldable-nav{{ end }}" {{/**/ -}}
|
{{- if .Site.Params.ui.sidebar_menu_foldable }} foldable-nav{{ end -}}
|
||||||
id="td-section-nav"
|
" id="td-section-nav">
|
||||||
{{- if .Site.Params.ui.sidebar_root_enabled }} data-sidebar-root-id="{{ $sidebarRootID }}"{{ end -}}
|
{{ if (gt (len .Site.Home.Translations) 0) -}}
|
||||||
>
|
<div class="td-sidebar-nav__section nav-item dropdown d-block d-lg-none">
|
||||||
{{ if and .Site.Params.ui.sidebar_lang_menu (gt (len .Site.Home.Translations) 0) -}}
|
|
||||||
<div class="td-sidebar-nav__section nav-item d-block d-lg-none">
|
|
||||||
{{ partial "navbar-lang-selector.html" . }}
|
{{ partial "navbar-lang-selector.html" . }}
|
||||||
</div>
|
</div>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
@ -65,129 +45,44 @@
|
||||||
{{ partial "toc.html" . }}
|
{{ partial "toc.html" . }}
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{- end }}{{/* with $context */ -}}
|
|
||||||
|
|
||||||
{{ define "section-tree-nav-section" -}}
|
{{ define "section-tree-nav-section" -}}
|
||||||
{{/* cSpell:ignore manuallink manuallinkrelref manuallinktitle */ -}}
|
{{ $s := .section -}}
|
||||||
{{ $s := .section -}}
|
{{ $p := .page -}}
|
||||||
{{ $p := .page -}}
|
{{ $shouldDelayActive := .shouldDelayActive -}}
|
||||||
{{ $shouldDelayActive := .shouldDelayActive -}}
|
{{ $sidebarMenuTruncate := .sidebarMenuTruncate -}}
|
||||||
{{ $sidebarMenuTruncate := .sidebarMenuTruncate -}}
|
{{ $treeRoot := cond (eq .ulNr 0) true false -}}
|
||||||
{{ $treeRoot := cond (eq .ulNr 0) true false -}}
|
{{ $ulNr := .ulNr -}}
|
||||||
{{ $ulNr := .ulNr -}}
|
{{ $ulShow := .ulShow -}}
|
||||||
{{ $ulShow := .ulShow -}}
|
{{ $active := and (not $shouldDelayActive) (eq $s $p) -}}
|
||||||
{{ $active := and (not $shouldDelayActive) (eq $s $p) -}}
|
{{ $activePath := and (not $shouldDelayActive) (or (eq $p $s) ($p.IsDescendant $s)) -}}
|
||||||
{{ $activePath := and (not $shouldDelayActive) (or (eq $p $s) ($p.IsDescendant $s)) -}}
|
{{ $show := cond (or (lt $ulNr $ulShow) $activePath (and (not $shouldDelayActive) (eq $s.Parent $p.Parent)) (and (not $shouldDelayActive) (eq $s.Parent $p)) (not $p.Site.Params.ui.sidebar_menu_compact) (and (not $shouldDelayActive) ($p.IsDescendant $s.Parent))) true false -}}
|
||||||
{{ $show := cond
|
{{ $mid := printf "m-%s" ($s.RelPermalink | anchorize) -}}
|
||||||
(or
|
{{ $pages_tmp := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true -}}
|
||||||
(lt $ulNr $ulShow)
|
{{ $pages := $pages_tmp | first $sidebarMenuTruncate -}}
|
||||||
$activePath
|
{{ $truncatedEntryCount := sub (len $pages_tmp) $sidebarMenuTruncate -}}
|
||||||
(and (not $shouldDelayActive) (eq $s.Parent $p.Parent))
|
{{ if gt $truncatedEntryCount 0 -}}
|
||||||
(and (not $shouldDelayActive) (eq $s.Parent $p))
|
{{ warnf "WARNING: %d sidebar entries have been truncated. To avoid this, increase `params.ui.sidebar_menu_truncate` to at least %d (from %d) in your config file. Section: %s"
|
||||||
(not $p.Site.Params.ui.sidebar_menu_compact)
|
$truncatedEntryCount (len $pages_tmp) $sidebarMenuTruncate $s.Path -}}
|
||||||
(and (not $shouldDelayActive) ($p.IsDescendant $s.Parent))
|
{{ end -}}
|
||||||
)
|
{{ $withChild := gt (len $pages) 0 -}}
|
||||||
true false
|
{{ $manualLink := cond (isset $s.Params "manuallink") $s.Params.manualLink ( cond (isset $s.Params "manuallinkrelref") (relref $s $s.Params.manualLinkRelref) $s.RelPermalink) -}}
|
||||||
-}}
|
{{ $manualLinkTitle := cond (isset $s.Params "manuallinktitle") $s.Params.manualLinkTitle $s.Title -}}
|
||||||
{{ $mid := printf "m-%s" ($s.RelPermalink | anchorize) -}}
|
<li class="td-sidebar-nav__section-title td-sidebar-nav__section{{ if $withChild }} with-child{{ else }} without-child{{ end }}{{ if $activePath }} active-path{{ end }}{{ if (not (or $show $p.Site.Params.ui.sidebar_menu_foldable )) }} collapse{{ end }}" id="{{ $mid }}-li">
|
||||||
{{ $pages_tmp := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true -}}
|
{{ if (and $p.Site.Params.ui.sidebar_menu_foldable (ge $ulNr 1)) -}}
|
||||||
{{ $pages := $pages_tmp | first $sidebarMenuTruncate -}}
|
<input type="checkbox" id="{{ $mid }}-check"{{ if $activePath}} checked{{ end }}/>
|
||||||
{{ $truncatedEntryCount := sub (len $pages_tmp) $sidebarMenuTruncate -}}
|
<label for="{{ $mid }}-check"><a href="{{ $manualLink }}"{{ if ne $s.LinkTitle $manualLinkTitle }} title="{{ $manualLinkTitle }}"{{ end }}{{ with $s.Params.manualLinkTarget }} target="{{ . }}"{{ if eq . "_blank" }} rel="noopener"{{ end }}{{ end }} class="align-left ps-0 {{ if $active}} active{{ end }} td-sidebar-link{{ if $s.IsPage }} td-sidebar-link__page{{ else }} td-sidebar-link__section{{ end }}{{ if $treeRoot }} tree-root{{ end }}" id="{{ $mid }}">{{ with $s.Params.Icon}}<i class="{{ . }}"></i>{{ end }}<span class="{{ if $active }}td-sidebar-nav-active-item{{ end }}">{{ $s.LinkTitle }}</span></a></label>
|
||||||
|
{{ else -}}
|
||||||
{{ if gt $truncatedEntryCount 0 -}}
|
<a href="{{ $manualLink }}"{{ if ne $s.LinkTitle $manualLinkTitle }} title="{{ $manualLinkTitle }}"{{ end }}{{ with $s.Params.manualLinkTarget }} target="{{ . }}"{{ if eq . "_blank" }} rel="noopener"{{ end }}{{ end }} class="align-left ps-0{{ if $active}} active{{ end }} td-sidebar-link{{ if $s.IsPage }} td-sidebar-link__page{{ else }} td-sidebar-link__section{{ end }}{{ if $treeRoot }} tree-root{{ end }}" id="{{ $mid }}">{{ with $s.Params.Icon}}<i class="{{ . }}"></i>{{ end }}<span class="{{ if $active }}td-sidebar-nav-active-item{{ end }}">{{ $s.LinkTitle }}</span></a>
|
||||||
{{ warnf "WARNING: %d sidebar entries have been truncated. To avoid this, increase `params.ui.sidebar_menu_truncate` to at least %d (from %d) in your config file. Section: %s"
|
{{- end }}
|
||||||
$truncatedEntryCount (len $pages_tmp) $sidebarMenuTruncate $s.Path -}}
|
{{- if $withChild }}
|
||||||
{{ end -}}
|
{{- $ulNr := add $ulNr 1 }}
|
||||||
|
<ul class="ul-{{ $ulNr }}{{ if (gt $ulNr 1)}} foldable{{end}}">
|
||||||
{{ $withChild := gt (len $pages) 0 -}}
|
{{ range $pages -}}
|
||||||
{{ $manualLink :=
|
{{ if (not (and (eq $s $p.Site.Home) (eq .Params.toc_root true))) -}}
|
||||||
cond
|
{{ template "section-tree-nav-section" (dict "page" $p "section" . "shouldDelayActive" $shouldDelayActive "sidebarMenuTruncate" $sidebarMenuTruncate "ulNr" $ulNr "ulShow" $ulShow) }}
|
||||||
(isset $s.Params "manuallink")
|
|
||||||
$s.Params.manualLink
|
|
||||||
(cond
|
|
||||||
(isset $s.Params "manuallinkrelref")
|
|
||||||
(relref $s $s.Params.manualLinkRelref)
|
|
||||||
$s.RelPermalink
|
|
||||||
)
|
|
||||||
-}}
|
|
||||||
{{ $manualLinkTitle :=
|
|
||||||
cond
|
|
||||||
(isset $s.Params "manuallinktitle")
|
|
||||||
$s.Params.manualLinkTitle
|
|
||||||
$s.Title
|
|
||||||
-}}
|
|
||||||
{{ if and $treeRoot (eq $s.Params.sidebar_root_for "self") -}}
|
|
||||||
{{ with $s.Parent -}}
|
|
||||||
{{ $manualLink = .RelPermalink -}}
|
|
||||||
{{ end -}}
|
|
||||||
{{ end -}}
|
|
||||||
<li class="td-sidebar-nav__section-title td-sidebar-nav__section
|
|
||||||
{{- if $withChild }} with-child{{ else }} without-child{{ end -}}
|
|
||||||
{{ if $activePath }} active-path{{ end -}}
|
|
||||||
{{ if (not (or $show $p.Site.Params.ui.sidebar_menu_foldable )) }} collapse{{ end -}}
|
|
||||||
" {{/**/ -}}
|
|
||||||
id="{{ $mid }}-li" {{- /**/ -}}
|
|
||||||
>
|
|
||||||
{{ if (and $p.Site.Params.ui.sidebar_menu_foldable (ge $ulNr 1)) -}}
|
|
||||||
<input type="checkbox" id="{{ $mid }}-check"{{ if $activePath}} checked{{ end }}/>
|
|
||||||
<label for="{{ $mid }}-check">{{/**/ -}}
|
|
||||||
<a href="{{ $manualLink }}"
|
|
||||||
{{- if ne $s.LinkTitle $manualLinkTitle }} {{/**/ -}}
|
|
||||||
title="{{ $manualLinkTitle }}"
|
|
||||||
{{- end -}}
|
|
||||||
{{ with $s.Params.manualLinkTarget }} {{/**/ -}}
|
|
||||||
target="{{ . }}"
|
|
||||||
{{- if eq . "_blank" }} rel="noopener"{{ end -}}
|
|
||||||
{{ end }} {{/**/ -}}
|
|
||||||
class="align-left ps-0 {{ if $active}} active{{ end }} td-sidebar-link
|
|
||||||
{{- if $s.IsPage }} td-sidebar-link__page
|
|
||||||
{{- else }} td-sidebar-link__section
|
|
||||||
{{- end }}
|
|
||||||
{{- if $treeRoot }} tree-root{{ end }}" {{/**/ -}}
|
|
||||||
id="{{ $mid }}" {{- /**/ -}}
|
|
||||||
>
|
|
||||||
{{- with $s.Params.Icon -}}
|
|
||||||
<i class="{{ . }}"></i>
|
|
||||||
{{- end -}}
|
|
||||||
<span class="{{ if $active }}td-sidebar-nav-active-item{{ end }}">
|
|
||||||
{{- $s.LinkTitle -}}
|
|
||||||
</span> {{- /**/ -}}
|
|
||||||
</a> {{- /**/ -}}
|
|
||||||
</label>
|
|
||||||
{{ else -}}
|
|
||||||
<a href="{{ $manualLink }}"
|
|
||||||
{{- if ne $s.LinkTitle $manualLinkTitle }} title="{{ $manualLinkTitle }}"{{ end -}}
|
|
||||||
{{ with $s.Params.manualLinkTarget }} {{/**/ -}}
|
|
||||||
target="{{ . }}"
|
|
||||||
{{- if eq . "_blank" }} rel="noopener"{{ end -}}
|
|
||||||
{{ end }} {{/**/ -}}
|
|
||||||
class="align-left ps-0
|
|
||||||
{{- if $active}} active{{ end }} {{/**/ -}}
|
|
||||||
td-sidebar-link
|
|
||||||
{{- if $s.IsPage }} td-sidebar-link__page{{ else }} td-sidebar-link__section{{ end }}
|
|
||||||
{{- if $treeRoot }} tree-root{{ end }}" {{/**/ -}}
|
|
||||||
id="{{ $mid }}" {{- /**/ -}}
|
|
||||||
>
|
|
||||||
{{- with $s.Params.Icon -}}
|
|
||||||
<i class="{{ . }}"></i>
|
|
||||||
{{- end -}}
|
|
||||||
<span class="
|
|
||||||
{{- if $active }}td-sidebar-nav-active-item{{ end -}}
|
|
||||||
{{- if and $s.Params.sidebar_root_for site.Params.ui.sidebar_root_enabled }} td-sidebar-root-up-icon{{ end -}}
|
|
||||||
">
|
|
||||||
{{- $s.LinkTitle -}}
|
|
||||||
</span></a>
|
|
||||||
{{- end -}}
|
|
||||||
{{ if $withChild -}}
|
|
||||||
{{ $ulNr := add $ulNr 1 }}
|
|
||||||
<ul class="ul-{{ $ulNr }}{{ if (gt $ulNr 1)}} foldable{{end}}">
|
|
||||||
{{ range $pages -}}
|
|
||||||
{{ if (not (and (eq $s $p.Site.Home) (eq .Params.toc_root true))) -}}
|
|
||||||
{{ template "section-tree-nav-section" (dict "page" $p "section" . "shouldDelayActive" $shouldDelayActive "sidebarMenuTruncate" $sidebarMenuTruncate "ulNr" $ulNr "ulShow" $ulShow) }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
</ul>
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</li>
|
{{- end }}
|
||||||
{{- end }}
|
</ul>
|
||||||
|
{{- end }}
|
||||||
|
</li>
|
||||||
|
{{- end -}}
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,15 @@
|
||||||
{{/*
|
{{/*
|
||||||
|
|
||||||
A copy of the toc.html partial in Docsy, modified to:
|
A modified version of the toc.html partial in Docsy.
|
||||||
|
|
||||||
* show the page's title instead of "on this page"
|
*/}}
|
||||||
|
{{ $page := .Params }}
|
||||||
*/ -}}
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
|
|
||||||
Always render the td-toc element. ScrollSpy is counting on it to exist,
|
|
||||||
even if it's empty.
|
|
||||||
|
|
||||||
cSpell:ignore notoc
|
|
||||||
*/ -}}
|
|
||||||
|
|
||||||
<div class="td-toc" data-proofer-ignore>
|
|
||||||
{{ if not .Params.notoc -}}
|
{{ if not .Params.notoc -}}
|
||||||
{{ $toc := .TableOfContents -}}
|
{{ with .TableOfContents -}}
|
||||||
{{ if and $toc (ne $toc `<nav id="TableOfContents"></nav>`) -}}
|
<hr>
|
||||||
<div class="td-toc-title">
|
<div id="toc">
|
||||||
<span class="td-toc-title__text">{{ .Params.Title }}</span>
|
<a id="toc-title" href="#">{{ $page.Title }}</a>
|
||||||
<a class="td-toc-title__link" title="{{ i18n "toc_top_of_page" }}" href="#"></a>
|
{{ . }}
|
||||||
</div>
|
</div>
|
||||||
{{ $toc | safeHTML }}
|
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
</div>
|
|
||||||
{{/* */ -}}
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,11 @@
|
||||||
{{/*
|
{{/*
|
||||||
|
|
||||||
A copy of the baseof.html partial in Docsy, modified to:
|
A copy of the baseof.html partial in Docsy, modified
|
||||||
|
to remove the right-hand column from the layout.
|
||||||
|
|
||||||
* generate a static file `versions.json` that can be used to populate the
|
*/}}
|
||||||
version picker.
|
|
||||||
* remove the right-hand column from the layout.
|
|
||||||
|
|
||||||
*/ -}}
|
{{/* Generate a static file versions.json that can be used to populate the version picker */}}
|
||||||
|
|
||||||
{{/* Generate a static file versions.json that can be used to populate the version picker */ -}}
|
|
||||||
{{ if .IsHome }}
|
{{ if .IsHome }}
|
||||||
{{- /* Load all changelog subpages, sorted by release date */ -}}
|
{{- /* Load all changelog subpages, sorted by release date */ -}}
|
||||||
{{ $changelog := site.GetPage "changelog" }}
|
{{ $changelog := site.GetPage "changelog" }}
|
||||||
|
|
@ -31,18 +28,20 @@
|
||||||
<html itemscope itemtype="http://schema.org/WebPage"
|
<html itemscope itemtype="http://schema.org/WebPage"
|
||||||
{{- with .Site.Language.LanguageDirection }} dir="{{ . }}" {{- end -}}
|
{{- with .Site.Language.LanguageDirection }} dir="{{ . }}" {{- end -}}
|
||||||
{{ with .Site.Language.Lang }} lang="{{ . }}" {{- end }} {{/**/ -}}
|
{{ with .Site.Language.Lang }} lang="{{ . }}" {{- end }} {{/**/ -}}
|
||||||
class="no-js"
|
class="no-js">
|
||||||
{{- $darkMode := partialCached "dark-mode-config.html" "dark-mode-global" -}}
|
|
||||||
{{- if $darkMode.enable }} data-theme-init{{ end }}>
|
|
||||||
<head>
|
<head>
|
||||||
{{ partial "head.html" . }}
|
{{ partial "head.html" . }}
|
||||||
|
{{ if .Page.Store.Get "hasMath" }}
|
||||||
|
<link href="{{ relURL "css/katex.min.css" }}" rel="preload" as="style">
|
||||||
|
<link href="{{ relURL "css/katex.min.css" }}" rel="stylesheet">
|
||||||
|
{{ end }}
|
||||||
</head>
|
</head>
|
||||||
<body class="td-{{ .Kind }}{{ with .Page.Params.body_class }} {{ . }}{{ end }}">
|
<body class="td-{{ .Kind }}{{ with .Page.Params.body_class }} {{ . }}{{ end }}">
|
||||||
<header>
|
<header>
|
||||||
{{ partial "navbar.html" . }}
|
{{ partial "navbar.html" . }}
|
||||||
</header>
|
</header>
|
||||||
<div class="container-fluid td-outer">
|
<div class="container-fluid td-outer">
|
||||||
<div class="td-main" {{- partialCached "td/scrollspy-attr.txt" . .Section | safeHTMLAttr }}>
|
<div class="td-main">
|
||||||
<div class="row flex-xl-nowrap">
|
<div class="row flex-xl-nowrap">
|
||||||
<aside class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none">
|
<aside class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none">
|
||||||
{{ partial "sidebar.html" . }}
|
{{ partial "sidebar.html" . }}
|
||||||
|
|
|
||||||
41
scripts/download-katex-assets.sh
Executable file
41
scripts/download-katex-assets.sh
Executable file
|
|
@ -0,0 +1,41 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Download the KaTeX fonts and CSS, and copy them into `static`.
|
||||||
|
set -e
|
||||||
|
|
||||||
|
root=$(dirname "$0")/..
|
||||||
|
|
||||||
|
# Check that the caller supplied a version.
|
||||||
|
version=$1
|
||||||
|
if [[ -z $1 || $1 = "-h" || $1 = "--help" ]]; then
|
||||||
|
>&2 echo "Usage: download-katex-assets.sh VERSION (e.g. v0.16.23)"
|
||||||
|
>&2 echo
|
||||||
|
>&2 echo "Downloads KaTeX fonts and CSS from the specified release"
|
||||||
|
>&2 echo "on GitHub and puts the files into static/."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create a temporary directory and register a handler to clean it up on exit.
|
||||||
|
tmp_dir=$(mktemp -d)
|
||||||
|
clean_up () {
|
||||||
|
rm -rf "$tmp_dir"
|
||||||
|
}
|
||||||
|
trap clean_up EXIT
|
||||||
|
|
||||||
|
# Fetch the release archive.
|
||||||
|
archive=$tmp_dir/katex.tar.gz
|
||||||
|
url=https://github.com/KaTeX/KaTeX/releases/download/$version/katex.tar.gz
|
||||||
|
echo "GET $url"
|
||||||
|
curl -L --output "$archive" "$url"
|
||||||
|
|
||||||
|
# Unpack the archive.
|
||||||
|
tar -xzvf "$archive" -C "$tmp_dir"
|
||||||
|
|
||||||
|
# Move the CSS file into place.
|
||||||
|
install -vm644 "$tmp_dir/katex/katex.min.css" "$root/static/css/katex.min.css"
|
||||||
|
|
||||||
|
# Remove any existing fonts and move the new ones into place.
|
||||||
|
rm -rvf "$root"/static/css/fonts/KaTeX*
|
||||||
|
while IFS= read -r -d '' file; do
|
||||||
|
install -vm644 "$file" "$root/static/css/fonts"
|
||||||
|
done < <(find "$tmp_dir/katex/fonts" -maxdepth 1 -name "KaTeX*.woff2" -print0)
|
||||||
BIN
static/css/fonts/KaTeX_AMS-Regular.woff2
Normal file
BIN
static/css/fonts/KaTeX_AMS-Regular.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
BIN
static/css/fonts/KaTeX_Caligraphic-Bold.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
BIN
static/css/fonts/KaTeX_Caligraphic-Regular.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Fraktur-Bold.woff2
Normal file
BIN
static/css/fonts/KaTeX_Fraktur-Bold.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Fraktur-Regular.woff2
Normal file
BIN
static/css/fonts/KaTeX_Fraktur-Regular.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Main-Bold.woff2
Normal file
BIN
static/css/fonts/KaTeX_Main-Bold.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Main-BoldItalic.woff2
Normal file
BIN
static/css/fonts/KaTeX_Main-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Main-Italic.woff2
Normal file
BIN
static/css/fonts/KaTeX_Main-Italic.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Main-Regular.woff2
Normal file
BIN
static/css/fonts/KaTeX_Main-Regular.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Math-BoldItalic.woff2
Normal file
BIN
static/css/fonts/KaTeX_Math-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Math-Italic.woff2
Normal file
BIN
static/css/fonts/KaTeX_Math-Italic.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_SansSerif-Bold.woff2
Normal file
BIN
static/css/fonts/KaTeX_SansSerif-Bold.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_SansSerif-Italic.woff2
Normal file
BIN
static/css/fonts/KaTeX_SansSerif-Italic.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_SansSerif-Regular.woff2
Normal file
BIN
static/css/fonts/KaTeX_SansSerif-Regular.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Script-Regular.woff2
Normal file
BIN
static/css/fonts/KaTeX_Script-Regular.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Size1-Regular.woff2
Normal file
BIN
static/css/fonts/KaTeX_Size1-Regular.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Size2-Regular.woff2
Normal file
BIN
static/css/fonts/KaTeX_Size2-Regular.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Size3-Regular.woff2
Normal file
BIN
static/css/fonts/KaTeX_Size3-Regular.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Size4-Regular.woff2
Normal file
BIN
static/css/fonts/KaTeX_Size4-Regular.woff2
Normal file
Binary file not shown.
BIN
static/css/fonts/KaTeX_Typewriter-Regular.woff2
Normal file
BIN
static/css/fonts/KaTeX_Typewriter-Regular.woff2
Normal file
Binary file not shown.
1
static/css/katex.min.css
vendored
Normal file
1
static/css/katex.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue