| | |
| | | import micromorph from "micromorph" |
| | | import { FullSlug, RelativeURL, getFullSlug, normalizeRelativeURLs } from "../../util/path" |
| | | import { fetchCanonical } from "./util" |
| | | |
| | | // adapted from `micromorph` |
| | | // https://github.com/natemoo-re/micromorph |
| | |
| | | async function navigate(url: URL, isBack: boolean = false) { |
| | | startLoading() |
| | | p = p || new DOMParser() |
| | | const contents = await fetch(`${url}`) |
| | | const contents = await fetchCanonical(url) |
| | | .then((res) => { |
| | | const contentType = res.headers.get("content-type") |
| | | if (contentType?.startsWith("text/html")) { |