etiennebacher / altdoc

Alternative to pkgdown to document packages
https://altdoc.etiennebacher.com
Other
61 stars 9 forks source link

FR: redirect traling slashes #281

Open olivroy opened 2 months ago

olivroy commented 2 months ago

For example, make this https://vincentarelbundock.github.io/tinytable/news/ a valid url.

https://vincentarelbundock.github.io/tinytable/NEWS works as expected.

I have a routine to check news on online doc. the first link works for pkgdown sites. I wondered if it were possible to make it work for altdoc sites.

vincentarelbundock commented 2 months ago

maybe the tinytable website has changed, but it looks like the address should be NEWS.html

Do you have another example?

Also, that might be a Quarto issue rather than altdoc...

olivroy commented 2 months ago

Possibly, but also the fact that https://vincentarelbundock.github.io/tinytable/NEWS works but not https://vincentarelbundock.github.io/tinytable/news is a bit strange?

vincentarelbundock commented 2 months ago

yep, good point. But honestly, I'm not sure what altdoc can do about this. Case sensitivity of links seems like it would be in scope for Quarto itself. Can I change anything in the _quarto.yml to force Quarto to disregard upper cases? I have no idea...

olivroy commented 1 month ago

Not sure. https://github.com/quarto-dev/quarto-cli/issues/6848 is opened about case sensitiviry. in pkgdown, there is build_redirects(). i wonder if quarto has something like this...

Oh, it does

The news file generated by alt doc could have this in header

https://quarto.org/docs/websites/website-navigation.html#redirects

---
aliases:
  - news.html
---

Same thing for other pages, so that url created in altdoc map almost exactly with how pkgdown structures things