Skip to content

Major update: sync with the current Evolution 101, new site structure, Bootstrap 5 theme and on-site search - #52

Merged
mortezagk merged 32 commits into
masterfrom
develop
Sep 26, 2026
Merged

mortezagk merged 32 commits into
masterfrom
develop

Conversation

@mortezagk

@mortezagk mortezagk commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

This brings the Persian translation (فرگشت ۱۰۱) up to date with the current
Understanding Evolution "Evolution 101" at evolution.berkeley.edu, reorganises
the site to match the original's structure, and rebuilds the theme.

Content

  • Every page (the introduction plus chapters 1–6) checked against the current
    English site. Sentences, paragraphs and pages added upstream since the
    translation was made have been translated and added.
  • New "Digging Data" research sections, styled as boxes like on the original.
  • The history-of-life timeline was checked against the text version of the
    original's interactive timeline.
  • Each page names its English source ("منبع ⎋"), linked below the footnotes.
  • Landing-page caption and about page corrected.

Structure and addresses (breaking)

  • New addresses mirror the original site:
    /{chapter number}-{chapter slug}/{page number}-{page slug}/,
    e.g. /4-speciation/06-cospeciation/.
  • New home page listing the introduction and every chapter; each chapter has
    a cover page with a card for each of its pages.
  • Chapter names in the sidebar link to their cover pages; the sidebar opens
    the current chapter.
  • The old chapter-N/… addresses are not redirected and will stop working.
    Resubmit https://evolution101.ir/sitemap.xml to Google Search Console after
    deploying.

Images

  • Figures are no longer stored in the repository: they are linked from
    evolution.berkeley.edu at the size the original shows them, with explicit
    width/height and lazy loading. The old image files are still in git history.

Theme

  • Bootstrap 2 replaced by Bootstrap 5.3 (RTL build); Font Awesome updated to
    version 7. lang="fa" dir="rtl" set on every page.
  • Type and layout follow the original site's style reference, sized in rem so
    the text scales with the reader's browser font and zoom settings. The Persian
    font (Sahel) is unchanged.
  • Quieter previous/next navigation, centred captions, a layout that works from
    phones to wide screens, and a sticky sidebar.
  • Canonical domain evolution101.ir, sitemap.xml and a clean robots.txt.
  • Invalid page HTML fixed; unused templates, scripts and settings removed.

Search

  • New on-site search (pages/search.html) across every page, working offline
    from the built files. It handles Persian spelling variants (Arabic ي/ك,
    diacritics, ZWNJ, Persian/Arabic digits), ranks title matches first, and
    highlights matches. A Google site-search link is offered as a fallback.
  • Result links are built without reading from the page, which resolves the
    CodeQL "DOM text reinterpreted as HTML" alerts.

CI

  • The build now fails if any internal link or image points at a missing file
    (checked by scripts/check_links.py in the deploy workflow).
  • A separate workflow (check-images.yml) checks the images linked from
    Berkeley on every pull request and weekly. A missing image fails it; a
    server that doesn't answer (Berkeley's firewall drops some GitHub runners)
    only gives a warning, so it never blocks a deploy.

Docs

  • README documents building, previewing, the link checks and the content
    layout (addresses, Source metadata, search, external images).

🤖 Generated with Claude Code

https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN

claude and others added 27 commits September 25, 2026 12:12
…ranslation

Cross-checked against evolution.berkeley.edu/evolution-101 (and the site's
2022 section PDFs). Adds missing content in: intro, descent with
modification, mechanisms of change, genetic variation, mutations, causes of
mutations, gene flow (Neanderthal example), sex and genetic shuffling
(red tubular flowers), development (sand dollars/cassiduloids), natural
selection at work (peppered moth), fitness, adaptation, trends (body size).

Also fixes gene flow being rendered as 'رانش ژن' in 203 (line was being
edited anyway).
Translated and embedded in the same pages as on evolution.berkeley.edu:
- 205: causes of mutation (Wu, Przeworski et al., human vs baboon)
- 213: sexual selection (Andrade, redback spiders)
- 214: artificial selection (Ostrander et al., ROBO1 in dog breeds)
- 502: patterns in macroevolution (Kemp & Hadly, Caribbean lizards)

