Show the build version in the footer
This commit is contained in:
1 parent
4e8a68c330
commit
66eccec274
2 files changed
+30
No files matched your search
@@ -67,6 +67,15 @@ function scanContentIcons(): { collections: string[], icons: string[] } {
|
||||
}
|
||||
const contentIcons = scanContentIcons()
|
||||
|
||||
// Version shown in the footer. It is the release number of the production
|
||||
// image (1.0.31, ...), decided by the docudjeex-build workflow, which passes
|
||||
// it as BUILD_VERSION when it builds the image. Left empty everywhere else
|
||||
// (dev, local builds, CI builds that are not published), and the footer then
|
||||
// shows nothing.
|
||||
function buildVersion(): string {
|
||||
return (process.env.BUILD_VERSION || '').trim()
|
||||
}
|
||||
|
||||
// ProseImg (app/components/content/ProseImg.vue) caps every markdown image
|
||||
// at 1280px wide, but NuxtImg's `width` prop always becomes the rendered
|
||||
// <img>'s HTML width attribute too, not just the resize target. Passing
|
||||
@@ -191,6 +200,11 @@ export default defineNuxtConfig({
|
||||
// Read by ProseImg to cap each image's width at its own real size
|
||||
// instead of always requesting (and rendering) 1280px.
|
||||
imageWidths: scanImageWidths(),
|
||||
// Shown in the footer (AppFooterRight), changes at every production build.
|
||||
buildVersion: buildVersion(),
|
||||
// Where the version links to: the pull request behind the build, set by
|
||||
// the same workflow (BUILD_VERSION_URL). The version stays plain text without it.
|
||||
buildVersionUrl: (process.env.BUILD_VERSION_URL || '').trim(),
|
||||
},
|
||||
},
|
||||
icon: {
|
||||
|
||||
Reference in new issue
Block a user