Repository navigation
fix: correct Blog schema — proper BlogPosting objects, fix Hugo eq() with 3 args #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,48 @@ | |
| } | ||
| } | ||
| </script> | ||
| {{ else if and (or (eq .Kind "section") (eq .Kind "taxonomy") (eq .Kind "term")) (eq .Section "blog") }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -euo pipefail
# Inspect configured taxonomy roots and taxonomy-related content paths.
fd -HI -t f '^(hugo|config)\.(toml|yaml|yml|json)$' . -x sh -c \
'echo "--- $1"; rg -n -C2 "taxonom|tag|categor" "$1"' sh {} || true
fd -HI -t f . content | rg '/(tags|categories)/|/_index\.md$' || trueRepository: dominicusin/dominicusin.github.io Length of output: 1248 🤖 get_repo_knowledge executed:
Length of output: 46001 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- layouts/partials/schema.html'
cat -n layouts/partials/schema.html
echo '--- relevant Hugo configuration'
cat -n config/_default/hugo.toml | sed -n '18,42p;54,62p'
echo '--- taxonomy and section content'
fd -HI -t f . content | sort | while read -r f; do
case "$f" in
*/_index.md|*/tags/*|*/categories/*)
echo "--- $f"
sed -n '1,40p' "$f"
;;
esac
doneRepository: dominicusin/dominicusin.github.io Length of output: 9557 🌐 Web query:
💡 Result: In Hugo, the.Kind property and page collections like.Pages are fundamental to understanding how Hugo categorizes content and manages lists of pages [1][2]..Kind The.Kind property returns a string identifying the specific classification of a page [1]. Every page in a Hugo site is assigned one of the following five kinds [1][2]: home: The homepage of the site [1]. page: A regular content page (e.g., a blog post or article) [1][2]. section: A top-level directory or any content directory containing an _index.md file [1][3]. taxonomy: A page that lists all terms within a specific taxonomy (e.g., /tags/) [2][4]. term: A page that lists content associated with a specific term within a taxonomy (e.g., /tags/hugo/) [2][4]..Pages The.Pages method returns a collection of pages associated with the current page [5][6]. It is primarily available for list pages—specifically those with the kind home, section, taxonomy, or term [5][2]. - When used in a section template, it returns regular pages within that section and the section pages of immediate descendant sections [5][6]. - It is a key tool for rendering lists of content within your templates [6]. Distinction in Taxonomies It is common to find the terminology confusing regarding taxonomy pages. Specifically, the page that lists all terms (e.g., /tags/) has a.Kind of taxonomy, while the individual pages for each term (e.g., /tags/hugo/) have a.Kind of term [1][7]. Summary of Template Availability Templates in Hugo are often chosen based on these kinds [8]. You can use the.Kind variable in your templates to conditionally render content [8]. For example: {{ if eq.Kind "home" }} {{ /* Render home page content / }} {{ else if eq.Kind "page" }} {{ / Render regular page content / }} {{ else if in (slice "section" "taxonomy" "term").Kind }} {{ / Render list page content using.Pages */ }} {{ end }} [8] Citations:
Route taxonomy and term pages by page kind. Hugo treats 🤖 Prompt for AI Agents |
||
| <script type="application/ld+json"> | ||
|
Comment on lines
+18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Section pages lose breadcrumb metadata schema.html diverts the blog list and knowledge-graph section into standalone structured-data branches that end before the shared breadcrumb block. Because structured breadcrumbs are enabled, both URLs stop emitting the BreadcrumbList that the previous fallback generated. Agent Prompt
|
||
| { | ||
| "@context": "https://schema.org", | ||
| "@type": "Blog", | ||
| "name": "{{ .Title | safeJS }}", | ||
| "description": "{{ .Site.Params.description | safeJS }}", | ||
| "url": "{{ .Permalink }}", | ||
| "publisher": { | ||
| "@type": "Person", | ||
| "name": "{{ .Site.Params.Author.name | safeJS }}" | ||
| }, | ||
| "blogPost": [ | ||
| {{- $posts := where .Pages "Section" "blog" | first 10 -}} | ||
| {{- range $i, $page := $posts -}} | ||
| {{- if $i }}, {{ end -}} | ||
| { | ||
| "@type": "BlogPosting", | ||
| "headline": "{{ $page.Title | safeJS }}", | ||
| "url": "{{ $page.RelPermalink }}" | ||
| } | ||
| {{- end -}} | ||
| ], | ||
| "numberOfItems": {{ len .Pages }} | ||
| } | ||
| </script> | ||
| {{ else if eq .Section "knowledge-graph" }} | ||
| <script type="application/ld+json"> | ||
| { | ||
| "@context": "https://schema.org", | ||
| "@type": "WebApplication", | ||
| "name": "Knowledge Graph", | ||
| "description": "Interactive semantic relationship visualization between posts, concepts, people and projects.", | ||
| "url": "{{ .Permalink }}", | ||
| "applicationCategory": "Visualization", | ||
| "operatingSystem": "All", | ||
| "offers": { | ||
| "@type": "Offer", | ||
| "price": "0" | ||
| } | ||
| } | ||
| </script> | ||
| {{ else }} | ||
| {{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} | ||
| {{- /* Resolve the author: first `authors` front matter key looked up in data/authors/, else the site author. */ -}} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Tag pages publish article metadata
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools