Skip to content

Commit 4dd54aa

Browse files
Clickinclaude
andcommitted
refactor: use siteCfg for metadata and fix structured data in projects
- index.astro, projects.astro: use siteCfg.title/description/author instead of hardcoded strings - projects.astro: move JSON-LD to BaseLayout structuredData prop (removes inline script tag, uses @graph for multiple items) - micronaut-8-views post: simplify Thymeleaf/Spring relationship description Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent aaf055d commit 4dd54aa

3 files changed

Lines changed: 28 additions & 27 deletions

File tree

src/content/posts/2026-02-22-micronaut-8-views/index.mdx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,20 @@ Micronaut Views 모듈(`micronaut-views-*`)은 여러 템플릿 엔진을 지원
3535

3636
이 편에서 Thymeleaf를 선택한 이유는 세 가지입니다.
3737

38-
**첫째, 강력한 에코시스템과 친숙도.** Thymeleaf는 흔히 Spring 팀이 직접 개발한 엔진으로 오해받기도 하지만, 실제로는 **다니엘 페르난데스(Daniel Fernández)**가 시작한 독립적인 오픈소스 프로젝트입니다. 다만 Spring MVC와의 완벽한 통합 모듈(`thymeleaf-spring`)을 통해 Spring Boot의 사실상 표준 뷰 엔진으로 자리 잡았습니다. 국내 Java 웹 프로젝트에서 JSP 이후 대안으로 가장 널리 쓰여 왔기에, Micronaut으로 넘어와도 학습 곡선이 거의 없다는 것이 큰 장점입니다.
38+
**첫째, 강력한 에코시스템과 친숙도.** Spring Boot 생태계의 사실상 표준 뷰 엔진으로 자리 잡은 Thymeleaf는 국내 Java 웹 프로젝트에서 JSP 이후 가장 널리 쓰인 선택입니다. Micronaut으로 넘어와도 학습 곡선이 거의 없다는 것이 큰 장점입니다.
3939

4040
**둘째, Natural Templates.** Thymeleaf의 핵심 설계 원칙 중 하나는 브라우저에서 HTML 파일을 직접 열었을 때도 구조를 확인할 수 있는 것입니다. `th:text="${product.name}"` 속성은 템플릿 엔진이 없는 환경에서 무시되고, 태그 안의 기본값이 그대로 보입니다. 디자이너와 협업하거나 Figma에서 내보낸 HTML을 템플릿으로 전환할 때 유리합니다.
4141

4242
**셋째, 성숙한 레이아웃 시스템.** `th:replace`, `th:insert`, `th:fragment`를 사용한 컴포넌트 조합이 직관적이고, 서드파티 `thymeleaf-layout-dialect` 없이도 충분한 레이아웃 구조를 만들 수 있습니다.
4343

4444
JTE는 컴파일 타임 타입 체크와 성능 면에서 고려할 만한 대안입니다. 다만 문법이 다르기 때문에 Spring 사용 경험이 있는 팀이라면 Thymeleaf 쪽이 전환 비용이 낮습니다.
4545

46-
> **Thymeleaf와 Spring의 관계에 대한 상식**
46+
> **Thymeleaf와 Spring의 관계**
4747
>
48-
> Thymeleaf는 Spring 팀이 직접 개발했거나 Spring 출신 팀이 만들었다는 것은 흔한 오해입니다. 실제로는 **다니엘 페르난데스(Daniel Fernández)**라는 스페인 출신의 엔지니어가 개인적으로 시작한 철저히 독립적인 오픈소스 프로젝트입니다.
48+
> Thymeleaf는 **다니엘 페르난데스(Daniel Fernández)**가 독립적으로 시작한 오픈소스 프로젝트로, Spring 팀과는 무관합니다. Spring의 공식 엔진처럼 보이는 데는 두 가지 배경이 있습니다.
4949
>
50-
> 그럼에도 왜 공식 툴처럼 보일까요?
51-
> * **초강력 Spring 통합 모듈:** 초기 설계부터 Spring MVC와의 완벽한 통합을 목표로 하여 데이터 바인딩, SpEL, 폼 검증 등을 네이티브 수준으로 지원합니다.
52-
> * **Spring Boot의 권장 엔진:** Spring Boot가 내장 WAS(JAR 패키징)에서 JSP 사용을 제한하면서, 대안으로 Natural Template을 지향하는 Thymeleaf를 적극적으로 추천하며 자동 설정을 제공했기 때문입니다.
50+
> * **Spring 통합 모듈:** 초기 설계부터 Spring MVC와의 완벽한 통합을 목표로 하여 데이터 바인딩, SpEL, 폼 검증 등을 네이티브 수준으로 지원합니다.
51+
> * **Spring Boot의 권장 엔진:** Spring Boot가 내장 WAS(JAR 패키징)에서 JSP 사용을 제한하면서, 대안으로 Thymeleaf를 적극 추천하고 자동 설정을 제공했습니다.
5352
5453
---
5554

src/pages/index.astro

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import BaseLayout from "../layouts/BaseLayout.astro";
33
import { getCollection } from "astro:content";
44
import { postUrl, normalizePostSlug } from "../lib/slug";
5+
import { site as siteCfg } from "../site.config";
56
67
const posts = (await getCollection("posts", ({ data }) => !data.draft && data.publish !== false))
78
.sort((a, b) => (b.data.updated ?? b.data.date).valueOf() - (a.data.updated ?? a.data.date).valueOf())
@@ -13,18 +14,18 @@ const siteUrl = Astro.site?.href ?? "https://clickin.github.io/";
1314
const structuredData = {
1415
"@context": "https://schema.org",
1516
"@type": "WebSite",
16-
"name": "Clickin Devlog",
17+
"name": siteCfg.title,
1718
"url": siteUrl,
18-
"description": "Developer blog — notes, write-ups, and explorations.",
19+
"description": siteCfg.description,
1920
"author": {
2021
"@type": "Person",
21-
"name": "Clickin"
22+
"name": siteCfg.author
2223
}
2324
};
2425
---
25-
<BaseLayout
26-
title="Home"
27-
description="Developer blog — notes, write-ups, and explorations."
26+
<BaseLayout
27+
title="Home"
28+
description={siteCfg.description}
2829
structuredData={structuredData}
2930
>
3031
<section class="py-8">

src/pages/projects.astro

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import BaseLayout from "../layouts/BaseLayout.astro";
3+
import { site as siteCfg } from "../site.config";
34
45
const base = import.meta.env.BASE_URL;
56
@@ -18,22 +19,24 @@ const projects = [
1819
},
1920
];
2021
21-
const schema = projects.map((project) => ({
22+
const structuredData = {
2223
"@context": "https://schema.org",
23-
"@type": "SoftwareApplication",
24-
name: project.name,
25-
description: project.description,
26-
applicationCategory: "DeveloperApplication",
27-
operatingSystem: "Any",
28-
offers: {
29-
"@type": "Offer",
30-
price: "0",
31-
priceCurrency: "USD",
32-
},
33-
}));
24+
"@graph": projects.map((project) => ({
25+
"@type": "SoftwareApplication",
26+
name: project.name,
27+
description: project.description,
28+
applicationCategory: "DeveloperApplication",
29+
operatingSystem: "Any",
30+
offers: {
31+
"@type": "Offer",
32+
price: "0",
33+
priceCurrency: "USD",
34+
},
35+
})),
36+
};
3437
---
3538

36-
<BaseLayout title="Projects" description="My open source projects">
39+
<BaseLayout title="Projects" description="My open source projects" structuredData={structuredData}>
3740
<h1 class="text-3xl sm:text-4xl font-extrabold mb-8">Projects</h1>
3841

3942
<div class="flex flex-col gap-4">
@@ -64,6 +67,4 @@ const schema = projects.map((project) => ({
6467
))
6568
}
6669
</div>
67-
68-
<script type="application/ld+json" set:html={JSON.stringify(schema)} />
6970
</BaseLayout>

0 commit comments

Comments
 (0)