-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Add support for a more dynamic configuration #20
Labels
enhancement
New feature or request
Comments
Hey @madebyfabian This should be solved in in 1.2.1:
|
Hey @harlan-zw Thank you very much 😇 |
@harlan-zw Thank you again so much, I just implemented it into my project and it works like a charm. Allowing me to inject a dynamic template with dynamic siteName coming from a DB call inside So clean! // app.vue
const prefix = process.env.NODE_ENV === 'development' ? '⚙️ ' : ''
const siteName = data.value.allSettings.generalSettingsTitle || ''
const siteDescription = data.value.allSettings.generalSettingsDescription || undefined
useSeoMeta({
titleTemplate: `${prefix}%s %titleSeperator %siteName`,
title: 'Home',
description: siteDescription,
}) // nuxt.config.ts
import { generateSitemap } from './generateSitemap'
import { cookieConfig, generateTwicpicsConfig } from './config'
export default defineNuxtConfig({
extends: ['nuxt-seo-kit'],
runtimeConfig: {
public: {
// ..
siteUrl: process.env.NUXT_PUBLIC_SITE_URL,
titleSeperator: '·',
language: 'en-US',
},
},
// ...
}) |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Clear and concise description of the problem
Me again 😄. Just a smaller feature request:
Before using this module, I was defining a dynamic title template (and therefore the site name) based on some external properties, inside
app.vue
:This was working fine, and allowed me fine-grained control about how to display the title. E.g. on dev, I add a
⚙️
emoji onto the beginning to differentiate the tabs. And, most importantly, the siteName coming from a dynamic source.nuxt-seo-kit
overrides these and since they are not defined in thenuxt.config.ts
, because they need to be dynamic, it uses the default values from the plugin, overriding both mytitleTemplate
and mydescription
meta.Is there a way to make a dynamic site name work? I tried doing
<SeoKit :siteName="siteTitle" />
but this does not have an effect, the meta tag is stillVue Playground
even though the variablesiteTitle
is definitely defined.Is there a way to make the
titleTemplate
from seo meta work? I know there isruntimeConfig.public.titleSeparator
but this just acts as a setting to set the title totitle seperator title
without further config.Suggested solution
<SeoKit />
insideapp.vue
titleTemplate
Alternative
Additional context
Validations
The text was updated successfully, but these errors were encountered: