Skip to content

Commit c335084

Browse files
authored
Refactor with Prettier style formatting (#6)
1 parent 87c3ce8 commit c335084

File tree

17 files changed

+4585
-1243
lines changed

17 files changed

+4585
-1243
lines changed

.prettierrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"printWidth": 999999,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"plugins": [
6+
"prettier-plugin-astro"
7+
],
8+
"overrides": [
9+
{
10+
"files": "*.astro",
11+
"options": {
12+
"parser": "astro"
13+
}
14+
}
15+
]
16+
}

bun.lock

Lines changed: 4167 additions & 769 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
"sharp": "0.34.5"
3434
},
3535
"devDependencies": {
36-
"@types/bun": "1.3.11"
36+
"@types/bun": "1.3.11",
37+
"prettier": "3.8.1",
38+
"prettier-plugin-astro": "0.14.1"
3739
}
38-
}
40+
}

src/components/BaseHead.astro

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
// Import the global.css file here so that it is included on
33
// all pages through the use of the <BaseHead /> component.
4-
import '../styles/global.css';
5-
import { Font } from 'astro:assets';
6-
import type { ImageMetadata } from 'astro';
7-
import FallbackImage from '../assets/blog-placeholder-1.jpg';
8-
import { SITE_TITLE } from '../consts';
4+
import "../styles/global.css";
5+
import { Font } from "astro:assets";
6+
import type { ImageMetadata } from "astro";
7+
import FallbackImage from "../assets/blog-placeholder-1.jpg";
8+
import { SITE_TITLE } from "../consts";
99
1010
interface Props {
11-
title: string;
12-
description: string;
13-
image?: ImageMetadata;
11+
title: string;
12+
description: string;
13+
image?: ImageMetadata;
1414
}
1515
1616
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
@@ -24,12 +24,7 @@ const { title, description, image = FallbackImage } = Astro.props;
2424
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
2525
<link rel="icon" href="/favicon.ico" />
2626
<link rel="sitemap" href="/sitemap-index.xml" />
27-
<link
28-
rel="alternate"
29-
type="application/rss+xml"
30-
title={SITE_TITLE}
31-
href={new URL('rss.xml', Astro.site)}
32-
/>
27+
<link rel="alternate" type="application/rss+xml" title={SITE_TITLE} href={new URL("rss.xml", Astro.site)} />
3328
<meta name="generator" content={Astro.generator} />
3429

3530
<!-- Font -->

src/components/Footer.astro

Lines changed: 34 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -3,70 +3,40 @@ const today = new Date();
33
---
44

55
<footer>
6-
<a href="https://hotfix.day" target="_blank" rel="noopener noreferrer">HotFix.Day</a> &copy; 2016&ndash;present by <a href="https://rdhar.dev" target="_blank" rel="noopener noreferrer">Rishav Dhar</a> &middot; Code: <a href="https://github.com/OP5dev/HotFix.Day?tab=Apache-2.0-1-ov-file#readme" target="_blank" rel="noopener noreferrer">Apache 2.0</a> &middot; Content: <a href="https://creativecommons.org/licenses/by/4.0" target="_blank" rel="noopener noreferrer">CC BY 4.0</a>.
7-
<div class="social-links">
8-
<a href="https://m.webtoo.ls/@astro" target="_blank" rel="noopener noreferrer">
9-
<span class="sr-only">Follow Astro on Mastodon</span>
10-
<svg
11-
viewBox="0 0 16 16"
12-
aria-hidden="true"
13-
width="32"
14-
height="32"
15-
astro-icon="social/mastodon"
16-
><path
17-
fill="currentColor"
18-
d="M11.19 12.195c2.016-.24 3.77-1.475 3.99-2.603.348-1.778.32-4.339.32-4.339 0-3.47-2.286-4.488-2.286-4.488C12.062.238 10.083.017 8.027 0h-.05C5.92.017 3.942.238 2.79.765c0 0-2.285 1.017-2.285 4.488l-.002.662c-.004.64-.007 1.35.011 2.091.083 3.394.626 6.74 3.78 7.57 1.454.383 2.703.463 3.709.408 1.823-.1 2.847-.647 2.847-.647l-.06-1.317s-1.303.41-2.767.36c-1.45-.05-2.98-.156-3.215-1.928a3.614 3.614 0 0 1-.033-.496s1.424.346 3.228.428c1.103.05 2.137-.064 3.188-.189zm1.613-2.47H11.13v-4.08c0-.859-.364-1.295-1.091-1.295-.804 0-1.207.517-1.207 1.541v2.233H7.168V5.89c0-1.024-.403-1.541-1.207-1.541-.727 0-1.091.436-1.091 1.296v4.079H3.197V5.522c0-.859.22-1.541.66-2.046.456-.505 1.052-.764 1.793-.764.856 0 1.504.328 1.933.983L8 4.39l.417-.695c.429-.655 1.077-.983 1.934-.983.74 0 1.336.259 1.791.764.442.505.661 1.187.661 2.046v4.203z"
19-
></path></svg
20-
>
21-
</a>
22-
<a href="https://twitter.com/astrodotbuild" target="_blank" rel="noopener noreferrer">
23-
<span class="sr-only">Follow Astro on Twitter</span>
24-
<svg
25-
viewBox="0 0 16 16"
26-
aria-hidden="true"
27-
width="32"
28-
height="32"
29-
astro-icon="social/twitter"
30-
><path
31-
fill="currentColor"
32-
d="M5.026 15c6.038 0 9.341-5.003 9.341-9.334 0-.14 0-.282-.006-.422A6.685 6.685 0 0 0 16 3.542a6.658 6.658 0 0 1-1.889.518 3.301 3.301 0 0 0 1.447-1.817 6.533 6.533 0 0 1-2.087.793A3.286 3.286 0 0 0 7.875 6.03a9.325 9.325 0 0 1-6.767-3.429 3.289 3.289 0 0 0 1.018 4.382A3.323 3.323 0 0 1 .64 6.575v.045a3.288 3.288 0 0 0 2.632 3.218 3.203 3.203 0 0 1-.865.115 3.23 3.23 0 0 1-.614-.057 3.283 3.283 0 0 0 3.067 2.277A6.588 6.588 0 0 1 .78 13.58a6.32 6.32 0 0 1-.78-.045A9.344 9.344 0 0 0 5.026 15z"
33-
></path></svg
34-
>
35-
</a>
36-
<a href="https://github.com/withastro/astro" target="_blank" rel="noopener noreferrer">
37-
<span class="sr-only">Go to Astro's GitHub repo</span>
38-
<svg
39-
viewBox="0 0 16 16"
40-
aria-hidden="true"
41-
width="32"
42-
height="32"
43-
astro-icon="social/github"
44-
><path
45-
fill="currentColor"
46-
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"
47-
></path></svg
48-
>
49-
</a>
50-
</div>
6+
<a href="https://hotfix.day" target="_blank" rel="noopener noreferrer">HotFix.Day</a> &copy; 2016&ndash;present by <a href="https://rdhar.dev" target="_blank" rel="noopener noreferrer">Rishav Dhar</a> &middot; Code: <a href="https://github.com/OP5dev/HotFix.Day?tab=Apache-2.0-1-ov-file#readme" target="_blank" rel="noopener noreferrer">Apache 2.0</a> &middot; Content: <a href="https://creativecommons.org/licenses/by/4.0" target="_blank" rel="noopener noreferrer">CC BY 4.0</a>.
7+
<div class="social-links">
8+
<a href="https://m.webtoo.ls/@astro" target="_blank" rel="noopener noreferrer">
9+
<span class="sr-only">Follow Astro on Mastodon</span>
10+
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32" astro-icon="social/mastodon"><path fill="currentColor" d="M11.19 12.195c2.016-.24 3.77-1.475 3.99-2.603.348-1.778.32-4.339.32-4.339 0-3.47-2.286-4.488-2.286-4.488C12.062.238 10.083.017 8.027 0h-.05C5.92.017 3.942.238 2.79.765c0 0-2.285 1.017-2.285 4.488l-.002.662c-.004.64-.007 1.35.011 2.091.083 3.394.626 6.74 3.78 7.57 1.454.383 2.703.463 3.709.408 1.823-.1 2.847-.647 2.847-.647l-.06-1.317s-1.303.41-2.767.36c-1.45-.05-2.98-.156-3.215-1.928a3.614 3.614 0 0 1-.033-.496s1.424.346 3.228.428c1.103.05 2.137-.064 3.188-.189zm1.613-2.47H11.13v-4.08c0-.859-.364-1.295-1.091-1.295-.804 0-1.207.517-1.207 1.541v2.233H7.168V5.89c0-1.024-.403-1.541-1.207-1.541-.727 0-1.091.436-1.091 1.296v4.079H3.197V5.522c0-.859.22-1.541.66-2.046.456-.505 1.052-.764 1.793-.764.856 0 1.504.328 1.933.983L8 4.39l.417-.695c.429-.655 1.077-.983 1.934-.983.74 0 1.336.259 1.791.764.442.505.661 1.187.661 2.046v4.203z"></path></svg>
11+
</a>
12+
<a href="https://twitter.com/astrodotbuild" target="_blank" rel="noopener noreferrer">
13+
<span class="sr-only">Follow Astro on Twitter</span>
14+
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32" astro-icon="social/twitter"><path fill="currentColor" d="M5.026 15c6.038 0 9.341-5.003 9.341-9.334 0-.14 0-.282-.006-.422A6.685 6.685 0 0 0 16 3.542a6.658 6.658 0 0 1-1.889.518 3.301 3.301 0 0 0 1.447-1.817 6.533 6.533 0 0 1-2.087.793A3.286 3.286 0 0 0 7.875 6.03a9.325 9.325 0 0 1-6.767-3.429 3.289 3.289 0 0 0 1.018 4.382A3.323 3.323 0 0 1 .64 6.575v.045a3.288 3.288 0 0 0 2.632 3.218 3.203 3.203 0 0 1-.865.115 3.23 3.23 0 0 1-.614-.057 3.283 3.283 0 0 0 3.067 2.277A6.588 6.588 0 0 1 .78 13.58a6.32 6.32 0 0 1-.78-.045A9.344 9.344 0 0 0 5.026 15z"></path></svg>
15+
</a>
16+
<a href="https://github.com/withastro/astro" target="_blank" rel="noopener noreferrer">
17+
<span class="sr-only">Go to Astro's GitHub repo</span>
18+
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32" astro-icon="social/github"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path></svg>
19+
</a>
20+
</div>
5121
</footer>
5222
<style>
53-
footer {
54-
padding: 2em 1em 6em 1em;
55-
background: linear-gradient(var(--gray-gradient)) no-repeat;
56-
color: rgb(var(--gray));
57-
text-align: center;
58-
}
59-
.social-links {
60-
display: flex;
61-
justify-content: center;
62-
gap: 1em;
63-
margin-top: 1em;
64-
}
65-
.social-links a {
66-
text-decoration: none;
67-
color: rgb(var(--gray));
68-
}
69-
.social-links a:hover {
70-
color: rgb(var(--gray-dark));
71-
}
23+
footer {
24+
padding: 2em 1em 6em 1em;
25+
background: linear-gradient(var(--gray-gradient)) no-repeat;
26+
color: rgb(var(--gray));
27+
text-align: center;
28+
}
29+
.social-links {
30+
display: flex;
31+
justify-content: center;
32+
gap: 1em;
33+
margin-top: 1em;
34+
}
35+
.social-links a {
36+
text-decoration: none;
37+
color: rgb(var(--gray));
38+
}
39+
.social-links a:hover {
40+
color: rgb(var(--gray-dark));
41+
}
7242
</style>

