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

Frontmatter JSON not applying, also Frontmatter YAML is applied twice #1063

Closed
3 tasks done
staghouse opened this issue Jul 25, 2022 · 2 comments
Closed
3 tasks done
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@staghouse
Copy link

staghouse commented Jul 25, 2022

Describe the bug

Frontmatter properties as JSON does not seem to be applying to pages using the following:

---
{
  'title': 'Changelogs',
  'meta':
    [
      { 'property': 'og:title', 'content': 'Changelogs' },
      { 'name': 'description', 'content': 'Various Changelogs.' },
      { 'property': 'og:description', 'content': 'Various Changelog.' },
      { 'name': 'keywords', 'content': 'changelogs' },
    ],
}
---

additionally, when using yaml the properties are not "merged" but added in addition to the regular meta definitions in /.vitepress/config.js resulting in double tags.

Reproduction

Apply Frontmatter meta configuration to any index.md page and view the rendered content. Only the title and description data in /.vitepress/config.js is applying to the page.

Expected behavior

The meta tags in the <head> of the rendered page should match what is in the Frontmatter of the markdown page.

System Info

System:
    OS: macOS 12.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 168.33 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.16.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.12.1 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 103.0.5060.134
    Firefox: 102.0.1
    Safari: 15.2
  npmPackages:
    vitepress: ^1.0.0-alpha.4 => 1.0.0-alpha.4

Additional context

No response

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@staghouse staghouse added the bug: pending triage Maybe a bug, waiting for confirmation label Jul 25, 2022
@staghouse staghouse changed the title Frontmatter meta does not seem to get applied to any pages Frontmatter JSON not applying, also Frontmatter YAML is applied twice Jul 25, 2022
@brc-dd
Copy link
Member

brc-dd commented Jul 25, 2022

when using yaml the properties are not "merged" but added in addition to the regular meta definitions in /.vitepress/config.js resulting in double tags.

This was fixed. Refer #975 for details. It'll be there in the next release.

Frontmatter properties as JSON does not seem to be applying to pages using the following: ...

Your format is wrong. The JSON should be like this:

{
  "head": [
    ["meta", { "name": "og:title", "content": "Foo Bar" }]
  ]
}

@brc-dd brc-dd closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2022
@brc-dd
Copy link
Member

brc-dd commented Jul 26, 2022

Closing this for now. Feel free to comment/reopen if the issue persists.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants