Skip to content

Commit bae1be1

Browse files
committed
feat(2.4): + common components(header, footer, etc.)
1 parent 85d598b commit bae1be1

6 files changed

Lines changed: 86 additions & 4 deletions

File tree

‎src/components/Footer.astro‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<div class="footer">
2+
<nav class="nav">
3+
<div>2021 &copy; Copyright notice | <a href="https://github.com/one-aalam/astro-ink">Ink</a> theme on <a href="https://astro.build/">Astro</a></div>
4+
</nav>
5+
</div>
6+
<style>
7+
.footer {
8+
@apply py-6 border-t dark:text-gray-300 border-gray-200 dark:border-gray-700
9+
}
10+
</style>

‎src/components/Header.astro‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
import SvgIcon from './SvgIcon.astro'
3+
---
4+
5+
<header class="header">
6+
<div class="header__logo">
7+
<a href="/" class="avatar">
8+
<img class="header__logo-img" src="/assets/logo.svg" alt="Astro logo" />
9+
</a>
10+
</div>
11+
<div class="header__meta flex-1">
12+
<h3 class="header__title">
13+
<a href="">Ink</a>
14+
</h3>
15+
<div class="header__meta-more flex">
16+
<p class="header__desc">
17+
Crisp, minimal, personal blog theme for Astro
18+
</p>
19+
<nav class="header__nav flex">
20+
<ul class="header__ref-list">
21+
<li>
22+
<a href="https://github.com/one-aalam/astro-ink" title="Github">
23+
<SvgIcon>
24+
<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path>
25+
</SvgIcon>
26+
</a>
27+
</li>
28+
</ul>
29+
</nav>
30+
</div>
31+
</div>
32+
</header>
33+
34+
<style>
35+
.header {
36+
@apply flex gap-4 border-b border-gray-200 dark:border-gray-700 py-3
37+
}
38+
.header__logo-img {
39+
@apply w-16 h-16 rounded-full overflow-hidden
40+
}
41+
.header__title {
42+
@apply text-4xl font-extrabold md:text-5xl text-primarySecondary dark:text-primarySecondaryDark
43+
}
44+
.header__desc {
45+
@apply text-xl flex-1 dark:text-gray-200
46+
}
47+
.header__ref-list {
48+
@apply flex gap-3 text-gray-400
49+
}
50+
</style>

‎src/components/Intro.astro‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<img src="/assets/yay.svg" alt="Yay!" />
2-
<h1>Hello, World!</h1>
32

43
<style>
54
img {

‎src/components/MainLayout.astro‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
import BaseLayout from './BaseLayout.astro';
3+
import Header from './Header.astro';
4+
import Footer from './Footer.astro';
5+
---
6+
<BaseLayout>
7+
<br class="my-4"/>
8+
<Header/>
9+
<div class="content">
10+
<slot />
11+
</div>
12+
<br class="my-4"/>
13+
<Footer/>
14+
</BaseLayout>
15+
16+
<style>
17+
.content {
18+
min-height: 580px
19+
}
20+
</style>

‎src/components/SvgIcon.astro‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2+
<slot />
3+
</svg>

‎src/pages/index.astro‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
import BaseHead from '$/components/BaseHead.astro'
3-
import BaseLayout from '$/components/BaseLayout.astro'
3+
import MainLayout from '$/components/MainLayout.astro'
44
import Intro from '$/components/Intro.astro'
55
---
66
<html>
77
<head>
88
<BaseHead title="Astro Ink | Home" />
99
</head>
10-
<BaseLayout>
10+
<MainLayout>
1111
<Intro/>
12-
</BaseLayout>
12+
</MainLayout>
1313
</html>

0 commit comments

Comments
 (0)