Skip to content

Trying to add a pdf link in the nav-bar does not work as expected #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
yassernec opened this issue Apr 21, 2025 · 2 comments
Open

Comments

@yassernec
Copy link

yassernec commented Apr 21, 2025

I am trying to add a link to a pdf to the nav-bar: I am using something like:

html_theme_options = {
    "nav_links": [
        {"title": "PDF Docs", "url": "_static/docs.pdf"},
    ],
}

What happens is that the link generated is something line _static/docs.pdf.html instead of _static/docs.pdf

Is there a way around that?

@lepture
Copy link
Owner

lepture commented Apr 21, 2025

Use absolute url with https://

@yassernec
Copy link
Author

Thank you. I did that and it works.

The only problem is that now I have to fix the absolute path which means I need to know the depolyed domain in advance. What I did is had the site published by gh-pages and then copied the address to make the complete path.

I think it is better if it was possible to do it without having to fix the absolute path though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants