diff --git a/examples/sitemap/advanced/.gitignore b/examples/sitemap/advanced/.gitignore deleted file mode 100644 index 6e9005893..000000000 --- a/examples/sitemap/advanced/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -# build output -dist/ - -# dependencies -node_modules/ - -# logs -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* - -# environment variables -.env -.env.production - -# macOS-specific files -.DS_Store diff --git a/examples/sitemap/advanced/.npmrc b/examples/sitemap/advanced/.npmrc deleted file mode 100644 index ef83021af..000000000 --- a/examples/sitemap/advanced/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -# Expose Astro dependencies for `pnpm` users -shamefully-hoist=true diff --git a/examples/sitemap/advanced/.stackblitzrc b/examples/sitemap/advanced/.stackblitzrc deleted file mode 100644 index 0dfa8f1e0..000000000 --- a/examples/sitemap/advanced/.stackblitzrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "startCommand": "npm start", - "env": { - "ENABLE_CJS_IMPORTS": true - } -} diff --git a/examples/sitemap/advanced/README.md b/examples/sitemap/advanced/README.md deleted file mode 100644 index ab7786383..000000000 --- a/examples/sitemap/advanced/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Demo for @astrojs/sitemap integration - -Play this demo [online](https://stackblitz.com/fork/github/withastro/astro/tree/main/examples/sitemap/advanced). diff --git a/examples/sitemap/advanced/astro.config.ts b/examples/sitemap/advanced/astro.config.ts deleted file mode 100644 index b45aa1c58..000000000 --- a/examples/sitemap/advanced/astro.config.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { defineConfig } from 'astro/config'; -import sitemap from '@astrojs/sitemap'; -import sitemapConfig from './sitemap.config'; - -// https://astro.build/config -export default defineConfig({ - integrations: [sitemap(sitemapConfig)], -}); diff --git a/examples/sitemap/advanced/package.json b/examples/sitemap/advanced/package.json deleted file mode 100644 index c1174a3de..000000000 --- a/examples/sitemap/advanced/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@example/sitemap-advanced", - "version": "0.0.1", - "private": true, - "license": "MIT", - "type": "module", - "scripts": { - "dev": "astro dev", - "start": "astro dev", - "build": "astro build", - "preview": "astro preview" - }, - "devDependencies": { - "astro": "workspace:*", - "@astrojs/sitemap": "workspace:*" - } -} diff --git a/examples/sitemap/advanced/public/favicon.ico b/examples/sitemap/advanced/public/favicon.ico deleted file mode 100644 index 578ad458b..000000000 Binary files a/examples/sitemap/advanced/public/favicon.ico and /dev/null differ diff --git a/examples/sitemap/advanced/sandbox.config.json b/examples/sitemap/advanced/sandbox.config.json deleted file mode 100644 index 9178af77d..000000000 --- a/examples/sitemap/advanced/sandbox.config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "infiniteLoopProtection": true, - "hardReloadOnChange": false, - "view": "browser", - "template": "node", - "container": { - "port": 3000, - "startScript": "start", - "node": "14" - } -} diff --git a/examples/sitemap/advanced/sitemap.config.ts b/examples/sitemap/advanced/sitemap.config.ts deleted file mode 100644 index 6ddea6f3d..000000000 --- a/examples/sitemap/advanced/sitemap.config.ts +++ /dev/null @@ -1,28 +0,0 @@ -const canonicalURL = 'https://example.com'; - -const sitemapConfig = { - filter: (page) => !/exclude-this/.test(page), // exclude pages from sitemap - customPages: [`${canonicalURL}/virtual-one.html`, `${canonicalURL}/virtual-two.html`], - canonicalURL, - - createLinkInHead: true, - - serialize(item) { - if (/special-page/.test(item.url)) { - item.changefreq = 'daily'; - item.lastmod = new Date(); - item.priority = 0.9; - } - return item; - }, - - // The integration creates a separate `sitemap-${i}.xml` file for each batch of 2, then adds this file to index - `sitemap-index.xml`. - entryLimit: 2, // default - 45000 - - // sitemap specific - changefreq: 'yearly', - lastmod: new Date('2019-12-31'), - priority: 0.4, -}; - -export default sitemapConfig; diff --git a/examples/sitemap/advanced/src/pages/404.astro b/examples/sitemap/advanced/src/pages/404.astro deleted file mode 100644 index 6abd145f8..000000000 --- a/examples/sitemap/advanced/src/pages/404.astro +++ /dev/null @@ -1,14 +0,0 @@ ---- ---- - - - - - 404 - - -

