diff --git a/exampleSite/content/archives/_index.md b/exampleSite/content/archives/_index.md new file mode 100644 index 0000000..02bac36 --- /dev/null +++ b/exampleSite/content/archives/_index.md @@ -0,0 +1,4 @@ +--- +title: "Lưu trữ" +description: "Toàn bộ bài viết theo năm và tháng." +--- diff --git a/exampleSite/content/post/2025/08/15/ghi-chu-hugo/index.md b/exampleSite/content/post/2025/08/15/ghi-chu-hugo/index.md new file mode 100644 index 0000000..fdcd60b --- /dev/null +++ b/exampleSite/content/post/2025/08/15/ghi-chu-hugo/index.md @@ -0,0 +1,20 @@ +--- +title: "Ghi chú về Hugo và static site" +date: 2025-08-15T09:00:00+07:00 +draft: false +tags: ["hugo", "viet"] +categories: ["ghi-chu"] +description: "Một vài ghi chú khi quay lại với Hugo sau thời gian dài." +--- + +Hugo là một static site generator viết bằng Go. Lần này quay lại sau một khoảng dài, có nhiều thứ đã đổi. + +## Layout convention mới + +Từ phiên bản 0.146, Hugo dùng `_partials`, `_markup`, `_shortcodes` cho các thư mục bên trong `layouts/`. Tên thư mục bắt đầu bằng dấu gạch dưới để tách biệt với các kind/section thông thường. + +## Vài điều giữ lại + +- Markdown thuần là tài sản lâu dài. +- Build chậm thì không phải Hugo. +- Theme nhẹ thì site nhẹ. diff --git a/exampleSite/content/post/2025/12/01/cuoi-nam/index.md b/exampleSite/content/post/2025/12/01/cuoi-nam/index.md new file mode 100644 index 0000000..9b09c77 --- /dev/null +++ b/exampleSite/content/post/2025/12/01/cuoi-nam/index.md @@ -0,0 +1,12 @@ +--- +title: "Vài suy nghĩ cuối năm" +date: 2025-12-01T20:30:00+07:00 +draft: false +tags: ["viet"] +categories: ["ghi-chu"] +description: "Nhìn lại một năm với nhiều thay đổi nhỏ." +--- + +Cuối năm là lúc thích hợp để dừng lại. Không phải để tổng kết, mà để quan sát. + +Có những thứ năm nay tôi làm tốt hơn năm ngoái. Và có những thứ vẫn vậy. Cả hai đều ổn. diff --git a/exampleSite/content/post/2026/01/10/ke-hoach-dau-nam/index.md b/exampleSite/content/post/2026/01/10/ke-hoach-dau-nam/index.md new file mode 100644 index 0000000..c1f3796 --- /dev/null +++ b/exampleSite/content/post/2026/01/10/ke-hoach-dau-nam/index.md @@ -0,0 +1,20 @@ +--- +title: "Lập kế hoạch đầu năm" +date: 2026-01-10T08:00:00+07:00 +draft: false +tags: ["tsuki", "hugo"] +categories: ["demo"] +description: "Bắt đầu năm mới bằng một kế hoạch nhỏ và một theme mới." +--- + +Đầu năm tôi thường viết ra ba thứ muốn làm xong trong sáu tháng đầu. Năm nay một trong số đó là viết một theme Hugo riêng — tsuki. + +## Vì sao tự viết + +Theme đang dùng tốt, nhưng nặng. Có nhiều thứ tôi không cần. Tự viết là cách hiểu rõ từng dòng. + +## Mục tiêu + +1. Không có bước build cho CSS/JS — chỉ Hugo + ES modules trình duyệt hiểu được. +2. Tiếng Việt trước. Ngôn ngữ khác không phải mục tiêu. +3. Trang chủ là portfolio. Bài viết là phần còn lại. diff --git a/exampleSite/content/post/2026/03/22/doc-sach-quan-sat/index.md b/exampleSite/content/post/2026/03/22/doc-sach-quan-sat/index.md new file mode 100644 index 0000000..369da35 --- /dev/null +++ b/exampleSite/content/post/2026/03/22/doc-sach-quan-sat/index.md @@ -0,0 +1,14 @@ +--- +title: "Đọc sách và quan sát" +date: 2026-03-22T15:00:00+07:00 +draft: false +tags: ["viet", "demo"] +categories: ["ghi-chu"] +description: "Đọc chậm hơn, viết ngắn hơn, quan sát kỹ hơn." +--- + +Tôi đang thử đọc lại những cuốn cũ. Lần trước đọc lướt; lần này đọc kỹ. + +Phát hiện ra: phần lớn ấn tượng đầu tiên về một cuốn sách là sai. Không phải vì cuốn sách thay đổi — mà vì tôi đã đọc khác đi. + +> Tháng ấy đẹp quá nhỉ. diff --git a/exampleSite/content/post/_index.md b/exampleSite/content/post/_index.md new file mode 100644 index 0000000..a881e73 --- /dev/null +++ b/exampleSite/content/post/_index.md @@ -0,0 +1,4 @@ +--- +title: "Bài viết" +description: "Tất cả ghi chú và bài viết." +--- diff --git a/layouts/_default/.gitkeep b/layouts/_default/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html new file mode 100644 index 0000000..1816359 --- /dev/null +++ b/layouts/_default/taxonomy.html @@ -0,0 +1,19 @@ +{{ define "body_class" }}list taxonomy-list{{ end }} + +{{ define "main" }} +
+

