Fix edit this Page
on examples/docs
(#6028)
* 🐛 Fix path from `pages` to `content/docs` * 🐛 Fix path from `pages` to `content/docs`
This commit is contained in:
parent
98a4a914bc
commit
9bb0bfab13
2 changed files with 3 additions and 4 deletions
|
@ -11,7 +11,6 @@ npm create astro@latest -- --template docs
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- ✅ **Full Markdown support**
|
- ✅ **Full Markdown support**
|
||||||
|
@ -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.
|
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
|
```diff
|
||||||
📂 src/pages
|
📂 src/content/docs
|
||||||
┣ 📂 en
|
┣ 📂 en
|
||||||
┃ ┣ 📜 page-1.md
|
┃ ┣ 📜 page-1.md
|
||||||
┃ ┣ 📜 page-2.md
|
┃ ┣ 📜 page-2.md
|
||||||
|
|
|
@ -17,7 +17,7 @@ type Props = CollectionEntry<'docs'>['data'] & {
|
||||||
const { headings, ...data } = Astro.props;
|
const { headings, ...data } = Astro.props;
|
||||||
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
||||||
const currentPage = Astro.url.pathname;
|
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}`;
|
const githubEditUrl = `${GITHUB_EDIT_URL}/${currentFile}`;
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue