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

Meta plugin duplicates YAML frontmatter values #6943

Closed
4 tasks done
Guts opened this issue Mar 20, 2024 · 2 comments
Closed
4 tasks done

Meta plugin duplicates YAML frontmatter values #6943

Guts opened this issue Mar 20, 2024 · 2 comments
Labels
duplicate Issue is a duplicate of another issue

Comments

@Guts
Copy link
Contributor

Guts commented Mar 20, 2024

Context

No response

Bug description

When the meta plugin is enabled, the page metadata seems to be duplicated. I realized this because I use the value of authors to add tags in the extrahead block.

That's why I took the liberty of including a theme customization in the reproduction.

Related links

Potential related issues:

Reproduction

9.5.14+insiders.4.53.2-meta-plugin-duplicates-frontmatter.zip

Steps to reproduce

  1. Enable meta plugin and add some authors in YAML frontmatter:

    ---
    authors:
        - Martin
    ---
    
    # Welcome to MkDocs
    
    [...]
  2. Use this variable somewhere, for example in a template extension:

    {% for a in page.meta.authors %}
      {% if page_author != config.site_author %}
        <meta name="author" content="{{ a }}">
      {% endif %}
    {% endfor %}
    
    
  3. mkdocs build

  4. result:

<head>
[...]
<meta name="author" content="Martin">
<meta name="author" content="Martin">
[...]
</head>

Browser

No response

Before submitting

@Guts
Copy link
Contributor Author

Guts commented Mar 20, 2024

possible cause: Front matter meta should override .meta.yml defaults #6914 in https://github.com/squidfunk/mkdocs-material-insiders/commit/ef7c754a9e076bcab726e71ce350f9b9d3ff8094

I confirm that getting back to mkdocs-material-9.5.13-insiders-4.53.1 is "solving" the issue.

@squidfunk
Copy link
Owner

Thanks for reporting. This is a duplicate of #6941.

@squidfunk squidfunk added the duplicate Issue is a duplicate of another issue label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issue is a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants