Stop rendering CS modules and room version fragments as standalone pages (#1317)

This is actually doing two things:

 * creating `{fragments,modules}/index.md` turns the fragments and modules into
   page resources, rather than pages in their own right. We have to update the
   shortcodes to match.

 * adding `headless: true` means that we don't render the pages.

The net effect is that we don't render pages like
https://spec.matrix.org/v1.4/rooms/fragments/v1-auth-rules/ and
https://spec.matrix.org/v1.4/client-server-api/modules/account_data/.
This commit is contained in:
Richard van der Hoff 2022-11-08 17:27:44 +00:00 committed by GitHub
parent 1945589acf
commit b07fe504ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 21 additions and 165 deletions

View file

@ -6,8 +6,6 @@
* include `div#toc` for the ToC
* start the sidebar at the root (homepage) since for us that is the Matrix
overview page
* omit module pages, which we don't want to be directly accessible
(we only use them as raw material for the client-server spec)
*/}}
@ -41,7 +39,6 @@
<li class="td-sidebar-nav__section-title">
<a href="{{ $s.RelPermalink }}" class="align-left pl-0 pr-2{{ if not $show }} collapsed{{ end }}{{ if $active}} active{{ end }} td-sidebar-link td-sidebar-link__section indent-{{$indent}}">{{ $s.LinkTitle }}</a>
{{ $pages := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true }}
{{ $pages = where $pages "Type" "!=" "module"}}
{{ $pages := $pages | first 50 }}
{{ if gt (len $pages) 0 }}
<ul>

View file

@ -9,5 +9,8 @@
{{ $name := .Params.name }}
{{ $page := .Site.GetPage (path.Join .Page.File.Dir "modules" (printf "%s%s" $name ".md"))}}
{{ $page.Content }}
{{ with .Site.GetPage "client-server-api/modules" }}
{{ with .Resources.GetMatch (printf "%s%s" $name ".md") }}
{{ .Content }}
{{ end }}
{{ end }}

View file

@ -17,10 +17,13 @@
{{ $name := .Params.name }}
{{ $withVersioning := .Params.withVersioning }}
{{ $page := .Site.GetPage (path.Join .Page.File.Dir "fragments" (printf "%s%s" $name ".md"))}}
{{ $content := $page.Content }}
{{ if not $withVersioning }}
{{ $content = (replace $content "[New in this version]" "") }}
{{ $content = (replace $content "[Changed in this version]" "") }}
{{ end }}
{{ with .Site.GetPage "rooms/fragments" }}
{{ with .Resources.GetMatch (printf "%s%s" $name ".md") }}
{{ $content := .Content }}
{{ if not $withVersioning }}
{{ $content = (replace $content "[New in this version]" "") }}
{{ $content = (replace $content "[Changed in this version]" "") }}
{{ end }}
{{ $content | safeHTML }}
{{ end }}
{{ end }}