Had the same issue and landed here, maybe this helps somebody.
I didn't find a way to embed the .pdf into a page but what I did was to add the .pdf to the wiki folder (like a normal page). Initially this didn't show up in the sidebar nor was it searchable from Github.
It is possible however to link it directly from other pages or a custom sidebar (see for example osquery's wiki for a nice sidebar). Clicking on the link allows you to download the .pdf (didn't find a way to preview it in the browser)
Answer from spygi on Stack OverflowHi,
I am building a static website using Hugo and want to deploy it in gitlab pages. However, I would like to provide the download of a pdf document.
Is this possible to do using Hugo?
If not, how would you do it?
The pdf document would be hosted in the same gitlab repository.
Thanks!
Had the same issue and landed here, maybe this helps somebody.
I didn't find a way to embed the .pdf into a page but what I did was to add the .pdf to the wiki folder (like a normal page). Initially this didn't show up in the sidebar nor was it searchable from Github.
It is possible however to link it directly from other pages or a custom sidebar (see for example osquery's wiki for a nice sidebar). Clicking on the link allows you to download the .pdf (didn't find a way to preview it in the browser)
It is possible that such action type is not allowed only in cloud gitlab version, cause gitlab-gollum lib documentation describes it so:
[[Gollum|gollum.pdf]]
I have tested your gitlab ci configuration. It works for me.
It only takes about 35 minutes for the page to become visible.
Please check if the assets job does not overwrite the pages job.
After the pipeline has finished successfully, wait approximately 30 minutes for your website to be visible. See here
Is "public" a folder? If so, try to put a backslash after it:
artifacts:
paths:
- public/