message: changed page url generation
diff: @@ -486,20 +486,25 @@ export default class Site {
  #urlPage(page) {
  const { dest } = page;
  let url = page.data.url;
  - let transform = true;
  if (typeof url === "function") {
  url = url(page);
  }
  - if (typeof url === "object") {
  - dest.path = url.path || dest.path;
  - dest.ext = url.ext || "";
  - transform = false;
  - } else if (typeof url === "string") {
  + if (typeof url === "string") {
  + if (url.endsWith("/")) {
  + dest.path = posix.join(url, "index");
  + dest.ext = ".html";
  + } else {
  dest.ext = extname(url);
  dest.path = dest.ext ? url.slice(0, -dest.ext.length) : url;
  }
  + } else if (!dest.ext) {
  + if (this.options.prettyUrls && posix.basename(dest.path) !== "index") {
  + dest.path = posix.join(dest.path, "index");
  + }
  + dest.ext = ".html";
  + }
  // Relative URL
  if (dest.path.startsWith("./") || dest.path.startsWith("../")) {
  @@ -508,20 +513,10 @@ export default class Site {
  dest.path = `/${dest.path}`;
  }
  - // Transform (prettyUrls, slugifyUrls)
  - if (transform) {
  if (this.options.slugifyUrls) {
  dest.path = slugify(dest.path, this.options.slugifyUrls);
  }
  - if (!dest.ext) {
  - if (this.options.prettyUrls && posix.basename(dest.path) !== "index") {
  - dest.path = posix.join(dest.path, "index");
  - }
  - dest.ext = ".html";
  - }
  - }
  -
  page.data.url =
  (dest.ext === ".html" && posix.basename(dest.path) === "index")
  ? dest.path.slice(0, -5)
  