Skip to content

Dark mode, Persian footnote numbers, and a separate English about page - #53

Merged
mortezagk merged 9 commits into
masterfrom
minor-dev
Sep 27, 2026
Merged

mortezagk merged 9 commits into
masterfrom
minor-dev

Conversation

@mortezagk

Copy link
Copy Markdown
Owner

Nine commits, oldest first.

Footnotes

  • Persian digits for the footnote numbers, in the text and in the list. Python-Markdown numbers footnotes by order of first use and writes its own Latin digits, so both sides are renumbered in CSS from the document order the markup already has.
  • English-only entries ("Lineage") read left-to-right, so the "↩" backref follows the term instead of landing to its left. Entries with a Persian gloss keep the surrounding right-to-left layout, which is what they want; the build marks the ones with no Persian in them.
  • Jumping to a footnote no longer lands it under the fixed navbar.
  • The [^۱] labels in two chapters now follow the order the notes are used in, so they match the numbers the reader sees.

Dark mode

  • Colours become semantic tokens, so the dark theme redefines only that list.
  • Follows the reader's system setting; a navbar button overrides it and the choice is remembered. The saved choice is applied before the first paint, so neither theme flashes.
  • Figures keep a white backdrop: 11 of the 96 hotlinked PNGs and GIFs are transparent and would otherwise be black lines on a black page.

About page

  • Split into درباره (/pages/about.html, unchanged address) and a new English About (/pages/about-en.html), which reads left-to-right via a Direction field in its metadata.
  • Menu and sidebar order: جستجو, درباره, About.
  • Notes when the translation started and when it went online.

Logo and favicon

  • Navbar logo is fa-dna, inline, so it needs no white asset of its own.
  • Favicon is fa-book-open rendered from the bundled font, six sizes.
  • body padding-top to 4rem: the bar measures 3.85rem, so content was sitting under it.

Also

  • The chapter covers no longer repeat the chapter's contents, which the sidebar now carries.
  • Config settings that repeated a Pelican default or did nothing are gone; the build output is byte for byte unchanged.

Built with --fatal warnings and checked with scripts/check_links.py at each step; rendering verified in Chrome in both themes, at desktop and phone widths.

mortezagk and others added 9 commits September 27, 2026 11:56
Body text goes to full black.

Footnote numbers were Latin: Python-Markdown numbers footnotes in order of
first use and writes its own digits, both in the text and as the list's
markers, so the [^۱] labels in the source only ever become link ids and the
two can differ (the twelfth label used tenth shows as 10). Both sides are
renumbered in CSS from the document order the markup already has, which
keeps them in step with each other and with the existing anchors.

Footnote entries are a mix of an English term on its own ("Lineage") and an
English term with a Persian gloss ("Phylogeny: روابط فرگشتی…"). The glossed
ones want the surrounding right-to-left layout; the all-English ones do not,
as their "↩" backref ends up to the left of the term rather than after it.
unicode-bidi: plaintext would fix those but flip every glossed entry, so the
build marks the entries with no Persian in them and only those read
left-to-right, on the <li> so the number travels with the text.

Jumping to a footnote landed it under the fixed navbar — by its full height,
most noticeable on a phone, where the bar covers more of the screen.
scroll-margin-top on the jump targets leaves room for it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both files kept two series of labels: [^۱] upwards for the short English
terms and [^۱۰] upwards for the longer Persian notes. Python-Markdown
numbers footnotes by order of first use, so the labels and the numbers the
reader sees drifted apart -- in 206, [^۱۲] appeared as 10.

The labels now follow the order the notes are used in, so the two agree.
Only the digits changed: each note keeps its text and every reference still
points at the note it did before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
None of these changed the build -- the output is byte for byte what it was.

  md_in_html   already comes with the extra extension, alongside footnotes,
               attr_list, def_list, tables and abbr
  toc 'title'  names a table of contents that is only generated where a page
               has a [TOC] marker, and none does
  the two ARTICLE_TRANSLATION_* settings have nothing to build: no page
               carries a Lang, so no translation is ever generated
  THEME_STATIC_PATHS and DEFAULT_PAGINATION repeat Pelican's own defaults

toc itself stays: it gives the headings the ids that the heading and
footnote links point at. A note now says so, so it does not read as
cosmetic.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The sidebar now carries every chapter's pages, so the «مطالب این فصل» cards
on the six chapter covers repeated a list the reader already has beside the
text -- and below it on a phone.

Removes the nav from the article template and its styles, leaving the cover
as its own introduction: the text, the figure, the source, then previous and
next.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- درباره keeps /pages/about.html; About is new at /pages/about-en.html
- a page sets Direction in its metadata to read left-to-right
- menu and sidebar order: جستجو, درباره, About
- credit the Noun Project logo and drop the old Scientific American image
- contribution section leads with issues and pull requests
- when the translation started and when it went online
- Circle tree by awimovic (Noun Project, CC BY 3.0), squared and stripped
  of its baked-in credit text; source kept in assets/, too big to serve
- favicon.ico in six sizes, with the small ones' alpha boosted so the
  branches do not wash out to a grey disc
- a white 32px copy for the navbar, which is dark
- body padding-top to 4rem: the bar measures 3.85rem, so content was
  sitting under it
- navbar logo is fa-dna, inline, so it needs no white asset of its own
- favicon is fa-book-open rendered from the bundled font, six sizes
- drops the Noun Project tree, its SVG source and its credit
- about: reword the contribution section

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- colours become semantic tokens, so the dark theme redefines only that list
- follows the reader's system setting; a navbar button overrides it and the
  choice is remembered
- the saved choice is applied before the first paint, so neither theme flashes
- figures keep a white backdrop: 11 of them are transparent and would
  otherwise be black lines on a black page
- data-bs-theme and color-scheme follow, for Bootstrap's own controls

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mortezagk
mortezagk merged commit 7c2c4d1 into master Sep 27, 2026
8 checks passed
@mortezagk
mortezagk deleted the minor-dev branch September 27, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant