message: fix relative urls
diff: @@ -497,8 +497,18 @@ export default class Site {
  }
  if (typeof url === "string") {
  + // Relative URL
  + if (url.startsWith("./") || url.startsWith("../")) {
  + url = posix.join(dirname(page.dest.path), url);
  + } else if (!url.startsWith("/")) {
  + throw new Exception(
  + `The url variable must start with "/", "./" or "../"`,
  + { page, url },
  + );
  + }
  +
  if (url.endsWith("/")) {
  - dest.path = posix.join(url, "index");
  + dest.path = `${url}index`;
  dest.ext = ".html";
  } else {
  dest.ext = extname(url);
  @@ -511,16 +521,6 @@ export default class Site {
  dest.ext = ".html";
  }
  - // Relative URL
  - if (dest.path.startsWith("./") || dest.path.startsWith("../")) {
  - dest.path = posix.join(dirname(page.src.path), dest.path);
  - } else if (!dest.path.startsWith("/")) {
  - throw new Exception(
  - `The url variable must start with "/", "./" or "../"`,
  - { page, url },
  - );
  - }
  -
  page.data.url =
  (dest.ext === ".html" && posix.basename(dest.path) === "index")
  ? dest.path.slice(0, -5)
  