Skip to content

Commit cd8d46e

Browse files
committed
[Feat] 기존 블로그의 /about /resume 구글 검색에 노출되어서 /about 페이지 신설
1 parent 4ea6275 commit cd8d46e

12 files changed

Lines changed: 228 additions & 26 deletions

File tree

astro.config.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ export default defineConfig({
9797
"/2021/03/14/thread-and-security-context-holder-mode": "/ko/posts/engineering/thread-and-security-context-holder-mode",
9898
"/2021/03/14/thread-and-security-context-holder-mode/": "/ko/posts/engineering/thread-and-security-context-holder-mode",
9999
"/2021/03/14/thread-and-security-context-holder-mode/index.html": "/ko/posts/engineering/thread-and-security-context-holder-mode",
100-
"/resume": "/ko/resume",
101-
"/resume/": "/ko/resume",
102-
"/resume/index.html": "/ko/resume",
100+
"/resume": "/ko/about",
101+
"/resume/": "/ko/about",
102+
"/resume/index.html": "/ko/about",
103103
"/about": "/ko/about",
104104
"/about/": "/ko/about",
105105
"/about/index.html": "/ko/about",

src/components/Footer.astro

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,7 @@ const currentYear = new Date().getFullYear();
125125
<a href={translatePath(sectionMap.posts.url)}>{sectionMap.posts.title}</a>
126126
<a href={translatePath(sectionMap.categories.url)}>{sectionMap.categories.title}</a>
127127
<a href={translatePath(sectionMap.hobby.url)}>{sectionMap.hobby.title}</a>
128-
<a href={sectionMap.about.url} target="_blank" rel="noopener noreferrer">
129-
{sectionMap.about.title}
130-
</a>
128+
<a href={translatePath(sectionMap.about.url)}>{sectionMap.about.title}</a>
131129
</nav>
132130
</div>
133131
</footer>

src/components/Header.astro

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ const totalYears = diff / (1000 * 60 * 60 * 24 * 365.25);
5353
<a href={translatePath(sectionMap.posts.url)}>{sectionMap.posts.title}</a>
5454
<a href={translatePath(sectionMap.categories.url)}>{sectionMap.categories.title}</a>
5555
<a href={translatePath(sectionMap.hobby.url)}>{sectionMap.hobby.title}</a>
56-
<a href={sectionMap.about.url} target="_blank" rel="noopener noreferrer">
57-
{sectionMap.about.title}
58-
</a>
56+
<a href={translatePath(sectionMap.about.url)}>{sectionMap.about.title}</a>
5957
</nav>
6058

6159
<nav class:list={["wsj-mainnav", `lang-${lang}`]} aria-label="sub (blog category) navigation">

src/layouts/BaseLayout.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const AARONS_BLOG_DESCRIPTION = {
2323
2424
const {
2525
lang,
26-
title = AARONS_BLOG_TITLE,
26+
title: posttitle = AARONS_BLOG_TITLE,
2727
author = AARON,
2828
keywords = AARONS_BLOG_KEYWORDS[lang as Lang],
2929
description = AARONS_BLOG_DESCRIPTION[lang as Lang],
@@ -33,6 +33,8 @@ const {
3333
updated,
3434
} = Astro.props;
3535
36+
// 제목 타이틀은 "예시 글 제목 | The Pessimistic Optimist" 이렇게 되어야한다
37+
const title = posttitle ? posttitle + ' | ' + AARONS_BLOG_TITLE : AARONS_BLOG_TITLE
3638
const ogImageUrl = new URL('/tpo-social-share.png', Astro.site).href;
3739
3840
const isArticle = title !== AARONS_BLOG_TITLE && !!created;

src/pages/[lang]/about/index.astro

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
import BaseLayout from "@/layouts/BaseLayout.astro";
3+
import { SUPPORTED_LANGUAGES, useTranslations } from "@/scripts/i18n";
4+
import { sectionMap } from "@/scripts/section";
5+
6+
export async function getStaticPaths() {
7+
return SUPPORTED_LANGUAGES.map((lang) => ({ params: { lang } }));
8+
}
9+
10+
const { lang } = Astro.params;
11+
const t = useTranslations(lang);
12+
---
13+
14+
<BaseLayout
15+
lang={lang}
16+
title={sectionMap.about.title}
17+
keywords={sectionMap.about.shorten[lang]}
18+
description={sectionMap.about.description[lang]}
19+
>
20+
<main>
21+
<div class="content">
22+
<div class="information">
23+
{t("about.quote")}<br />
24+
<span class="subspan">{t("about.quote.description")}</span>
25+
</div>
26+
27+
<div class="section">
28+
<h1>{t("about.name")}</h1>
29+
<h2>{t("about.jobtitle")}</h2>
30+
<div class="information">
31+
<span>{t("about.email")} | {t("about.phone")}</span><br />
32+
<span>{t("about.address")}</span>
33+
</div>
34+
</div>
35+
36+
<div class="section">
37+
<div class="information linefeed">{t("about.explain.study")}</div>
38+
<span class="information">{t("about.explain.study.sub")}</span>
39+
<div class="information linefeed">{t("about.explain.mountain")}</div>
40+
<span class="information">{t("about.explain.mountain.sub")}</span>
41+
<div class="information linefeed">{t("about.explain.humanity")}</div>
42+
<span class="information">{t("about.explain.humanity.sub")}</span>
43+
</div>
44+
45+
<div class="section">
46+
<h2>Resume:</h2>
47+
<h3>
48+
<a href="https://aaronryu.notion.site/resume" target="_blank" rel="noopener noreferrer">
49+
Notion Page
50+
</a>
51+
</h3>
52+
</div>
53+
</div>
54+
</main>
55+
</BaseLayout>
56+
57+
<style>
58+
main {
59+
max-width: 900px;
60+
text-align: center;
61+
margin: 1.2em auto 2.6em;
62+
padding: 0 1.2em;
63+
64+
@media only screen and (max-width: 700px) {
65+
margin: 0.9em auto 2em;
66+
padding: 0 0.9em;
67+
}
68+
}
69+
70+
p,
71+
h1,
72+
h2,
73+
h3,
74+
h4 {
75+
margin: 0;
76+
}
77+
78+
h1 {
79+
font-size: 1.6em;
80+
font-weight: 400;
81+
margin: 0.5em 0 0;
82+
line-height: 1.3em;
83+
@media only screen and (max-width: 700px) {
84+
line-height: 1.1em;
85+
}
86+
}
87+
88+
h2 {
89+
font-size: 1.15em;
90+
font-weight: 400;
91+
}
92+
93+
h3 {
94+
font-size: 1.1em;
95+
font-weight: 400;
96+
line-height: 1.1em;
97+
}
98+
99+
span {
100+
font-weight: 100;
101+
}
102+
103+
.information {
104+
margin-top: 0.4em;
105+
line-height: 1.4em;
106+
107+
@media only screen and (max-width: 490px) {
108+
margin-top: 0.2em;
109+
white-space: pre-wrap; /* 줄바꿈 문자(\n)를 렌더링하게 함 */
110+
}
111+
}
112+
113+
.section {
114+
margin-top: 1.6em;
115+
}
116+
117+
.linefeed {
118+
margin-top: 0.6em;
119+
}
120+
121+
.resume-summary {
122+
text-align: start;
123+
}
124+
</style>

src/pages/[lang]/categories/index.astro

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import MainCategory from "@/components/MainCategory.astro";
33
import SectionHeader from "@/components/SectionHeader.astro";
44
import BaseLayout from "@/layouts/BaseLayout.astro";
55
import { getCategoryTree, type CategoryTree } from "@/scripts/category";
6-
import { getI18nStaticPaths } from "@/scripts/i18n";
6+
import { getI18nStaticPaths, type Lang } from "@/scripts/i18n";
7+
import { sectionMap } from "@/scripts/section";
78
89
export async function getStaticPaths() {
910
return getI18nStaticPaths(async (lang) => {
@@ -20,11 +21,20 @@ interface Props {
2021
categoryTree: CategoryTree;
2122
}
2223
23-
const { lang } = Astro.params;
24-
const { categoryTree } = Astro.props;
24+
interface Params {
25+
lang: Lang;
26+
}
27+
28+
const { lang } = Astro.params as unknown as Params;
29+
const { categoryTree } = Astro.props as unknown as Props;
2530
---
2631

27-
<BaseLayout lang={lang}>
32+
<BaseLayout
33+
lang={lang}
34+
title={sectionMap.categories.title}
35+
keywords={sectionMap.categories.shorten[lang]}
36+
description={sectionMap.categories.description[lang]}
37+
>
2838
<SectionHeader lang={lang} section={"categories"} />
2939
<article>
3040
<div class="categories">

src/pages/[lang]/hobby/[...page].astro

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,24 @@ interface Props {
3232
page: Page<CollectionEntry<"hobby">>;
3333
}
3434
35-
const { lang } = Astro.params;
36-
const translatePath = useTranslatedPath(lang!);
37-
const t = useTranslations(lang as Lang);
35+
interface Params {
36+
lang: Lang;
37+
}
38+
39+
const { lang } = Astro.params as unknown as Params;
40+
const translatePath = useTranslatedPath(lang);
41+
const t = useTranslations(lang);
3842
3943
// 왜 pages/[lang]/posts/[section]/[...page].astro 는 잘되는데 이 파일은 Props 가 안되는지 모르겠음
4044
const { page } = Astro.props as unknown as Props;
4145
---
4246

43-
<BaseLayout lang={lang}>
47+
<BaseLayout
48+
lang={lang}
49+
title={sectionMap.hobby.title}
50+
keywords={sectionMap.hobby.shorten[lang]}
51+
description={sectionMap.hobby.description[lang]}
52+
>
4453
<main>
4554
<SectionHeader lang={lang as Lang} section={"hobby"} />
4655
<div class="dashboard">

src/pages/[lang]/posts/[section]/[...page].astro

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,24 @@ interface Props {
4545
page: Page<CollectionEntry<"blog">>;
4646
}
4747
48-
const { lang, section } = Astro.params;
48+
interface Params {
49+
lang: Lang;
50+
section: keyof typeof sectionMap;
51+
}
52+
53+
const { lang, section } = Astro.params as unknown as Params;
4954
const translatePath = useTranslatedPath(lang!);
5055
const t = useTranslations(lang as Lang);
5156
5257
const { page } = Astro.props as unknown as Props;
5358
---
5459

55-
<BaseLayout lang={lang}>
60+
<BaseLayout
61+
lang={lang}
62+
title={sectionMap[section].title}
63+
keywords={sectionMap[section].shorten[lang]}
64+
description={sectionMap[section].description[lang]}
65+
>
5666
<!-- @ts-ignore -->
5767
<SectionHeader lang={lang} section={section} />
5868
<main>

src/pages/[lang]/posts/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const sectionPosts = new Map(
3737
);
3838
---
3939

40-
<BaseLayout lang={lang}>
40+
<BaseLayout lang={lang} title={sectionMap.posts.title}>
4141
<main>
4242
<SectionHeader lang={lang} section={"posts"} />
4343
<div class="dashboard">

src/pages/[lang]/resume/index.astro

Whitespace-only changes.

0 commit comments

Comments
 (0)