{{ .Title }}

+ {{- with .Description }}

{{ . }}

{{ end }} +
+ + +{{ end }} diff --git a/layouts/_partials/archive-group.html b/layouts/_partials/archive-group.html new file mode 100644 index 0000000..20925e9 --- /dev/null +++ b/layouts/_partials/archive-group.html @@ -0,0 +1,17 @@ +{{- $year := . -}} +
+

{{ $year.Key }}

+ {{- range $year.Pages.GroupByDate "1" }} +
+

{{ i18n "month" (dict "Number" .Key) | default (printf "Tháng %s" .Key) }}

+ +
+ {{- end }} +
diff --git a/layouts/_partials/pagination.html b/layouts/_partials/pagination.html new file mode 100644 index 0000000..bcd65f6 --- /dev/null +++ b/layouts/_partials/pagination.html @@ -0,0 +1,26 @@ +{{- $p := .Paginator -}} +{{- if gt $p.TotalPages 1 -}} + +{{- end -}} diff --git a/layouts/archives/.gitkeep b/layouts/archives/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/layouts/archives/list.html b/layouts/archives/list.html new file mode 100644 index 0000000..ea91dd5 --- /dev/null +++ b/layouts/archives/list.html @@ -0,0 +1,17 @@ +{{ define "body_class" }}list archive{{ end }} + +{{ define "main" }} +
+

{{ .Title }}

+ {{- with .Description }}

{{ . }}

{{ end }} +
+ +
+ {{- $posts := where site.RegularPages "Section" "post" }} + {{- range $posts.GroupByDate "2006" }} + {{ partial "archive-group.html" . }} + {{- else }} +

{{ i18n "archiveEmpty" | default "Chưa có bài viết." }}

+ {{- end }} +
+{{ end }} diff --git a/layouts/post/.gitkeep b/layouts/post/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/layouts/post/list.html b/layouts/post/list.html new file mode 100644 index 0000000..ad0f764 --- /dev/null +++ b/layouts/post/list.html @@ -0,0 +1,16 @@ +{{ define "body_class" }}list section-post{{ end }} + +{{ define "main" }} +
+

{{ .Title }}

+ {{- with .Description }}

{{ . }}

{{ end }} +
+ +
+ {{- range .Paginator.Pages }} + {{ partial "post-card.html" . }} + {{- end }} +
+ +{{ partial "pagination.html" . }} +{{ end }} diff --git a/layouts/taxonomy/term.html b/layouts/taxonomy/term.html new file mode 100644 index 0000000..d99cd2f --- /dev/null +++ b/layouts/taxonomy/term.html @@ -0,0 +1,18 @@ +{{ define "body_class" }}list term-list{{ end }} + +{{ define "main" }} +
+

+ {{ .Title }} +

+ {{- with .Description }}

{{ . }}

{{ end }} +
+ +
+ {{- range .Paginator.Pages }} + {{ partial "post-card.html" . }} + {{- end }} +
+ +{{ partial "pagination.html" . }} +{{ end }}