From 6f35eb644a27d1ef8c6baec5364a5aa368ba368c Mon Sep 17 00:00:00 2001 From: Philippe Serhal Date: Wed, 11 Feb 2026 19:39:28 -0500 Subject: [PATCH] fix: don't hardcode npmx.dev & docs.npmx.dev Extract a composable that returns URLs for this app itself (and docs, which lives in this codebase), so that URLs are always internally consistent within an environment, e.g. in dev links go to dev. --- app/app.vue | 3 ++- app/components/AppFooter.vue | 3 ++- app/components/AppHeader.vue | 3 ++- app/components/Package/SkillsModal.vue | 5 ++--- app/composables/useAppUrls.ts | 11 +++++++++++ app/composables/useJsonLd.ts | 12 +++++++----- app/pages/org/[org].vue | 3 ++- .../[packageName]/v/[version]/[...filePath].vue | 3 ++- app/pages/package/[[org]]/[name].vue | 3 ++- config/env.ts | 8 ++++++++ modules/build-env.ts | 11 ++++++----- modules/standard-site-sync.ts | 6 +++--- shared/utils/constants.ts | 3 ++- 13 files changed, 51 insertions(+), 23 deletions(-) create mode 100644 app/composables/useAppUrls.ts diff --git a/app/app.vue b/app/app.vue index 2b0a58740..e63e3d2cc 100644 --- a/app/app.vue +++ b/app/app.vue @@ -44,7 +44,8 @@ useHead({ }) if (import.meta.server) { - setJsonLd(createWebSiteSchema()) + const { siteUrl } = useAppUrls() + setJsonLd(createWebSiteSchema(siteUrl)) } onKeyDown( diff --git a/app/components/AppFooter.vue b/app/components/AppFooter.vue index b7e745377..4f3e41ea5 100644 --- a/app/components/AppFooter.vue +++ b/app/components/AppFooter.vue @@ -1,4 +1,5 @@