src/components/FormattedDate.astro

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
interface Props {
3-
date: Date;
3+
date: Date;
44
}
55
66
const { date } = Astro.props;
77
---
88

99
<time datetime={date.toISOString()}>
10-
{
11-
date.toLocaleDateString('en-us', {
12-
year: 'numeric',
13-
month: 'short',
14-
day: 'numeric',
15-
})
16-
}
10+
{
11+
date.toLocaleDateString("en-us", {
12+
year: "numeric",
13+
month: "short",
14+
day: "numeric",
15+
})
16+
}
1717
</time>

src/components/Header.astro

Lines changed: 62 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,70 @@
11
---
2-
import { SITE_TITLE } from '../consts';
3-
import HeaderLink from './HeaderLink.astro';
2+
import { SITE_TITLE } from "../consts";
3+
import HeaderLink from "./HeaderLink.astro";
44
---
55

66
<header>
7-
<nav>
8-
<h2><a href="/">{SITE_TITLE}</a></h2>
9-
<div class="internal-links">
10-
<HeaderLink href="/">Home</HeaderLink>
11-
<HeaderLink href="/blog">Blog</HeaderLink>
12-
<HeaderLink href="/about">About</HeaderLink>
13-
</div>
14-
<div class="social-links">
15-
<a href="https://m.webtoo.ls/@astro" target="_blank">
16-
<span class="sr-only">Follow Astro on Mastodon</span>
17-
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32"
18-
><path
19-
fill="currentColor"
20-
d="M11.19 12.195c2.016-.24 3.77-1.475 3.99-2.603.348-1.778.32-4.339.32-4.339 0-3.47-2.286-4.488-2.286-4.488C12.062.238 10.083.017 8.027 0h-.05C5.92.017 3.942.238 2.79.765c0 0-2.285 1.017-2.285 4.488l-.002.662c-.004.64-.007 1.35.011 2.091.083 3.394.626 6.74 3.78 7.57 1.454.383 2.703.463 3.709.408 1.823-.1 2.847-.647 2.847-.647l-.06-1.317s-1.303.41-2.767.36c-1.45-.05-2.98-.156-3.215-1.928a3.614 3.614 0 0 1-.033-.496s1.424.346 3.228.428c1.103.05 2.137-.064 3.188-.189zm1.613-2.47H11.13v-4.08c0-.859-.364-1.295-1.091-1.295-.804 0-1.207.517-1.207 1.541v2.233H7.168V5.89c0-1.024-.403-1.541-1.207-1.541-.727 0-1.091.436-1.091 1.296v4.079H3.197V5.522c0-.859.22-1.541.66-2.046.456-.505 1.052-.764 1.793-.764.856 0 1.504.328 1.933.983L8 4.39l.417-.695c.429-.655 1.077-.983 1.934-.983.74 0 1.336.259 1.791.764.442.505.661 1.187.661 2.046v4.203z"
21-
></path></svg
22-
>
23-
</a>
24-
<a href="https://twitter.com/astrodotbuild" target="_blank">
25-
<span class="sr-only">Follow Astro on Twitter</span>
26-
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32"
27-
><path
28-
fill="currentColor"
29-
d="M5.026 15c6.038 0 9.341-5.003 9.341-9.334 0-.14 0-.282-.006-.422A6.685 6.685 0 0 0 16 3.542a6.658 6.658 0 0 1-1.889.518 3.301 3.301 0 0 0 1.447-1.817 6.533 6.533 0 0 1-2.087.793A3.286 3.286 0 0 0 7.875 6.03a9.325 9.325 0 0 1-6.767-3.429 3.289 3.289 0 0 0 1.018 4.382A3.323 3.323 0 0 1 .64 6.575v.045a3.288 3.288 0 0 0 2.632 3.218 3.203 3.203 0 0 1-.865.115 3.23 3.23 0 0 1-.614-.057 3.283 3.283 0 0 0 3.067 2.277A6.588 6.588 0 0 1 .78 13.58a6.32 6.32 0 0 1-.78-.045A9.344 9.344 0 0 0 5.026 15z"
30-
></path></svg
31-
>
32-
</a>
33-
<a href="https://github.com/withastro/astro" target="_blank">
34-
<span class="sr-only">Go to Astro's GitHub repo</span>
35-
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32"
36-
><path
37-
fill="currentColor"
38-
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"
39-
></path></svg
40-
>
41-
</a>
42-
</div>
43-
</nav>
7+
<nav>
8+
<h2><a href="/">{SITE_TITLE}</a></h2>
9+
<div class="internal-links">
10+
<HeaderLink href="/">Home</HeaderLink>
11+
<HeaderLink href="/blog">Blog</HeaderLink>
12+
<HeaderLink href="/about">About</HeaderLink>
13+
</div>
14+
<div class="social-links">
15+
<a href="https://m.webtoo.ls/@astro" target="_blank">
16+
<span class="sr-only">Follow Astro on Mastodon</span>
17+
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32"><path fill="currentColor" d="M11.19 12.195c2.016-.24 3.77-1.475 3.99-2.603.348-1.778.32-4.339.32-4.339 0-3.47-2.286-4.488-2.286-4.488C12.062.238 10.083.017 8.027 0h-.05C5.92.017 3.942.238 2.79.765c0 0-2.285 1.017-2.285 4.488l-.002.662c-.004.64-.007 1.35.011 2.091.083 3.394.626 6.74 3.78 7.57 1.454.383 2.703.463 3.709.408 1.823-.1 2.847-.647 2.847-.647l-.06-1.317s-1.303.41-2.767.36c-1.45-.05-2.98-.156-3.215-1.928a3.614 3.614 0 0 1-.033-.496s1.424.346 3.228.428c1.103.05 2.137-.064 3.188-.189zm1.613-2.47H11.13v-4.08c0-.859-.364-1.295-1.091-1.295-.804 0-1.207.517-1.207 1.541v2.233H7.168V5.89c0-1.024-.403-1.541-1.207-1.541-.727 0-1.091.436-1.091 1.296v4.079H3.197V5.522c0-.859.22-1.541.66-2.046.456-.505 1.052-.764 1.793-.764.856 0 1.504.328 1.933.983L8 4.39l.417-.695c.429-.655 1.077-.983 1.934-.983.74 0 1.336.259 1.791.764.442.505.661 1.187.661 2.046v4.203z"></path></svg>
18+
</a>
19+
<a href="https://twitter.com/astrodotbuild" target="_blank">
20+
<span class="sr-only">Follow Astro on Twitter</span>
21+
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32"><path fill="currentColor" d="M5.026 15c6.038 0 9.341-5.003 9.341-9.334 0-.14 0-.282-.006-.422A6.685 6.685 0 0 0 16 3.542a6.658 6.658 0 0 1-1.889.518 3.301 3.301 0 0 0 1.447-1.817 6.533 6.533 0 0 1-2.087.793A3.286 3.286 0 0 0 7.875 6.03a9.325 9.325 0 0 1-6.767-3.429 3.289 3.289 0 0 0 1.018 4.382A3.323 3.323 0 0 1 .64 6.575v.045a3.288 3.288 0 0 0 2.632 3.218 3.203 3.203 0 0 1-.865.115 3.23 3.23 0 0 1-.614-.057 3.283 3.283 0 0 0 3.067 2.277A6.588 6.588 0 0 1 .78 13.58a6.32 6.32 0 0 1-.78-.045A9.344 9.344 0 0 0 5.026 15z"></path></svg>
22+
</a>
23+
<a href="https://github.com/withastro/astro" target="_blank">
24+
<span class="sr-only">Go to Astro's GitHub repo</span>
25+
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path></svg>
26+
</a>
27+
</div>
28+
</nav>
4429
</header>
4530
<style>
46-
header {
47-
margin: 0;
48-
padding: 0 1em;
49-
background: white;
50-
box-shadow: 0 2px 8px rgba(var(--black), 5%);
51-
}
52-
h2 {
53-
margin: 0;
54-
font-size: 1em;
55-
}
31+
header {
32+
margin: 0;
33+
padding: 0 1em;
34+
background: white;
35+
box-shadow: 0 2px 8px rgba(var(--black), 5%);
36+
}
37+
h2 {
38+
margin: 0;
39+
font-size: 1em;
40+
}
5641

