google / docsy

A set of Hugo doc templates for launching open source content.
https://docsy.dev
Apache License 2.0
2.56k stars 888 forks source link

Q: Issue with printing ... _print 404 #661

Open laszewsk opened 3 years ago

laszewsk commented 3 years ago

I thought I have done everything i need to use the new theme. However it turns out that my printing does not work. I configured my toml file with the options in the documentation (e.g. the default). Yet when I print any page I get an error that I do not know how to fix

Here is an example of a page I like to print: https://cybertraining-dsc.github.io/report/su21-reu-361/project/

When I click on print I get 404 page not found and I get this link: https://cybertraining-dsc.github.io/report/_print/

My toml file is at https://github.com/cybertraining-dsc/cybertraining-dsc.github.io/blob/main/config.toml

The way I create the site is with recursive submodules: https://github.com/cybertraining-dsc/cybertraining-dsc.github.io#clone

I also increase on macOS the limits with https://github.com/cybertraining-dsc/cybertraining-dsc.github.io#osx

Version of go and hugo are go: 1.16.5 darwin/amd64 hugo: v.083.1+extended

I hope I just did some silly mistake somewhere in the toml file.

gwatts commented 3 years ago

@laszewsk I think this is the same problem as https://github.com/google/docsy/issues/421#issuecomment-763670038 - Github pages don't appear to support the underscore in the URL

laszewsk commented 3 years ago

works! thanks.

would it not be best if this is added by default to the default toml and do not _print but printpreview

[outputFormats]
[outputFormats.PRINT]
baseName = "index"
isHTML = true
mediaType = "text/html"
path = "printview"
permalinkable = false
LisaFC commented 3 years ago

@gwatts do you want to add this workaround to https://www.docsy.dev/docs/adding-content/print/ - I agree that _print works well as a default for a lot of sites because it's unlikely to clash with anything (eg docs about printing) but we should add a note saying that you might want to change the name if you're using Github Pages.

Or should we change the default?

gwatts commented 3 years ago

yeah i wonder if a dash instead of an underscore would work better.. /-print perhaps.. will give it a try if I can find a few minutes - Been super busy with work lately unfortunately