Skip to content

Commit

Permalink
Set site indexability at runtime (#4671)
Browse files Browse the repository at this point in the history
  • Loading branch information
zackkrida authored Jul 30, 2024
1 parent 7c5a785 commit 23c46d3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions frontend/server/plugins/indexable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineNitroPlugin } from "nitropack/runtime"

import { PRODUCTION } from "~/constants/deploy-env"

export default defineNitroPlugin(async (nitroApp) => {
nitroApp.hooks.hook("site-config:init", ({ siteConfig }) => {
siteConfig.push({
indexable: import.meta.env.DEPLOYMENT_ENV === PRODUCTION,
})
})
})

0 comments on commit 23c46d3

Please sign in to comment.