57-
h2 a,
58-
h2 a.active {
59-
text-decoration: none;
60-
}
61-
nav {
62-
display: flex;
63-
align-items: center;
64-
justify-content: space-between;
65-
}
66-
nav a {
67-
padding: 1em 0.5em;
68-
color: var(--black);
69-
border-bottom: 4px solid transparent;
70-
text-decoration: none;
71-
}
72-
nav a.active {
73-
text-decoration: none;
74-
border-bottom-color: var(--accent);
75-
}
76-
.social-links,
77-
.social-links a {
78-
display: flex;
79-
}
80-
@media (max-width: 720px) {
81-
.social-links {
82-
display: none;
83-
}
84-
}
42+
h2 a,
43+
h2 a.active {
44+
text-decoration: none;
45+
}
46+
nav {
47+
display: flex;
48+
align-items: center;
49+
justify-content: space-between;
50+
}
51+
nav a {
52+
padding: 1em 0.5em;
53+
color: var(--black);
54+
border-bottom: 4px solid transparent;
55+
text-decoration: none;
56+
}
57+
nav a.active {
58+
text-decoration: none;
59+
border-bottom-color: var(--accent);
60+
}
61+
.social-links,
62+
.social-links a {
63+
display: flex;
64+
}
65+
@media (max-width: 720px) {
66+
.social-links {
67+
display: none;
68+
}
69+
}
8570
</style>