Figures are marked with <!-- TODO تصویر --> placeholders.
- 000: replace four old GIFs with the site's combined change-over-time figure
- 101: rewrite zoom-in passage (eukaryotes > Opisthokonta), new tree figure
- 104/105: updated vertebrate tree (Irisarri et al. 2017); add missing sentence
- 106: new classification trees
- 107: fix 3.8 billion years and 'multicellular life'; new time tree

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
- 201-203, 209, 211, 215: update passages the site has revised
- 204: tulip example replaces apple; add 'Effects of mutations' section
  (separate page upstream) with the neutral/detrimental/beneficial layout
- 205, 213, 214: fill Digging Data figures from the site, add references
- 208: new definition, reordered sections, new sand dollar figure
- 213: new intro and collage; 'Why is sexual selection so powerful?'
  becomes its own section (separate page upstream)
- 218: fix swapped image alt text
- add image credits the site now shows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
- 400, 401, 405, 601, 603: update passages the site has revised
- 500: new 'you are here' tree of life figure
- 501: fix 3.8 million -> 3.8 billion years
- 502: fill Digging Data figures from the site, add reference
- 602: fix Cambrian explosion date (350 -> 530 million years)
- 604: drop cephalization example removed upstream
- add image credits the site now shows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
- The introduction (000) is now the landing page (index.html); the old
  pages/index.md content (term note and chapter list) moves into it and
  the 'index' direct template is dropped
- Chapter cover pages (x00) list the chapter's pages automatically
- Every page links to its original page on evolution.berkeley.edu via
  new Source / Source_title metadata
- 'The effects of mutations' and 'Why is sexual selection so powerful?'
  become their own pages (205, 215), matching the site; chapter 2 files
  after them are renumbered

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
Each page now lives at the same path as on the original site (without the
evolution-101/ prefix), e.g.
  mechanisms-the-processes-of-evolution/mutations/
Chapter cover pages sit at the chapter path and the introduction stays
the landing page.

Old chapter-N/NN-slug.html URLs from the live site are kept working with
redirect stubs, written by a small local plugin from each article's new
Redirect_from metadata.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
With the full image set now available, replace the old GIF renders with
the figures evolution.berkeley.edu currently shows (redrawn beetle,
drosophila, gopher/lice and phylogeny figures; updated mammal tree from
Upham et al. 2019; new coelacanth photo; combined bowerbird photo).
Remove a caption sentence in 303 that described the old drift figure.

Delete 88 image files no page references any more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
- base.html: close the footer and container (every page had an unclosed
  <footer> and a stray second one); lang=fa dir=rtl; drop the broken
  feed link, missing apple-touch icons, dead html5shim and unused
  pygments.css; per-page meta description and canonical link
- article.html (moved from theme_overrides into the theme): drop the
  commented-out tag box and twitter include; titles get the site name
- pelicanconf: C.UTF-8 locale fallback so --fatal warnings passes on
  machines without fa/en locales; remove quickstart leftovers
  (LINKS/SOCIAL/codehilite); stop building the unlinked tag, category,
  author, archive pages and the unused search-index.json
- remove the stale 2020 copies in theme/css, js, img, font (the build
  uses theme/bookstrap/static)

All 102 generated pages now parse without HTML errors (was 184).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
Scale images wider than 1400px down to 1400px, recompress JPEGs at
quality 85, and palette-compress large PNG illustrations. Filenames are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
- Addresses are now <chapter>-<chapter slug>/<position>-<page slug>/,
  e.g. 4-speciation/06-cospeciation/ (chapter covers are the chapter
  folder). Links point at index.html explicitly, so the built site works
  both on the web and when opened straight from disk; the previous
  folder-only links showed a directory listing from disk.
- New home page (content/pages/index.md) translating the Evolution 101
  front page, with the introduction as its first link; the introduction
  is a normal page again.
- The four questions on the 'big issues' cover now link to their pages,
  as on the original site.
- Remove the redirect plugin and Redirect_from metadata.
- Drop dir=rtl on <html>, which shifted the Bootstrap layout off-screen.
- Sidebar numbers match the page positions in the addresses (covers
  unnumbered); article heading links to the page itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
… Digging Data boxes

- Sidebar: each chapter name links to its cover page; a separate arrow
  button opens and closes the chapter's page list. The current page is
  highlighted and covers are no longer repeated inside the list.
- Chapter covers: the page list is now a set of cards with the page
  number, title and a short excerpt.
- The link to the original page moves to the top, under the title, as
  'متن اصلی ⎋'.
- Digging Data sections sit in a box styled after the original site,
  with its banner, a teal/green palette and smaller portrait photos.
