Skip to content

Always show the current year in the footer copyright - #1

Merged
p-yukusai merged 1 commit into
mainfrom
fix/always-current-copyright-year
Aug 22, 2026
Merged

p-yukusai merged 1 commit into
mainfrom
fix/always-current-copyright-year

Conversation

@GbotHQ

@GbotHQ GbotHQ commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Problem

The live site shows © 2023 AnimeEffectDevs and never updates.

Root cause (three layers)

  1. Deployments stalled in March 2023. The site is served from the gh-pages
    branch (a fossil build), and the hugo.yml workflow on main has zero runs
    ever — it deploys via actions/deploy-pages, which requires the Pages source to
    be set to GitHub Actions, which it isn't. So nothing newer ever shipped.
  2. The theme's client-side year refresh is broken. Compose's bundled
    updateDate() was supposed to make the year stale-proof:
    yearEl ? year.innerHTML = year : false;   // assigns innerHTML on the NUMBER, not the element
    It writes innerHTML on the numeric variable — a silent no-op in sloppy mode.
    Verified in a browser: the footer year never changes even when the bundle runs.
  3. Author name typo in config/_default/params.toml: AnimeEffectDevs →
    AnimeEffectsDevs (rendered next to the year in the footer).

Changes

  • assets/js/custom.js (new) — overrides the theme's placeholder
    assets/js/custom.js, which Hugo concatenates last into js/bundle.js. Sets the
    footer year to the client's current year on every load, so even a stale build
    or cached page displays the correct year.
  • config/_default/params.toml — fix the author-name typo.
  • .github/workflows/hugo.yml — publish the built site to the gh-pages
    branch (the current Pages source), so merges actually deploy without any
    settings change. Also: build on PRs (deploy skipped), drop the unused
    dart-sass-embedded step (the extended binary's libsass compiles the theme
    fine), harden the build with --gc and the production base URL.

Verification

  • Built locally with the exact CI Hugo version (extended 0.108.0): build passes.
  • Browser-tested the built site: with the served HTML tampered to
    © 1999, the footer renders © 2026 after load on both the homepage and
    /about/ (the footer partial is cached, the fix is bundle-level and page-agnostic).
  • Workflow YAML validated.

Notes for reviewers

  • The build-time {{ now.Year }} in the theme's footer is kept as-is; the JS fix
    covers the gap between builds. No theme files were modified (site-level
    override only, so theme module updates stay safe).
  • Top-level copyright = 'AnimeEffectsDevs' in config.toml only feeds the RSS
    <copyright> element and is left untouched.

The Compose theme already renders the build year server-side and ships an
updateDate() IIFE meant to refresh it client-side, but that code assigns
year.innerHTML (the number) instead of yearEl.innerHTML — a silent no-op.
Combined with deployments having stalled in 2023, the live site shows
(C) 2023 forever.

- assets/js/custom.js: override the theme's placeholder custom.js (bundled
  last) with a corrected year updater so stale builds self-correct.
- config/_default/params.toml: fix AnimeEffectDevs typo in footer author.
- .github/workflows/hugo.yml: publish the built site to the gh-pages branch
  (the configured Pages source) so changes actually ship; drop the unused
  dart-sass step and deploy via Actions artifact.
@p-yukusai
p-yukusai merged commit 88ef4fb into main Aug 22, 2026
1 check passed
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.

2 participants