Skip to content

Commit c7e895b

Browse files
authored
Show the Generated stamp only on preview builds (#2884)
1 parent 552cf1f commit c7e895b

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tabler/preview": patch
3+
---
4+
5+
Updated the footer to show the version link everywhere and the `Generated` timestamp only on preview builds.

‎shared/components/layout/Footer.astro‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import Icon from '@ui/Icon.astro'
33
import { site } from '@shared/lib/site'
44
import { formatUtcTimestamp } from '@shared/lib/date-format'
55
6-
// Development build (unminified assets), same as BaseLayout.
7-
const environment: string = 'development'
6+
// Set to "preview" on the branch deploys, same as robots.txt and sitemap.xml.
7+
const environment = process.env.NODE_ENV || 'production'
88
99
const now = new Date()
10-
const generatedAt = formatUtcTimestamp(now)
1110
---
1211

1312
<!-- BEGIN FOOTER -->
@@ -44,12 +43,12 @@ const generatedAt = formatUtcTimestamp(now)
4443
</li>
4544
<li class="list-inline-item">
4645
{
47-
environment === 'production' || environment === 'preview' ? (
46+
environment === 'preview' ? (
47+
`Generated ${formatUtcTimestamp(now)}`
48+
) : (
4849
<a href="./changelog.html" class="link-secondary" rel="noopener">
4950
v{site.version}
5051
</a>
51-
) : (
52-
`Generated ${generatedAt}`
5352
)
5453
}
5554
</li>

0 commit comments

Comments
 (0)