Skip to content

Commit c923e20

Browse files
committed
Use relative URLs
To be able to develop git-scm.com changes in a personal fork (where the URL is of the form `https://user.github.io/git-scm.com/`, i.e. the site is _not_ located at the root directory) as well as reuse the result in the main repository (where the site does live in the root directory), it is highly recommended to use relative URLs where possible. This is particularly necessary because we want https://git.github.io/git-scm.com/ to render correctly, too. This trick is a bit tricky because Hugo's `relURL` function is only available in the `layouts/` directory, and our custom `relurl` shortcode has to be used inside `content/`, and the trick was performed by: sed -i 's,\(href=\|src=\)["'\'']/\([^{"'\'']*\)["'\''],\1"{{< relurl "\2" >}}",g' \ $(git ls-files content/\*.html) sed -i 's,\(href=\|src=\|action=\)["'\'']/\([^{"'\'']*\)["'\''],\1"{{ relURL "\2" }}",g' \ $(git ls-files ':^content/' \*.html) Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 18e40f2 commit c923e20

31 files changed

+174
-173
lines changed

content/404.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<div class='inner'>
66
<p>
7-
<img src="/images/[email protected]" alt="404" width="456" height="149" />
7+
<img src="{{< relurl "images/[email protected]" >}}" alt="404" width="456" height="149" />
88
</p>
99
<h1>That page doesn't exist.</h1>
1010
<p>

content/about/branching-and-merging.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ <h2>Branching and Merging</h2>
4242
</ul>
4343

4444
<p class="center">
45-
<img src="/images/about/[email protected]" width="500" height="288" alt="Branches">
45+
<img src="{{< relurl "images/about/[email protected]" >}}" width="500" height="288" alt="Branches">
4646
</p>
4747

4848
<p>
@@ -54,7 +54,7 @@ <h2>Branching and Merging</h2>
5454
</p>
5555

5656
<div class="bottom-nav" style="display: block;">
57-
<a href="/about/small-and-fast" class="next" data-section-id="small-and-fast">Small and Fast →</a>
57+
<a href="{{< relurl "about/small-and-fast" >}}" class="next" data-section-id="small-and-fast">Small and Fast →</a>
5858
</div>
5959

6060
</section>

content/about/data-assurance.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h2>Data Assurance</h2>
1717
checksum when checked back out. It's impossible to get anything out of Git
1818
other than the <strong>exact bits you put in</strong>.
1919
</p>
20-
<img height="522" src="/images/[email protected]" width="628">
20+
<img height="522" src="{{< relurl "images/[email protected]" >}}" width="628">
2121
<p>
2222
It is also impossible to change any file, date, commit message, or any other
2323
data in a Git repository without changing the IDs of everything after it.
@@ -29,8 +29,8 @@ <h2>Data Assurance</h2>
2929
Most centralized version control systems provide no such integrity by default.
3030
</p>
3131
<div class="bottom-nav" style="display: block;">
32-
<a href="/about/distributed" class="previous" data-section-id="distributed">← Distributed</a>
33-
<a href="/about/staging-area" class="next" data-section-id="staging-area">Staging Area →</a>
32+
<a href="{{< relurl "about/distributed" >}}" class="previous" data-section-id="distributed">← Distributed</a>
33+
<a href="{{< relurl "about/staging-area" >}}" class="next" data-section-id="staging-area">Staging Area →</a>
3434
</div>
3535
</section>
3636

content/about/distributed.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,25 @@ <h4>Subversion-Style Workflow</h4>
2727
A centralized workflow is very common, especially from people transitioning from a centralized system. Git will not allow you to push if someone has pushed since the last time you fetched, so a centralized model where all developers push to the same server works just fine.
2828
</p>
2929
<p class="center">
30-
<img src="/images/about/[email protected]" width="415" height="209" alt="Workflow A">
30+
<img src="{{< relurl "images/about/[email protected]" >}}" width="415" height="209" alt="Workflow A">
3131
</p>
3232
<h4>Integration Manager Workflow</h4>
3333
<p>
3434
Another common Git workflow involves an integration manager — a single person who commits to the 'blessed' repository. A number of developers then clone from that repository, push to their own independent repositories, and ask the integrator to pull in their changes. This is the type of development model often seen with open source or GitHub repositories.
3535
</p>
3636
<p class="center">
37-
<img src="/images/about/[email protected]" width="407" height="164" alt="Workflow B">
37+
<img src="{{< relurl "images/about/[email protected]" >}}" width="407" height="164" alt="Workflow B">
3838
</p>
3939
<h4>Dictator and Lieutenants Workflow</h4>
4040
<p>
4141
For more massive projects, a development workflow like that of the Linux kernel is often effective.
4242
In this model, some people ('lieutenants') are in charge of a specific subsystem of the project and they merge in all changes related to that subsystem. Another integrator (the 'dictator') can pull changes from only his/her lieutenants and then push to the 'blessed' repository that everyone then clones from again.
4343
</p>
4444
<p class="center">
45-
<img src="/images/about/[email protected]" width="562" height="303" alt="Workflow C">
45+
<img src="{{< relurl "images/about/[email protected]" >}}" width="562" height="303" alt="Workflow C">
4646
</p>
4747
<div class="bottom-nav" style="display: block;">
48-
<a href="/about/small-and-fast" class="previous" data-section-id="small-and-fast">← Small and Fast</a>
49-
<a href="/about/data-assurance" class="next" data-section-id="info-assurance">Data Assurance →</a>
48+
<a href="{{< relurl "about/small-and-fast" >}}" class="previous" data-section-id="small-and-fast">← Small and Fast</a>
49+
<a href="{{< relurl "about/data-assurance" >}}" class="next" data-section-id="info-assurance">Data Assurance →</a>
5050
</div>
5151
</section>

content/about/free-and-open-source.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ <h2>Free and Open Source</h2>
1717
free for all its users.</p>
1818

1919
<p>However, we do restrict the use of the term "Git" and the
20-
<a href="/downloads/logos">logos</a> to avoid confusion. Please
21-
see our <a href="/trademark">trademark</a> policy for
20+
<a href="{{< relurl "downloads/logos" >}}">logos</a> to avoid confusion. Please
21+
see our <a href="{{< relurl "trademark" >}}">trademark</a> policy for
2222
details.</p>
2323

2424
<div class="bottom-nav" style="display: block;">
25-
<a href="/about/staging-area" class="previous" data-section-id="staging-area">← Staging Area</a>
26-
<a href="/about/trademark" class="next" data-section-id="trademark">Trademark →</a>
25+
<a href="{{< relurl "about/staging-area" >}}" class="previous" data-section-id="staging-area">← Staging Area</a>
26+
<a href="{{< relurl "about/trademark" >}}" class="next" data-section-id="trademark">Trademark →</a>
2727
</div>
2828
</section>

content/about/small-and-fast.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ <h3>Benchmarks</h3>
155155
</p>
156156

157157
<div class="bottom-nav" style="display: block;">
158-
<a href="/about/branching-and-merging" class="previous" data-section-id="branching-and-merging">← Branching and Merging</a>
159-
<a href="/about/distributed" class="next" data-section-id="distributed">Distributed →</a>
158+
<a href="{{< relurl "about/branching-and-merging" >}}" class="previous" data-section-id="branching-and-merging">← Branching and Merging</a>
159+
<a href="{{< relurl "about/distributed" >}}" class="next" data-section-id="distributed">Distributed →</a>
160160
</div>
161161

162162
</section>

