diff options
author | 2021-07-12 23:46:28 -0400 | |
---|---|---|
committer | 2021-07-13 00:49:13 -0400 | |
commit | 3f14bed413074aba0ab9199d3a2e24802f51eb72 (patch) | |
tree | 5460d384a66f5c428c8617eddb511e6f55adfb9e /examples | |
parent | 1b13f5c158b5fbe157406308205c0939b415e1d7 (diff) | |
download | astro-3f14bed413074aba0ab9199d3a2e24802f51eb72.tar.gz astro-3f14bed413074aba0ab9199d3a2e24802f51eb72.tar.zst astro-3f14bed413074aba0ab9199d3a2e24802f51eb72.zip |
Add lang attribute to html tags
Diffstat (limited to 'examples')
32 files changed, 62 insertions, 33 deletions
diff --git a/examples/blog-multiple-authors/src/layouts/post.astro b/examples/blog-multiple-authors/src/layouts/post.astro index c8f394892..b34275d84 100644 --- a/examples/blog-multiple-authors/src/layouts/post.astro +++ b/examples/blog-multiple-authors/src/layouts/post.astro @@ -6,7 +6,7 @@ import authorData from '../data/authors.json'; const { content } = Astro.props; --- -<html> +<html lang={ content.lang ?? 'en' }> <head> <title>{content.title}</title> <MainHead title={content.title} description={content.description} image={content.image} canonicalURL={Astro.request.canonicalURL} /> diff --git a/examples/blog-multiple-authors/src/pages/$author.astro b/examples/blog-multiple-authors/src/pages/$author.astro index ff80344e4..bcd9d76af 100644 --- a/examples/blog-multiple-authors/src/pages/$author.astro +++ b/examples/blog-multiple-authors/src/pages/$author.astro @@ -8,6 +8,7 @@ import Pagination from '../components/Pagination.astro'; let title = 'Don’s Blog'; let description = 'An example blog on Astro'; let canonicalURL = Astro.request.canonicalURL; +let lang = 'en'; // collection import authorData from '../data/authors.json'; @@ -45,7 +46,7 @@ export async function createCollection() { const author = authorData[collection.params.author]; --- -<html> +<html lang={ lang ?? 'en' }> <head> <title>{title}</title> <MainHead diff --git a/examples/blog-multiple-authors/src/pages/$posts.astro b/examples/blog-multiple-authors/src/pages/$posts.astro index 0975e8007..c535b581d 100644 --- a/examples/blog-multiple-authors/src/pages/$posts.astro +++ b/examples/blog-multiple-authors/src/pages/$posts.astro @@ -8,6 +8,7 @@ import Pagination from '../components/Pagination.astro'; let title = 'Don’s Blog'; let description = 'An example blog on Astro'; let canonicalURL = Astro.request.canonicalURL; +let lang = 'en'; // collection import authorData from '../data/authors.json'; @@ -38,7 +39,7 @@ export async function createCollection() { } --- -<html> +<html lang={ lang ?? 'en' }> <head> <title>{title}</title> <MainHead diff --git a/examples/blog-multiple-authors/src/pages/about.astro b/examples/blog-multiple-authors/src/pages/about.astro index d7a219057..17035a88e 100644 --- a/examples/blog-multiple-authors/src/pages/about.astro +++ b/examples/blog-multiple-authors/src/pages/about.astro @@ -3,8 +3,9 @@ import MainHead from '../components/MainHead.astro'; import Nav from '../components/Nav.astro'; let title = "About"; +let lang = 'en'; --- -<html> +<html lang={ lang ?? 'en' }> <head> <MainHead title={title} diff --git a/examples/blog-multiple-authors/src/pages/index.astro b/examples/blog-multiple-authors/src/pages/index.astro index 0b1c95df4..400d04292 100644 --- a/examples/blog-multiple-authors/src/pages/index.astro +++ b/examples/blog-multiple-authors/src/pages/index.astro @@ -12,6 +12,7 @@ import authorData from '../data/authors.json'; // All variables are available to use in the HTML template below. let title = 'Don’s Blog'; let description = 'An example blog on Astro'; +let lang = 'en'; // Data Fetching: List all Markdown posts in the repo. let allPosts = Astro.fetchContent('./post/*.md'); @@ -21,7 +22,7 @@ let firstPage = allPosts.slice(0, 2); // Full Astro Component Syntax: // https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md --- -<html> +<html lang={ lang ?? 'en' }> <head> <title>{title}</title> <MainHead diff --git a/examples/blog/src/layouts/BlogPost.astro b/examples/blog/src/layouts/BlogPost.astro index e6b644789..1b02d7aad 100644 --- a/examples/blog/src/layouts/BlogPost.astro +++ b/examples/blog/src/layouts/BlogPost.astro @@ -7,7 +7,7 @@ import BlogPost from '../components/BlogPost.astro'; const {content} = Astro.props; const {title, description, publishDate, author, heroImage, permalink} = content; --- -<html> +<html lang={ content.lang ?? 'en' }> <head> <BaseHead title={title} description={description} permalink={permalink} /> <link rel="stylesheet" href="/blog.css" /> diff --git a/examples/blog/src/pages/index.astro b/examples/blog/src/pages/index.astro index 13b28d9db..3c9fdd5a0 100644 --- a/examples/blog/src/pages/index.astro +++ b/examples/blog/src/pages/index.astro @@ -11,6 +11,7 @@ import BlogPostPreview from '../components/BlogPostPreview.astro'; let title = 'Example Blog'; let description = 'The perfect starter for your perfect blog.'; let permalink = 'https://example.com/'; +let lang = 'en'; // Data Fetching: List all Markdown posts in the repo. let allPosts = Astro.fetchContent('./posts/*.md'); @@ -19,7 +20,7 @@ allPosts = allPosts.sort((a, b) => new Date(b.publishDate) - new Date(a.publishD // Full Astro Component Syntax: // https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md --- -<html> +<html lang={ lang ?? 'en' }> <head> <BaseHead title={title} description={description} permalink={permalink} /> <link rel="stylesheet" href="/blog.css" /> diff --git a/examples/docs/src/layouts/Main.astro b/examples/docs/src/layouts/Main.astro index dbfc90791..fe847496e 100644 --- a/examples/docs/src/layouts/Main.astro +++ b/examples/docs/src/layouts/Main.astro @@ -18,7 +18,7 @@ const githubEditUrl = `https://github.com/USER/REPO/blob/main/${currentFile}` // Full Astro Component Syntax: // https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md --- -<html> +<html lang={ content.lang ?? 'en' }> <head> <title>{content.title}</title> diff --git a/examples/framework-multiple/src/pages/index.astro b/examples/framework-multiple/src/pages/index.astro index 826a9d5f9..0b6a8ad6d 100644 --- a/examples/framework-multiple/src/pages/index.astro +++ b/examples/framework-multiple/src/pages/index.astro @@ -6,10 +6,12 @@ import { PreactCounter } from '../components/PreactCounter.tsx'; import VueCounter from '../components/VueCounter.vue'; import SvelteCounter from '../components/SvelteCounter.svelte'; +let lang = 'en'; + // Full Astro Component Syntax: // https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md --- -<html> +<html lang={ lang ?? 'en' }> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" /> diff --git a/examples/framework-preact/src/pages/index.astro b/examples/framework-preact/src/pages/index.astro index c370d7298..513c43b43 100644 --- a/examples/framework-preact/src/pages/index.astro +++ b/examples/framework-preact/src/pages/index.astro @@ -2,10 +2,12 @@ // Component Imports import Counter from '../components/Counter.jsx' +let lang = 'en'; + // Full Astro Component Syntax: // https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md --- -<html> +<html lang={ lang ?? 'en' }> <head> <meta charset="utf-8" /> <meta diff --git a/examples/framework-react/src/pages/index.astro b/examples/framework-react/src/pages/index.astro index a62427dd9..b4eff1231 100644 --- a/examples/framework-react/src/pages/index.astro +++ b/examples/framework-react/src/pages/index.astro @@ -2,10 +2,12 @@ // Component Imports import Counter from '../components/Counter.jsx' +let lang = 'en'; + // Full Astro Component Syntax: // https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md --- -<html> +<html lang={ lang ?? 'en' }> <head> <meta charset="utf-8" /> <meta diff --git a/examples/framework-svelte/src/pages/index.astro b/examples/framework-svelte/src/pages/index.astro index 15d93bbaa..71d42d924 100644 --- a/examples/framework-svelte/src/pages/index.astro +++ b/examples/framework-svelte/src/pages/index.astro @@ -2,10 +2,12 @@ // Component Imports import Counter from '../components/Counter.svelte' +let lang = 'en'; + // Full Astro Component Syntax: // https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md --- -<html> +<html lang={ lang ?? 'en' }> <head> <meta charset="utf-8" /> <meta diff --git a/examples/framework-vue/src/pages/index.astro b/examples/framework-vue/src/pages/index.astro index 2dcc11da6..4959173d6 100644 --- a/examples/framework-vue/src/pages/index.astro +++ b/examples/framework-vue/src/pages/index.astro @@ -2,10 +2,12 @@ // Component Imports import Counter from '../components/Counter.vue' +let lang = 'en'; + // Full Astro Component Syntax: // https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md --- -<html> +<html lang={ lang ?? 'en' }> <head> <meta charset="utf-8" /> <meta diff --git a/examples/portfolio/src/layouts/project.astro b/examples/portfolio/src/layouts/project.astro index 4ebfed8e1..3ef6d1b88 100644 --- a/examples/portfolio/src/layouts/project.astro +++ b/examples/portfolio/src/layouts/project.astro @@ -6,7 +6,7 @@ import Nav from '../components/Nav/index.jsx'; const { content } = Astro.props; --- -<html> +<html lang={ content.lang ?? 'en' }> <head> <MainHead title={content.title} /> <style lang="scss"> diff --git a/examples/portfolio/src/pages/$projects.astro b/examples/portfolio/src/pages/$projects.astro index 9a3407b83..43b39ca28 100644 --- a/examples/portfolio/src/pages/$projects.astro +++ b/examples/portfolio/src/pages/$projects.astro @@ -5,6 +5,7 @@ import Nav from '../components/Nav/index.jsx'; import PortfolioPreview from '../components/PortfolioPreview/index.jsx'; let { collection } = Astro.props; +let lang = 'en'; export async function createCollection() { return { async data() { @@ -16,7 +17,7 @@ export async function createCollection() { } --- -<html> +<html lang={ lang ?? 'en' }> <head> <MainHead title="All Projects | Jeanine White" /> <style lang="scss"> diff --git a/examples/portfolio/src/pages/404.astro b/examples/portfolio/src/pages/404.astro index 6929c61e9..2368b2531 100644 --- a/examples/portfolio/src/pages/404.astro +++ b/examples/portfolio/src/pages/404.astro @@ -2,9 +2,11 @@ import MainHead from '../components/MainHead.astro'; import Footer from '../components/Footer/index.jsx'; import Nav from '../components/Nav/index.jsx'; + +let lang = 'en'; --- -<html> +<html lang={ lang ?? 'en' }> <head> <MainHead title="Not Found" /> </head> diff --git a/examples/portfolio/src/pages/about.astro b/examples/portfolio/src/pages/about.astro index 4ae7c3f08..50e6dac62 100644 --- a/examples/portfolio/src/pages/about.astro +++ b/examples/portfolio/src/pages/about.astro @@ -2,9 +2,11 @@ import MainHead from '../components/MainHead.astro'; import Footer from '../components/Footer/index.jsx'; import Nav from '../components/Nav/index.jsx'; + +let lang = 'en'; --- -<html> +<html lang={ lang ?? 'en' }> <head> <MainHead title="About | Jeanine White" /> <style lang="scss"> diff --git a/examples/portfolio/src/pages/index.astro b/examples/portfolio/src/pages/index.astro index 4638bb3e9..2a2009682 100644 --- a/examples/portfolio/src/pages/index.astro +++ b/examples/portfolio/src/pages/index.astro @@ -9,11 +9,12 @@ import PorfolioPreview from '../components/PortfolioPreview/index.jsx'; // Data Fetching: List all Markdown posts in the repo. const projects = Astro.fetchContent('./project/**/*.md'); const featuredProject = projects[0]; +let lang = 'en'; // Full Astro Component Syntax: // https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md --- -<html> +<html lang={ lang ?? 'en' }> <head> <MainHead title="Jeanine White: Personal Site" /> <style lang="scss"> diff --git a/examples/snowpack/src/layouts/content-with-cover.astro b/examples/snowpack/src/layouts/content-with-cover.astro index ea2ecaf0e..ccc1f671b 100644 --- a/examples/snowpack/src/layouts/content-with-cover.astro +++ b/examples/snowpack/src/layouts/content-with-cover.astro @@ -8,7 +8,7 @@ const { content } = Astro.props; --- <!doctype html> -<html> +<html lang={ content.lang ?? 'en' }> <head> <style> diff --git a/examples/snowpack/src/layouts/content.astro b/examples/snowpack/src/layouts/content.astro index 6c728db9d..a69f78f17 100644 --- a/examples/snowpack/src/layouts/content.astro +++ b/examples/snowpack/src/layouts/content.astro @@ -8,7 +8,7 @@ const { content } = Astro.props; --- <!doctype html> -<html> +<html lang={ content.lang ?? 'en' }> <head> <BaseHead title={content.title} description={content.description} permalink="TODO" /> diff --git a/examples/snowpack/src/layouts/post.astro b/examples/snowpack/src/layouts/post.astro index 7b0b614fe..0662b3f1b 100644 --- a/examples/snowpack/src/layouts/post.astro +++ b/examples/snowpack/src/layouts/post.astro @@ -7,7 +7,7 @@ const { content } = Astro.props; --- <!doctype html> -<html> +<html lang={ content.lang ?? 'en' }> <head> <style lang="scss"> diff --git a/examples/snowpack/src/pages/404.astro b/examples/snowpack/src/pages/404.astro index 053c931f4..ec3327ae4 100644 --- a/examples/snowpack/src/pages/404.astro +++ b/examples/snowpack/src/pages/404.astro @@ -4,10 +4,11 @@ import MainLayout from '../components/MainLayout.astro'; let title = 'Not Found'; let description = 'Snowpack is a lightning-fast frontend build tool, designed for the modern web.'; +let lang = 'en'; --- <!doctype html> -<html> +<html lang={ lang ?? 'en' }> <head> <BaseHead title={title} description={description} permalink="TODO" /> diff --git a/examples/snowpack/src/pages/guides.astro b/examples/snowpack/src/pages/guides.astro index e02856ede..93cedddac 100644 --- a/examples/snowpack/src/pages/guides.astro +++ b/examples/snowpack/src/pages/guides.astro @@ -23,7 +23,7 @@ let title = 'Guides'; let description = 'Snowpack\'s usage and integration guides.'; let guides; let communityGuides; - +let lang = 'en'; guides = paginate({ files: '/posts/guides/*.md', @@ -41,7 +41,7 @@ let communityGuides; --- <!doctype html> -<html> +<html lang={ lang ?? 'en' }> <head> <BaseHead title={title} description={description} permalink="TODO" /> diff --git a/examples/snowpack/src/pages/index.astro b/examples/snowpack/src/pages/index.astro index f2a8f7f26..029692161 100644 --- a/examples/snowpack/src/pages/index.astro +++ b/examples/snowpack/src/pages/index.astro @@ -7,10 +7,11 @@ import BaseLayout from '../components/BaseLayout.astro'; let title = 'Snowpack'; let description = 'Snowpack is a lightning-fast frontend build tool, designed for the modern web.'; +let lang = 'en'; --- <!doctype html> -<html> +<html lang={ lang ?? 'en' }> <head> <style lang="scss"> @use '../../public/styles/var' as *; diff --git a/examples/snowpack/src/pages/news.astro b/examples/snowpack/src/pages/news.astro index f51631d28..a8b99678e 100644 --- a/examples/snowpack/src/pages/news.astro +++ b/examples/snowpack/src/pages/news.astro @@ -14,10 +14,11 @@ import users from '../data/users.json'; const title = 'Community & News'; const description = 'Snowpack community news and companies that use Snowpack.'; +let lang = 'en'; --- <!doctype html> -<html> +<html lang={ lang ?? 'en' }> <head> <BaseHead title={title} description={description} permalink="TODO" /> diff --git a/examples/snowpack/src/pages/plugins.astro b/examples/snowpack/src/pages/plugins.astro index ce70f4cac..3ff13c115 100644 --- a/examples/snowpack/src/pages/plugins.astro +++ b/examples/snowpack/src/pages/plugins.astro @@ -5,10 +5,11 @@ import MainLayout from '../components/MainLayout.astro'; let title = 'The Snowpack Plugin Catalog'; let description = 'Snowpack plugins allow for configuration-minimal tooling integration.'; +let lang = 'en'; --- <!doctype html> -<html> +<html lang={ lang ?? 'en' }> <head> <BaseHead title={title} description={description} permalink="TODO" /> diff --git a/examples/snowpack/src/pages/proof-of-concept-dynamic/[slug].astro.ignore b/examples/snowpack/src/pages/proof-of-concept-dynamic/[slug].astro.ignore index 2b05bcf66..726f15642 100644 --- a/examples/snowpack/src/pages/proof-of-concept-dynamic/[slug].astro.ignore +++ b/examples/snowpack/src/pages/proof-of-concept-dynamic/[slug].astro.ignore @@ -8,6 +8,7 @@ import BaseLayout from '../components/BaseLayout.astro'; let title = 'Community & News'; let description = 'Snowpack community news and companies that use Snowpack.'; let entry; +let lang = 'en'; export default async function ({ params }) { entry = await contentful.getEntry(params.slug); @@ -15,7 +16,7 @@ export default async function ({ params }) { } --- -<html> +<html lang={ lang ?? 'en' }> <head> <BaseHead title={title} description={description} permalink="TODO" /> diff --git a/examples/starter/src/pages/index.astro b/examples/starter/src/pages/index.astro index 2e5832a3f..f2aab935b 100644 --- a/examples/starter/src/pages/index.astro +++ b/examples/starter/src/pages/index.astro @@ -9,11 +9,12 @@ import Tour from '../components/Tour.astro'; // It will run during the build, but never in the browser. // All variables are available to use in the HTML template below. let title = 'My Astro Site'; +let lang = 'en'; // Full Astro Component Syntax: // https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md --- -<html lang="en"> +<html lang={ lang ?? 'en' }> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> diff --git a/examples/with-markdown-plugins/src/layouts/main.astro b/examples/with-markdown-plugins/src/layouts/main.astro index d324d2017..46427fa8f 100644 --- a/examples/with-markdown-plugins/src/layouts/main.astro +++ b/examples/with-markdown-plugins/src/layouts/main.astro @@ -2,7 +2,7 @@ const { content } = Astro.props; --- -<html> +<html lang={ content.lang ?? 'en' }> <head> <meta charset="utf-8" /> <title>{content.title}</title> diff --git a/examples/with-markdown/src/layouts/main.astro b/examples/with-markdown/src/layouts/main.astro index c3ef56d60..431c0f28e 100644 --- a/examples/with-markdown/src/layouts/main.astro +++ b/examples/with-markdown/src/layouts/main.astro @@ -2,7 +2,7 @@ const { content } = Astro.props; --- -<html> +<html lang={ content.lang ?? 'en' }> <head> <meta charset="utf-8"> <title>{content.title}</title> diff --git a/examples/with-nanostores/src/pages/index.astro b/examples/with-nanostores/src/pages/index.astro index a3f0c7c8c..8f6153505 100644 --- a/examples/with-nanostores/src/pages/index.astro +++ b/examples/with-nanostores/src/pages/index.astro @@ -5,10 +5,11 @@ import AdminsSvelte from '../components/AdminsSvelte.svelte'; import AdminsVue from '../components/AdminsVue.vue'; import AdminsPreact from '../components/AdminsPreact.jsx'; +let lang = 'en'; // Full Astro Component Syntax: // https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md --- -<html lang="en"> +<html lang={ lang ?? 'en' }> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> diff --git a/examples/with-tailwindcss/src/pages/index.astro b/examples/with-tailwindcss/src/pages/index.astro index 1c1c52902..ede61ab82 100644 --- a/examples/with-tailwindcss/src/pages/index.astro +++ b/examples/with-tailwindcss/src/pages/index.astro @@ -2,10 +2,11 @@ // Component Imports import Button from '../components/Button.astro'; +let lang = 'en'; // Full Astro Component Syntax: // https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md --- -<html> +<html lang={ lang ?? 'en' }> <head> <meta charset="UTF-8" /> <title>Astro + TailwindCSS</title> |