You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that if I have a page in html_additional_pages, e.g.,
html_additional_pages= {"index": "index.html"}
then hasdoc("index") returns False while pathto("index") can give the correct relative path. Hence the current logic (as follows) would treat "index" as an external URL.
{% if not theme_logo.get("link") %}
{% set href = pathto(root_doc) %}
{% elif hasdoc(theme_logo.get("link")) %}
{% set href = pathto(theme_logo.get("link")) %} {# internal page #}
{% else %}
{% set href = theme_logo.get("link") %} {# external url #}
{% endif %}
Is there a workaround for this, or is it possible to fix this?
The text was updated successfully, but these errors were encountered:
I guess the easiest would be to check the path itself xith a jinja filter to detect relative and absolute path. I checked rapidely on the web and didn't find any so the easiest way to proceed is to build a custom filter to wire "abspath" in the layout.
Could we just do a check for something like "if the file at pathto(theme_logo.get("link")) exists, then trigger the second elif block" (instead of using hasdoc at all)? I wonder if you could use the "file" version of pathto (where you do pathto("filepath", 1)) to avoid it converting your path to html?
It seems that if I have a page in
html_additional_pages
, e.g.,then
hasdoc("index")
returns False whilepathto("index")
can give the correct relative path. Hence the current logic (as follows) would treat"index"
as an external URL.Is there a workaround for this, or is it possible to fix this?
The text was updated successfully, but these errors were encountered: