Skip to content

Commit

Permalink
Merge branch 'main' into remove-references
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffmaher authored Aug 29, 2023
2 parents 82ecfe0 + 3abd505 commit e6e8403
Show file tree
Hide file tree
Showing 33 changed files with 67 additions and 794 deletions.
12 changes: 8 additions & 4 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ module.exports = function (eleventyConfig) {
// https://www.11ty.dev/docs/data-deep-merge/
eleventyConfig.setDataDeepMerge(true);

// Alias `layout: post` to `layout: layouts/post.njk`
eleventyConfig.addLayoutAlias('post', 'layouts/post.njk');

eleventyConfig.addFilter('readableDate', dateObj => {
return DateTime.fromJSDate(dateObj, { zone: 'utc' }).toFormat('dd LLL yyyy');
});
Expand All @@ -61,9 +58,16 @@ module.exports = function (eleventyConfig) {

eleventyConfig.addFilter('filterTagList', tags => {
// should match the list in tags.njk
return (tags || []).filter(tag => ['all', 'nav', 'post', 'posts'].indexOf(tag) === -1);
return (tags || []).filter(tag => ['all', 'nav'].indexOf(tag) === -1);
})

// Create a collection for sections in alphabetical title order
eleventyConfig.addCollection('sections', function (collection) {
return collection.getFilteredByTag('section').sort((a, b) => {
return a.data.title.localeCompare(b.data.title);
});
});

// Create an array of all tags
eleventyConfig.addCollection('tagList', function (collection) {
const tagSet = new Set();
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ This uses whatever NPM and Node version you have installed on your machine, and
1. View the site in your browser at [http://localhost:8080](http://localhost:8080)

From here, changes to files will rebuild the site.

## Editing Instructions

### Adding a Section

To add a new section to the site:

1. Add a new Markdown file to the `sections` folder (example: `sections/my-new-section.md`)
1. At the top of the file, add two lines with `---` and between those two lines put:
- `layout: layouts/section`
- `title: My New Section's Title`
1. Add content below the second `---`

Feel free to look at any of the existing sections as a starting point.

## Checking code before PR
### Running Linters
1. Navigate to the base of this repo
Expand Down
13 changes: 2 additions & 11 deletions _data/metadata.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
{
"title": "Bloom Works Guides",
"url": "https://bloomworks.digital/",
"guide": "Bloom Works Guides Template",
"googlesitevertification" : "",
"language": "en",
"robots": "index, follow",
"description": "Guides from Bloom Works",
"feed": {
"subtitle": "Guides from Bloom Works",
"filename": "feed.xml",
"path": "/feed/feed.xml",
"id": "https://text11ty.pages.dev/"
},
"jsonfeed": {
"path": "/feed/feed.json",
"url": "https://text11ty.pages.dev/feed/feed.json"
}
"description": "Guides from Bloom Works"
}
3 changes: 1 addition & 2 deletions _includes/components/PageHeader.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// Strip whitespace
const { html } = require('common-tags');

function renderPageHeader (subhead, title) {
function renderPageHeader (title) {
return html`
<header role="banner" class="page-header">
<div class="l-wrapper">
<h1>
${subhead ? `<span>${subhead}</span>` : ''}
<span class="sr-only">: </span>
${title}
</h1>
Expand Down
2 changes: 1 addition & 1 deletion _includes/layouts/content.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% PageHeader subhead, title %}
{% PageHeader title %}

<main{% if templateClass %} class="{{ templateClass }}"{% endif %} id="content">
<div class="l-wrapper">
Expand Down
6 changes: 3 additions & 3 deletions _includes/layouts/navigation.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="nav-meta">
<a href="https://bloomworks.digital" aria-label="Bloom Works Logo" class="nav-home">
{% include "bloom-logo-graphic.svg" %}
<strong> {{ guide }}</strong>
<strong> {{ metadata.guide }}</strong>
</a>
</div>
<button class="nav-button" data-nav-button="search">
Expand All @@ -34,9 +34,9 @@
</header>
<section class="dialog-body">
<ol>
{% for chapter in collections[tags] %}
{% for section in collections.sections %}
<li>
<a href="{{ chapter.page.url }}">{% if chapter.data.subhead %}{{ chapter.data.subhead }}: {% endif %}{{ chapter.data.title }}</a>
<a href="{{ section.page.url }}">{{ section.data.title }}</a>
</li>
{% endfor %}
</ol>
Expand Down
26 changes: 0 additions & 26 deletions _includes/layouts/post.njk

This file was deleted.

4 changes: 4 additions & 0 deletions _includes/layouts/section.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
tags: section
---
{% include "layouts/base.njk" %}
19 changes: 0 additions & 19 deletions _includes/postslist.njk

This file was deleted.

10 changes: 0 additions & 10 deletions about/index.md

This file was deleted.

12 changes: 0 additions & 12 deletions archive.njk

This file was deleted.

2 changes: 1 addition & 1 deletion components/page-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ title: "About the Playbook"
{% include "layouts/head.njk" %}
{% include "layouts/seo.njk" %}
{% include "layouts/css.njk" %}
{%- PageHeader subhead, title -%}
{%- PageHeader title -%}
29 changes: 0 additions & 29 deletions feed/feed.njk

This file was deleted.

6 changes: 0 additions & 6 deletions feed/htaccess.njk

This file was deleted.

32 changes: 0 additions & 32 deletions feed/json.njk

This file was deleted.

1 change: 0 additions & 1 deletion google6392df0c2099b010.html

This file was deleted.

Empty file removed img/.gitkeep
Empty file.
9 changes: 2 additions & 7 deletions index.njk
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
---
layout: layouts/base.njk
eleventyNavigation:
key: Home
order: 1
guide: Bloom Works Guides
title: Page Title
subhead: Subhead
layout: layouts/base
title: Home
---

<h1>Heading 1</h1>
Expand Down
22 changes: 0 additions & 22 deletions posts/eleventy.md

This file was deleted.

19 changes: 0 additions & 19 deletions posts/hosting.md

This file was deleted.

22 changes: 0 additions & 22 deletions posts/install.md

This file was deleted.

14 changes: 0 additions & 14 deletions posts/markdown.md

This file was deleted.

18 changes: 0 additions & 18 deletions posts/postingan.md

This file was deleted.

5 changes: 0 additions & 5 deletions posts/posts.json

This file was deleted.

Loading

0 comments on commit e6e8403

Please sign in to comment.