Skip to content
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

Declaring language in HTML tag #388

Closed
wushan opened this issue Mar 15, 2017 · 8 comments
Closed

Declaring language in HTML tag #388

wushan opened this issue Mar 15, 2017 · 8 comments
Labels

Comments

@wushan
Copy link

wushan commented Mar 15, 2017

Since we can set some meta tags in the head in nuxtConfig file, how do we declare html lang attribute in HTML tag like this ?

<html lang="fr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">

This question is available on Nuxt.js community (#c338)
@ausir0726
Copy link

ausir0726 commented Mar 15, 2017

you can edit in nuxt.config.js

module.exports = {
  /**
   * if you want after run npm generate place dist to subdomain on webhost , you should change base 
   */
  router: {
    base: '/',
  },
  /*
  ** Headers of the page
  */
  head: {
    // this htmlAttrs you need
    htmlAttrs: {
      lang: 'zh-Hant',
    },
    title: 'prject',
    meta: [
      { 'http-equiv': 'X-UA-Compatible', content: 'IE=edge' },
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'keyword', name: 'keyword', content: 'yoyo' },
      { hid: 'description', name: 'description', content: 'FINPO project' },
    ]
   .....

you can find more setting on vue-meta
https://github.com/declandewet/vue-meta

@wushan
Copy link
Author

wushan commented Mar 15, 2017

@ausir0726 It works like charm. I really should read vue-meta's document first. Thanks !

@ErickPetru
Copy link

I came here because of the same "problem". I believe the documentation should include it, maybe here: https://nuxtjs.org/guide/views/#document.

valeriosillari added a commit to valeriosillari/zitronenstrasse that referenced this issue Jan 12, 2018
@nicoladl
Copy link

nicoladl commented Apr 9, 2018

How can I declare lang attribute from $store.state ?

@hoektoe
Copy link

hoektoe commented Jun 11, 2018

Would also like to know if can declare via $store.state

@mattbag
Copy link

mattbag commented Oct 8, 2018

head(){} method in the pages can be used with $store.state I believe

@nicoladl
Copy link

nicoladl commented Oct 8, 2018

@mattbag you are right

but if you are in 'spa' mode metatag placed in pages are not been see from search engine

@lock
Copy link

lock bot commented Nov 7, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 7, 2018
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants