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

Fix edit this Page on examples/docs #6028

Merged
merged 3 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions examples/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ npm create astro@latest -- --template docs

![docs](https://user-images.githubusercontent.com/4677417/186189283-0831b9ab-d6b9-485d-8955-3057e532ab31.png)


## Features

- ✅ **Full Markdown support**
Expand Down Expand Up @@ -104,10 +103,10 @@ Note the top-level `en` key: This is needed for multi-language support. You can

The Astro docs template supports multiple languages out of the box. The default theme only shows `en` documentation, but you can enable multi-language support features by adding a second language to your project.

To add a new language to your project, you'll want to extend the current `src/pages/[lang]/...` layout:
To add a new language to your project, you'll want to extend the current `src/content/docs/[lang]/...` layout:

```diff
📂 src/pages
📂 src/content/docs
┣ 📂 en
┃ ┣ 📜 page-1.md
┃ ┣ 📜 page-2.md
Expand Down
2 changes: 1 addition & 1 deletion examples/docs/src/layouts/MainLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Props = CollectionEntry<'docs'>['data'] & {
const { headings, ...data } = Astro.props;
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
const currentPage = Astro.url.pathname;
const currentFile = `src/pages${currentPage.replace(/\/$/, '')}.md`;
const currentFile = `src/content/docs${currentPage.replace(/\/$/, '')}.md`;
const githubEditUrl = `${GITHUB_EDIT_URL}/${currentFile}`;
---

Expand Down