Skip to content

How to change the lang attribute on <html> #177

Closed
@thibaultmalfoy

Description

@thibaultmalfoy

I've tried to change the lang attribute on <html> using YAML front matter, but I probably miss something because it doesn't work.

This is what I do for each page:

---
lang: fr-FR
---

$page.frontmatter.lang is then equal to fr-FR, but $lang is still en-US.

The only way I've found is to use the locales option in .vuepress/config.js:

locales: {
  "/": {
    lang: "fr-FR"
  }
}

but it's weird, and activate the languages link in the navbar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions