mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 13:17:00 +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 { 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>
|
||||||
|
|||||||
Reference in new issue
Block a user