From c008b60ad9217b9ed3d2a8069b6430d2de1af993 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 26 Sep 2024 01:09:28 +0200 Subject: [PATCH 1/4] Replace bogus Horizontal Tab character We try to indent only with spaces over here. Signed-off-by: Johannes Schindelin --- layouts/partials/sidebar.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 5655408b61..8f04270b36 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -7,7 +7,7 @@ About {{ if (eq $section "about") }} - {{ $subsection := .Params.subsection }} + {{ $subsection := .Params.subsection }} {{ $abouts := sort (where .Site.RegularPages "Params.section" "about") "Params.order" }} {{ range $i, $about := $abouts }}
  • From 87f7c491cfa73930f43c70eaad7bfacb03453141 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 26 Sep 2024 02:05:15 +0200 Subject: [PATCH 2/4] script/book: store the repository URL in the site data The URL is already stored in the front matter of the front page of each translation. However, we need it on every page, not just the front page, because the repository link is shown on the bottom of the sidebar. Signed-off-by: Johannes Schindelin --- script/book.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/script/book.rb b/script/book.rb index 4bd3a5386f..d5c91e7068 100644 --- a/script/book.rb +++ b/script/book.rb @@ -118,6 +118,7 @@ def save end data = { "language_code" => @language_code, + "repository_url" => "https://github.com/#{@@all_books[@language_code]}", "chapters" => chapters } path = File.join(File.dirname(__FILE__), "..", "external", "book", "data", "book", "#{@language_code}.yml") From a0bd94983096b82505f64122273e68aa5e118f1a Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 26 Sep 2024 02:06:40 +0200 Subject: [PATCH 3/4] book/data: populate the repository URLs This trick was performed by letting the freshly-modified `script/book.rb` script do its job. Signed-off-by: Johannes Schindelin --- external/book/data/book/az.yml | 1 + external/book/data/book/be.yml | 1 + external/book/data/book/bg.yml | 1 + external/book/data/book/cs.yml | 1 + external/book/data/book/de.yml | 1 + external/book/data/book/en.yml | 1 + external/book/data/book/es.yml | 1 + external/book/data/book/fa.yml | 1 + external/book/data/book/fr.yml | 1 + external/book/data/book/gr.yml | 1 + external/book/data/book/id.yml | 1 + external/book/data/book/it.yml | 1 + external/book/data/book/ja.yml | 1 + external/book/data/book/ko.yml | 1 + external/book/data/book/mk.yml | 1 + external/book/data/book/ms.yml | 1 + external/book/data/book/nl.yml | 1 + external/book/data/book/pl.yml | 1 + external/book/data/book/pt-br.yml | 1 + external/book/data/book/pt-pt.yml | 1 + external/book/data/book/ru.yml | 1 + external/book/data/book/sl.yml | 1 + external/book/data/book/sr.yml | 1 + external/book/data/book/sv.yml | 1 + external/book/data/book/tl.yml | 1 + external/book/data/book/tr.yml | 1 + external/book/data/book/uk.yml | 1 + external/book/data/book/uz.yml | 1 + external/book/data/book/zh-tw.yml | 1 + external/book/data/book/zh.yml | 1 + 30 files changed, 30 insertions(+) diff --git a/external/book/data/book/az.yml b/external/book/data/book/az.yml index 06089a5741..a99d2f54df 100644 --- a/external/book/data/book/az.yml +++ b/external/book/data/book/az.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: az +repository_url: https://github.com/progit2-aze/progit2 chapters: - cs_number: '1' title: Başlanğıc diff --git a/external/book/data/book/be.yml b/external/book/data/book/be.yml index 9316f428b5..da14020163 100644 --- a/external/book/data/book/be.yml +++ b/external/book/data/book/be.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: be +repository_url: https://github.com/progit/progit2-be chapters: - cs_number: '1' title: Першыя крокі diff --git a/external/book/data/book/bg.yml b/external/book/data/book/bg.yml index 1c20fb94b4..e1f13e03c1 100644 --- a/external/book/data/book/bg.yml +++ b/external/book/data/book/bg.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: bg +repository_url: https://github.com/progit/progit2-bg chapters: - cs_number: '1' title: Начало diff --git a/external/book/data/book/cs.yml b/external/book/data/book/cs.yml index 2ec6e9f3fe..ece5752745 100644 --- a/external/book/data/book/cs.yml +++ b/external/book/data/book/cs.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: cs +repository_url: https://github.com/progit-cs/progit2-cs chapters: - cs_number: '1' title: Úvod diff --git a/external/book/data/book/de.yml b/external/book/data/book/de.yml index 9d54357318..27317e9677 100644 --- a/external/book/data/book/de.yml +++ b/external/book/data/book/de.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: de +repository_url: https://github.com/progit/progit2-de chapters: - cs_number: '1' title: Erste Schritte diff --git a/external/book/data/book/en.yml b/external/book/data/book/en.yml index 7e5028195f..6037933859 100644 --- a/external/book/data/book/en.yml +++ b/external/book/data/book/en.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: en +repository_url: https://github.com/progit/progit2 chapters: - cs_number: '1' title: Getting Started diff --git a/external/book/data/book/es.yml b/external/book/data/book/es.yml index 2d8b14a100..906c95efb5 100644 --- a/external/book/data/book/es.yml +++ b/external/book/data/book/es.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: es +repository_url: https://github.com/progit/progit2-es chapters: - cs_number: '1' title: Inicio - Sobre el Control de Versiones diff --git a/external/book/data/book/fa.yml b/external/book/data/book/fa.yml index 1de7a78ccd..f6cb96c9a1 100644 --- a/external/book/data/book/fa.yml +++ b/external/book/data/book/fa.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: fa +repository_url: https://github.com/progit2-fa/progit2 chapters: - cs_number: '1' title: شروع به کار diff --git a/external/book/data/book/fr.yml b/external/book/data/book/fr.yml index 17e4d19f1c..c2632071fd 100644 --- a/external/book/data/book/fr.yml +++ b/external/book/data/book/fr.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: fr +repository_url: https://github.com/progit/progit2-fr chapters: - cs_number: '1' title: Démarrage rapide diff --git a/external/book/data/book/gr.yml b/external/book/data/book/gr.yml index e560909f47..170d38114e 100644 --- a/external/book/data/book/gr.yml +++ b/external/book/data/book/gr.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: gr +repository_url: https://github.com/progit2-gr/progit2 chapters: - cs_number: '1' title: Ξεκινώντας με το Git diff --git a/external/book/data/book/id.yml b/external/book/data/book/id.yml index 076d5e3a38..4d5b1a8601 100644 --- a/external/book/data/book/id.yml +++ b/external/book/data/book/id.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: id +repository_url: https://github.com/progit/progit2-id chapters: - cs_number: '1' title: Memulai diff --git a/external/book/data/book/it.yml b/external/book/data/book/it.yml index 1ef9117009..c2937f2f96 100644 --- a/external/book/data/book/it.yml +++ b/external/book/data/book/it.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: it +repository_url: https://github.com/progit/progit2-it chapters: - cs_number: '1' title: Per Iniziare diff --git a/external/book/data/book/ja.yml b/external/book/data/book/ja.yml index 461d3af478..6edad13080 100644 --- a/external/book/data/book/ja.yml +++ b/external/book/data/book/ja.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: ja +repository_url: https://github.com/progit/progit2-ja chapters: - cs_number: '1' title: 使い始める diff --git a/external/book/data/book/ko.yml b/external/book/data/book/ko.yml index f62345f4fb..c7ed5d7f23 100644 --- a/external/book/data/book/ko.yml +++ b/external/book/data/book/ko.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: ko +repository_url: https://github.com/progit/progit2-ko chapters: - cs_number: '1' title: 시작하기 diff --git a/external/book/data/book/mk.yml b/external/book/data/book/mk.yml index 24207bbccb..afe348381f 100644 --- a/external/book/data/book/mk.yml +++ b/external/book/data/book/mk.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: mk +repository_url: https://github.com/progit2-mk/progit2 chapters: - cs_number: '1' title: Почеток diff --git a/external/book/data/book/ms.yml b/external/book/data/book/ms.yml index 9be3c5385c..326e45a863 100644 --- a/external/book/data/book/ms.yml +++ b/external/book/data/book/ms.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: ms +repository_url: https://github.com/progit2-ms/progit2 chapters: - cs_number: '1' title: Getting Started diff --git a/external/book/data/book/nl.yml b/external/book/data/book/nl.yml index ef38a4019c..5f83024b59 100644 --- a/external/book/data/book/nl.yml +++ b/external/book/data/book/nl.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: nl +repository_url: https://github.com/progit/progit2-nl chapters: - cs_number: '1' title: Aan de slag diff --git a/external/book/data/book/pl.yml b/external/book/data/book/pl.yml index 3176cb93b3..3df2ab0484 100644 --- a/external/book/data/book/pl.yml +++ b/external/book/data/book/pl.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: pl +repository_url: https://github.com/progit2-pl/progit2-pl chapters: - cs_number: '1' title: Pierwsze kroki diff --git a/external/book/data/book/pt-br.yml b/external/book/data/book/pt-br.yml index 440bd11f2a..59fb9bfa1c 100644 --- a/external/book/data/book/pt-br.yml +++ b/external/book/data/book/pt-br.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: pt-br +repository_url: https://github.com/progit/progit2-pt-br chapters: - cs_number: '1' title: Começando diff --git a/external/book/data/book/pt-pt.yml b/external/book/data/book/pt-pt.yml index 4a8d128545..18502fc248 100644 --- a/external/book/data/book/pt-pt.yml +++ b/external/book/data/book/pt-pt.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: pt-pt +repository_url: https://github.com/progit2-pt-pt/progit2 chapters: - cs_number: '1' title: Começando diff --git a/external/book/data/book/ru.yml b/external/book/data/book/ru.yml index 94e1a23c98..bb481a35ca 100644 --- a/external/book/data/book/ru.yml +++ b/external/book/data/book/ru.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: ru +repository_url: https://github.com/progit/progit2-ru chapters: - cs_number: '1' title: Введение diff --git a/external/book/data/book/sl.yml b/external/book/data/book/sl.yml index 45741bca56..06fb3e5528 100644 --- a/external/book/data/book/sl.yml +++ b/external/book/data/book/sl.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: sl +repository_url: https://github.com/progit/progit2-sl chapters: - cs_number: '1' title: Začetek diff --git a/external/book/data/book/sr.yml b/external/book/data/book/sr.yml index 0a4d90a26f..985eea87e3 100644 --- a/external/book/data/book/sr.yml +++ b/external/book/data/book/sr.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: sr +repository_url: https://github.com/progit/progit2-sr chapters: - cs_number: '1' title: Почетак diff --git a/external/book/data/book/sv.yml b/external/book/data/book/sv.yml index 0899f34d26..102a982882 100644 --- a/external/book/data/book/sv.yml +++ b/external/book/data/book/sv.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: sv +repository_url: https://github.com/progit2-sv/progit2 chapters: - cs_number: '1' title: Kom igång diff --git a/external/book/data/book/tl.yml b/external/book/data/book/tl.yml index 0cfff699db..9a8ee458ce 100644 --- a/external/book/data/book/tl.yml +++ b/external/book/data/book/tl.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: tl +repository_url: https://github.com/progit2-tl/progit2 chapters: - cs_number: '1' title: Pagsisimula diff --git a/external/book/data/book/tr.yml b/external/book/data/book/tr.yml index e26660e288..98cdc2f9ba 100644 --- a/external/book/data/book/tr.yml +++ b/external/book/data/book/tr.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: tr +repository_url: https://github.com/progit/progit2-tr chapters: - cs_number: '1' title: Başlangıç diff --git a/external/book/data/book/uk.yml b/external/book/data/book/uk.yml index f71abdb849..55193e44a2 100644 --- a/external/book/data/book/uk.yml +++ b/external/book/data/book/uk.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: uk +repository_url: https://github.com/progit/progit2-uk chapters: - cs_number: '1' title: Вступ diff --git a/external/book/data/book/uz.yml b/external/book/data/book/uz.yml index dbb303f69e..21949aba31 100644 --- a/external/book/data/book/uz.yml +++ b/external/book/data/book/uz.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: uz +repository_url: https://github.com/progit/progit2-uz chapters: - cs_number: '1' title: Иш бошланиши diff --git a/external/book/data/book/zh-tw.yml b/external/book/data/book/zh-tw.yml index 4617fa4f98..6858006b3b 100644 --- a/external/book/data/book/zh-tw.yml +++ b/external/book/data/book/zh-tw.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: zh-tw +repository_url: https://github.com/progit/progit2-zh-tw chapters: - cs_number: '1' title: 開始 diff --git a/external/book/data/book/zh.yml b/external/book/data/book/zh.yml index ede0d2810b..5c5ed3f1d1 100644 --- a/external/book/data/book/zh.yml +++ b/external/book/data/book/zh.yml @@ -1,6 +1,7 @@ ### DO NOT EDIT! Generated by script/update-book2.rb --- language_code: zh +repository_url: https://github.com/progit/progit2-zh chapters: - cs_number: '1' title: 起步 From 041f29fe7ebcabcc9d633c7d0ecc9d01aed2ed62 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 26 Sep 2024 01:49:25 +0200 Subject: [PATCH 4/4] book: fix the repository link at the bottom of the sidebar The repository link worked for the front page of each translation of the book, but not for any other page. Now that the URL is stored in the site-wide data, we can fix this. Signed-off-by: Johannes Schindelin --- layouts/partials/sidebar.html | 2 +- layouts/partials/translations.html | 2 +- tests/git-scm.spec.js | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 8f04270b36..a96cc0540a 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -51,7 +51,7 @@ {{ if (eq .Params.Sidebar "book") }} - {{ partial "translations.html" }} + {{ partial "translations.html" . }} {{ else if (and (ne $section "documentation") (ne $section "site")) }} {{ partial "book.html" }} diff --git a/layouts/partials/translations.html b/layouts/partials/translations.html index 1308b524a2..2cb786361c 100644 --- a/layouts/partials/translations.html +++ b/layouts/partials/translations.html @@ -48,6 +48,6 @@

    -The source of this book is hosted on GitHub.
    +The source of this book is hosted on GitHub.
    Patches, suggestions and comments are welcome.

    diff --git a/tests/git-scm.spec.js b/tests/git-scm.spec.js index e8674a84bb..46554b3b9a 100644 --- a/tests/git-scm.spec.js +++ b/tests/git-scm.spec.js @@ -201,10 +201,18 @@ test('manual pages', async ({ page }) => { test('book', async ({ page }) => { await page.goto(`${url}book`) + // the repository URL is correct + await expect(page.getByRole('link', { name: 'hosted on GitHub' })) + .toHaveAttribute('href', 'https://github.com/progit/progit2') + // Navigate to the first section await page.getByRole('link', { name: 'Getting Started' }).click() await expect(page).toHaveURL(/Getting-Started-About-Version-Control/) + // the repository URL is still correct + await expect(page.getByRole('link', { name: 'hosted on GitHub' })) + .toHaveAttribute('href', 'https://github.com/progit/progit2') + // Verify that the drop-down is shown when clicked const chaptersDropdown = page.locator('#chapters-dropdown') await expect(chaptersDropdown).toBeHidden() @@ -220,6 +228,10 @@ test('book', async ({ page }) => { await expect(page).toHaveURL(/book\/fr/) await expect(page.getByRole('link', { name: 'Démarrage rapide' })).toBeVisible() + // the repository URL now points to the French translation + await expect(page.getByRole('link', { name: 'hosted on GitHub' })) + .toHaveAttribute('href', 'https://github.com/progit/progit2-fr') + // Navigate to a page whose URL contains a question mark await page.goto(`${url}book/az/v2/Başlanğıc-Git-Nədir?`) if (isRailsApp) { @@ -229,4 +241,8 @@ test('book', async ({ page }) => { await expect(page).toHaveURL(/Ba%C5%9Flan%C4%9F%C4%B1c-Git-N%C9%99dir%3F/) } await expect(page.getByRole('document')).toHaveText(/Snapshot’lar, Fərqlər Yox/) + + // the repository URL now points to the Azerbaijani translation + await expect(page.getByRole('link', { name: 'hosted on GitHub' })) + .toHaveAttribute('href', 'https://github.com/progit2-aze/progit2') })