Skip to content

Commit 0004194

Browse files
UI 개선: minimal header, solarized light theme, hero image 크기 조정
Amp-Thread-ID: https://ampcode.com/threads/T-019c1880-22c4-707a-8f73-2be4c0de2188 Co-authored-by: Amp <amp@ampcode.com>
1 parent cbc0537 commit 0004194

File tree

6 files changed

+89
-103
lines changed

6 files changed

+89
-103
lines changed

src/components/Footer.astro

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,12 @@ const today = new Date();
33
---
44

55
<footer>
6-
&copy; {today.getFullYear()} Your name here. All rights reserved.
6+
&copy; {today.getFullYear()} mexicorea. All rights reserved.
7+
<!-- social-links hidden for now
78
<div class="social-links">
8-
<a href="https://m.webtoo.ls/@astro" target="_blank">
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">
23-
<span class="sr-only">Follow Astro on Twitter</span>
24-
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32" astro-icon="social/twitter"
25-
><path
26-
fill="currentColor"
27-
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"
28-
></path></svg
29-
>
30-
</a>
31-
<a href="https://github.com/withastro/astro" target="_blank">
32-
<span class="sr-only">Go to Astro's GitHub repo</span>
33-
<svg viewBox="0 0 16 16" aria-hidden="true" width="32" height="32" astro-icon="social/github"
34-
><path
35-
fill="currentColor"
36-
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"
37-
></path></svg
38-
>
39-
</a>
9+
...
4010
</div>
11+
-->
4112
</footer>
4213
<style>
4314
footer {

src/components/Header.astro

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,25 @@ import HeaderLink from './HeaderLink.astro';
66
<header>
77
<nav>
88
<h2><a href="/">{SITE_TITLE}</a></h2>
9+
<!-- internal-links hidden for minimal design
910
<div class="internal-links">
1011
<HeaderLink href="/">Home</HeaderLink>
1112
<HeaderLink href="/blog">Blog</HeaderLink>
1213
<HeaderLink href="/about">About</HeaderLink>
1314
</div>
15+
-->
16+
<!-- social-links hidden for now
1417
<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>
18+
...
4219
</div>
20+
-->
4321
</nav>
4422
</header>
4523
<style>
4624
header {
4725
margin: 0;
4826
padding: 0 1em;
49-
background: white;
50-
box-shadow: 0 2px 8px rgba(var(--black), 5%);
27+
background: linear-gradient(var(--gray-gradient)) no-repeat;
5128
}
5229
h2 {
5330
margin: 0;
@@ -63,6 +40,9 @@ import HeaderLink from './HeaderLink.astro';
6340
align-items: center;
6441
justify-content: space-between;
6542
}
43+
nav {
44+
min-height: 60px;
45+
}
6646
nav a {
6747
padding: 1em 0.5em;
6848
color: var(--black);

src/consts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Place any global data in this file.
22
// You can import this data from anywhere in your site by using the `import` keyword.
33

4-
export const SITE_TITLE = 'Song Yongseok';
4+
export const SITE_TITLE = 'mexicorea';
55
export const SITE_DESCRIPTION = '학력(學歷) 말고 학력(學力) | Product Engineer | Family man';

src/layouts/BlogPost.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
2222
}
2323
.hero-image {
2424
width: 100%;
25+
max-width: 480px;
26+
margin: 0 auto;
2527
}
2628
.hero-image img {
2729
display: block;
2830
margin: 0 auto;
2931
border-radius: 12px;
30-
box-shadow: var(--box-shadow);
3132
}
3233
.prose {
3334
width: 720px;

src/pages/index.astro

Lines changed: 61 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,81 @@
11
---
2+
import { getCollection } from 'astro:content';
23
import BaseHead from '../components/BaseHead.astro';
34
import Footer from '../components/Footer.astro';
45
import Header from '../components/Header.astro';
6+
import FormattedDate from '../components/FormattedDate.astro';
57
import { SITE_DESCRIPTION, SITE_TITLE } from '../consts';
8+
9+
const posts = (await getCollection('blog')).sort(
10+
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(),
11+
);
612
---
713

814
<!doctype html>
915
<html lang="en">
1016
<head>
1117
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
18+
<style>
19+
main {
20+
width: 720px;
21+
max-width: calc(100% - 2em);
22+
margin: auto;
23+
padding: 3em 1em;
24+
}
25+
ul {
26+
list-style-type: none;
27+
margin: 0;
28+
padding: 0;
29+
}
30+
ul li {
31+
margin-bottom: 2rem;
32+
}
33+
ul li a {
34+
text-decoration: none;
35+
color: inherit;
36+
}
37+
ul li a:hover .title {
38+
text-decoration: underline;
39+
}
40+
.title {
41+
margin: 0 0 0.25rem 0;
42+
font-size: 1.5rem;
43+
font-weight: 700;
44+
color: rgb(var(--black));
45+
line-height: 1.3;
46+
}
47+
.date {
48+
margin: 0;
49+
color: rgb(var(--gray));
50+
font-size: 0.875rem;
51+
}
52+
.description {
53+
margin: 0.5rem 0 0 0;
54+
color: rgb(var(--gray-dark));
55+
font-size: 1rem;
56+
}
57+
</style>
1258
</head>
1359
<body>
1460
<Header />
1561
<main>
16-
<h1>🧑‍🚀 Hello, Astronaut!</h1>
17-
<p>
18-
Welcome to the official <a href="https://astro.build/">Astro</a> blog starter template. This template
19-
serves as a lightweight, minimally-styled starting point for anyone looking to build a personal
20-
website, blog, or portfolio with Astro.
21-
</p>
22-
<p>
23-
This template comes with a few integrations already configured in your
24-
<code>astro.config.mjs</code> file. You can customize your setup with
25-
<a href="https://astro.build/integrations">Astro Integrations</a> to add tools like Tailwind,
26-
React, or Vue to your project.
27-
</p>
28-
<p>Here are a few ideas on how to get started with the template:</p>
2962
<ul>
30-
<li>Edit this page in <code>src/pages/index.astro</code></li>
31-
<li>Edit the site header items in <code>src/components/Header.astro</code></li>
32-
<li>Add your name to the footer in <code>src/components/Footer.astro</code></li>
33-
<li>Check out the included blog posts in <code>src/content/blog/</code></li>
34-
<li>Customize the blog post page layout in <code>src/layouts/BlogPost.astro</code></li>
63+
{
64+
posts.map((post) => (
65+
<li>
66+
<a href={`/blog/${post.id}/`}>
67+
<h2 class="title">{post.data.title}</h2>
68+
<p class="date">
69+
<FormattedDate date={post.data.pubDate} />
70+
</p>
71+
{post.data.description && (
72+
<p class="description">{post.data.description}</p>
73+
)}
74+
</a>
75+
</li>
76+
))
77+
}
3578
</ul>
36-
<p>
37-
Have fun! If you get stuck, remember to
38-
<a href="https://docs.astro.build/">read the docs</a>
39-
or <a href="https://astro.build/chat">join us on Discord</a> to ask questions.
40-
</p>
41-
<p>
42-
Looking for a blog template with a bit more personality? Check out
43-
<a href="https://github.com/Charca/astro-blog-template">astro-blog-template</a>
44-
by <a href="https://twitter.com/Charca">Maxi Ferreira</a>.
45-
</p>
4679
</main>
4780
<Footer />
4881
</body>

src/styles/global.css

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
*/
66

77
:root {
8-
--accent: #2337ff;
9-
--accent-dark: #000d8a;
8+
--accent: #586e75;
9+
--accent-dark: #073642;
1010
--black: 15, 18, 25;
1111
--gray: 96, 115, 159;
12-
--gray-light: 229, 233, 240;
12+
--gray-light: 238, 232, 213;
1313
--gray-dark: 34, 41, 57;
14-
--gray-gradient: rgba(var(--gray-light), 50%), #fff;
14+
--gray-gradient: rgba(var(--gray-light), 50%), #fdf6e3;
15+
--bg-color: #fdf6e3;
1516
--box-shadow:
1617
0 2px 6px rgba(var(--gray), 25%), 0 8px 24px rgba(var(--gray), 33%), 0 16px 32px
1718
rgba(var(--gray), 33%);
@@ -35,8 +36,7 @@ body {
3536
margin: 0;
3637
padding: 0;
3738
text-align: left;
38-
background: linear-gradient(var(--gray-gradient)) no-repeat;
39-
background-size: 100% 600px;
39+
background: var(--bg-color);
4040
word-wrap: break-word;
4141
overflow-wrap: break-word;
4242
color: rgb(var(--gray-dark));
@@ -60,16 +60,16 @@ h6 {
6060
line-height: 1.2;
6161
}
6262
h1 {
63-
font-size: 3.052em;
63+
font-size: 2.5em;
6464
}
6565
h2 {
66-
font-size: 2.441em;
66+
font-size: 1.5em;
6767
}
6868
h3 {
69-
font-size: 1.953em;
69+
font-size: 1.25em;
7070
}
7171
h4 {
72-
font-size: 1.563em;
72+
font-size: 1.1em;
7373
}
7474
h5 {
7575
font-size: 1.25em;
@@ -121,7 +121,8 @@ blockquote {
121121
border-left: 4px solid var(--accent);
122122
padding: 0 0 0 20px;
123123
margin: 0;
124-
font-size: 1.333em;
124+
font-size: 1em;
125+
color: var(--accent);
125126
}
126127
hr {
127128
border: none;

0 commit comments

Comments
 (0)