You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you omit the file extension (e.g. .html) in your permalink, Cobalt will treat the permalink as a folder and create the file with the name index.html.
An alternative where one can save the file directly without .html suffix would be appreciated. Why? One possible reason is here, but I'm sure there are plenty of more, such as simply having pretty URLs (without having to generate a new directory).
The text was updated successfully, but these errors were encountered:
Maybe I missed something but when I followed that link and then again to what it links to, the suggestion seemed to be to not remove extensions from your files but to not have them exist in your links.
File name extension. This is a very common one. "cgi", even ".html" is something which will change. You may not be using HTML for that page in 20 years time, but you might want today's links to it to still be valid. The canonical way of making links to the W3C site doesn't use the extension.(how?)
Following the how link:
If you are using, for example, Apache, you can set it up to do content negotiation. You keep the file extension (such as .png) on the file (e.g. mydog.png), but refer to the web resource without it. Apache then checks the directory for all files with that name and any extension, and it can also pick the best one out of a set (e.g. GIF and PNG). (You do not have to put different types of file in different directories, in fact the content negotiation won't work if you do.)
Set up your server to do content negotiation
Make references always to the URI without the extension
atm cobalt doesn't generate too many URIs but in general, this would look like:
Ensure cobalt serve can handle content negotation
Allow people to opt-in to extension-less URIs on a site-wide basis
This may as well be a documentation bug, however https://cobalt-org.github.io/docs/permalink/ states
An alternative where one can save the file directly without
.html
suffix would be appreciated. Why? One possible reason is here, but I'm sure there are plenty of more, such as simply having pretty URLs (without having to generate a new directory).The text was updated successfully, but these errors were encountered: