Show the Generated stamp only on preview builds (#2884)

This commit is contained in:
Paweł Kuna authored and GitHub committed 2026-08-16 22:50:40 +02:00
1 parent 552cf1fad8
commit c7e895b3da
2 files changed
+10 -6

No files matched your search

@@ -0,0 +1,5 @@
---
"@tabler/preview": patch
---
Updated the footer to show the version link everywhere and the `Generated` timestamp only on preview builds.
+5 -6
View File
@@ -3,11 +3,10 @@ import Icon from '@ui/Icon.astro'
import { site } from '@shared/lib/site' import { site } from '@shared/lib/site'
import { formatUtcTimestamp } from '@shared/lib/date-format' import { formatUtcTimestamp } from '@shared/lib/date-format'
// Development build (unminified assets), same as BaseLayout. // Set to "preview" on the branch deploys, same as robots.txt and sitemap.xml.
const environment: string = 'development' const environment = process.env.NODE_ENV || 'production'
const now = new Date() const now = new Date()
const generatedAt = formatUtcTimestamp(now)
--- ---
<!-- BEGIN FOOTER --> <!-- BEGIN FOOTER -->
@@ -44,12 +43,12 @@ const generatedAt = formatUtcTimestamp(now)
</li> </li>
<li class="list-inline-item"> <li class="list-inline-item">
{ {
environment === 'production' || environment === 'preview' ? ( environment === 'preview' ? (
`Generated ${formatUtcTimestamp(now)}`
) : (
<a href="./changelog.html" class="link-secondary" rel="noopener"> <a href="./changelog.html" class="link-secondary" rel="noopener">
v{site.version} v{site.version}
</a> </a>
) : (
`Generated ${generatedAt}`
) )
} }
</li> </li>