mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 05:06:55 +04:00
Show the Generated stamp only on preview builds (#2884)
This commit is contained in:
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.
|
||||
@@ -3,11 +3,10 @@ import Icon from '@ui/Icon.astro'
|
||||
import { site } from '@shared/lib/site'
|
||||
import { formatUtcTimestamp } from '@shared/lib/date-format'
|
||||
|
||||
// Development build (unminified assets), same as BaseLayout.
|
||||
const environment: string = 'development'
|
||||
// Set to "preview" on the branch deploys, same as robots.txt and sitemap.xml.
|
||||
const environment = process.env.NODE_ENV || 'production'
|
||||
|
||||
const now = new Date()
|
||||
const generatedAt = formatUtcTimestamp(now)
|
||||
---
|
||||
|
||||
<!-- BEGIN FOOTER -->
|
||||
@@ -44,12 +43,12 @@ const generatedAt = formatUtcTimestamp(now)
|
||||
</li>
|
||||
<li class="list-inline-item">
|
||||
{
|
||||
environment === 'production' || environment === 'preview' ? (
|
||||
environment === 'preview' ? (
|
||||
`Generated ${formatUtcTimestamp(now)}`
|
||||
) : (
|
||||
<a href="./changelog.html" class="link-secondary" rel="noopener">
|
||||
v{site.version}
|
||||
</a>
|
||||
) : (
|
||||
`Generated ${generatedAt}`
|
||||
)
|
||||
}
|
||||
</li>
|
||||
|
||||
Reference in new issue
Block a user