src/components/HeaderLink.astro

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
---
2-
import type { HTMLAttributes } from 'astro/types';
2+
import type { HTMLAttributes } from "astro/types";
33
4-
type Props = HTMLAttributes<'a'>;
4+
type Props = HTMLAttributes<"a">;
55
66
const { href, class: className, ...props } = Astro.props;
7-
const pathname = Astro.url.pathname.replace(import.meta.env.BASE_URL, '');
7+
const pathname = Astro.url.pathname.replace(import.meta.env.BASE_URL, "");
88
const subpath = pathname.match(/[^\/]+/g);
9-
const isActive = href === pathname || href === '/' + (subpath?.[0] || '');
9+
const isActive = href === pathname || href === "/" + (subpath?.[0] || "");
1010
---
1111

1212
<a href={href} class:list={[className, { active: isActive }]} {...props}>
13-
<slot />
13+
<slot />
1414
</a>
1515
<style>
16-
a {
17-
display: inline-block;
18-
text-decoration: none;
19-
}
20-
a.active {
21-
font-weight: bolder;
22-
text-decoration: underline;
23-
}
16+
a {
17+
display: inline-block;
18+
text-decoration: none;
19+
}
20+
a.active {
21+
font-weight: bolder;
22+
text-decoration: underline;
23+
}
2424
</style>

0 commit comments

Comments
 (0)