AutoLang (seo-auto-lang
)
Syntax
<seo-auto-lang
:langs="['fr', 'en', 'de']"
mode="domain"
default="en"
></seo-auto-lang>
Props
- langs: The langs the website is available in
- mode: How you encode the lang in the url, supported formats:
domain
: The lang is an is an ISO-639-1 lang code put as a subdomain. Eg: 'fr.papayapods.com'.
- default: This is the default language. It will be ommited in the urls generateds
Impact
This component will generate automatically <seo-lang>
components based on the current url in all the langs you defined. And automatically updates when the url change.
Example
<seo-auto-lang :langs="['en', 'fr', 'de']" default="fr" mode="domain"></seo-auto-lang>
<!-- This will generate (if the current hostname is en.papayapods.com/toto)
<seo-lang code="fr" url="papayapods.com/toto" ></seo-lang> Because default is "fr"
<seo-lang code="en" url="en.papayapods.com/toto" ></seo-lang>
<seo-lang code="de" url="de.papayapods.com/toto" ></seo-lang>
-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.21/vue.js"></script>
<script src="https://rawgit.com/GuillaumeLeclerc/vue-seo/master/index.js"></script>
Vue.use(VueSEO, { });
new Vue({
el: 'body',
})