Skip to content
Discussion options

You must be logged in to vote

Hello @VladimirFokow,
should be possible, just like in the theme templates you can use the url filter to generate a relative link to the current page:

<link rel="stylesheet" href="{{ 'assets/stylesheets/main.css' | url }}" />

The 'assets/stylesheets/main.css' is passed to the url filter and processed accordingly.
https://github.com/mkdocs/mkdocs/blob/e755aaed7ea47348a60495ab364d5483ab90a4a6/mkdocs/utils/templates.py#L38
https://github.com/mkdocs/mkdocs/blob/e755aaed7ea47348a60495ab364d5483ab90a4a6/mkdocs/utils/__init__.py#L205

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@VladimirFokow
Comment options

@kamilkrzyskow
Comment options

Answer selected by VladimirFokow
Comment options

You must be logged in to vote
2 replies
@kamilkrzyskow
Comment options

@alexvoss
Comment options

alexvoss Mar 7, 2024
Collaborator Sponsor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants