Skip to content

Commit

Permalink
CLDR-18001 site: fix link in ToC to entire page, fix some titles (#4126)
Browse files Browse the repository at this point in the history
  • Loading branch information
srl295 authored Oct 10, 2024
1 parent 97ba5b2 commit 62f93db
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 25 deletions.
26 changes: 18 additions & 8 deletions docs/site/assets/css/page.css
Original file line number Diff line number Diff line change
Expand Up @@ -816,23 +816,21 @@ body.page .subpages a.hasChildren:after {
}

/* these are the ToC entries in the sidebar, according to what element they came from originally. */
.pagecontents .headingH1 {
margin-left: 0em;
}
.pagecontents .headingH1,
.pagecontents .headingH2 {
margin-left: 1em;
margin-left: 0em;
}
.pagecontents .headingH3 {
margin-left: 2em;
margin-left: 1em;
}
.pagecontents .headingH4 {
margin-left: 3em;
margin-left: 2em;
}
.pagecontents .headingH5 {
margin-left: 4em;
margin-left: 3em;
}
.pagecontents .headingH6 {
margin-left: 5em;
margin-left: 4em;
}

header {
Expand Down Expand Up @@ -907,6 +905,10 @@ div.sitemap {
padding-left: 0.25em;
}

.topTitle {
display: none;
}

div.sitemap {
height: 90%;
}
Expand Down Expand Up @@ -1009,6 +1011,14 @@ div > header {
display: none !important;
}

section.body h1.title {
text-align: center;
}

section.body h1.redundantTitle {
display: none;
}

section.body h1 {
font-size: 2em;
line-height: 1.2;
Expand Down
22 changes: 14 additions & 8 deletions docs/site/assets/js/cldrsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,6 @@ const app = Vue.createApp(
<div class="breadcrumb">
<AncestorPages :ancestorPages="ancestorPages"/>
<div v-if="!children || !children.length" class="title"> {{ ourTitle }} </div>
<div v-else class="title" >
{{ ourTitle }}
</div>
</div>
</div>`,
Expand Down Expand Up @@ -441,7 +435,13 @@ if (myPath === "sitemap.html") {
mounted() {
const t = this;
siteDataPromise.then(
(d) => (t.tree.value = d),
(d) => {
t.tree.value = d;
// set style on first header if redundant
if (this.anchorElements[0]?.textContent === this.ourTitle) {
this.anchorElements[0].className = "redundantTitle";
}
},
(e) => (t.status = e)
);
},
Expand Down Expand Up @@ -475,14 +475,17 @@ if (myPath === "sitemap.html") {
contents() {
// For now we generate a flat map
// this
const objects = this.anchorElements?.map(
let objects = this.anchorElements?.map(
({ textContent, id, tagName }) => ({
title: textContent,
href: `#${id}`,
children: null,
style: `heading${tagName}`,
})
);
if (objects[0]?.title === this.ourTitle) {
objects = objects.slice(1);
}
if (!objects?.length) return null;
return objects;
},
Expand All @@ -499,9 +502,12 @@ if (myPath === "sitemap.html") {
},
},
template: `
<div>
<div class="navBar" v-if="contents || (children.length)">
<PageContents v-if="contents" :children="contents" />
<SubPagesPopup v-if="children.length" :children="children"/>
</div>
<h1 class="title">{{ ourTitle }}</h1>
</div>`,
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/site/cldr-tc.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: CLDR Technical Committee (TC)
title: "CLDR Technical Committee (TC)"
---

# CLDR Technical Committee (TC)
Expand Down
2 changes: 1 addition & 1 deletion docs/site/development/development-process.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Handling Tickets (bugs/enhancements)
title: 'Handling Tickets (bugs/enhancements)'
---

# Handling Tickets (bugs/enhancements)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: BCP 47 Changes (DRAFT)
title: 'BCP 47 Changes (DRAFT)'
---

# BCP 47 Changes (DRAFT)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Chinese (and other) calendar support, intercalary months, year cycles
title: 'Chinese (and other) calendar support, intercalary months, year cycles'
---

# Chinese (and other) calendar support, intercalary months, year cycles
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Delimiter (Quotation Mark) Proposal
title: 'Delimiter (Quotation Mark) Proposal'
---

# Delimiter (Quotation Mark) Proposal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: JSON Packaging (Approved by the CLDR TC on 2015-03-25)
title: 'JSON Packaging (Approved by the CLDR TC on 2015-03-25)'
---

# JSON Packaging (Approved by the CLDR TC on 2015-03-25)
Expand Down
2 changes: 1 addition & 1 deletion docs/site/development/updating-codes/un-literacy.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: UN Literacy Data (CLDR BRS)
title: 'UN Literacy Data (CLDR BRS)'
---

# UN Literacy Data (CLDR BRS)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Country/Region (Territory) Names
title: 'Country/Region (Territory) Names'
---

# Country/Region (Territory) Names
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Locale Option Names (Key)
title: 'Locale Option Names (Key)'
---

# Locale Option Names (Key)
Expand Down

0 comments on commit 62f93db

Please sign in to comment.