Using custom icons in Markdown #5199
-
I am having trouble using custom icons with Markdown. Following, the additional icons instructions... I can get my custom icons to work as configurations in the File Organization:
Icon used as a configuration: # Configuration for webpage theme
theme:
# Theme: https://squidfunk.github.io/mkdocs-material/
name: material
# Icon in Browser Tab (must be square img - i.e. 32x32 pixels)
favicon: img/sfe_logo_sq.png
# Configures icons
icon:
# Sets homepage icon
logo: logoA
# Adds overrides for stylesheets, html, etc.
custom_dir: docs/overrides
# Included MkDocs plugins
# Add the installation of any new plugins to the ./github/workflows/mkdocs.yml file also
plugins:
- typeset
# Included Markdown extensions
markdown_extensions:
- admonition
- md_in_html
- attr_list
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
options:
custom_icons:
- overrides/.icons
extra:
# Configures social icons in the footer
social:
- icon: test/logo1
link: https://www.sparkfun.com/ Icon used in Markdown: :logoA:
:logoB:
:test-logo1:
:test-logo2: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Your # Included Markdown extensions
markdown_extensions:
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
options:
custom_icons:
- docs/overrides/.icons # <-- NOT recommended, see explanation. |
Beta Was this translation helpful? Give feedback.
Your
custom_dir
points todocs/.overrides
, while you pointpymdownx.emoji
tooverrides/.icons
. I think if you change it todocs/overrides/.icons
, it should work. Nevertheless, never put overrides in thedocs_dir
– they will all be copied and included with the final output.