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

chore: demo translate post #160

Closed
wants to merge 5 commits into from
Closed

chore: demo translate post #160

wants to merge 5 commits into from

Conversation

timlrx
Copy link
Owner

@timlrx timlrx commented Aug 5, 2021

No description provided.

@vercel
Copy link

vercel bot commented Aug 5, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/timlrx/tailwind-nextjs-starter-blog/4BmstNgcHq7atwjdNabhmaE8m378
✅ Preview: https://tailwind-nextjs-starter-blog-git-demo-translate-timlrx.vercel.app

@timlrx
Copy link
Owner Author

timlrx commented Aug 6, 2021

Here's a demo with translation of the markdown posts:

The main change in the code is to modify getStaticPaths to generate paths for each markdown file and locale combination. In getStaticProps we infer the locale being used and use it to get the appropriate file by slug.

@timlrx timlrx mentioned this pull request Aug 6, 2021
@timlrx timlrx closed this Aug 6, 2021
@vahidtakro
Copy link

thanks a lot, this works perfect, how can I have the repo?
and also clicking on tags, will lead to 404, I think in this case, blog page, plus second, third,... pages of blog will lead to 404 on second language.

@timlrx timlrx reopened this Aug 6, 2021
@timlrx
Copy link
Owner Author

timlrx commented Aug 6, 2021

It's a demo of how to translate a markdown post, not a full working example. You should modify the tags page similar to the changes made in the blog page and it would work. Just to round things off, I pushed the required code for tags. Here's the preview: https://tailwind-nextjs-starter-blog-oedqvf5r7-timlrx.vercel.app/

The full code can be found on the demo/translate branch.

@timlrx timlrx closed this Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants