core
core copied to clipboard
Static HTML sitelets: add option to not add .html suffix to links
In Html project mode, context.Link() adds a .html suffix to URLs, so that the link points directly to a generated file. However some hosts (like GitHub pages) can also serve a file foo.html when browsing URL /foo, so it would be nice to have the option to not add .html to URLs.
It's also easy to test a static site locally so that URL /foo points to file foo.html:
dotnet tool install -g dotnet-serve
dotnet serve --default-extensions:html
Yes, good idea, should be quick to implement.
@Tarmil Have you imagined this as an extra project setting? So not an optional argument to Link but always global, like "linksWithNoHtmlExt" in wsconfig.jon. This name is a bit long, any ideas for shorter one? Thanks!
I'd prefer if we could pass in whatever extension we like, none if empty. So something like staticLinkExtension with a default of ".html".
@Jand42 Yes I was definitely thinking of it as a compiler option in wsconfig.json.