Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix book repository URLs #1877

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions external/book/data/book/az.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/be.yml
Original file line number Diff line number Diff line change
@@ -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: Першыя крокі
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/bg.yml
Original file line number Diff line number Diff line change
@@ -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: Начало
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/cs.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/de.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/en.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/es.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/fa.yml
Original file line number Diff line number Diff line change
@@ -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: شروع به کار
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/fr.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/gr.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/id.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/it.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/ja.yml
Original file line number Diff line number Diff line change
@@ -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: 使い始める
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/ko.yml
Original file line number Diff line number Diff line change
@@ -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: 시작하기
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/mk.yml
Original file line number Diff line number Diff line change
@@ -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: Почеток
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/ms.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/nl.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/pl.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/pt-br.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/pt-pt.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/ru.yml
Original file line number Diff line number Diff line change
@@ -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: Введение
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/sl.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/sr.yml
Original file line number Diff line number Diff line change
@@ -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: Почетак
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/sv.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/tl.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/tr.yml
Original file line number Diff line number Diff line change
@@ -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ıç
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/uk.yml
Original file line number Diff line number Diff line change
@@ -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: Вступ
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/uz.yml
Original file line number Diff line number Diff line change
@@ -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: Иш бошланиши
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/zh-tw.yml
Original file line number Diff line number Diff line change
@@ -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: 開始
Expand Down
1 change: 1 addition & 0 deletions external/book/data/book/zh.yml
Original file line number Diff line number Diff line change
@@ -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: 起步
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<a href="{{ relURL "about" }}"{{ if (eq $section "about") }} class="active"{{ end }}>About</a>
<ul{{ if (eq $section "about") }} class="expanded"{{ end }}>
{{ if (eq $section "about") }}
{{ $subsection := .Params.subsection }}
{{ $subsection := .Params.subsection }}
{{ $abouts := sort (where .Site.RegularPages "Params.section" "about") "Params.order" }}
{{ range $i, $about := $abouts }}
<li>
Expand Down Expand Up @@ -51,7 +51,7 @@
</ul>
{{ if (eq .Params.Sidebar "book") }}
<hr class="sidebar">
{{ partial "translations.html" }}
{{ partial "translations.html" . }}
{{ else if (and (ne $section "documentation") (ne $section "site")) }}
<hr class="sidebar">
{{ partial "book.html" }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/translations.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
</p>
<hr class="sidebar"/>
<p>
The source of this book is <a href="{{ .Page.book.repository_url }}">hosted on GitHub.</a></br>
The source of this book is <a href="{{ (index (index .Site.Data.book .Page.Params.book.language_code) "repository_url") }}">hosted on GitHub.</a></br>
Patches, suggestions and comments are welcome.
</p>
1 change: 1 addition & 0 deletions script/book.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
16 changes: 16 additions & 0 deletions tests/git-scm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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) {
Expand All @@ -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')
})
Loading