mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-04-08 04:14:13 +02:00
Merge fdd2a9abe8 into 6a001cccb0
This commit is contained in:
commit
d281b10b89
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
|
|
@ -236,6 +236,10 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
tar -C "spec${baseURL}" --strip-components=1 -xzf openapi.tar.gz
|
tar -C "spec${baseURL}" --strip-components=1 -xzf openapi.tar.gz
|
||||||
|
|
||||||
|
- name: "🔍 pagefind indexing"
|
||||||
|
run: |
|
||||||
|
npx -y pagefind --site "spec${baseURL}"
|
||||||
|
|
||||||
- name: "📦 Tarball creation"
|
- name: "📦 Tarball creation"
|
||||||
run: |
|
run: |
|
||||||
cd spec
|
cd spec
|
||||||
|
|
|
||||||
|
|
@ -661,3 +661,9 @@ dd {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Style for page search */
|
||||||
|
#search {
|
||||||
|
display: none;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
}
|
||||||
1
changelogs/internal/newsfragments/2331.feature
Normal file
1
changelogs/internal/newsfragments/2331.feature
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Add page search widget.
|
||||||
|
|
@ -16,3 +16,7 @@
|
||||||
{{ $inter := resources.Get "css/fonts/Inter.css" -}}
|
{{ $inter := resources.Get "css/fonts/Inter.css" -}}
|
||||||
<link rel="preload" href="{{ $inter.RelPermalink }}" as="style">
|
<link rel="preload" href="{{ $inter.RelPermalink }}" as="style">
|
||||||
<link rel="stylesheet" href="{{ $inter.RelPermalink }}">
|
<link rel="stylesheet" href="{{ $inter.RelPermalink }}">
|
||||||
|
|
||||||
|
{{/* Load Pagefind stuff to power the page search. */}}
|
||||||
|
<link href="/pagefind/pagefind-ui.css" rel="stylesheet">
|
||||||
|
<script src="/pagefind/pagefind-ui.js"></script>
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,28 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
<li class="nav-item" id="search-button">
|
||||||
|
<a class="nav-link" href="#" role="button">Search</a>
|
||||||
|
</li>
|
||||||
|
<script>
|
||||||
|
document.querySelector("#search-button").addEventListener("click", (event) => {
|
||||||
|
const search = document.querySelector("#search");
|
||||||
|
|
||||||
|
if (search.style.display === "block") {
|
||||||
|
// Hide the search widget.
|
||||||
|
search.style.display = "none";
|
||||||
|
} else {
|
||||||
|
// Initialise the search widget if needed.
|
||||||
|
if (!search.innerHTML.length) {
|
||||||
|
new PagefindUI({ element: "#search", showSubResults: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unhide and focus the search widget.
|
||||||
|
search.style.display = "block";
|
||||||
|
search.querySelector("input").focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
{{ 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 td-navbar__version-menu">
|
||||||
{{ partial "navbar-version-selector.html" . -}}
|
{{ partial "navbar-version-selector.html" . -}}
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@
|
||||||
</aside>
|
</aside>
|
||||||
<main class="col-12 col-md-9 col-xl-8 ps-md-5" role="main">
|
<main class="col-12 col-md-9 col-xl-8 ps-md-5" role="main">
|
||||||
{{ partial "version-banner.html" . }}
|
{{ partial "version-banner.html" . }}
|
||||||
|
<div id="search"></div>
|
||||||
{{ if not (.Param "ui.breadcrumb_disable") -}}
|
{{ if not (.Param "ui.breadcrumb_disable") -}}
|
||||||
{{ partial "breadcrumb.html" . -}}
|
{{ partial "breadcrumb.html" . -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue