summaryrefslogtreecommitdiff
path: root/examples/blog/src
diff options
context:
space:
mode:
authorGravatar Shreesh Bhat <shreeshbhat@users.noreply.github.com> 2021-07-12 23:46:28 -0400
committerGravatar Shreesh Bhat <shreeshbhat@users.noreply.github.com> 2021-07-13 00:49:13 -0400
commit3f14bed413074aba0ab9199d3a2e24802f51eb72 (patch)
tree5460d384a66f5c428c8617eddb511e6f55adfb9e /examples/blog/src
parent1b13f5c158b5fbe157406308205c0939b415e1d7 (diff)
downloadastro-3f14bed413074aba0ab9199d3a2e24802f51eb72.tar.gz
astro-3f14bed413074aba0ab9199d3a2e24802f51eb72.tar.zst
astro-3f14bed413074aba0ab9199d3a2e24802f51eb72.zip
Add lang attribute to html tags
Diffstat (limited to 'examples/blog/src')
-rw-r--r--examples/blog/src/layouts/BlogPost.astro2
-rw-r--r--examples/blog/src/pages/index.astro3
2 files changed, 3 insertions, 2 deletions
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" />