diff options
author | Valentin Popov <valentin@popov.link> | 2024-09-05 18:01:13 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2024-09-05 18:01:13 +0300 |
commit | 17c3115a0608bb7ef42c8038b36f24b2356004ec (patch) | |
tree | fb59e691830155a1b003dca9125fd871bd66176c | |
parent | 7ba2de71480c1b568ed8b7d7f693f17774da1684 (diff) | |
download | popov.link-17c3115a0608bb7ef42c8038b36f24b2356004ec.tar.xz popov.link-17c3115a0608bb7ef42c8038b36f24b2356004ec.zip |
Added basic structure
-rw-r--r-- | src/components/Head.astro | 17 | ||||
-rw-r--r-- | src/components/Header.astro | 14 | ||||
-rw-r--r-- | src/layouts/BaseLayout.astro | 26 | ||||
-rw-r--r-- | src/layouts/PostLayout.astro | 17 |
4 files changed, 55 insertions, 19 deletions
diff --git a/src/components/Head.astro b/src/components/Head.astro new file mode 100644 index 0000000..bc5609f --- /dev/null +++ b/src/components/Head.astro @@ -0,0 +1,17 @@ +--- +const canonicalURL = new URL(Astro.url.pathname, Astro.site); +--- + +<head> + <meta content="IE=edge" http-equiv="X-UA-Compatible" /> + <meta content="text/html; charset=utf-8" http-equiv="content-type" /> + <meta content="width=device-width, initial-scale=1" name="viewport" /> + <meta content="index, follow" name="robots" /> + <meta content="Description" name="description" /> + + <link href="/feed.xml" rel="alternate" title="RSS" type="application/atom+xml" /> + <link href="/sitemap-index.xml" rel="sitemap" /> + <link href={canonicalURL} rel="canonical" /> + + <title>Title</title> +</head> diff --git a/src/components/Header.astro b/src/components/Header.astro new file mode 100644 index 0000000..5b35d8a --- /dev/null +++ b/src/components/Header.astro @@ -0,0 +1,14 @@ +--- + +--- + +<header> + <nav> + <a href="/">Home</a> + <a href="/blog/">Blog</a> + <span> + <span>|</span> + <a href="/feed.xml">RSS</a> + </span> + </nav> +</header> diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 2def353..5a73ac6 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -1,27 +1,15 @@ --- -import CanonicalURL from "../components/CanonicalURL.astro"; +import Head from "../components/Head.astro"; +import Header from "../components/Header.astro"; --- <html> - <head> - <!-- Meta tags --> - <meta content="IE=edge" http-equiv="X-UA-Compatible" /> - <meta content="text/html; charset=utf-8" http-equiv="content-type" /> - <meta content="width=device-width, initial-scale=1" name="viewport" /> - <meta content="index, follow" name="robots" /> - - <!-- Title / Description --> - <meta content="Description" name="description" /> - <title>Title</title> - - <!-- RSS --> - <link href="#" rel="alternate" title="RSS" type="application/atom+xml" /> - - <!-- Canonical URL --> - <CanonicalURL /> - </head> + <Head /> <body> - <slot /> + <Header /> + <article> + <slot /> + </article> </body> </html> diff --git a/src/layouts/PostLayout.astro b/src/layouts/PostLayout.astro index ed2c900..37bbe37 100644 --- a/src/layouts/PostLayout.astro +++ b/src/layouts/PostLayout.astro @@ -2,6 +2,23 @@ import BaseLayout from "../layouts/BaseLayout.astro"; --- +<style> + .header { + text-align: center; + } +</style> + <BaseLayout> + <div class="header"> + <h1>Title</h1> + <p> + <small> + Posted + <time datetime="#">#</time> + by Valentin Popov ‐ + <strong>1 min read</strong> + </small> + </p> + </div> <slot /> </BaseLayout> |