404

-

Not Found

- Back to Home - - diff --git a/examples/sitemap/advanced/src/pages/exclude-this.astro b/examples/sitemap/advanced/src/pages/exclude-this.astro deleted file mode 100644 index e7b23e2d9..000000000 --- a/examples/sitemap/advanced/src/pages/exclude-this.astro +++ /dev/null @@ -1,13 +0,0 @@ ---- ---- - - - - - Exclude this page - - -

Exclude this pade

- Back to Home - - diff --git a/examples/sitemap/advanced/src/pages/index.astro b/examples/sitemap/advanced/src/pages/index.astro deleted file mode 100644 index bd25ea7e2..000000000 --- a/examples/sitemap/advanced/src/pages/index.astro +++ /dev/null @@ -1,15 +0,0 @@ ---- ---- - - - - - Astro - - -

Astro

- Second page - Special page - Exclude this page - - diff --git a/examples/sitemap/advanced/src/pages/second-page.astro b/examples/sitemap/advanced/src/pages/second-page.astro deleted file mode 100644 index 77cfad9f8..000000000 --- a/examples/sitemap/advanced/src/pages/second-page.astro +++ /dev/null @@ -1,13 +0,0 @@ ---- ---- - - - - - Second page - - -

Second page

- Back to Home - - diff --git a/examples/sitemap/advanced/src/pages/special-page.astro b/examples/sitemap/advanced/src/pages/special-page.astro deleted file mode 100644 index 54b3bcce1..000000000 --- a/examples/sitemap/advanced/src/pages/special-page.astro +++ /dev/null @@ -1,13 +0,0 @@ ---- ---- - - - - - Special page - - -

Special page

- Back to Home - - diff --git a/examples/sitemap/advanced/tsconfig.json b/examples/sitemap/advanced/tsconfig.json deleted file mode 100644 index 7ac81809a..000000000 --- a/examples/sitemap/advanced/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "compilerOptions": { - // Enable top-level await, and other modern ESM features. - "target": "ESNext", - "module": "ESNext", - // Enable node-style module resolution, for things like npm package imports. - "moduleResolution": "node", - // Enable JSON imports. - "resolveJsonModule": true, - // Enable stricter transpilation for better output. - "isolatedModules": true, - // Add type definitions for our Vite runtime. - "types": ["vite/client"] - } -} diff --git a/examples/sitemap/basic/.gitignore b/examples/sitemap/basic/.gitignore deleted file mode 100644 index 6e9005893..000000000 --- a/examples/sitemap/basic/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -# build output -dist/ - -# dependencies -node_modules/ - -# logs -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* - -# environment variables -.env -.env.production - -# macOS-specific files -.DS_Store diff --git a/examples/sitemap/basic/.npmrc b/examples/sitemap/basic/.npmrc deleted file mode 100644 index ef83021af..000000000 --- a/examples/sitemap/basic/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -# Expose Astro dependencies for `pnpm` users -shamefully-hoist=true diff --git a/examples/sitemap/basic/.stackblitzrc b/examples/sitemap/basic/.stackblitzrc deleted file mode 100644 index 0dfa8f1e0..000000000 --- a/examples/sitemap/basic/.stackblitzrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "startCommand": "npm start", - "env": { - "ENABLE_CJS_IMPORTS": true - } -} diff --git a/examples/sitemap/basic/README.md b/examples/sitemap/basic/README.md deleted file mode 100644 index d690ff6cc..000000000 --- a/examples/sitemap/basic/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Demo for @astrojs/sitemap integration - -Play this demo [online](https://stackblitz.com/fork/github/withastro/astro/tree/main/examples/sitemap/basic). diff --git a/examples/sitemap/basic/astro.config.ts b/examples/sitemap/basic/astro.config.ts deleted file mode 100644 index 752cf3cfe..000000000 --- a/examples/sitemap/basic/astro.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { defineConfig } from 'astro/config'; -import sitemap from '@astrojs/sitemap'; - -// https://astro.build/config -export default defineConfig({ - site: 'https://example.com', - base: 'test', - integrations: [sitemap()], -}); diff --git a/examples/sitemap/basic/package.json b/examples/sitemap/basic/package.json deleted file mode 100644 index b232e45f1..000000000 --- a/examples/sitemap/basic/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@example/sitemap-basic", - "version": "0.0.1", - "private": true, - "license": "MIT", - "type": "module", - "scripts": { - "dev": "astro dev", - "start": "astro dev", - "build": "astro build", - "preview": "astro preview" - }, - "devDependencies": { - "astro": "workspace:*", - "@astrojs/sitemap": "workspace:*" - } -} diff --git a/examples/sitemap/basic/public/favicon.ico b/examples/sitemap/basic/public/favicon.ico deleted file mode 100644 index 578ad458b..000000000 Binary files a/examples/sitemap/basic/public/favicon.ico and /dev/null differ diff --git a/examples/sitemap/basic/sandbox.config.json b/examples/sitemap/basic/sandbox.config.json deleted file mode 100644 index 9178af77d..000000000 --- a/examples/sitemap/basic/sandbox.config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "infiniteLoopProtection": true, - "hardReloadOnChange": false, - "view": "browser", - "template": "node", - "container": { - "port": 3000, - "startScript": "start", - "node": "14" - } -} diff --git a/examples/sitemap/basic/src/pages/index.astro b/examples/sitemap/basic/src/pages/index.astro deleted file mode 100644 index 5e6ba1a2b..000000000 --- a/examples/sitemap/basic/src/pages/index.astro +++ /dev/null @@ -1,12 +0,0 @@ ---- ---- - - - - - Astro - - -

Astro

- - diff --git a/examples/sitemap/basic/src/pages/second-page.astro b/examples/sitemap/basic/src/pages/second-page.astro deleted file mode 100644 index 77cfad9f8..000000000 --- a/examples/sitemap/basic/src/pages/second-page.astro +++ /dev/null @@ -1,13 +0,0 @@ ---- ---- - - - - - Second page - - -

Second page

- Back to Home - - diff --git a/examples/sitemap/basic/tsconfig.json b/examples/sitemap/basic/tsconfig.json deleted file mode 100644 index 7ac81809a..000000000 --- a/examples/sitemap/basic/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "compilerOptions": { - // Enable top-level await, and other modern ESM features. - "target": "ESNext", - "module": "ESNext", - // Enable node-style module resolution, for things like npm package imports. - "moduleResolution": "node", - // Enable JSON imports. - "resolveJsonModule": true, - // Enable stricter transpilation for better output. - "isolatedModules": true, - // Add type definitions for our Vite runtime. - "types": ["vite/client"] - } -} diff --git a/examples/sitemap/i18n/.gitignore b/examples/sitemap/i18n/.gitignore deleted file mode 100644 index 6e9005893..000000000 --- a/examples/sitemap/i18n/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -# build output -dist/ - -# dependencies -node_modules/ - -# logs -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* - -# environment variables -.env -.env.production - -# macOS-specific files -.DS_Store diff --git a/examples/sitemap/i18n/.npmrc b/examples/sitemap/i18n/.npmrc deleted file mode 100644 index ef83021af..000000000 --- a/examples/sitemap/i18n/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -# Expose Astro dependencies for `pnpm` users -shamefully-hoist=true diff --git a/examples/sitemap/i18n/.stackblitzrc b/examples/sitemap/i18n/.stackblitzrc deleted file mode 100644 index 0dfa8f1e0..000000000 --- a/examples/sitemap/i18n/.stackblitzrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "startCommand": "npm start", - "env": { - "ENABLE_CJS_IMPORTS": true - } -} diff --git a/examples/sitemap/i18n/README.md b/examples/sitemap/i18n/README.md deleted file mode 100644 index e053a3191..000000000 --- a/examples/sitemap/i18n/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Demo for @astrojs/sitemap integration - -This sample demonstrates the localization capabilities of `@astrojs/sitemap` integration. - -The `i18n.mjs` file contains the locales basic info. - -Its data is used for dynamic page generation, for language switch and as a source for the `@astrojs/sitemap` integration config. - -Play this demo [online](https://stackblitz.com/fork/github/withastro/astro/tree/main/examples/sitemap/i18n). diff --git a/examples/sitemap/i18n/astro.config.ts b/examples/sitemap/i18n/astro.config.ts deleted file mode 100644 index 6c2f39556..000000000 --- a/examples/sitemap/i18n/astro.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from 'astro/config'; -import sitemap from '@astrojs/sitemap'; - -import sitemapConfig from './sitemap.config'; - -// https://astro.build/config -export default defineConfig({ - site: 'https://another.com', - integrations: [sitemap(sitemapConfig)], -}); diff --git a/examples/sitemap/i18n/package.json b/examples/sitemap/i18n/package.json deleted file mode 100644 index 1eba1ccb5..000000000 --- a/examples/sitemap/i18n/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "@example/sitemap-i18n", - "version": "0.0.1", - "private": true, - "license": "MIT", - "scripts": { - "dev": "astro dev", - "start": "astro dev", - "build": "astro build", - "preview": "astro preview" - }, - "devDependencies": { - "astro": "workspace:*", - "@astrojs/sitemap": "workspace:*" - } -} diff --git a/examples/sitemap/i18n/sandbox.config.json b/examples/sitemap/i18n/sandbox.config.json deleted file mode 100644 index 9178af77d..000000000 --- a/examples/sitemap/i18n/sandbox.config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "infiniteLoopProtection": true, - "hardReloadOnChange": false, - "view": "browser", - "template": "node", - "container": { - "port": 3000, - "startScript": "start", - "node": "14" - } -} diff --git a/examples/sitemap/i18n/sitemap.config.ts b/examples/sitemap/i18n/sitemap.config.ts deleted file mode 100644 index 044c630df..000000000 --- a/examples/sitemap/i18n/sitemap.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import i18n from './src/i18n.js'; - -/** @type {import('astro-sitemap').SitemapOptions} */ -const sitemapConfig = { - // added - i18n: { - defaultLocale: i18n.defaultLocale, - locales: Object.entries(i18n.locales).reduce((prev, [locale, { lang }]) => { - prev[locale] = lang; - return prev; - }, {}), - }, -}; - -export default sitemapConfig; diff --git a/examples/sitemap/i18n/src/components/LanguageSwitch.astro b/examples/sitemap/i18n/src/components/LanguageSwitch.astro deleted file mode 100644 index 9d2571624..000000000 --- a/examples/sitemap/i18n/src/components/LanguageSwitch.astro +++ /dev/null @@ -1,45 +0,0 @@ ---- -import i18n from '../i18n'; - -export interface Props { - currentLocale: string; -} - -const { currentLocale } = Astro.props as Props; -const pathname = new URL(Astro.request.url).pathname; - -const getLink = (locale: string) => { - let path: string; - if (pathname === '/') { - path = '/'; - } else { - const a = pathname.split('/'); - if (i18n.locales[a[1]]) { - path = a.slice(2).join('/'); - } else { - path = pathname; - } - } - if (!path.startsWith('/')) { - path = '/' + path; - } - return locale === i18n.defaultLocale ? path : `/${locale}${path}`; -}; ---- - diff --git a/examples/sitemap/i18n/src/i18n.ts b/examples/sitemap/i18n/src/i18n.ts deleted file mode 100644 index 25015676a..000000000 --- a/examples/sitemap/i18n/src/i18n.ts +++ /dev/null @@ -1,25 +0,0 @@ -const i18n = { - defaultLocale: 'en', - locales: { - en: { - name: 'i18n test', - short_name: 'Test', - description: 'This is the application description', - lang: 'en-US', - }, - es: { - name: 'Prueba i18n', - short_name: 'Prueba', - description: 'Esta es la descripciĆ³n de la aplicaciĆ³n.', - lang: 'es-ES', - }, - fr: { - name: 'Test i18n', - short_name: 'Test', - description: "Ceci est la description de l'application", - lang: 'fr-CA', - }, - }, -}; - -export default i18n; diff --git a/examples/sitemap/i18n/src/images/logomark-light.png b/examples/sitemap/i18n/src/images/logomark-light.png deleted file mode 100644 index b77f87fc5..000000000 Binary files a/examples/sitemap/i18n/src/images/logomark-light.png and /dev/null differ diff --git a/examples/sitemap/i18n/src/images/logomark-light.svg b/examples/sitemap/i18n/src/images/logomark-light.svg deleted file mode 100644 index afbe94eae..000000000 --- a/examples/sitemap/i18n/src/images/logomark-light.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/examples/sitemap/i18n/src/pages/404.astro b/examples/sitemap/i18n/src/pages/404.astro deleted file mode 100644 index 95ef4a175..000000000 --- a/examples/sitemap/i18n/src/pages/404.astro +++ /dev/null @@ -1,17 +0,0 @@ ---- -import i18n from '../i18n'; - -const locale = i18n.defaultLocale; -const { lang } = i18n.locales[locale]; ---- - - - - - 404 - - -

404

- - - diff --git a/examples/sitemap/i18n/src/pages/[locale]/404.astro b/examples/sitemap/i18n/src/pages/[locale]/404.astro deleted file mode 100644 index 270790f67..000000000 --- a/examples/sitemap/i18n/src/pages/[locale]/404.astro +++ /dev/null @@ -1,32 +0,0 @@ ---- -import i18n from '../../i18n'; - -export async function getStaticPaths() { - const items = Object.entries(i18n.locales).filter(([locale]) => locale !== i18n.defaultLocale); - - const paths = items.map(([locale, { lang }]) => ({ - params: { locale }, - props: { lang }, - })); - - return paths; -} - -export interface Props { - lang: string; -} - -const { locale } = Astro.params; -const { lang } = Astro.props as Props; ---- - - - - - 404 - - -

404

- - - diff --git a/examples/sitemap/i18n/src/pages/[locale]/index.astro b/examples/sitemap/i18n/src/pages/[locale]/index.astro deleted file mode 100644 index d28571f09..000000000 --- a/examples/sitemap/i18n/src/pages/[locale]/index.astro +++ /dev/null @@ -1,38 +0,0 @@ ---- -import i18n from '../../i18n'; -import LanguageSwitch from '../../components/LanguageSwitch.astro'; - -export async function getStaticPaths() { - const items = Object.entries(i18n.locales).filter(([locale]) => locale !== i18n.defaultLocale); - - const paths = items.map(([locale, { name, lang }]) => ({ - params: { locale }, - props: { name, lang }, - })); - - return paths; -} - -export interface Props { - name: string; - description: string; - lang: string; -} - -const { locale } = Astro.params; -const { name, description, lang } = Astro.props as Props; ---- - - - - - Astro {locale} - - -

Astro {locale}

-

{name}

-

{description}

- #2 - - - diff --git a/examples/sitemap/i18n/src/pages/[locale]/second-page.astro b/examples/sitemap/i18n/src/pages/[locale]/second-page.astro deleted file mode 100644 index 97f04f58d..000000000 --- a/examples/sitemap/i18n/src/pages/[locale]/second-page.astro +++ /dev/null @@ -1,36 +0,0 @@ ---- -import i18n from '../../i18n'; -import LanguageSwitch from '../../components/LanguageSwitch.astro'; - -export async function getStaticPaths() { - const items = Object.entries(i18n.locales).filter(([locale]) => locale !== i18n.defaultLocale); - - const paths = items.map(([locale, { name, lang }]) => ({ - params: { locale }, - props: { name, lang }, - })); - - return paths; -} - -export interface Props { - name: string; - description: string; - lang: string; -} - -const { locale } = Astro.params; -const { lang } = Astro.props as Props; ---- - - - - - #2 {locale} - - -

#2 {locale}

- - - - diff --git a/examples/sitemap/i18n/src/pages/index.astro b/examples/sitemap/i18n/src/pages/index.astro deleted file mode 100644 index 71c0e1734..000000000 --- a/examples/sitemap/i18n/src/pages/index.astro +++ /dev/null @@ -1,21 +0,0 @@ ---- -import i18n from '../i18n'; -import LanguageSwitch from '../components/LanguageSwitch.astro'; - -const locale = i18n.defaultLocale; -const { lang, name, description } = i18n.locales[locale]; ---- - - - - - Astro {locale} - - -

Astro {locale}

-

{name}

-

{description}

- #2 - - - diff --git a/examples/sitemap/i18n/src/pages/second-page.astro b/examples/sitemap/i18n/src/pages/second-page.astro deleted file mode 100644 index 10dc0cac4..000000000 --- a/examples/sitemap/i18n/src/pages/second-page.astro +++ /dev/null @@ -1,19 +0,0 @@ ---- -import i18n from '../i18n'; -import LanguageSwitch from '../components/LanguageSwitch.astro'; - -const locale = i18n.defaultLocale; -const { lang } = i18n.locales[locale]; ---- - - - - - #2 {locale} - - -

#2 {locale}

- - - - diff --git a/examples/sitemap/i18n/tsconfig.json b/examples/sitemap/i18n/tsconfig.json deleted file mode 100644 index 7ac81809a..000000000 --- a/examples/sitemap/i18n/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "compilerOptions": { - // Enable top-level await, and other modern ESM features. - "target": "ESNext", - "module": "ESNext", - // Enable node-style module resolution, for things like npm package imports. - "moduleResolution": "node", - // Enable JSON imports. - "resolveJsonModule": true, - // Enable stricter transpilation for better output. - "isolatedModules": true, - // Add type definitions for our Vite runtime. - "types": ["vite/client"] - } -}