Skip to content

Remove index.html suffix #1251

@nihaals

Description

@nihaals

As most static file servers will automatically serve index.html, it would be nice to have an option where you can use / instead of /index.html

Workaround

if (window.location.href.endsWith("/index.html")) {
  history.replaceState(null, "", window.location.href.slice(0, -10));
}

window.onload = function () {
  const anchors = document.getElementsByTagName("a");

  for (let i = 0; i < anchors.length; i++) {
    if (anchors[i].href.endsWith("/index.html")) {
      anchors[i].href = anchors[i].href.slice(0, -10);
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions