johannschopplich / nuxt-kql

🫧 Kirby's Query Language API for Nuxt
https://nuxt-kql.byjohann.dev
MIT License
42 stars 2 forks source link

Prefetching queries in multi-language sites #9

Closed marco-land closed 1 year ago

marco-land commented 1 year ago

Describe the feature

The prefetching is great! Maybe I am overseeing it, but it would be great to prefetch content in different (or rather all available) languages. If this is already possible, it would be great to add something to the existing docs.

Additional information

Final checks

johannschopplich commented 1 year ago

Great feature request! What do you think about the following syntax?

// `nuxt.config.ts`
export default defineNuxtConfig({
  modules: ['nuxt-kql'],

  kql: {
    prefetch: {
      site: {
        // Define a query and its language
        query: {
          query: 'site',
          select: ['title']
        },
        language: 'de'
      }
    }
  }
})
marco-land commented 1 year ago

Yeah I think that makes sense 👍 Thank you for looking into it!