Skip to content

Tags icons listed before the default entry are ignored #6635

@Guts

Description

@Guts

Context

No response

Bug description

Pretty tricky bug that I'm trying to catch up for months now!

Expected behavior: when using tag icons, the order of icons identifiers should not matter and every icon should be rendered, no matter if its identifier is below or above the entry entry.

Given this mkdocs.yml:

site_name: My Docs

plugins: 
  - tags:
      enabled: true


theme:
  name: material
  icon:
    tag:
      database: fontawesome/solid/database
      # icons above this entry are not rendered
      default: fontawesome/solid/tag
      globe: fontawesome/solid/earth-europe

extra: 
  tags:
    DuckDB: database
    GEOS: globe
    PostGIS: database
    PostgreSQL: database
    

This index.md:

---
tags:
    - DuckDB
    - GEOS
    - PostGIS
    - PostgreSQL
---

# Welcome to MkDocs

For full documentation visit [mkdocs.org](https://www.mkdocs.org).

Output:

image

Now, let's move every icon identifiers below ðefault entry:

[...]
theme:
  name: material
  icon:
    tag:
      # icons above this entry are not rendered
      default: fontawesome/solid/tag
      database: fontawesome/solid/database
      globe: fontawesome/solid/earth-europe
[...]

Output:

image

🥳 every defined icons are rendered!

Related links

Reproduction

9.5.3+insiders.4.49.2-plugin_tags_icons_order.zip

Steps to reproduce

  1. Create a page with some tags
  2. In theme.icon.tag, add some icons above and below the default entry
  3. In extra.tags, match between tags and icons
  4. mkdocs serve --> every tag whose icon entry is defined above default does not have its own icon rendered

Browser

Chrome, Firefox

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions