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

adding font files from lullabot.com #27

Merged
merged 8 commits into from
Jul 16, 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
1 change: 1 addition & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module.exports = function (eleventyConfig) {
});

eleventyConfig.addPassthroughCopy("img");
eleventyConfig.addPassthroughCopy("fonts");
eleventyConfig.addPassthroughCopy("src/ebooks/**/*.png");
eleventyConfig.addPassthroughCopy("src/ebooks/**/*.jpg");
eleventyConfig.addPassthroughCopy("src/ebooks/**/*.jpeg");
Expand Down
Binary file added fonts/Circular/Circular-Bold.woff
Binary file not shown.
Binary file added fonts/Circular/Circular-Bold.woff2
Binary file not shown.
Binary file added fonts/Circular/Circular-BoldItalic.woff
Binary file not shown.
Binary file added fonts/Circular/Circular-BoldItalic.woff2
Binary file not shown.
Binary file added fonts/Circular/Circular-Book.woff
Binary file not shown.
Binary file added fonts/Circular/Circular-Book.woff2
Binary file not shown.
Binary file added fonts/Circular/Circular-BookItalic.woff
Binary file not shown.
Binary file added fonts/Circular/Circular-BookItalic.woff2
Binary file not shown.
Binary file added fonts/Circular/Circular-Italic.woff
Binary file not shown.
Binary file added fonts/Circular/Circular-Italic.woff2
Binary file not shown.
Binary file added fonts/Circular/Circular-Medium.woff
Binary file not shown.
Binary file added fonts/Circular/Circular-Medium.woff2
Binary file not shown.
Binary file added fonts/Circular/Circular-MediumItalic.woff
Binary file not shown.
Binary file added fonts/Circular/Circular-MediumItalic.woff2
Binary file not shown.
Binary file added fonts/IBMPlexMono/IBMPlexMono-Bold.ttf
Binary file not shown.
Binary file added fonts/IBMPlexMono/IBMPlexMono-BoldItalic.ttf
Binary file not shown.
Binary file added fonts/IBMPlexMono/IBMPlexMono-Italic.ttf
Binary file not shown.
Binary file added fonts/IBMPlexMono/IBMPlexMono-Regular.ttf
Binary file not shown.
86 changes: 86 additions & 0 deletions fonts/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
@font-face {
font-family: 'Circular';
src: url('Circular/Circular-Bold.woff2') format('woff2'),
url('Circular/Circular-Bold.woff') format('woff');
font-weight: 700;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: 'Circular';
src: url('Circular/Circular-BoldItalic.woff2') format('woff2'),
url('Circular/Circular-BoldItalic.woff') format('woff');
font-weight: 700;
font-style: italic;
font-display: swap;
}

@font-face {
font-family: 'Circular';
src: url('Circular/Circular-Medium.woff2') format('woff2'),
url('Circular/Circular-Medium.woff') format('woff');
font-weight: 500;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: 'Circular';
src: url('Circular/Circular-MediumItalic.woff2') format('woff2'),
url('Circular/Circular-MediumItalic.woff') format('woff');
font-weight: 500;
font-style: italic;
font-display: swap;
}

@font-face {
font-family: 'Circular';
src: url('Circular/Circular-Book.woff2') format('woff2'),
url('Circular/Circular-Book.woff') format('woff');
font-weight: 450;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: 'Circular';
src: url('Circular/Circular-BookItalic.woff2') format('woff2'),
url('Circular/Circular-BookItalic.woff') format('woff');
font-weight: 450;
font-style: italic;
font-display: swap;
}

@font-face {
font-family: 'IBMPlexMono';
src: url('IBMPlexMono/IBMPlexMono-Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: 'IBMPlexMono';
src: url('IBMPlexMono/IBMPlexMono-Italic.ttf') format('truetype');
font-weight: 400;
font-style: italic;
font-display: swap;
}

@font-face {
font-family: 'IBMPlexMono';
src: url('IBMPlexMono/IBMPlexMono-Bold.ttf') format('truetype');
font-weight: 700;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: 'IBMPlexMono';
src: url('IBMPlexMono/IBMPlexMono-BoldItalic.ttf')
format('truetype');
font-weight: 700;
font-style: italic;
font-display: swap;
}
25 changes: 16 additions & 9 deletions src/_includes/chapter.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,25 @@
layout: layout
---


{% assign currentBookSlug = page.filePathStem | split: "/" | slice: 2, 1 | join: "" %}
{% assign bookWithChapters = collections.booksWithChapters | where: "book.slug", currentBookSlug | first %}
{% assign chapter = bookWithChapters.chapters | where: "url", page.url | first %}
{% assign previousChapter = chapter.previous %}
{% assign nextChapter = chapter.next %}
{% assign isFirstChapter = chapter.index == 0 %}
{% assign isLastChapter = chapter.index == bookWithChapters.chapters.size | minus: 1 %}

{% assign chapterIndex = chapter.index | plus: 1 %}
{% if chapterIndex < 10 %}
{% assign chapterIndex = "0" | append: chapterIndex %}
{% endif %}


<div class="ebook-page-container">
<div class="ebook-heading-container">
<div class="ebook-chapter-heading">
<p class="ebook-chapter-number">Chapter {{ page.fileSlug | replace: 'chapter-', '' }}</p>
<p class="ebook-chapter-number">Chapter {{ chapterIndex }}</p>
<p class="ebook-chapter-title">{{ title }} </p>
</div>
<div class="ebook-copy">
Expand All @@ -20,14 +35,6 @@ layout: layout
</div>
</div>

{% assign currentBookSlug = page.filePathStem | split: "/" | slice: 2, 1 | join: "" %}
{% assign bookWithChapters = collections.booksWithChapters | where: "book.slug", currentBookSlug | first %}
{% assign chapter = bookWithChapters.chapters | where: "url", page.url | first %}
{% assign previousChapter = chapter.previous %}
{% assign nextChapter = chapter.next %}
{% assign isFirstChapter = chapter.index == 0 %}
{% assign isLastChapter = chapter.index == bookWithChapters.chapters.size | minus: 1 %}

<div class="nav-container">
{% if isFirstChapter %}
<a href="../../table-of-contents/">
Expand Down
41 changes: 26 additions & 15 deletions src/_includes/layout.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,33 @@
<div>{{ chapter.data.title }}</div>
</div>

{% assign currentBookSlug = page.filePathStem | split: "/" | slice: 2, 1 | join: "" %}
{% for bookWithChapters in collections.booksWithChapters %}
{% if bookWithChapters.book.slug == currentBookSlug %}
<div class="page-number">
<div>
{% if page.fileSlug == 'cover' %}
<!-- Empty for cover page -->
{% elsif page.fileSlug == 'table-of-contents' %}
TOC
{% else %}
{{ page.fileSlug | replace: 'chapter-', '' }}
{% endif %}
{% assign currentBookSlug = page.filePathStem | split: "/" | slice: 2, 1 | join: "" %}
{% for bookWithChapters in collections.booksWithChapters %}
{% if bookWithChapters.book.slug == currentBookSlug %}
{% assign chapter = bookWithChapters.chapters | where: "url", page.url | first %}
<div class="page-number">
<div>
{% if page.fileSlug == 'cover' %}
<!-- Empty for cover page -->
{% elsif page.fileSlug == 'table-of-contents' %}
TOC
{% else %}
{% assign chapterNumber = page.fileSlug | remove: 'chapter-' %}
{% assign numericChapterNumber = chapterNumber | plus: 0 %}
{% if numericChapterNumber == 0 or numericChapterNumber > 0 %}
{% if numericChapterNumber < 10 %}
0{{ numericChapterNumber }}
{% else %}
{{ numericChapterNumber }}
{% endif %}
{% else %}
{{ chapterNumber }}
{% endif %}
{% endif %}
</div>
</div>
</div>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}

</div>
<main>
Expand Down
23 changes: 21 additions & 2 deletions src/sass/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ $lb-red: #f81e00;
$lb-gray: #e0e6eb;
$lb-white: #fff;

@import "/fonts/fonts.css";

body {
margin: 0;
display: flex;
}

main {
font-family: verdana, sans-serif;
font-family: 'Circular', verdana, sans-serif;
font-size: 20px;
display: flex;
flex-direction: column;
justify-content: space-between;
Expand Down Expand Up @@ -60,7 +63,7 @@ main {
display: flex;
align-items: center;
justify-content: center;
font-family: verdana, sans-serif;
font-family: 'IBMPlexMono';
border-top: 1px solid $lb-gray;
font-size: 14px;
font-weight: 400;
Expand Down Expand Up @@ -174,6 +177,22 @@ main {
}
}

p {
.chapter {
font-size: 1.25em;
font-weight: 700;
margin-bottom: 2em;
color: $lb-red;
}

.title {
font-size: 2em;
font-weight: 700;
margin-bottom: 2em;
color: $lb-black;
}
}

.ebook-page-container {
display: flex;
height: 100%;
Expand Down
Loading