Use absolute refs transformed to relative
Write all links as absolute refs from the virtual root of the website's path namespace and then transform these into relative links with the resolveRefs utility function.
This commit is contained in:
parent
17f8693eae
commit
d003ea01d0
5 changed files with 37 additions and 20 deletions
|
@ -5,7 +5,7 @@ import { updates } from "./updates.js"
|
|||
const title = "Hornwitser's Site";
|
||||
export const index = {
|
||||
title,
|
||||
ref: "index.html",
|
||||
ref: "/index.html",
|
||||
content: <BasePage title={title}>
|
||||
<main>
|
||||
<div class="hero" />
|
||||
|
@ -21,13 +21,13 @@ export const index = {
|
|||
<p>
|
||||
I'm a red dragon that mostly dabble in hobby programming and the occasional artwork.
|
||||
</p>
|
||||
<h2>Latest <a href="./updates.html">Updates</a></h2>
|
||||
<h2>Latest <a href="/updates.html">Updates</a></h2>
|
||||
<ul>
|
||||
{ updates.map(update => <li><a href={"./" + update.ref}>{update.title}</a></li>)}
|
||||
{ updates.map(update => <li><a href={update.ref}>{update.title}</a></li>)}
|
||||
</ul>
|
||||
<h2>Projects</h2>
|
||||
<ul>
|
||||
{ projects.map(project => <li><a href={"./" + project.ref}>{project.title}</a></li>)}
|
||||
{ projects.map(project => <li><a href={project.ref}>{project.title}</a></li>)}
|
||||
</ul>
|
||||
</main>
|
||||
</BasePage>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue