patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: Valentin Gagarin <valentin@gagarin.work>
Cc: devel@spectrum-os.org
Subject: Re: [PATCH v3 1/3] Documentation: align Jekyll page style to rest of website
Date: Tue, 16 Jun 2026 13:49:04 +0200	[thread overview]
Message-ID: <87o6hau2mn.fsf@alyssa.is> (raw)
In-Reply-To: <20260616093527.388679-2-valentin@gagarin.work>

[-- Attachment #1: Type: text/plain, Size: 1992 bytes --]

Valentin Gagarin <valentin@gagarin.work> writes:

> diff --git a/Documentation/_includes/sitemap.html b/Documentation/_includes/sitemap.html
> new file mode 100644
> index 0000000..723bdb3
> --- /dev/null
> +++ b/Documentation/_includes/sitemap.html
> @@ -0,0 +1,58 @@
> +{% comment %}
> +SPDX-License-Identifier: GPL-3.0-or-later
> +SPDX-FileCopyrightText: 2026 Valentin Gagarin <valentin@gagarin.work>
> +
> +Render a nested sitemap rooted at a given URL prefix.  Hierarchy is
> +derived from URL structure: a page is a direct child of prefix P iff
> +its URL starts with P, is not P itself, and contains no further path
> +segments below P.
> +{% endcomment %}
> +
> +{%- assign default_root = "/" -%}
> +{% comment %}
> +`prefix` is the URL of the section to list children of.  It must end with "/",
> +which we assume if it is constructed by a directory and contains an index file.
> +{% endcomment %}
> +{%- assign prefix = include.prefix | default: default_root -%}
> +{%- capture inner -%}
> +  {%- assign candidates = site.html_pages
> +        | where_exp: "p", "p.url contains prefix"
> +        | where_exp: "p", "p.url != prefix" -%}
> +  {%- comment %}
> +  Ordered pages first, ascending.  The rest after, in URL order, so output is deterministic.
> +  {%- endcomment %}
> +  {%- assign ordered = candidates | where_exp: "p", "p.nav_order" | sort: "nav_order" -%}
> +  {%- assign unordered = candidates | where_exp: "p", "p.nav_order == nil" | sort: "url" -%}
> +  {%- assign sorted = ordered | concat: unordered -%}
> +  {%- for p in sorted -%}
> +    {%- comment %}
> +    `assign` is page-global.  A recursive include below may have overwritten `prefix`.
> +    {%- endcomment %}
> +    {%- assign prefix = include.prefix | default: default_root -%}
> +    {%- assign url_start = p.url | slice: 0, prefix.size -%}
> +    {%- if url_start == prefix -%}

Should be indentation inside this.  (Or we could do a continue to avoid
rightward drift.)  Let me know which you prefer.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

  reply	other threads:[~2026-06-16 11:49 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 16:49 [PATCH 0/3] Documentation: render all pages in one style Valentin Gagarin
2026-06-08 16:49 ` [PATCH 1/3] Documentation: align Jekyll page style to rest of website Valentin Gagarin
2026-06-08 16:49 ` [PATCH 2/3] Documentation: drop Just the Docs Valentin Gagarin
2026-06-08 16:49 ` [PATCH 3/3] Documentation: uniform navigation across all pages Valentin Gagarin
2026-06-08 16:49 ` [PATCH 1/3] Documentation: align Jekyll page style to rest of website Valentin Gagarin
2026-06-09 11:45   ` Alyssa Ross
2026-06-10 12:12     ` Valentin Gagarin
2026-06-10 12:23       ` Alyssa Ross
2026-06-08 16:49 ` [PATCH 2/3] Documentation: drop Just the Docs Valentin Gagarin
2026-06-09 11:43   ` Alyssa Ross
2026-06-08 16:49 ` [PATCH 3/3] Documentation: uniform navigation across all pages Valentin Gagarin
2026-06-09 11:54   ` Alyssa Ross
2026-06-11  6:37 ` [PATCH v2 1/3] Documentation: align Jekyll page style to rest of website Valentin Gagarin
2026-06-11  6:37   ` [PATCH v2 2/3] Documentation: drop Just the Docs Valentin Gagarin
2026-06-11  6:37   ` [PATCH v2 3/3] Documentation: uniform navigation across all pages Valentin Gagarin
2026-06-12  8:44     ` Alyssa Ross
2026-06-12  8:27   ` [PATCH v2 1/3] Documentation: align Jekyll page style to rest of website Alyssa Ross
2026-06-16  9:35 ` [PATCH v3 0/3] Documentation: render all pages in one style Valentin Gagarin
2026-06-16  9:35   ` [PATCH v3 1/3] Documentation: align Jekyll page style to rest of website Valentin Gagarin
2026-06-16 11:49     ` Alyssa Ross [this message]
2026-06-16 12:02       ` Valentin Gagarin
2026-06-17 10:48     ` Alyssa Ross
2026-06-16  9:35   ` [PATCH v3 2/3] Documentation: drop Just the Docs Valentin Gagarin
2026-06-17 10:48     ` Alyssa Ross
2026-06-16  9:35   ` [PATCH v3 3/3] Documentation: uniform navigation across all pages Valentin Gagarin
2026-06-16 12:01     ` Alyssa Ross
2026-06-17 10:48     ` Alyssa Ross
2026-06-16 12:01   ` [PATCH v3 0/3] Documentation: render all pages in one style Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o6hau2mn.fsf@alyssa.is \
    --to=hi@alyssa.is \
    --cc=devel@spectrum-os.org \
    --cc=valentin@gagarin.work \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).