Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

73 short titles #77

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const path = require("path");
module.exports = function (eleventyConfig) {
// Generate a collection of all books with their pages
eleventyConfig.addCollection("booksWithPages", function (collectionApi) {
const books = collectionApi.getFilteredByGlob("src/ebooks/*/cover.md");
const books = collectionApi.getFilteredByGlob("src/ebooks/*/index.html");
const pages = collectionApi.getFilteredByGlob("src/ebooks/*/pages/*.md");

return books.map(book => {
const bookSlug = book.filePathStem.split("/")[2];
const bookSlug = book.filePathStem.split('/')[2];
const bookPages = pages
.filter(page => page.inputPath.includes(bookSlug))
.sort((a, b) => {
Expand All @@ -19,8 +19,10 @@ module.exports = function (eleventyConfig) {

return {
book: {
...book.data,
title: book.data.title,
shortTitle: book.data.shortTitle,
slug: bookSlug,
url: book.url
},
pages: bookPages.map((page, index) => ({
...page.data, // Include all frontmatter data
Expand Down
1 change: 1 addition & 0 deletions src/COPYME_sample-ebook/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Sample eBook"
shortTitle: "Sample eBook"
layout: layout
---

Expand Down
6 changes: 4 additions & 2 deletions src/_includes/sidebar.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
{% assign currentBookSlug = page.filePathStem | split: "/" | slice: 2, 1 | join: "" %}
{% for bookWithPages in collections.booksWithPages %}
{% if bookWithPages.book.slug == currentBookSlug %}

<div class="page-title">
<div>{{ bookWithPages.book.title }}</div>
<div>
<span class="full-title">{{ bookWithPages.book.title }}</span>
<span class="short-title">{{ bookWithPages.book.shortTitle | default: bookWithPages.book.title }}</span>
</div>
</div>
<div class="page-number">
<div aria-label="Current page number">
Expand Down
5 changes: 3 additions & 2 deletions src/ebooks/keeping-government-consistent/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Keeping State Government Websites Consistent and Accessible"
layout: layout
title: "Keeping Government Software Development Consistent Across Teams"
shortTitle: "Gov Software Teams"
layout: cover
---

{% include 'page.liquid' %}
Expand Down
5 changes: 3 additions & 2 deletions src/ebooks/large-team-challenges/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: "Challenges for Large Content Teams"
layout: layout
title: "Managing Large Team Challenges in Government Software Projects"
shortTitle: "Team Management"
layout: cover
---

{% include 'page.liquid' %}
Expand Down
1 change: 1 addition & 0 deletions src/ebooks/over-structured-content/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "5 Signs You’ve Over-structured Your Content"
shortTitle: "Over-structured Content"
layout: layout
---

Expand Down
3 changes: 2 additions & 1 deletion src/ebooks/rogue-university/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "How to Keep Your University’s Websites from Going Rogue"
title: "How to Keep Your University's Websites from Going Rogue"
shortTitle: "University Websites"
layout: layout
---

Expand Down
1 change: 1 addition & 0 deletions src/ebooks/why-your-cms-will-fail/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Why Your CMS Project Will Fail"
shortTitle: "CMS Failure"
layout: layout
---

Expand Down
31 changes: 28 additions & 3 deletions src/sass/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,23 @@ main {
font-size: 1.25em;
padding: 1em;
}

.short-title {
display: none;
}
}
}

@media (height <= 920px) {
.sidebar .page-title {
div {
.full-title {
display: none;
}
.short-title {
display: inline;
}
}
}
}

Expand Down Expand Up @@ -520,11 +537,19 @@ p {
flex-direction: row;

.page-title {
transform: rotate(90deg);
transform: none;
width: auto;

div {
overflow: hidden;
text-overflow: ellipsis;
transform: none;
padding: 1em;

.full-title {
display: none;
}
.short-title {
display: inline;
}
}
}
}
Expand Down
Loading