docs: fix broken relative page links (#1106)

In touching up the migration guide, I noticed that many of our documentation site links are broken! For example, on the homepage, this link:

<img width="782" alt="screenshot of homepage; code snippet is in next block" src="https://user-images.githubusercontent.com/14893287/210462690-31aa7bf5-dd79-4e8f-a3c5-1213e73771c4.png">

which has the following href

```code
<a href="/just-the-docs/just-the-docs/CHANGELOG/">the CHANGELOG</a>
```

duplicates the `baseurl` twice. There are 14 such broken links across the site. Each link duplicates the `baseurl` and `link` tags, which has since been resolved with links being relative by default (there's a set of PRs that document this - I can't find the exact paper trail right now).

To resolve this, I:

- find and replace site-wide `{{ site.baseurl }}{% link` with `{% link`
- tested each link, which now works properly locally *and* on the deploy preview

I'm surprised we didn't catch this earlier! I also could be missing something else, in which case feedback on this PR is certainly welcome.
This commit is contained in:
Matt Wang 2023-01-13 15:56:05 -08:00 committed by GitHub
parent ee178d7bdf
commit a789198b20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 15 deletions

View File

@ -79,7 +79,7 @@ mermaid:
version: "9.1.3" version: "9.1.3"
``` ```
See [the Code documentation]({{ site.baseurl }}{% link docs/ui-components/code.md %}#mermaid-diagram-code-blocks) for more configuration options and information. See [the Code documentation]({% link docs/ui-components/code.md %}#mermaid-diagram-code-blocks) for more configuration options and information.
## Aux links ## Aux links
@ -106,7 +106,7 @@ heading_anchors: true
## External navigation links ## External navigation links
External links can be added to the navigation through the `nav_external_links` option. External links can be added to the navigation through the `nav_external_links` option.
See [Navigation Structure]({{ site.baseurl }}{% link docs/navigation-structure.md %}#external-navigation-links) for more details. See [Navigation Structure]({% link docs/navigation-structure.md %}#external-navigation-links) for more details.
## Footer content ## Footer content
@ -162,7 +162,7 @@ jtd.addEvent(toggleDarkMode, 'click', function(){
}); });
</script> </script>
See [Customization]({{ site.baseurl }}{% link docs/customization.md %}) for more information. See [Customization]({% link docs/customization.md %}) for more information.
## Callouts ## Callouts
@ -215,7 +215,7 @@ The value of `callouts_level` is either `quiet` or `loud`;
The default level is `quiet` when using the `light` or custom color schemes, The default level is `quiet` when using the `light` or custom color schemes,
and `loud` when using the `dark color scheme.` and `loud` when using the `dark color scheme.`
See [Callouts]({{ site.baseurl }}{% link docs/ui-components/callouts.md %}) for more information. See [Callouts]({% link docs/ui-components/callouts.md %}) for more information.
## Google Analytics ## Google Analytics

View File

@ -149,7 +149,7 @@ Just the Docs provides the following custom includes files:
`_includes/toc_heading_custom.html` `_includes/toc_heading_custom.html`
If the page has any child pages, and `has_toc` is not set to `false`, this content appears as a heading above the [auto-generating list of child pages]({{ site.baseurl }}{% link docs/navigation-structure.md %}#auto-generating-table-of-contents) after the page's content. If the page has any child pages, and `has_toc` is not set to `false`, this content appears as a heading above the [auto-generating list of child pages]({% link docs/navigation-structure.md %}#auto-generating-table-of-contents) after the page's content.
#### Example #### Example
{: .no_toc } {: .no_toc }
@ -165,7 +165,7 @@ The (optional) `text-delta` class makes the heading appear as **Contents**{:.tex
`_includes/footer_custom.html` `_includes/footer_custom.html`
This content appears at the bottom of every page's main content. More info for this include can be found in the [Configuration - Footer content]({{ site.baseurl }}{% link docs/configuration.md %}#footer-content). This content appears at the bottom of every page's main content. More info for this include can be found in the [Configuration - Footer content]({% link docs/configuration.md %}#footer-content).
### Custom Head ### Custom Head

View File

@ -235,7 +235,7 @@ Currently, the navigation structure is limited to 3 levels: grandchild pages can
## Auxiliary Links ## Auxiliary Links
To add auxiliary links to your site (in the upper right on all pages), add it to the `aux_links` [configuration option]({{ site.baseurl }}{% link docs/configuration.md %}#aux-links) in your site's `_config.yml` file. To add auxiliary links to your site (in the upper right on all pages), add it to the `aux_links` [configuration option]({% link docs/configuration.md %}#aux-links) in your site's `_config.yml` file.
#### Example #### Example
{: .no_toc } {: .no_toc }
@ -251,7 +251,7 @@ aux_links:
## External Navigation Links ## External Navigation Links
To add external links to the navigation, add them to the `nav_external_links` [configuration]({{ site.baseurl }}{% link docs/configuration.md %}) option in your site's `_config.yml` file. To add external links to the navigation, add them to the `nav_external_links` [configuration]({% link docs/configuration.md %}) option in your site's `_config.yml` file.
External links will appear in the navigation after the links to ordinary pages, but before any collections. External links will appear in the navigation after the links to ordinary pages, but before any collections.
#### Example #### Example

View File

@ -56,7 +56,7 @@ GitHub Flavored Markdown does not support the `button` element, so you'll have t
### Button size ### Button size
Wrap the button in a container that uses the [font-size utility classes]({{ site.baseurl }}{% link docs/utilities/typography.md %}) to scale buttons: Wrap the button in a container that uses the [font-size utility classes]({% link docs/utilities/typography.md %}) to scale buttons:
<div class="code-example" markdown="1"> <div class="code-example" markdown="1">
<span class="fs-6"> <span class="fs-6">
@ -79,7 +79,7 @@ Wrap the button in a container that uses the [font-size utility classes]({{ site
### Spacing between buttons ### Spacing between buttons
Use the [margin utility classes]({{ site.baseurl }}{% link docs/utilities/layout.md %}#spacing) to add spacing between two buttons in the same block. Use the [margin utility classes]({% link docs/utilities/layout.md %}#spacing) to add spacing between two buttons in the same block.
<div class="code-example" markdown="1"> <div class="code-example" markdown="1">
[Button with space](http://example.com/){: .btn .btn-purple .mr-2 } [Button with space](http://example.com/){: .btn .btn-purple .mr-2 }

View File

@ -7,14 +7,14 @@ nav_order: 7
# Callouts # Callouts
Markdown does not include support for callouts. However, you can style text as a callout using a Markdown extension supported by kramdown: [*block IALs*](https://kramdown.gettalong.org/quickref.html#block-attributes). Markdown does not include support for callouts. However, you can style text as a callout using a Markdown extension supported by kramdown: [*block IALs*](https://kramdown.gettalong.org/quickref.html#block-attributes).
Common kinds of callouts include `highlight`, `important`, `new`, `note`, and `warning`. Common kinds of callouts include `highlight`, `important`, `new`, `note`, and `warning`.
{: .warning } {: .warning }
These callout names are *not* pre-defined by the theme: you need to define your own names. These callout names are *not* pre-defined by the theme: you need to define your own names.
When you have [configured]({{ site.baseurl }}{% link docs/configuration.md %}#callouts) the `color` and (optional) `title` for a callout, you can apply it to a paragraph, or to a block quote with several paragraphs, as illustrated below.[^postfix] When you have [configured]({% link docs/configuration.md %}#callouts) the `color` and (optional) `title` for a callout, you can apply it to a paragraph, or to a block quote with several paragraphs, as illustrated below.[^postfix]
[^postfix]: [^postfix]:
You can put the callout markup either before or after its content. You can put the callout markup either before or after its content.

View File

@ -111,4 +111,4 @@ Text can be **bold**, _italic_, or ~~strikethrough~~.
There are a number of specific typographic CSS classes that allow you to override default styling for font size, font weight, line height, and capitalization. There are a number of specific typographic CSS classes that allow you to override default styling for font size, font weight, line height, and capitalization.
[View typography utilities]({{ site.baseurl }}{% link docs/utilities/typography.md %}){: .btn .btn-outline } [View typography utilities]({% link docs/utilities/typography.md %}){: .btn .btn-outline }

View File

@ -18,7 +18,7 @@ Just the Docs gives your documentation a jumpstart with a responsive Jekyll them
--- ---
{: .warning } {: .warning }
> This website documents the features of the current `main` branch of the Just the Docs theme. See [the CHANGELOG]({{ site.baseurl }}{% link CHANGELOG.md %}) for a list of releases, new features, and bug fixes. > This website documents the features of the current `main` branch of the Just the Docs theme. See [the CHANGELOG]({% link CHANGELOG.md %}) for a list of releases, new features, and bug fixes.
Just the Docs is a theme for generating static websites with [Jekyll]. You can write source files for your web pages using [Markdown], the [Liquid] templating language, and HTML.[^1] Jekyll builds your site by converting all files that have [front matter] to HTML. Your [Jekyll configuration] file determines which theme to use, and sets general parameters for your site, such as the URL of its home page. Just the Docs is a theme for generating static websites with [Jekyll]. You can write source files for your web pages using [Markdown], the [Liquid] templating language, and HTML.[^1] Jekyll builds your site by converting all files that have [front matter] to HTML. Your [Jekyll configuration] file determines which theme to use, and sets general parameters for your site, such as the URL of its home page.
@ -95,5 +95,5 @@ Just the Docs is committed to fostering a welcoming community.
[GitHub Pages]: https://pages.github.com/ [GitHub Pages]: https://pages.github.com/
[Template README]: https://github.com/just-the-docs/just-the-docs-template/blob/main/README.md [Template README]: https://github.com/just-the-docs/just-the-docs-template/blob/main/README.md
[GitHub Pages / Actions workflow]: https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/ [GitHub Pages / Actions workflow]: https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/
[customize]: {{ site.baseurl }}{% link docs/customization.md %} [customize]: {% link docs/customization.md %}
[use the template]: https://github.com/just-the-docs/just-the-docs-template/generate [use the template]: https://github.com/just-the-docs/just-the-docs-template/generate