- plain_text filter for excerpts and meta descriptions (drops footnote
  markers and images).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
Stop hosting figures in the repository. Every image now points at the
file the original page uses (including its resized variant, e.g.
radioactive-sign-300x298.png) with that page's width and height, taken
from the saved HTML of the site. Chapter covers use the images the site's
cover pages show today; 220's two cone photos become the site's combined
figure; 301 uses the site's beetle zoom still; the 501 figure that the
site no longer has is dropped. content/images is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
scripts/check_links.py (standard library only) walks the built site and
fails if an internal href/src points at a file missing from the build,
or if an external image (the figures linked from evolution.berkeley.edu)
doesn't return HTTP 200 with an image content type. Network errors are
retried three times before counting as broken; 403/404/410 fail at once.

The deploy workflow runs it right after the Pelican build, so a broken
link stops the deploy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
- Remove the forced 1200px .container width: between 768px and 1200px
  wide the page overflowed (scrollWidth 1205 at 900px), pushing the
  site name off-screen and cutting off text. Bootstrap's responsive
  widths now apply.
- Replace the 74 obsolete <center> captions with <div class="caption">
  and a matching style.
- Typography: remove zero-width non-joiners next to spaces or
  punctuation, doubled spaces, and a misplaced comma (' ،').
- CSS: load the Sahel woff2 font (smaller) with font-display: swap;
  drop unused tag/attentionBox rules, including a typo'd font-size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
Delete 20 templates Pelican never renders here (tag, category, author and
archive listings, pagination, comments, Disqus, Piwik, old Google
Analytics, Twitter, GitHub ribbon, Google CSE sidebar) and the unused
autosidebar.js, along with their includes in base, sidebar and article.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
- SITEURL and README now use evolution101.ir, matching CNAME (they said
  www.evolution101.ir, so canonical links and site search pointed at a
  different host than the one GitHub Pages serves).
- robots.txt: its first line was not a comment, it mixed an empty
  Disallow with real rules, blocked a folder that no longer exists and
  asked for a 120s crawl delay. Now a minimal file pointing at the
  sitemap.
- Generate sitemap.xml with every page, so search engines pick up the
  new addresses.
- Pages (home, about, search) get a canonical link and description; the
  home page title is just the site name.
- About page: say figures come from the original site; drop the request
  for help updating graphics.
- search.md: add missing trailing newline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
Removing the forced 1200px container (48cd840) left the sidebar too wide
for its column: it is a .span3 with .well padding, so column plus
padding no longer fit next to the .span9 and the sidebar wrapped below
the page body. Use border-box sizing on #sidebar so the padding counts
inside the column width. Checked at 375, 800, 1024, 1280, 1440 and
1920px: beside the text from 768px up, stacked on phones, no horizontal
overflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
Replace the 2012 stack (Bootstrap 2.0, jQuery 1.7.2, Font Awesome 3)
that the theme was built on.

- Bootstrap 5.3.8, right-to-left build (bootstrap.rtl.min.css) and
  bootstrap.bundle.min.js; html is now lang=fa dir=rtl, so the hand-made
  RTL overrides are gone. Responsive grid: sidebar on the right beside
  the text from 768px, below it on phones; the sidebar stays in view
  while scrolling.
- Navbar rebuilt with Bootstrap 5 markup; the mobile menu button works
  without jQuery.
- Font Awesome Free 7.3.1 in theme/static/fontawesome (woff2 only), with
  current class names (fa-solid fa-book, fa-chevron-down, ...).
- jQuery removed; the sidebar script moves to js/site.js.
- style.css rewritten: Bootstrap 2 workarounds dropped, chapter cards,
  Digging Data box, captions, tables and source link kept; links are
  underlined only on hover, as before.
- Search form uses Bootstrap 5's input-group; drop the unused PDF block
  from page.html.
- Remove Bootstrap 2 files, glyphicon sprites, old Font Awesome fonts,
  unused pygments.css and the legacy eot/ttf copies of Sahel.
