mirror of
https://github.com/tabler/tabler.git
synced 2026-10-12 05:06:55 +04:00
Restore the promo top banner on docs and preview (#3136)
This commit is contained in:
1 parent
9dfa78995b
commit
add68b29b6
3 files changed
+15
No files matched your search
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@tabler/docs": patch
|
||||||
|
"@tabler/preview": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixed the missing promo top banner on docs.tabler.io and preview.tabler.io by restoring the `banner.js` script.
|
||||||
@@ -86,6 +86,8 @@ const pagePlugins = [...basePlugins, ...cssPlugins.filter((plugin) => !basePlugi
|
|||||||
const environment = process.env.NODE_ENV || 'production';
|
const environment = process.env.NODE_ENV || 'production';
|
||||||
// Vercel preview/branch deployments must not be indexed (VERCEL_ENV is unset locally).
|
// Vercel preview/branch deployments must not be indexed (VERCEL_ENV is unset locally).
|
||||||
const isVercelPreview = !!process.env.VERCEL_ENV && process.env.VERCEL_ENV !== 'production';
|
const isVercelPreview = !!process.env.VERCEL_ENV && process.env.VERCEL_ENV !== 'production';
|
||||||
|
// The promo top banner loads on Vercel deploys (production and branch previews), never in local builds.
|
||||||
|
const isVercelDeploy = !!process.env.VERCEL_ENV;
|
||||||
|
|
||||||
// Strip /docs prefix (and optional .html) for the docs namespace URL.
|
// Strip /docs prefix (and optional .html) for the docs namespace URL.
|
||||||
// Canonical form has no trailing slash (matching vercel.json trailingSlash: false);
|
// Canonical form has no trailing slash (matching vercel.json trailingSlash: false);
|
||||||
@@ -510,5 +512,7 @@ const relatedPages = await Promise.all(
|
|||||||
<!-- END GLOBAL MANDATORY SCRIPTS -->
|
<!-- END GLOBAL MANDATORY SCRIPTS -->
|
||||||
|
|
||||||
<PageScripts />
|
<PageScripts />
|
||||||
|
|
||||||
|
{isVercelDeploy && <script is:inline src="https://scripts.tabler.io/banner.js" defer data-tblr-ref="tabler-docs" />}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -32,6 +32,9 @@ const themeAttributes = themeDataAttributes(themeSettings)
|
|||||||
const environment = process.env.NODE_ENV || 'production'
|
const environment = process.env.NODE_ENV || 'production'
|
||||||
const isDevelopment = environment === 'development'
|
const isDevelopment = environment === 'development'
|
||||||
const min = isDevelopment ? '' : '.min'
|
const min = isDevelopment ? '' : '.min'
|
||||||
|
// The promo top banner loads on Vercel deploys (production and branch previews),
|
||||||
|
// never in local builds or the packaged demo (VERCEL_ENV is unset there).
|
||||||
|
const isVercelDeploy = !!process.env.VERCEL_ENV
|
||||||
// RTL swaps tabler/plugin stylesheets for their .rtl.css variants (demo stays LTR)
|
// RTL swaps tabler/plugin stylesheets for their .rtl.css variants (demo stays LTR)
|
||||||
const rtlSuffix = rtl ? '.rtl' : ''
|
const rtlSuffix = rtl ? '.rtl' : ''
|
||||||
|
|
||||||
@@ -268,5 +271,7 @@ const libJsFiles = (head: boolean) => pageLibEntries.filter(([, lib]) => Boolean
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<!-- END PAGE SCRIPTS -->
|
<!-- END PAGE SCRIPTS -->
|
||||||
|
|
||||||
|
{isVercelDeploy && <script is:inline src="https://scripts.tabler.io/banner.js" defer data-tblr-ref="tabler-preview-top-banner" />}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in new issue
Block a user