Hi, I have been struggling to find a way to have my page title redirect to open a PDF file in the browser.
What I have (obviously) been able to do is insert [file](file.pdf) into a default Grav themed page, and clicking on the link in the page, the browser opens the PDF.
Is there a way to do the same immediately from the page title? So that clicking on the page title doesn’t open the page, but directly the pdf?
I could use the redirect frontmatter, but then I can’t seem to reference a local file, but would have to upload the PDF to some other cloud provider and create a share link.
Which theme are you using and could you please indicate which part of your theme page contains what you refer to as “page title”? That term is open to different interpretations.
Your file.url may be your first file of page.media {{page.media.all|first}} if you have only one pdf per page. Otherwise you have to define this file in the blueprint of downloads page.
This is indicative. It might be interesting for you to take a look at Grav’s documentation on blueprints and media.
Surely someone on this forum will have a more specific idea and can help you much better.