Skip to content

Commit

Permalink
use fix: proper trailing slashes (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
a2937 committed Sep 18, 2024
1 parent 3f0ddbf commit aaeb136
Show file tree
Hide file tree
Showing 28 changed files with 108 additions and 101 deletions.
5 changes: 3 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import tailwind from '@astrojs/tailwind';
// https://astro.build/config
export default defineConfig({
redirects: {
'/index': '/intro',
'/FAQ': '/faq'
'/index': '/intro/',
'/FAQ': '/faq/'
},
i18n: {
defaultLocale: 'en',
Expand Down Expand Up @@ -50,6 +50,7 @@ export default defineConfig({
})
],
output: 'server',
trailingSlash: 'always',
adapter: node({
mode: 'middleware'
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/FCCHeader.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import FCCThemeSelect from './FCCThemeSelect.astro';

{/* Center: Logo */}
<div class='flex-grow flex justify-center'>
<a href='/intro' class='flex items-center'>
<a href='/intro/' class='flex items-center'>
<img
src='https://cdn.freecodecamp.org/platform/universal/fcc_secondary.svg'
alt='freeCodeCamp.org'
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/codebase-best-practices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ We are striving to support right-to-left (RTL) layout in the codebase for langua

## General JavaScript

In most cases, our [linter](/how-to-setup-freecodecamp-locally#follow-these-steps-to-get-your-development-environment-ready) will warn of any formatting which goes against this codebase's preferred practice.
In most cases, our [linter](/how-to-setup-freecodecamp-locally/#follow-these-steps-to-get-your-development-environment-ready) will warn of any formatting which goes against this codebase's preferred practice.

It is encouraged to use functional components over class-based components.

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Yes - You can contribute to any of the 30+ languages we have enabled on our tran

We have user-contributed translations live in some languages. We intend to localize freeCodeCamp into several major world languages. You can read all about this in our [announcement here](https://www.freecodecamp.org/news/help-translate-freecodecamp-language/).

If you are interested in contributing to translations please make sure you [read this guide](/how-to-translate-files) first.
If you are interested in contributing to translations please make sure you [read this guide](/how-to-translate-files/) first.

## Can I contribute articles to freeCodeCamp News or videos to freeCodeCamp's YouTube channel?

Expand Down Expand Up @@ -95,7 +95,7 @@ Altogether, be respectful to others. We are humans from all around the world. Wi

If you practice the above **consistently for a while** and our fellow moderator members recommend you, a staff member will reach out and onboard you to the moderators' team. Open source work is voluntary work and our time is limited. We acknowledge that this is probably true in your case as well. So we emphasize being **consistent** rather than engaging in the community 24/7.

Take a look at our [Moderator Handbook](/moderator-handbook) for a more exhaustive list of other responsibilities and expectations we have of our moderators.
Take a look at our [Moderator Handbook](/moderator-handbook/) for a more exhaustive list of other responsibilities and expectations we have of our moderators.

## I am stuck on something that is not included in this documentation.

Expand Down
8 changes: 4 additions & 4 deletions src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Before you proceed, please take a quick 2 minutes to read our [Code of Conduct](

You are welcome to create, update and fix bugs in our [curriculum](#curriculum), help us fix bugs in freeCodeCamp.org's [learning platform](#learning-platform), or [help us translate](#translations) freeCodeCamp.org to world languages.

We answer the most common questions about contributing [in our contributor FAQ](/faq).
We answer the most common questions about contributing [in our contributor FAQ](/faq/).

Happy contributing.

Expand All @@ -23,7 +23,7 @@ Our curriculum is curated by the global freeCodeCamp community. This way, we are

You can help expand and improve the curriculum. You can also update project user stories to better-explain concepts. And you can improve our automated tests so that we can more accurately test people's code.

**If you're interested in improving our curriculum, here's [how to contribute to the curriculum](/how-to-work-on-coding-challenges).**
**If you're interested in improving our curriculum, here's [how to contribute to the curriculum](/how-to-work-on-coding-challenges/).**

## Translations

Expand All @@ -41,12 +41,12 @@ Certifications are already live in some major world languages like below:

We encourage you to read the [announcement here](https://www.freecodecamp.org/news/help-translate-freecodecamp-language/) and share it with your friends to get them excited about this.

**If you're interested in translating, here's [how to translate freeCodeCamp's resources](/how-to-translate-files).**
**If you're interested in translating, here's [how to translate freeCodeCamp's resources](/how-to-translate-files/).**

## Learning Platform

Our learning platform runs on a modern JavaScript stack. It has various components, tools, and libraries. These include Node.js, MongoDB, OAuth 2.0, React, Gatsby, Webpack, and more.

Broadly, we have a Node.js based API server, a set of React-based client applications, testing scripts to evaluate camper-submitted curriculum projects, and more. If you want to productively contribute to the learning platform, we recommend some familiarity with these tools.

**If you want to help us improve our codebase here's [how to set up freeCodeCamp](/how-to-setup-freecodecamp-locally).**
**If you want to help us improve our codebase here's [how to set up freeCodeCamp](/how-to-setup-freecodecamp-locally/).**
4 changes: 2 additions & 2 deletions src/content/docs/how-to-add-playwright-tests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ describe('The campers landing page', () => {

### Ensure that MongoDB and Client Applications are Running

- [Start MongoDB and seed the database](/how-to-setup-freecodecamp-locally#step-3-start-mongodb-and-seed-the-database). In order for Playwright tests to work, be sure that you use the `pnpm run seed:certified-user` command.
- [Start MongoDB and seed the database](/how-to-setup-freecodecamp-locally/#step-3-start-mongodb-and-seed-the-database). In order for Playwright tests to work, be sure that you use the `pnpm run seed:certified-user` command.

- [Start the freeCodeCamp client application and API server](/how-to-setup-freecodecamp-locally#step-4-start-the-freecodecamp-client-application-and-api-server)
- [Start the freeCodeCamp client application and API server](/how-to-setup-freecodecamp-locally/#step-4-start-the-freecodecamp-client-application-and-api-server)

### Run the Playwright Tests

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/how-to-contribute-to-the-codebase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Ignoring these steps may soil your copy which makes the contributing, maintainin

## Contributing to the Codebase

You can now make changes to files and commit your changes to your fork, which you can prepare by reading [how to set up freeCodeCamp locally](/how-to-setup-freecodecamp-locally).
You can now make changes to files and commit your changes to your fork, which you can prepare by reading [how to set up freeCodeCamp locally](/how-to-setup-freecodecamp-locally/).

Follow these steps:

Expand Down Expand Up @@ -207,7 +207,7 @@ Follow these steps:

## Proposing a Pull Request (PR)

After you've committed your changes, check here for [how to open a Pull Request](/how-to-open-a-pull-request).
After you've committed your changes, check here for [how to open a Pull Request](/how-to-open-a-pull-request/).
## Quick commands reference
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/how-to-enable-new-languages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ You don't have to have everything in these 3 files translated at first. It's pos

You can replace any URLs that you have corresponding pages ready in your language.

For example, if you have a publication in your language, you can replace the URL for `"news"`. If you want to translate articles listed in the footer links, see [How to Translate Articles in the Footer Links](/language-lead-handbook#how-to-translate-articles-in-the-footer-links).
For example, if you have a publication in your language, you can replace the URL for `"news"`. If you want to translate articles listed in the footer links, see [How to Translate Articles in the Footer Links](/language-lead-handbook/#how-to-translate-articles-in-the-footer-links).

#### `meta-tags.json`

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/how-to-help-with-video-challenges.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Skim the YouTube video with that `videoId` and think of a multiple-choice questi

### Add the Question to the Markdown File

You can add the question locally or using the GitHub interface. To add the question locally, you need to [set up freeCodeCamp locally](/how-to-setup-freecodecamp-locally). You can also find the file on GitHub and click the edit button to add the question right in your browser.
You can add the question locally or using the GitHub interface. To add the question locally, you need to [set up freeCodeCamp locally](/how-to-setup-freecodecamp-locally/). You can also find the file on GitHub and click the edit button to add the question right in your browser.

If a question has not yet been added to a particular video challenge, it will have the following default question:

Expand Down Expand Up @@ -205,4 +205,4 @@ For more examples, you can look at the markdown files for the following video co

## Open a Pull Request

After creating one or more questions, you can commit the changes to a new branch and [open a pull request](/how-to-open-a-pull-request).
After creating one or more questions, you can commit the changes to a new branch and [open a pull request](/how-to-open-a-pull-request/).
6 changes: 3 additions & 3 deletions src/content/docs/how-to-open-a-pull-request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Some examples of this are:
</Steps>

:::note
Your PR should be targeting changes to the English curriculum only. Read [this guide](/intro#translations) instead for contributing to translations.
Your PR should be targeting changes to the English curriculum only. Read [this guide](/intro/#translations) instead for contributing to translations.
:::

## Prepare a Good PR Title
Expand Down Expand Up @@ -107,7 +107,7 @@ Some examples of good PR titles would be:

- This is very important when making changes that are not just edits to text content like documentation or a challenge description. Examples of changes that need local testing include JavaScript, CSS, or HTML, which could change the functionality or layout of a page.

- If your PR affects the behavior of a page, it should be accompanied by corresponding [Playwright integration tests](/how-to-add-playwright-tests).
- If your PR affects the behavior of a page, it should be accompanied by corresponding [Playwright integration tests](/how-to-add-playwright-tests/).

</Steps>

Expand All @@ -120,7 +120,7 @@ Our moderators will now take a look and leave you feedback. Please be patient wi
And as always, feel free to ask questions on the ['Contributors' category on our forum](https://forum.freecodecamp.org/c/contributors) or [the contributors chat room](https://discord.gg/PRyKn3Vbay).

:::tip
If you are to be contributing more pull requests, we recommend you read the [making changes and syncing](/how-to-setup-freecodecamp-locally#making-changes-locally) guidelines to avoid having to delete your fork.
If you are to be contributing more pull requests, we recommend you read the [making changes and syncing](/how-to-setup-freecodecamp-locally/#making-changes-locally) guidelines to avoid having to delete your fork.
:::

## Conflicts on a Pull Request
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/how-to-proofread-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You should see the list of projects you have been granted access to. Select the
You should now see the list of available files. Choose your file by selecting the `Proofread` button on the right of that file, then choosing `Proofreading` from the drop-down menu that appears.

:::note
If you are in this workspace view, but want to work on [translating a file](/how-to-translate-files) instead of proofreading, you may select `Crowdsourcing` from the dropdown menu instead.
If you are in this workspace view, but want to work on [translating a file](/how-to-translate-files/) instead of proofreading, you may select `Crowdsourcing` from the dropdown menu instead.
:::

## Proofread Translations
Expand Down
12 changes: 6 additions & 6 deletions src/content/docs/how-to-setup-freecodecamp-locally.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Follow these guidelines for setting up a development environment for freeCodeCam

<Aside type='danger' title='Warning for Windows Users'>

- You can't build and run the codebase on Windows, you will [need to use WSL2](/how-to-setup-wsl) and then follow the rest of the instructions for Linux or macOS.
- You can't build and run the codebase on Windows, you will [need to use WSL2](/how-to-setup-wsl/) and then follow the rest of the instructions for Linux or macOS.
- You can't use Windows Command Prompt, Git Bash or PowerShell.
- The hardware requirements need to be better than [what we recommend](/how-to-setup-freecodecamp-locally?id=how-to-prepare-your-local-machine) to accommodate for a WSL-based setup.

Expand Down Expand Up @@ -129,7 +129,7 @@ We have automated the process of installing all the dependencies & tools you wil

That's it, you can now skip to the [syncing up from parent](#set-up-syncing-from-parent) section after you have launched a Gitpod workspace.

Most parts of this guide applies to Gitpod workspaces, make sure to check the [troubleshooting section](/troubleshooting-development-issues) for any gotchas.
Most parts of this guide applies to Gitpod workspaces, make sure to check the [troubleshooting section](/troubleshooting-development-issues/) for any gotchas.

</Aside>

Expand All @@ -147,13 +147,13 @@ Here is a minimum system requirement for running freeCodeCamp locally:

- A fast CPU (4+ cores)
- At least 8 GB RAM
- macOS, Linux or Windows 10 or 11 ([with WSL](/how-to-setup-wsl))
- macOS, Linux or Windows 10 or 11 ([with WSL](/how-to-setup-wsl/))
- 8-10 GB of free disk space
- (Optional) 30-50 Mbps internet connection

</Card>

We primarily support development on Linux and Unix-based systems like Ubuntu and macOS. You can develop on Windows 10 or 11 with WSL2 only. You can follow [this guide](/how-to-setup-wsl) to set up WSL2. You can't use Command Prompt, Git Bash or PowerShell to run freeCodeCamp natively within windows.
We primarily support development on Linux and Unix-based systems like Ubuntu and macOS. You can develop on Windows 10 or 11 with WSL2 only. You can follow [this guide](/how-to-setup-wsl/) to set up WSL2. You can't use Command Prompt, Git Bash or PowerShell to run freeCodeCamp natively within windows.

Start by installing the prerequisite software for your operating system.

Expand All @@ -167,7 +167,7 @@ Start by installing the prerequisite software for your operating system.

<Aside type='caution' title='Did you check the version?'>

If you have a different version of a requisite software, please install the recommended version. See the [troubleshooting section](/troubleshooting-development-issues) for more details.
If you have a different version of a requisite software, please install the recommended version. See the [troubleshooting section](/troubleshooting-development-issues/) for more details.

</Aside>

Expand Down Expand Up @@ -407,7 +407,7 @@ If the app loads, sign in. You now have a copy of freeCodeCamp's entire learning
<Aside type='note'>
If you have issues with the setup, check out the [troubleshooting section](/troubleshooting-development-issues).
If you have issues with the setup, check out the [troubleshooting section](/troubleshooting-development-issues/).
</Aside>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ You only need to follow this section if you're modifying the challenge test runn

## Proposing a Pull Request (PR)

After you've committed your changes, check here for [how to open a Pull Request](/how-to-open-a-pull-request).
After you've committed your changes, check here for [how to open a Pull Request](/how-to-open-a-pull-request/).
// Quick commands reference - NEED TO DISCUSS ABOUT THIS
Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/how-to-setup-wsl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Before you follow these instructions make sure your system meets the requirement
**Docker Desktop for Windows**: See respective requirements for [Windows 10 Pro](https://docs.docker.com/docker-for-windows/install/#system-requirements) and [Windows 10 Home](https://docs.docker.com/docker-for-windows/install-windows-home/#system-requirements)
:::

This guide covers some common steps with the setup of WSL2. Once some of the common issues with WSL2 are addressed, you should be able to follow [this local setup guide](/how-to-setup-freecodecamp-locally) to work with freeCodeCamp on Windows running a WSL distro like Ubuntu.
This guide covers some common steps with the setup of WSL2. Once some of the common issues with WSL2 are addressed, you should be able to follow [this local setup guide](/how-to-setup-freecodecamp-locally/) to work with freeCodeCamp on Windows running a WSL distro like Ubuntu.

## Enable WSL

Expand Down Expand Up @@ -86,7 +86,7 @@ Once you have configured Docker Desktop to work with WSL2, follow these steps to

1. Launch a new Ubuntu terminal

2. Pull MongoDB from Docker Hub. Please refer to the [Prerequisites](/how-to-setup-freecodecamp-locally#Prerequisites) table for the current version of MongoDB used by freeCodeCamp. For example, if the version number is `5.0.x`, replace `<x.y>` with `5.0` in the following two code snippets.
2. Pull MongoDB from Docker Hub. Please refer to the [Prerequisites](/how-to-setup-freecodecamp-locally/#Prerequisites) table for the current version of MongoDB used by freeCodeCamp. For example, if the version number is `5.0.x`, replace `<x.y>` with `5.0` in the following two code snippets.

```bash
docker pull mongo:<x.y>
Expand Down Expand Up @@ -127,7 +127,7 @@ npm install -g pnpm

## Set up freeCodeCamp Locally

Now that you have installed the pre-requisites, follow [our local setup guide](/how-to-setup-freecodecamp-locally) to clone, install and set up freeCodeCamp locally on your machine.
Now that you have installed the pre-requisites, follow [our local setup guide](/how-to-setup-freecodecamp-locally/) to clone, install and set up freeCodeCamp locally on your machine.

## Optimize Windows and WSL

Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/how-to-translate-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Our `/learn` interface relies on JSON files loaded into an i18n plugin to genera

The `links.json`, `meta-tags.json`, `motivation.json`, and `trending.json` files contain information that needs to be updated to reflect your language. However, we cannot load these into Crowdin, as the content isn't something that would be a one-to-one translation.

These files will most likely be maintained by your language lead but you are welcome to [read about how to translate them](/language-lead-handbook).
These files will most likely be maintained by your language lead but you are welcome to [read about how to translate them](/language-lead-handbook/).

### On Crowdin

Expand Down Expand Up @@ -213,9 +213,9 @@ After translation

The actual files in docs are written in Markdown, but they will appear as HTML tags on Crowdin.

You can find out how `docsify` converts a string in your language into an id by looking into the translated pages. If the translation is not deployed yet, you can preview it by [running the docs site locally](/how-to-work-on-the-docs-theme#serving-the-documentation-site-locally).
You can find out how `docsify` converts a string in your language into an id by looking into the translated pages. If the translation is not deployed yet, you can preview it by [running the docs site locally](/how-to-work-on-the-docs-theme/#serving-the-documentation-site-locally).

You can learn more about [internal links in our docs here](/how-to-work-on-the-docs-theme#how-to-create-an-internal-link).
You can learn more about [internal links in our docs here](/how-to-work-on-the-docs-theme/#how-to-create-an-internal-link).

## Translate the LearnToCode RPG

Expand Down
Loading

0 comments on commit aaeb136

Please sign in to comment.