feat(head): optional application version meta tag#1986
Merged
Conversation
Add an opt-in <meta name="application"> tag rendered when a site sets [params.application]. A new assets/app-version.html resolver reads the version from site config, the HUGO_APPLICATION_VERSION env var, or the short commit hash, stripping a leading "v". Sites without the param are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for gethinode-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
🎉 This PR is included in version 2.18.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an opt-in third
<head>identity meta tag —<meta name="application" content="<label> <version>">— alongside the existinggenerator(Hugo) andtheme(Hinode) tags. A site advertises its own release version by declaring[params.application]; sites that omit it render nothing.Changes
layouts/_partials/assets/app-version.html(mirrorsassets/version.html): resolves the version asparams.application.version→HUGO_APPLICATION_VERSIONenv → short commit hash (viaenableGitInfo), stripping a leadingv.layouts/_partials/head/head.html: renders the tag whenisset site.Params "application"— opt-in on block presence, so non-adopting sites are unaffected.README.md: documents the config.Verification
Built
exampleSiteacross all cases: bare[application]+HUGO_APPLICATION_VERSION=9.9.9→content="9.9.9";[application] name="My App"(no env) →content="My App g<hash>"; no block → no tag. Lint clean.Motivation
Lets a Hinode-based site advertise its own build/release version in the document head. The version is supplied via config or the
HUGO_APPLICATION_VERSIONenvironment variable at build/CI time, with a graceful commit-hash fallback for local builds.🤖 Generated with Claude Code