- Theme README and about page credits updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
- Headings one step smaller: page title 1.9rem (was Bootstrap's 2.5rem),
  h2 1.4rem, h3 1.15rem.
- Previous/next at the top become two small outlined buttons
  ('قبلی' / 'بعدی').
- At the bottom they become two cards with a small label and the title of
  the neighbouring page, side by side (stacked on phones); a lone 'next'
  card stays on its own side. Links carry rel=prev/next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
…otes

Search: the Google 'site:' box found nothing because Google hasn't
indexed the site under that domain. Replace it with a search that runs
in the browser:
- The build writes search-index.js (title, chapter, address and plain
  text of every page; UTF-8 JSON via a to_json filter, 229 KB / 58 KB
  gzipped). A .js file so it also loads from disk.
- js/search.js matches every word of the query, ranks title matches
  (and exact/leading title matches) higher, shows chapter and a snippet
  with highlights, and keeps ?q= in the address. It normalises Arabic
  yeh/kaf, diacritics, tatweel, half-spaces and Persian/Arabic digits.
- A secondary 'search on Google' link puts the term first.

Source link: renamed to 'منبع ⎋' and moved below the footnotes, above
the previous/next cards. Drop a duplicate <hr> before the footer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
Follow the Understanding Evolution content-page spec (evo101_page_style),
keeping the Sahel font and mirroring left/right for RTL:
- Body 18px, line-height 1.625, #333; paragraphs and lists 30px below;
  lists indented 40px (on the right), nested lists with circle bullets.
- Headings weight 400, line-height 1.2, 20px below: h1 30px (10px
  below), h2 27px, h3 24px/600, h4 20px/600 with 40px above, h5 18px,
  h6 16px. Colours stay ours rather than the original's slate grey:
  the article title keeps its link blue, headings use the text colour.
- Captions 14px, weight 400, start-aligned, 10px side padding.
- Layout: one breakpoint at 960px; above it a 1140px page with 30px
  padding, text column 65% (702px) and sidebar 30% (324px) on the right;
  below it one column with the sidebar under the article. Replaces the
  Bootstrap grid in base.html with a small flex layout; the navbar uses
  the same container.
- Sidebar held at 16px; footnotes 15px.

All sizes, the page width and the breakpoint are in rem/em, not the
original's px: identical at the default 16px browser font size (checked
at 360-1920px against the spec's column widths), but they grow with the
reader's font-size setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
Start-aligned captions drifted away from narrow images (they sat at the
edge of the column while the image was centred). Centre them instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
The page still said each page links to its original at the top; since
d37c164 that link is 'منبع ⎋' below the footnotes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
…ed as HTML'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
The link is built from data-root and the build's search index, so it is
not user-controlled, but guard it anyway: javascript:, data: and
vbscript: become '#' (ignoring the whitespace and control characters
browsers skip). Absolute roots such as https://evolution101.ir still
work, which a stricter same-site check would have broken.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
Internal links need no network and take under a second, so they stay in
the deploy build and still block a deploy. The hotlinked images from
evolution.berkeley.edu move to check-images.yml, which runs on every
pull request and weekly, so a slow or unreachable Berkeley server no
longer holds up a deploy (the last run sat for over 8 minutes).

check_links.py gets an --images mode that prints each image as it is
checked, sends browser-like headers, and gives up sooner (2 attempts,
15 s timeout, 16 workers); the job itself is capped at 10 minutes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
The search page is always pages/search.html and the index URLs are
relative to the site root, so a result's link is simply '../' + url.
Reading the root from the form's data-root attribute was what CodeQL
flagged as DOM text flowing into a link; with no value read from the
page, that source is gone. The links keep working opened from disk,
under a subfolder and in builds with absolute URLs. The script-scheme
check stays as a backstop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
On one GitHub runner every Berkeley image failed with "Network is
unreachable" while the same images all loaded on the run before: the
server's firewall drops connections from some runners. That says
nothing about the images, so only a real answer now fails the check
(404/410 or another 4xx, or a reply that isn't an image). Timeouts,
refused connections and 403/408/429/5xx count as "not checked" and
end in a warning annotation instead.

After 4 unanswered requests in a row with no success, the rest of that
server's images are skipped, so a blocked run takes about half a
minute instead of several. Requests go 4 at a time instead of 16.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KnHLNra67nUp4DCY8tVDdN
@mortezagk
mortezagk marked this pull request as ready for review September 26, 2026 15:29
@mortezagk mortezagk changed the title Upgrade to Bootstrap 5 RTL with modern styling and search Major update: sync with the current Evolution 101, new site structure, Bootstrap 5 theme and on-site search Sep 26, 2026
@mortezagk
mortezagk merged commit a4fd981 into master Sep 26, 2026
8 checks passed
@mortezagk
mortezagk deleted the develop branch September 26, 2026 15:35
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.

3 participants