Add lang attribute to html tags

This commit is contained in:
Shreesh Bhat 2021-07-12 23:46:28 -04:00
parent 1b13f5c158
commit 3f14bed413
33 changed files with 79 additions and 33 deletions

View file

@ -0,0 +1,17 @@
---
'@example/blog': minor
'@example/blog-multiple-authors': minor
'@example/docs': minor
'@example/framework-multiple': minor
'@example/framework-preact': minor
'@example/framework-react': minor
'@example/framework-svelte': minor
'@example/framework-vue': minor
'@example/portfolio': minor
'@example/snowpack': minor
'@example/with-markdown': minor
'@example/with-markdown-plugins': minor
'@example/with-tailwindcss': minor
---
Add lang attribute to html tags

View file

@ -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} />

View file

@ -8,6 +8,7 @@ import Pagination from '../components/Pagination.astro';
let title = 'Dons 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

View file

@ -8,6 +8,7 @@ import Pagination from '../components/Pagination.astro';
let title = 'Dons 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

View file

@ -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}

View file

@ -12,6 +12,7 @@ import authorData from '../data/authors.json';
// All variables are available to use in the HTML template below.
let title = 'Dons 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

View file

@ -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" />

View file

@ -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" />

View file

@ -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>

View file

@ -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" />

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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">

View file

@ -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">

View file

@ -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>

View file

@ -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">

View file

@ -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">

View file

@ -8,7 +8,7 @@ const { content } = Astro.props;
---
<!doctype html>
<html>
<html lang={ content.lang ?? 'en' }>
<head>
<style>

View file

@ -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" />

View file

@ -7,7 +7,7 @@ const { content } = Astro.props;
---
<!doctype html>
<html>
<html lang={ content.lang ?? 'en' }>
<head>
<style lang="scss">

View file

@ -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" />

View file

@ -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" />

View file

@ -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 *;

View file

@ -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" />

View file

@ -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" />

View file

@ -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" />

View file

@ -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">

View file

@ -2,7 +2,7 @@
const { content } = Astro.props;
---
<html>
<html lang={ content.lang ?? 'en' }>
<head>
<meta charset="utf-8" />
<title>{content.title}</title>

View file

@ -2,7 +2,7 @@
const { content } = Astro.props;
---
<html>
<html lang={ content.lang ?? 'en' }>
<head>
<meta charset="utf-8">
<title>{content.title}</title>

View file

@ -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">

View file

@ -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>