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

Translations #161

Merged
merged 9 commits into from
Dec 18, 2024
Merged

Translations #161

merged 9 commits into from
Dec 18, 2024

Conversation

mimiflynn
Copy link
Member

@mimiflynn mimiflynn commented Dec 12, 2024

Addresses issue #140

This PR is so large because of the number of files moved into a new directory to support translations. We will need to further review and adjust the content to account for translations support living within the /exercises/directory. Because the translations will not be a 1:1 for each curriculum, each language index will be honed to the existing content. I'd like to automate this page, but that will have to live in another PR.

@mimiflynn mimiflynn added the enhancement New feature or request label Dec 12, 2024
@mimiflynn mimiflynn self-assigned this Dec 12, 2024
@mimiflynn mimiflynn marked this pull request as ready for review December 18, 2024 17:10
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file replaces what used to be a dynamic page in the /pages/ directory. Ideally, all content will live in /content/ and all content management will live in /src/.


function getTemplate(page) {
return page.frontmatter.exercise ? exerciseTemplate : pageTemplate;
const path = page.internal.contentFilePath;
const isExerciseIndex = path.includes('index') && path.includes('exercise');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creates a new page template for index.mdx files that live in /exercises/.

@@ -46,10 +46,10 @@
"serve": "gatsby serve",
"clean": "gatsby clean",
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1",
"pub": "rm -rf ../docs && mv public ../docs",
"pubWindows": "rd /S \"../docs\" && move public \"../docs\""
"pub": "rimraf ../docs && mv public ../docs"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rimraf for all the OS's.

import SummaryCard from '../components/summary-card';
import Translations from '../components/translations';

export const SHORTCODES = { Hero, Link, SummaryCard, Translations };
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the React components that are available in .mdx files.

Shortcodes

Sorry, the url you're looking for appears to be missing. Check out the
sitemap below to find your expected page.
</p>
<SiteMap location={location} nodes={nodes} />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the url updates, I went ahead and enhanced the 404 page with a sitemap so a user could hopefully find what they were looking for.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I liked the sadness

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadness is always available.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Head component to be used with Gatsby Head API.

Copy link
Contributor

@olivierbeau olivierbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good from a high level perspective.

@mimiflynn Do we have a QA version of the website where we can preview changes in a commit ?

If not, it might be a cool addition :)

@mimiflynn
Copy link
Member Author

@olivierbeau I was just telling @kristen-holmes that I wish we had PR previews to act as QA but we don't have the option at the moment.

@mimiflynn mimiflynn merged commit efdfe22 into main Dec 18, 2024
2 checks passed
@mimiflynn mimiflynn deleted the translations branch December 18, 2024 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants