Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Links to pdf page media

Started by Muut Archive 11 years ago · 4 replies · 2276 views
11 years ago

Hi!

I'm having some problems with my urls for page media data files.

When I include

TXT
[bid.pdf](bid.pdf)

in my Markdown, the generated slug-style html is
--- html
<a href="/grav/pdf-test/bid.pdf">bid.pdf</a>

TXT
That looks good. However, when I click through, I get a 404 Error. I have the same problem with .txt files, but images work. Is there something I need to do to get the routing for data files?

(For reference, the file is accessible via directory-style links. So, from Twig

<a href="{{ page.media.files[bid.filename].url }}">{{ bid.name }}</a>

HTML
to html
--- html
<a href="http://localhost/grav/user/pages/08.pdf-test/bid.pdf">bid.pdf</a>

works. Though I'd actually rather have the other link format here too.)

Thanks!

11 years ago

I am having this same problem and I believe it used to work just fine. I have a site where I am linking to a PDF or any other file for that matter. My markdown link is like this: [SRraffle-poster.pdf](SRraffle-poster.pdf)
The link I get is like this: http://breastcancersnowrun.org/events/SRraffle-poster.pdf
That is where the pdf file is located so the link should work. I have tried different settings in .htaccess, but that is not the problem. I don't see an issue raised in github either but am happy to do so.

For now I have to create the links to these files manually.

11 years ago

will look at this. It definitely was working...

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1348 9 years ago
Archive · by Muut Archive, 9 years ago
2 934 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2946 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago