Skip to content

Commit 74c8981

Browse files
Fix links in JS
SHA: 4974c85 Reason: push, by pietercolpaert Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 614bedd commit 74c8981

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

‎workingdraft/server-primer.html‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@
15311531
<script>
15321532
(() => {
15331533
const siteBase = "https://w3id.org/ldes/";
1534-
const releasesBase = `${siteBase}releases/`;
1534+
const releasesBase = "https://w3id.org/ldes/releases/";
15351535

15361536
const currentPath = new URL(window.location.href).pathname;
15371537
const documentName = (() => {
@@ -1540,10 +1540,16 @@
15401540
return lastSegment;
15411541
})();
15421542

1543-
const documentPath = documentName === "index.html" ? "" : documentName;
1543+
let documentPath = documentName === "index.html" ? "" : documentName;
1544+
documentPath = documentPath.substring(0, documentPath.indexOf(".html"));
1545+
let latest = `${siteBase}${documentPath}`;
1546+
if (documentPath === '') {
1547+
latest += 'specification';
1548+
}
15441549
const linkTargets = {
1545-
latest: `${siteBase}${documentPath}`,
1550+
latest: latest,
15461551
archivedVersions: releasesBase,
1552+
workingDraft: `${siteBase}workingdraft/${documentPath}`,
15471553
};
15481554

15491555
function setVersionLinks() {
@@ -1557,9 +1563,10 @@
15571563
currentUrl.search = "";
15581564

15591565
const rows = [
1560-
createVersionRow("This version:", currentUrl.toString(), true),
1566+
createVersionRow("This version:", siteBase + currentPath.substring(0, currentPath.indexOf(".html")), true),
15611567
createVersionRow("Latest version:", linkTargets.latest),
15621568
createVersionRow("Archived versions:", linkTargets.archivedVersions),
1569+
createVersionRow("Working draft:", linkTargets.workingDraft),
15631570
];
15641571
metadata.prepend(...rows.flat());
15651572
}
@@ -1582,12 +1589,7 @@
15821589

15831590
function removeVersionRows(metadata) {
15841591
const versionLabels = new Set([
1585-
"Previous version:",
1586-
"This version:",
1587-
"Next version:",
1588-
"Latest version:",
1589-
"Working draft:",
1590-
"Archived versions:",
1592+
"This version:"
15911593
]);
15921594

15931595
for (const term of [...metadata.querySelectorAll("dt")]) {
@@ -1612,7 +1614,7 @@
16121614
</script>
16131615
<meta content="Bikeshed version 0a3d88311, updated Mon May 4 18:07:03 2026 +0000" name="generator">
16141616
<link href="https://w3id.org/ldes/server-primer" rel="canonical">
1615-
<meta content="8e4eff998e7105958d8e13698b8d29cf40e7c48b" name="revision">
1617+
<meta content="4974c85c3fab8443acd60085542f11e5f99bd27d" name="revision">
16161618
<meta content="dark light" name="color-scheme">
16171619
<style>/* Boilerplate: style-autolinks */
16181620
.css.css, .property.property, .descriptor.descriptor {

0 commit comments

Comments
 (0)