Skip to content

ability to use custom templates? #281

Closed

Description

@dbinetti

I have some custom templates (using the custom_dir setting in MkDocs) which the macros apparently can't access. Setting include_dir to include my custom templates does not work. Perhaps this is not supported?

Activity

  1. github-actions commented on Nov 17, 2025

    @github-actions

    Welcome to this project and thank you!

  2. FredZinelli commented on Dec 19, 2025

    @FredZinelli

    What are you trying to do exactly?

    Macros are used/rendered in the on_page_markdown event and are supposed to be used in md files, while templates are used later in the build and macros are not supposed to be used in them, afaik (despite the syntax being kinda the same, they are not registered in the Jinja environment. You can add your own functions to the Jinja environment through the on_env event, on the other hand).

  3. Repository owner locked and limited conversation to collaborators on May 3, 2026
  4. converted this issue into a discussion #290 on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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