Skip to content

Commit 19fa02f

Browse files
bholmesdevdelucis
andauthored
[i18nIgnore] Migrate to Content Collections (withastro#2546)
Co-authored-by: Chris Swithinbank <[email protected]>
1 parent 4044666 commit 19fa02f

File tree

1,136 files changed

+77823
-78159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,136 files changed

+77823
-78159
lines changed

.eslintignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ dist
22
node_modules
33
.github
44
.changeset
5-
/src/pages/lighthouse

.eslintrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ module.exports = {
3838
'@typescript-eslint/no-non-null-assertion': 'off',
3939
},
4040
},
41+
{
42+
files: ['*.d.ts'],
43+
rules: {
44+
'@typescript-eslint/triple-slash-reference': 'off',
45+
},
46+
},
4147
{
4248
files: ['*.tsx'],
4349
parser: '@typescript-eslint/parser',

.github/actions/install/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ runs:
1010
- name: Setup Node
1111
uses: actions/setup-node@v3
1212
with:
13-
node-version: 16
13+
node-version: 18
1414
cache: pnpm
1515

1616
- name: Install dependencies

.github/labeler.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
- .github/workflows/**
55

66
i18n:
7-
- any: ['src/pages/**/*.mdx', '!src/pages/en/**/*']
7+
- any: ['src/content/docs/**/*.mdx', '!src/content/docs/en/**/*']

.github/workflows/nightly.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
with:
2929
branch: ci/docgen-integrations
3030
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
31-
add-paths: src/pages/en/guides/integrations-guide/*.mdx
31+
add-paths: src/content/docs/en/guides/integrations-guide/*.mdx
3232
commit-message: 'ci: update integration docs'
3333
title: 'ci: update integration docs'
3434
body: |
@@ -55,7 +55,7 @@ jobs:
5555
with:
5656
branch: ci/docgen
5757
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
58-
add-paths: src/pages/en/reference/*.mdx
58+
add-paths: src/content/docs/en/reference/*.mdx
5959
commit-message: 'ci: update reference docs'
6060
title: 'ci: update reference docs'
6161
body: |
@@ -82,7 +82,7 @@ jobs:
8282
with:
8383
branch: ci/docgen-errors
8484
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
85-
add-paths: src/pages/en/reference/*.mdx
85+
add-paths: src/content/docs/en/reference/*.mdx
8686
commit-message: 'ci: update error reference docs'
8787
title: 'ci: update error reference docs'
8888
body: |

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# build output
22
dist
3+
.astro/
34

45
# dependencies
56
node_modules/

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16.19.0
1+
18.14.0

.prettierignore

-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ node_modules
44
.changeset
55
*.md
66
*.mdx
7-
src/pages/lighthouse/*.astro
87
pnpm-lock.yaml

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Contributions to the documentation site are made by editing the docs repository.
8686
8787
**Internationalization (i18n)**
8888

89-
Please only add new text content to the docs **in English**, by modifying only **`.md` files located within `src/pages/en/`**.
89+
Please only add new text content to the docs **in English**, by modifying only **`.md` files located within `src/content/docs/en/`**.
9090

9191
We have automated systems in place for notifying our community translators that there is new material to be translated, so there is no need to make changes to additional languages yourself.
9292

TRANSLATING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Each of these content types lives in a different place.
7070

7171
### 1. Documentation pages
7272

73-
Each documentation page lives in the `src/pages` directory of this <abbr title="repository">repo</abbr>. There you’ll find directories for all of the languages currently translated. Each page is a Markdown file to support rich text formatting. For example, the English language “Getting Started” page is at `src/pages/en/getting-started.md` and the same page in French is at `src/pages/fr/getting-started.md`.
73+
Each documentation page lives in the `src/content/docs/` directory of this <abbr title="repository">repo</abbr>. There you’ll find directories for all of the languages currently translated. Each page is a Markdown file to support rich text formatting. For example, the English language “Getting Started” page is at `src/content/docs/en/getting-started.md` and the same page in French is at `src/content/docs/fr/getting-started.md`.
7474

7575
### 2. UI text
7676

@@ -102,7 +102,7 @@ If you spot something on [docs.astro.build](https://docs.astro.build/) that you
102102

103103
4. Is the text specific to one page (page title, main content, etc.)?
104104

105-
➤ Go to `src/pages/{language}/{page-slug}.md`
105+
➤ Go to `src/content/docs/{language}/{page-slug}.md`
106106

107107
# Contributing to translations
108108

astro.config.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { defineConfig } from 'astro/config';
55
import AutoImport from 'astro-auto-import';
66
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
77
import rehypeSlug from 'rehype-slug';
8-
import remarkGFM from 'remark-gfm';
98
import remarkSmartypants from 'remark-smartypants';
109

1110
import { asideAutoImport, astroAsides } from './integrations/astro-asides';
@@ -33,9 +32,9 @@ export default defineConfig({
3332
markdown: {
3433
syntaxHighlight: 'shiki',
3534
shikiConfig: { theme },
35+
// Override with our own config
36+
smartypants: false,
3637
remarkPlugins: [
37-
// These are here because setting custom plugins disables the default plugins
38-
remarkGFM,
3938
[remarkSmartypants, { dashes: false }],
4039
// Add our custom plugin that marks links to fallback language pages
4140
remarkFallbackLang(),

package.json

+8-10
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"test": "vitest",
1010
"preview": "astro preview",
1111
"check": "astro check",
12-
"tsc": "tsc",
12+
"tsc": "astro sync && tsc",
1313
"format": "pnpm run format:code",
1414
"format:ci": "pnpm run format:imports && pnpm run format:code",
1515
"format:code": "prettier -w . --cache --plugin-search-dir=.",
@@ -31,23 +31,24 @@
3131
"@11ty/eleventy-fetch": "^3.0.0",
3232
"@actions/core": "^1.9.0",
3333
"@algolia/client-search": "^4.14.2",
34-
"@astrojs/mdx": "^0.14.0",
35-
"@astrojs/preact": "^1.2.0",
36-
"@astrojs/sitemap": "1.0.0",
34+
"@astrojs/mdx": "^0.16.1",
35+
"@astrojs/preact": "^2.0.3",
36+
"@astrojs/sitemap": "1.0.1",
3737
"@babel/core": "^7.18.10",
3838
"@docsearch/css": "^3.2.2",
3939
"@docsearch/react": "^3.2.0",
40+
"@types/canvas-confetti": "^1.6.0",
4041
"@types/chroma-js": "^2.1.4",
4142
"@types/hast": "^2.3.4",
4243
"@types/html-escaper": "^3.0.0",
4344
"@types/mdast": "^3.0.10",
4445
"@types/node": "^18.6.4",
4546
"@typescript-eslint/eslint-plugin": "^5.46.1",
4647
"@typescript-eslint/parser": "^5.46.1",
47-
"astro": "^1.8.0",
48-
"astro-auto-import": "^0.2.0",
48+
"astro": "^2.0.12",
49+
"astro-auto-import": "^0.2.1",
4950
"astro-eslint-parser": "^0.9.2",
50-
"astro-og-canvas": "^0.1.5",
51+
"astro-og-canvas": "^0.1.6",
5152
"bcp-47-normalize": "^2.1.0",
5253
"canvaskit-wasm": "^0.37.0",
5354
"chroma-js": "^2.4.2",
@@ -57,7 +58,6 @@
5758
"eslint-plugin-astro": "^0.21.0",
5859
"eslint-plugin-react": "^7.32.1",
5960
"fast-glob": "^3.2.11",
60-
"gray-matter": "^4.0.3",
6161
"hast-util-from-html": "^1.0.0",
6262
"hast-util-to-string": "^2.0.0",
6363
"hastscript": "^7.0.2",
@@ -81,7 +81,6 @@
8181
"remark": "^14.0.2",
8282
"remark-directive": "^2.0.1",
8383
"simple-git": "^3.11.0",
84-
"tiny-glob": "^0.2.9",
8584
"tsm": "^2.2.2",
8685
"typescript": "^4.7.4",
8786
"unified": "^10.1.2",
@@ -93,7 +92,6 @@
9392
"dependencies": {
9493
"@fontsource/ibm-plex-mono": "^4.5.10",
9594
"@nanostores/preact": "^0.1.3",
96-
"@types/canvas-confetti": "^1.6.0",
9795
"canvas-confetti": "^1.6.0",
9896
"jsdoc-api": "^7.1.1",
9997
"nanostores": "^0.5.13",

plugins/rehype-i18n-autolink-headings.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { getLanguageCodeFromPathname, mdFilePathToUrl } from './remark-fallback-
1111
* Rehype plugin to translate the headings' anchors according to the currently selected language.
1212
*/
1313
export function rehypei18nAutolinkHeadings() {
14-
const pageSourceDir = path.resolve('./src/pages');
14+
const pageSourceDir = path.resolve('./src/content/docs');
1515
const baseUrl = 'https://docs.astro.build/';
1616

1717
const transformer: Transformer<Root> = (tree, file) => {

plugins/remark-fallback-lang.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { Plugin, Transformer } from 'unified';
55
import { visit } from 'unist-util-visit';
66

77
export function remarkFallbackLang(): Plugin<[], Root> {
8-
const pageSourceDir = path.resolve('./src/pages');
8+
const pageSourceDir = path.resolve('./src/content/docs');
99
const baseUrl = 'https://docs.astro.build/';
1010

1111
const transformer: Transformer<Root> = (tree, file) => {

0 commit comments

Comments
 (0)