content/about/staging-area.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h2>Staging Area</h2>
1616
One thing that sets Git apart from other tools is that it's possible to quickly stage some of your files and commit them without committing all of the other modified files in your working directory or having to list them on the command line during the commit.
1717
</p>
1818
<p class="center">
19-
<img src="/images/about/[email protected]" width="336" height="194" alt="Index 1">
19+
<img src="{{< relurl "images/about/[email protected]" >}}" width="336" height="194" alt="Index 1">
2020
</p>
2121
<p>
2222
This allows you to stage only portions of a modified file. Gone are the days of making two logically unrelated modifications to a file before you realized that you forgot to commit one of them. Now you can just stage the change you need for the current commit and stage the other change for the next commit. This feature scales up to as many different changes to your file as needed.
@@ -25,11 +25,11 @@ <h2>Staging Area</h2>
2525
Of course, Git also makes it easy to ignore this feature if you don't want that kind of control — just add a '-a' to your commit command in order to add all changes to all files to the staging area.
2626
</p>
2727
<p class="center">
28-
<img src="/images/about/[email protected]" width="338" height="185" alt="Index 2">
28+
<img src="{{< relurl "images/about/[email protected]" >}}" width="338" height="185" alt="Index 2">
2929
</p>
3030
<div class="bottom-nav" style="display: block;">
31-
<a href="/about/data-assurance" class="previous" data-section-id="info-assurance">← Data Assurance</a>
32-
<a href="/about/free-and-open-source" class="next" data-section-id="free-and-open-source">Free and Open Source →</a>
31+
<a href="{{< relurl "about/data-assurance" >}}" class="previous" data-section-id="info-assurance">← Data Assurance</a>
32+
<a href="{{< relurl "about/free-and-open-source" >}}" class="next" data-section-id="free-and-open-source">Free and Open Source →</a>
3333
</div>
3434
</section>
3535

content/about/trademark.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ <h3>4 Questions</h3>
187187
Montague St. Ste 380, Brooklyn, NY 11201-3548.</p>
188188

189189
<div class="bottom-nav" style="display: block;">
190-
<a href="/about/free-and-open-source" class="previous" data-section-id="free-and-open-source">← Free and Open Source</a>
190+
<a href="{{< relurl "about/free-and-open-source" >}}" class="previous" data-section-id="free-and-open-source">← Free and Open Source</a>
191191
</div>
192192

193193
</section>

content/blog/_index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ <h1>
1010
Moved!
1111
</h1>
1212

13-
Technical content that was previously found in the blog section of this site has been integrated into the <a href="/book/en/v2">second edition of the Pro Git book</a>.
13+
Technical content that was previously found in the blog section of this site has been integrated into the <a href="{{< relurl "book/en/v2" >}}">second edition of the Pro Git book</a>.
1414
</div>

content/community/_index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h2> Bug Reporting </h2>
4848

4949
<p>
5050
If you are using git 2.27.0 or later, you can run
51-
<a href="/docs/git-bugreport"><span class="fixed">git bugreport</span></a> in the repository
51+
<a href="{{< relurl "docs/git-bugreport" >}}"><span class="fixed">git bugreport</span></a> in the repository
5252
where you observed the bug,
5353
which generates a template to guide you through writing a useful bug
5454
report and gathers some diagnostic information about your
@@ -101,7 +101,7 @@ <h2> Newsletter </h2>
101101
<h2> Contributing to Git </h2>
102102

103103
<p>
104-
The <a href="https://github.com/git/git/tree/master/Documentation">Documentation directory</a> in the Git source code has several files of interest to developers who are looking to help contribute. After reading the <a href="https://github.com/git/git/blob/master/Documentation/CodingGuidelines">coding guidelines</a> and <a href="https://github.com/git/git/blob/master/CODE_OF_CONDUCT.md">code of conduct</a>, you can learn <a href="/docs/SubmittingPatches">how to submit patches</a>. If you are just starting out, you can read the <a href="/docs/MyFirstContribution">My First Contribution tutorial</a>. For those looking to get more deeply involved, there is a <a href="https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt">howto for Git maintainers</a>.
104+
The <a href="https://github.com/git/git/tree/master/Documentation">Documentation directory</a> in the Git source code has several files of interest to developers who are looking to help contribute. After reading the <a href="https://github.com/git/git/blob/master/Documentation/CodingGuidelines">coding guidelines</a> and <a href="https://github.com/git/git/blob/master/CODE_OF_CONDUCT.md">code of conduct</a>, you can learn <a href="{{< relurl "docs/SubmittingPatches" >}}">how to submit patches</a>. If you are just starting out, you can read the <a href="{{< relurl "docs/MyFirstContribution" >}}">My First Contribution tutorial</a>. For those looking to get more deeply involved, there is a <a href="https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt">howto for Git maintainers</a>.
105105
</p>
106106

107107
<p>

content/doc/_index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1> Documentation </h1>
1313
<h2> Reference </h2>
1414

1515
<div class="callout ref-manual">
16-
<h3><a href="/docs">Reference Manual</a></h3>
16+
<h3><a href="{{< relurl "docs" >}}">Reference Manual</a></h3>
1717

1818
<p>
1919
The official and comprehensive <strong>man pages</strong> that are included in the Git package itself.
@@ -33,8 +33,8 @@ <h2> Book </h2>
3333

3434
<div class="callout ref-manual">
3535
<h3>Pro Git</h3>
36-
<p>The entire <strong><a href="/book">Pro Git book</a></strong> written
37-
by Scott Chacon and Ben Straub is available to <a href="/book">read online for free</a>.
36+
<p>The entire <strong><a href="{{< relurl "book" >}}">Pro Git book</a></strong> written
37+
by Scott Chacon and Ben Straub is available to <a href="{{< relurl "book" >}}">read online for free</a>.
3838
Dead tree versions are available on <a href="https://www.amazon.com/Pro-Git-Scott-Chacon/dp/1484200772?ie=UTF8&camp=1789&creative=9325&creativeASIN=1430218339&linkCode=as2&tag=git-sfconservancy-20">Amazon.com</a>.
3939
</p>
4040
</div>
@@ -45,12 +45,12 @@ <h2> Videos </h2>
4545
{{< videos >}}
4646

4747
<p>
48-
<a href="/videos">See all videos →</a>
48+
<a href="{{< relurl "videos" >}}">See all videos →</a>
4949
</p>
5050

5151
<h2> External Links </h2>
5252
<p>
53-
The <a href="/doc/ext">External Links section</a> is a curated, ever-evolving collection of tutorials, books, videos, and other Git resources.
53+
The <a href="{{< relurl "doc/ext" >}}">External Links section</a> is a curated, ever-evolving collection of tutorials, books, videos, and other Git resources.
5454
</p>
5555

5656
</div>

content/downloads/_index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ <h1>Downloads</h1>
1414
<table class="binaries">
1515
<tr>
1616
<td>
17-
<a href="/download/mac" class="icon mac">macOS</a>
17+
<a href="{{< relurl "download/mac" >}}" class="icon mac">macOS</a>
1818
</td>
1919
<td>
20-
<a href="/download/win" class="icon windows">Windows</a>
20+
<a href="{{< relurl "download/win" >}}" class="icon windows">Windows</a>
2121
</td>
2222
</tr>
2323
<tr>
2424
<td>
25-
<a href="/download/linux" class="icon linux">Linux/Unix</a>
25+
<a href="{{< relurl "download/linux" >}}" class="icon linux">Linux/Unix</a>
2626
</td>
2727
</tr>
2828
</table>
@@ -44,7 +44,7 @@ <h2>GUI Clients</h2>
4444
</p>
4545
<p>
4646
<strong>
47-
<a href="/downloads/guis">View GUI Clients →</a>
47+
<a href="{{< relurl "downloads/guis" >}}">View GUI Clients →</a>
4848
</strong>
4949
</p>
5050
</div>
@@ -53,7 +53,7 @@ <h2>Logos</h2>
5353
<p>Various Git logos in PNG (bitmap) and EPS (vector) formats are available for use in online and print projects.</p>
5454
<p>
5555
<strong>
56-
<a href="/downloads/logos">View Logos →</a>
56+
<a href="{{< relurl "downloads/logos" >}}">View Logos →</a>
5757
</strong>
5858
</p>
5959
</div>

content/downloads/guis/_index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div id="main">
1111
<h1>GUI Clients</h1>
1212
<p>
13-
Git comes with built-in GUI tools for committing (<a href="/docs/git-gui">git-gui</a>) and browsing (<a href="/docs/gitk">gitk</a>), but there are several third-party tools for users looking for platform-specific experience.
13+
Git comes with built-in GUI tools for committing (<a href="{{< relurl "docs/git-gui" >}}">git-gui</a>) and browsing (<a href="{{< relurl "docs/gitk" >}}">gitk</a>), but there are several third-party tools for users looking for platform-specific experience.
1414
</p>
1515
<p>
1616
<small>If you want to add another GUI tool to this list, just <a href="https://github.com/git/git-scm.com/blob/main/README.md#adding-new-gui">follow the instructions</a>.</small>

0 commit comments

Comments
 (0)