Fix generated links
This brings little changes in tone to the README, plus a fix for generating URLs.
The application now also respects --site parameter (including and without trailing slash) when generating URLs. This means that from now on we always have to specify the --site parameter, unless we are building the production deployment for https://ecobytes.net, as defined in the Astro config.
This is achieved by few conventions:
- The
baseUrldoes never end with a slash, no matter which--baseis passed. - The
--baseparameter always begins and ends with a slash (default/). - Parameters to the
url()helper function always begin with a slash. - Links to the root of the project (
/) always end in a slash, no matter if located at the mainsitedomain, or in a sub path at a differentbaseof thesite.
In general, Node land has enough to say about joining URL path fragments, and offers additional packages for this functionality.
References about joining URLs with Node.js / TypeScript
We're working around this by carefully crafting the baseUrl with passing through a new URL, but also with having all links appear relative to the / root of the site.
Closes #83 (closed)
Edited by Jon Richter