Skip to content

merge upstream#1

Open
emhl wants to merge 240 commits into
roverserver:masterfrom
halogenica:master
Open

merge upstream#1
emhl wants to merge 240 commits into
roverserver:masterfrom
halogenica:master

Conversation

@emhl

@emhl emhl commented Dec 30, 2023

Copy link
Copy Markdown
Member

No description provided.

davidmn and others added 30 commits June 19, 2023 10:29
…465)

Co-authored-by: Alexandra Zaharia <alexandra.zaharia@platform.sh>
Solves #455 by statically
configuring the page source to use the source and description of the first image
in bigimg. When the description is empty, also pre-hides the description box.

When JavaScript is enabled, this theme's main.js
(https://github.com/halogenica/beautifulhugo/blob/master/static/js/main.js)
takes over and will overwrite this style attribute, changing the image in use.
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Ox-hugo uses an array for authors by default which breaks this
theme. Some themes already support multiple authors e.g. ananke
Adding Disclaimer Text to the footer.

Signed-off-by: Robert Terakedis <rterakedis@vmware.com>
Co-authored-by: Robert Terakedis <rterakedis@vmware.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
* Convert theme to hugo module

* ci: bump PR build too

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Bump hugo SSG to latest version

* Update .github/workflows/ci.yml

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
* seo/article: Fix dateModified and add timezone

* Remove new line at the end of the file
* Fixes Upstream Issue 349 - tag link has double forward slash

* Updated fix for Upstream Issue 349 - tag link has double forward slash
* Add cusdis support

* update example website config.toml
added logo manager for asset, if is assets, optimize the logo in Hugo pipelines
* Site.Author is deprecated, use Params.author instead

* Update footer.html

* Update footer.html

* Update footer.html

* Update footer.html

* Update footer.html

* Update footer.html

* Update footer.html

* Update ci.yml

* Update ci.yml

* Update footer.html

* Update ci.yml

* Update ci.yml

---------

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
* Fixed deprecated site.isServer param to hugo.isServer param

* Also fixed another deprecated function for disqus

* Updated README.md

In the face of that we will update to 0.120 it would also be nice to update the README to reference the hugo.* file as the config instead of the config.* file.
I also changed the description of the disqus feature to match the updated version of the code

* Added checks for hugoVersion and disqus feature

* Fixed accidental delete

* Removed new line
henryiii and others added 30 commits May 17, 2026 20:18
* fix: correct paths for subdirectory deployments

- Remove absolute '/index.json' fallback in search-fuse.js that
  bypassed relURL for subdirectory deployments
- Guard footer commit link with .Site.Params.commit check so
  'commit = false' doesn't render 'false' + hash in the URL
- Clean up redundant 'and' in show-source.html GitInfo conditional

Assisted-by: opencode:glm-5

* fix: default search provider to fuse instead of none

When [Params.search] is absent from config, the provider defaulted to
"none" instead of "fuse", disabling search unexpectedly. The
search-provider partial now defaults to "fuse" so search works out of
the box.

Assisted-by: opencode:glm-5

* Apply suggestion from @henryiii
relURL with a leading slash (e.g. "/index.json") produces a server-root
path, ignoring the baseURL subpath. Remove the leading slash so relURL
correctly prepends the path component (e.g. "/beautifulhugo/index.json"
instead of "/index.json"). Also add comment= to example site config.

Assisted-by: OpenCode:glm-5
Add callout, include-code, and no-ai-summary shortcodes.
Add recipe content type, TOC panel, robot/AI meta tags, view source
button, custom HTML hooks, and MathJax support. Replace outdated
'Home page callout' with slide-out TOC panel.

Assisted-by: OpenCode:glm-5
Same relURL leading-slash issue as the search index URL: "/css/search.css"
and "/js/search.js" with relURL produce server-root paths that ignore the
baseURL subpath. Remove leading slashes so they resolve correctly under
subpath deployments like /beautifulhugo/.

Assisted-by: OpenCode:glm-5
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
…#744)

The search page uses type:search, so the header partial generates a
search-heading class, but CSS only had rules for page-heading,
tags-heading, and categories-heading. This caused the search page title
to be left-aligned with inconsistent font sizing compared to other pages.

Assisted-by: OpenCode:glm-5
The vendored Bootstrap 5.3.5 CSS does not include [data-bs-theme="dark"]
alert overrides. Since the Beautiful Hugo theme uses a custom
data-theme="dark" attribute, the six main Bootstrap alert types
(primary, secondary, info, success, warning, danger) retained their
light-mode pastel backgrounds and dark text in dark mode, making them
nearly unreadable.

Add explicit [data-theme="dark"] overrides for .alert-{type}.callout
border, background, and text colors (and their .alert-heading colors)
to static/css/dark.css, matching Bootstrap 5's dark emphasis palette.

Assisted-by: OpenCode:Kimi-K2.6
Override Bootstrap tooltip background color from black (#000) to dark grey (#343a40) for better visual appearance.

Assisted-by: OpenCode:NRP/kimi
* feat(search): decode HTML entities in search results

Add a `decodeHtml` helper function to ensure that HTML-encoded characters in page titles and excerpts are properly decoded before being escaped and rendered in the search results dropdown. This prevents double-encoding or raw entity display in the UI.

* refactor: replace DOM element creation with DOMParser for HTML decoding
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
…#753)

* fix(seo): self-canonicalize paginated pages without breaking listings

The canonical link added in #731 used `.Permalink`, which makes every
paginated page (`/page/2/`, `/post/page/2/`, …) canonicalize to page 1.
Google now recommends paginated pages self-canonicalize instead.

Switching to `.Paginator.URL` (as proposed in #750) fixes the URLs but
introduces a silent bug: the SEO partial runs in <head>, before the body,
so calling `.Paginator` there builds the default, *unfiltered* paginator
first. Hugo caches one paginator per page and hands that cached set to the
body's filtered `.Paginate`, ignoring the filter — `hidden` posts then
leak onto the home page.

Fix by centralizing the list collection so the <head> canonical and the
<body> listing paginate the exact same set:

- Add `partials/func/list-pages.html`: single source of truth for a list
  node's collection (home → mainSections regular pages; section/term →
  `.Pages`), with `hidden` pages filtered out before pagination so they
  neither show nor leave gaps in the page numbering.
- Add `partials/seo/canonical.html`: overridable canonical tag. Resolution
  order is front-matter `canonicalURL` → paginator URL (home/section/term)
  → permalink. Honors `disableCanonical` (site-wide or per-page). The
  taxonomy index keeps using `.Permalink`, so no phantom paginated pages.
- Route `seo/main.html`, `index.html`, and `list.html` through the shared
  collection partial.
- Document canonical behavior in the example site (seo-and-i18n.md,
  configuration.md).

Verified against the example site: the 6 paginated pages now
self-canonicalize, all other canonicals and every list page's contents are
unchanged, and a `hidden` post no longer leaks into any listing.

Closes #751. Supersedes #750.

Assisted-by: ClaudeCode:claude-opus-4.8
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(seo): use absLangURL for canonical links on multilingual sites

Per PR review: relative `canonicalURL` overrides ran through `absURL`,
which resolves against the global baseURL and drops the language prefix on
multilingual sites. Switch to `absLangURL` so relative overrides stay
language-correct.

Verified on a two-language test site that this is safe in every case:
- paginator URLs already carry the language prefix, and absLangURL does not
  double it (…/fr/post/page/2/ stays correct);
- relative overrides become language-aware (/fr/post/original/);
- absolute override URLs (https://other.com/…) are emitted unchanged.

Single-language sites are unaffected. Doc wording updated to match.

Assisted-by: ClaudeCode:claude-opus-4.8
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* chore: Update partial to return a dict of schema data

Add @id to be reference by WebPage
Add publisher which references #organization
Remove @context as this will be contained within the @graph

Chnage partial to return a dict which will be used when building the
@graph schema. This will merge all ld+json into a single context.

* chore: Update partial to return a dict and add missing data

Remove @context as this will be part of a @graph context
Add @id #webpage
Add isPartOf which links the WebPage to the #website

* chore: Update partial to return a dict

This makes it ready to be used as part of a new @graph schema context

* chore: Update partial to return a dict

This just makes it ready to use with a new @graph context, unifying the
schema.

* typo: Wording fix

* fix: Provide correct support for pagination and breadcrumb creation

The previous implemenation had several issues.

- the url for home "/" was not unique across homepage pagination. This
meant the @id was not truely unique for #breadcrumb.
- The absolute "/" should not contain a #breadcrumb. Its a bit of
circular reference, as breadcrumbs are intended to show how to get to
the current page from the sites root page. However, breadcrumbs should
exist for the homepage where pagination has ocurred. Such as /page/2
/page/3 and so on

This new implemenation provides these elements.
- "/" does not contain #breadcrumb
- Paginated pages such as /page/2 now have unique #breadcrumb @ids in
the form of /page/2/#breadcrumb and so on.

* feat: Add CollectionPage for .IsNode content

Add a #collectionpage @id

- A CollectionPage supports #breadcrumb. This means that WebPage is not
needed in the schema for these pages.
- Correctly avoid adding #breadcrumb for "/" but adds it for "/page/2"
and so on.
- Pagination is limited to pages that are of "post". This might need to
be revisist? Or it may impact how others use the theme if they are
heavily custimised. This is just speculation on my part.

* fix: Update partial to return a dict and improve data

Remove @context
remove "isPartOf" and replace with "mainEntityOfPage" to main link to
#webpage

* feat: Switch to a single @graph schema

Rework schema to generate a single inified @graph schema.

This makes use of the partials that have been updated to return
dictionaries of their related data.

*May want to consider remove the "recipe" from the theme layout and
instead creating a custom schema.html for the example site within its
own layout strucuture*

* fix: tag for multiple author support

If there are multiple author the "#author" alone does not provide
uniqueness.

- Create unique id using #athor-name
  name constructed using the urlize function
- Each author has their own "Person" object created with their unique
@id.
- The article then gets an "author" attribute that is an array of "@id"s
to link to the "Person" objects. This ensure uniquness.

#Note: This still supports the case where there is only a single author.
The array structure does not create any issues.

* delete: Remove "publisher" within the article schema

Remove the "publisher" organization object. This is no unique as it uses
the "#organization" tag.

Multiple Organization blocks can be used but each must be unique.
The Site publisher gets a "#organization" tag.
You might then create another Organization denoted where the author
works if they are not work for the same organization. This new
organization would have a differe @id such as #author-org. This is
merely a tag and could be anything as long as it is unique. The author
object would then need to contain a "worksFor" attribute that would have
an @id referecnes #author-org.

* fix: Add the publisher attribute using @id

* fix: Update recipe.html to be similar to article.html

* fix: keywords list correctly as done in article.html

* fix(issue 2): This addresses the issue 2 of the copilot review

* fix(issue 3): This addresses issue 3 reported by copilot

* fix: Switch to using func/list-pages.html

* refactor(seo): clean up structured-data partials

- Remove dead old-breadcrumb.html backup partial
- Drop unused $currentPageUrl variable in schema.html
- Reuse the .Store paginator in collection-page.html instead of
  re-paginating with a hardcoded 'post' section, keeping the collection
  consistent with the canonical link and body listing

Assisted-by: ClaudeCode:claude-opus-4.8

---------

Co-authored-by: Adam.S <Bas-Man@users.noreply.github.com>
Co-authored-by: Henry Schreiner <henryfs@princeton.edu>
Update the CI test matrix to replace 0.161.1 with 0.163.0 as the
latest Hugo release. Also fix AGENTS.md docs to reflect the current
matrix: 0.146.2, 0.155.2, 0.163.0.

Assisted-by: OpenCode:glm-5
* Added uptional dates

* Update to docs

* Updates

* Tweak

* Done
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Inside the comment range loop the dot is the comment data map, so
.Site.Params.dateformat silently resolved to nil and comments always
used the shortdateFormat fallback. Use $.Site to reach the page
context.

Assisted-by: ClaudeCode:claude-sonnet-4-6
The dateformat validator only recognized the numeric (01) and full
(January) month forms, so valid Go layouts like "Jan 2, 2006" - the
canonical Go reference format - failed the build. Accept the
abbreviated (Jan) form as well, in both post_meta and page_meta.

Assisted-by: ClaudeCode:claude-sonnet-4-6
seo/schema.html built the paginator from the unfiltered .Pages for
non-home nodes. Since it runs in <head>, it won the one-paginator-per-
page race and the filtered .Paginate in list.html was silently
ignored, so pages with hidden: true appeared in section/term listings
and their JSON-LD. Route all node kinds through func/list-pages,
which already handles the filtering.

Assisted-by: ClaudeCode:claude-sonnet-4-6
* feat: add mathjax switch

Assisted-by: OpenCode:Kimi-K2.6
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* chore: minor touchup

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* feat: per-page settings

Assisted-by: OpenCode:Kimi-K2.6
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* fix: load MathJax even when selfHosted is enabled

head.html emitted the window.MathJax config for mathEngine=mathjax
regardless of selfHosted, but scripts.html only loaded the MathJax
library in the CDN branch, so selfHosted sites got a config and no
library - math silently broke. MathJax is not vendored, so load it
from the CDN in both branches and document the behavior.

Assisted-by: ClaudeCode:claude-sonnet-4-6

---------

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
The inline script for delayed Disqus loading never closed its
$(function(){ wrapper, so the whole script failed to parse and the
"Show comments" button did nothing.

Assisted-by: ClaudeCode:claude-sonnet-4-6
The noscript tracking pixel hardcoded http://, which is blocked as
mixed content on https sites.

Assisted-by: ClaudeCode:claude-sonnet-4-6
The fuse search index URL used relURL, which always resolves to the
default-language /index.json. Multilingual sites emit one index per
language, so non-default languages searched the wrong index. Use
relLangURL, matching the adjacent searchPageURL.

Assisted-by: ClaudeCode:claude-sonnet-4-6
Params.comment was a typo'd leftover of Params.commit (set to false
above it) and is read by nothing. The commented AISearchSummary block
referenced a config scheme that was never implemented; the real
feature is the [Params.seo] ai-summary-limit map.

Assisted-by: ClaudeCode:claude-sonnet-4-6
…768)

StumbleUpon shut down in 2018. The email icon used fab fa-at, but
fa-at is a solid icon so nothing rendered. The Twitter share URL
emitted a dangling via= when author.twitter was unset.

Assisted-by: ClaudeCode:claude-sonnet-4-6
printf "%d" emitted max-snippet:%!d(string=50) when the front matter
value was a quoted number. Cast to int before formatting.

Assisted-by: ClaudeCode:claude-sonnet-4-6
relURL/absURL treat a leading-slash input as host-root relative, so
user-config paths like logo = "/img/avatar.png" rendered without the
baseURL subpath and 404'd on sites deployed under a path prefix.
Strip the leading slash before relURL/absURL for user-supplied image
params (favicon, logo, bigimg, post previews, figure shortcodes,
gallery, twitter/JSON-LD images), leaving page-relative figure paths
untouched since RelPermalink already carries the prefix.

Assisted-by: ClaudeCode:claude-sonnet-4-6
- seo/opengraph.html had no callers
- layouts/index.html duplicated _default/list.html minus fullWidth;
  the home page now falls back to list.html and gains fullWidth
- layouts/index.json inlined the search_index partial verbatim;
  home JSON falls back to _default/index.json
- _default/list.json made every section emit an identical copy of
  the site-wide search index that nothing fetches
- terms.html carried an unreachable range-else fallback
- header.html had a fileExists conditional with identical branches

Assisted-by: ClaudeCode:claude-sonnet-4-6
- func/date-format.html: dateformat resolution + validation shared
  by post_meta and page_meta
- seo/structured/author-schema.html: author Person/@id JSON-LD
  builder shared by article and recipe schemas
- func/menu-name.html: menu i18n lookup shared by top-level and
  dropdown entries in the navbar
- func/toc-state.html: TOC/posts-panel availability shared by the
  navbar toggle and the panel itself

Built example site is byte-identical before and after.

Assisted-by: ClaudeCode:claude-opus-4-8
- footer: compute social href once instead of duplicating the <a> tag
- github-buttons: drop identity and()/redundant gating
- share-links: trust the caller's socialShare gate (single.html
  already uses .Param, which has identical precedence)
- search index: .Plain is already plain text; plainify was re-parsing
  it as HTML and stripping code tokens from the index
- meta-robots: append each tag once instead of accumulating
  duplicates for uniq to clean up
- article/recipe schema: replace assignment-inside-return with a
  plain pipeline
- post_meta: emit separators based on whether anything rendered
  before, not on whether the immediately preceding feature is on

Assisted-by: ClaudeCode:claude-opus-4-8
- paginator prev/next now use .Paginator.URL, which respects a custom
  pagination path and links page 1 at the canonical section URL
  instead of the /page/1/ alias redirect
- archive selects mainSections pages by Type, matching every other
  listing in the theme
- in-site page links use .RelPermalink / relLangURL per the theme's
  relative-URL convention; JSON-LD, share, comment, and translation
  links intentionally stay absolute

Assisted-by: ClaudeCode:claude-opus-4-8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.