zeon-studio / hugoplate

Hugoplate is a free starter template built with Hugo and TailwindCSS that will save you hours of work.
https://zeon.studio/preview?project=hugoplate
MIT License
894 stars 243 forks source link

Button action to download a file #26

Closed walidbou6 closed 1 year ago

walidbou6 commented 1 year ago

I'm trying to to use a button to download a PDF file in my assets folder use it like following:

button: enable: true label: "get my resume here" link: "/pdfs/walid_bousseta_EN.pdf"

but that doesn't work, it's just gives me a 404 error page. is there another way to do so, please could you share with us? and thank you for this wonderful template

tfsomrat commented 1 year ago

Hey @walidbou6

Sorry to hear that. You should put your PDF in the static folder, and then you can do it.

walidbou6 commented 1 year ago

I have put the pdf in the following path; /assets/pdfs/walid_bousseta_EN.pdf

I also tried puting it in the data folder that just gived me an error can't load the pdf format

as well created a static folder at the following structure |--data |--themes |--static |----|--pdfs |----|-----|--walid_bousseta_EN.pdf | --.gitignore |--... and use the following script:

button: enable: true label: "get my resume here" link: "static/pdfs/walid_bousseta_EN.pdf"

still not working, getting a 404 error

tfsomrat commented 1 year ago

remove "static" from the link

On Fri, Aug 18, 2023, 2:02 AM walidbou6 @.***> wrote:

I have put the pdf in the following path; /assets/pdfs/walid_bousseta_EN.pdf

I also tried puting it in the data folder that just gived me an error can't load the pdf format

as well created a static folder at the following structure |--data |--themes |--static |----|--pdfs |----|-----|--walid_bousseta_EN.pdf | --.gitignore |--... and use the following script:

button: enable: true label: "get my resume here" link: "static/pdfs/walid_bousseta_EN.pdf"

still not working, getting a 404 error

— Reply to this email directly, view it on GitHub https://github.com/zeon-studio/hugoplate/issues/26#issuecomment-1682899511, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOAMCYYFG3ESJ2ILL6UJBULXVZ2FBANCNFSM6AAAAAA3TELPJU . You are receiving this because you commented.Message ID: @.***>

walidbou6 commented 1 year ago

I did still nothing same error

somratpro commented 1 year ago

@walidbou6 did you tried like this link: "pdfs/walid_bousseta_EN.pdf"?

ElioDiNino commented 1 year ago

I got this working by creating a static folder and linking as follows:

|--static |----|--pdfs |----|-----|--example.pdf

Link: /pdfs/example.pdf