mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-14 18:18:09 +00:00
feat: standardize content type names and URL structure
- Convert singular to plural: project→projects, publication→publications, event→events - Rename: post→blog, teaching→courses (with "blog" being the justified exception to plural rule) - Update i18n translations (en, zh, zh-Hant, de, nl, fr, es, pt) - Fix template references to use new content type names - Update section IDs to maintain compatibility with menu references - Fix debug template to better handle variable log structures This change provides a more intuitive content structure with URL paths that match common expectations, following standard practices where collection types use plural names (with blog as the standard exception).
This commit is contained in:
1 parent
220330d872
commit
b8ab618087
62 files changed
+58
-99
No files matched your search
@@ -225,14 +225,14 @@
|
||||
|
||||
# Content types for default archive page titles and search results
|
||||
|
||||
- id: posts
|
||||
- id: blog
|
||||
translation: Blog
|
||||
|
||||
- id: publications
|
||||
translation: Publikationen
|
||||
|
||||
- id: talks
|
||||
translation: Vorträge
|
||||
- id: events
|
||||
translation: Veranstaltungen
|
||||
|
||||
- id: projects
|
||||
translation: Projekte
|
||||
|
||||
@@ -268,13 +268,13 @@
|
||||
|
||||
# Content types for default archive page titles and search results
|
||||
|
||||
- id: posts
|
||||
translation: Posts
|
||||
- id: blog
|
||||
translation: Blog
|
||||
|
||||
- id: publications
|
||||
translation: Publications
|
||||
|
||||
- id: talks
|
||||
- id: events
|
||||
translation: Events
|
||||
|
||||
- id: projects
|
||||
|
||||
@@ -205,13 +205,13 @@
|
||||
|
||||
# Content types for default archive page titles and search results
|
||||
|
||||
- id: posts
|
||||
translation: Posts
|
||||
- id: blog
|
||||
translation: Blog
|
||||
|
||||
- id: publications
|
||||
translation: Publicaciones
|
||||
|
||||
- id: talks
|
||||
- id: events
|
||||
translation: Eventos
|
||||
|
||||
- id: projects
|
||||
|
||||
@@ -208,14 +208,14 @@
|
||||
|
||||
# Content types for default archive page titles and search results
|
||||
|
||||
- id: posts
|
||||
translation: Posts
|
||||
- id: blog
|
||||
translation: Blog
|
||||
|
||||
- id: publications
|
||||
translation: Publications
|
||||
|
||||
- id: talks
|
||||
translation: Présentations
|
||||
- id: events
|
||||
translation: Événements
|
||||
|
||||
- id: projects
|
||||
translation: Projets
|
||||
|
||||
@@ -205,14 +205,14 @@
|
||||
|
||||
# Content types for default archive page titles and search results
|
||||
|
||||
- id: posts
|
||||
translation: Berichten
|
||||
- id: blog
|
||||
translation: Blog
|
||||
|
||||
- id: publications
|
||||
translation: Publicaties
|
||||
|
||||
- id: talks
|
||||
translation: Presentaties
|
||||
- id: events
|
||||
translation: Evenementen
|
||||
|
||||
- id: projects
|
||||
translation: Projects
|
||||
|
||||
@@ -205,14 +205,14 @@
|
||||
|
||||
# Content types for default archive page titles and search results
|
||||
|
||||
- id: posts
|
||||
translation: Posts
|
||||
- id: blog
|
||||
translation: Blog
|
||||
|
||||
- id: publications
|
||||
translation: Publicações
|
||||
|
||||
- id: talks
|
||||
translation: Palestras
|
||||
- id: events
|
||||
translation: Eventos
|
||||
|
||||
- id: projects
|
||||
translation: Projetos
|
||||
|
||||
@@ -205,14 +205,14 @@
|
||||
|
||||
# Content types for default archive page titles and search results
|
||||
|
||||
- id: posts
|
||||
translation: 文章
|
||||
- id: blog
|
||||
translation: 博客
|
||||
|
||||
- id: publications
|
||||
translation: 出版物
|
||||
|
||||
- id: talks
|
||||
translation: 演講
|
||||
- id: events
|
||||
translation: 活動
|
||||
|
||||
- id: projects
|
||||
translation: 專案
|
||||
|
||||
@@ -211,14 +211,14 @@
|
||||
|
||||
# Content types for default archive page titles and search results
|
||||
|
||||
- id: posts
|
||||
translation: 文章
|
||||
- id: blog
|
||||
translation: 博客
|
||||
|
||||
- id: publications
|
||||
translation: 出版物
|
||||
|
||||
- id: talks
|
||||
translation: 演讲
|
||||
- id: events
|
||||
translation: 活动
|
||||
|
||||
- id: projects
|
||||
translation: 项目
|
||||
|
||||
@@ -22,7 +22,18 @@
|
||||
console.groupCollapsed('[HBX] Build completed with {{ len $all_logs }} log entries');
|
||||
console.log('Debug data available at:', '/hbx-debug.json');
|
||||
{{ range $all_logs }}
|
||||
console.log('[HBX:{{ .level }}]', {{ .message | jsonify }}, 'page:', {{ .page | jsonify }});
|
||||
{{ if . }}
|
||||
{{ if reflect.IsMap . }}
|
||||
console.log(
|
||||
'[HBX:{{ if .level }}{{ .level }}{{ else }}info{{ end }}]',
|
||||
{{ if .message }}{{ .message | jsonify }}{{ else }}"No message"{{ end }},
|
||||
'page:',
|
||||
{{ if .page }}{{ .page | jsonify }}{{ else }}"unknown"{{ end }}
|
||||
);
|
||||
{{ else }}
|
||||
console.log('[HBX:info]', "Log entry with unexpected format", {{ . | jsonify }});
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
console.groupEnd();
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
{{/* Hugo Blox: Export Debug Logs for Future Debug Widget */}}
|
||||
{{/* This hook collects all HBX logs and exports them to a JSON file for tooling */}}
|
||||
|
||||
{{- if hugo.IsServer -}}
|
||||
{{/* Collect all logs from all pages */}}
|
||||
{{- $all_logs := slice -}}
|
||||
{{- range .Site.Pages -}}
|
||||
{{- $page_logs := .Store.Get "hbx_logs" | default slice -}}
|
||||
{{- $all_logs = $all_logs | append $page_logs -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $all_logs -}}
|
||||
{{/* Create debug export as a resource for tooling */}}
|
||||
{{- $debug_data := dict "logs" $all_logs "build_time" now.Unix "hugo_version" hugo.Version -}}
|
||||
{{- $debug_json := $debug_data | jsonify -}}
|
||||
{{- $debug_resource := resources.FromString "hbx-debug.json" $debug_json -}}
|
||||
{{- $debug_resource.Publish -}}
|
||||
|
||||
{{/* Also emit to console for immediate visibility */}}
|
||||
<script>
|
||||
if (window.console && console.groupCollapsed) {
|
||||
console.groupCollapsed('[HBX] Build completed with {{ len $all_logs }} log entries');
|
||||
console.log('Debug data available at:', '/hbx-debug.json');
|
||||
{{ range $all_logs }}
|
||||
console.log('[HBX:{{ .level }}]', {{ .message | jsonify }}, 'page:', {{ .page | jsonify }});
|
||||
{{ end }}
|
||||
console.groupEnd();
|
||||
}
|
||||
</script>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
{{- else if $page.IsPage -}}
|
||||
|
||||
{{ if (eq $page.Type "blog") | or (eq $page.Type "publication") | or (eq $page.Type "project") }}
|
||||
{{ if (eq $page.Type "blog") | or (eq $page.Type "publications") | or (eq $page.Type "projects") }}
|
||||
{{ partial "jsonld/article.html" (dict "page" $page "summary" $summary) }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq $page.Type "event" }}
|
||||
{{ if eq $page.Type "events" }}
|
||||
{{ partial "jsonld/event.html" (dict "page" $page "summary" $summary) }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
@@ -33,8 +33,5 @@
|
||||
|
||||
{{/* EXTENSIBILITY HOOK: BODY-END */}}
|
||||
{{ partial "functions/get_hook" (dict "hook" "body-end" "context" .) }}
|
||||
|
||||
{{/* Hugo Blox Debug Export (dev only) */}}
|
||||
{{ partial "hooks/body-end/hbx-debug-export" . }}
|
||||
</body>
|
||||
</html>
|
||||
@@ -197,7 +197,7 @@
|
||||
{{end}}
|
||||
|
||||
{{/* EVENT / PUBLICATION METADATA */}}
|
||||
{{ if .Params.abstract | or (eq .Type "publication") | or (eq .Type "event") }}
|
||||
{{ if .Params.abstract | or (eq .Type "publications") | or (eq .Type "events") }}
|
||||
<div class="max-w-prose grid grid-cols-1 md:grid-cols-[200px_auto] gap-4 my-6">
|
||||
|
||||
{{ if .Params.abstract }}
|
||||
@@ -222,7 +222,7 @@
|
||||
<div>{{ .Params.publication | markdownify }}</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .Type "event" }}
|
||||
{{ if eq .Type "events" }}
|
||||
<div class="font-bold text-2xl">{{ i18n "date" }}</div>
|
||||
<div>
|
||||
{{ partial "functions/get_event_dates" . }}
|
||||
|
||||
@@ -31,8 +31,6 @@ enableEmoji: true
|
||||
enableRobotsTXT: true
|
||||
footnotereturnlinkcontents: <sup>^</sup>
|
||||
ignoreFiles: [\.ipynb$, .ipynb_checkpoints$, \.Rmd$, \.Rmarkdown$, _cache$]
|
||||
permalinks:
|
||||
authors: '/author/:slug/'
|
||||
disableAliases: true
|
||||
outputs:
|
||||
home: [HTML, RSS, headers, redirects, backlinks]
|
||||
|
||||
@@ -23,5 +23,5 @@ main:
|
||||
url: projects/
|
||||
weight: 30
|
||||
- name: Teaching
|
||||
url: teaching/
|
||||
url: courses/
|
||||
weight: 40
|
||||
@@ -47,7 +47,7 @@ sections:
|
||||
title: Featured Publications
|
||||
filters:
|
||||
folders:
|
||||
- publication
|
||||
- publications
|
||||
featured_only: true
|
||||
design:
|
||||
view: article-grid
|
||||
@@ -58,7 +58,7 @@ sections:
|
||||
text: ''
|
||||
filters:
|
||||
folders:
|
||||
- publication
|
||||
- publications
|
||||
exclude_featured: false
|
||||
design:
|
||||
view: citation
|
||||
@@ -68,7 +68,7 @@ sections:
|
||||
title: Recent & Upcoming Talks
|
||||
filters:
|
||||
folders:
|
||||
- event
|
||||
- events
|
||||
design:
|
||||
view: card
|
||||
- block: collection
|
||||
@@ -78,7 +78,7 @@ sections:
|
||||
subtitle: ''
|
||||
text: ''
|
||||
# Page type to display. E.g. post, talk, publication...
|
||||
page_type: post
|
||||
page_type: blog
|
||||
# Choose how many pages you would like to display (0 = all pages)
|
||||
count: 5
|
||||
# Filter on criteria
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
|
500 Internal Server Error
An error occurred: An error occurred Gitea Version: 28.1.0 |