Skip to content

Commit

Permalink
Merge pull request #90 from VermontDepartmentOfHealth/kyle
Browse files Browse the repository at this point in the history
site maintenance fixes and enhancements
  • Loading branch information
KyleMit authored Jan 6, 2020
2 parents 1036da7 + 59ae32f commit d928416
Show file tree
Hide file tree
Showing 59 changed files with 2,189 additions and 1,136 deletions.
28 changes: 14 additions & 14 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@


module.exports = function(eleventyConfig) {

// static passthroughs - remap to root
Expand Down Expand Up @@ -30,27 +29,28 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addFilter("contentTags", tags => tags.filter(t => !["post","draft"].includes(t)));
eleventyConfig.addFilter("findByName", (arr, findValue) => arr.find(a => a.name === findValue));
eleventyConfig.addFilter("isPostType", tags => tags && tags.some(t => ["post","draft"].includes(t)));
eleventyConfig.addFilter("isDraft", tags => tags && tags.some(t => t === 'draft'));
eleventyConfig.addFilter("take", (array, n) => array.slice(0,n));
eleventyConfig.addFilter("sortByPostCount", arr => arr.sort((a,b) => (a.posts.length < b.posts.length ? 1 : -1)));


// custom collections
let builder = require("./plugins/builder.js")
eleventyConfig.addCollection("projects", col => builder(col, "project", "name", "summary", "project", "./projects/"));
eleventyConfig.addCollection("authors", col => builder(col, "author", "name", "summary", "authors", "./authors/"));
eleventyConfig.addCollection("teams", col => builder(col, "team", "name", "summary", "team", "./teams/"));
eleventyConfig.addCollection("departments", col => builder(col, "department", "name", "summary", "department", "./departments/"));
eleventyConfig.addCollection("authors", col => builder(col, "author", "name", "summary", "authors", "./pages/authors/"));
eleventyConfig.addCollection("projects", col => builder(col, "project", "name", "summary", "project", "./pages/projects/"));
eleventyConfig.addCollection("teams", col => builder(col, "team", "name", "summary", "team", "./pages/teams/"));
eleventyConfig.addCollection("departments", col => builder(col, "department", "name", "summary", "department", "./pages/departments/"));

eleventyConfig.addCollection("published", col => col.getFilteredByTag("post").filter(item => !item.data.draft));
eleventyConfig.addCollection("drafts", col => col.getFilteredByTag("post").filter(item => item.data.draft));

// bundle collection
eleventyConfig.addCollection("bundles", col => {
let scriptCol = col.getFilteredByGlob("**/meta/bundle-scripts.njk")
let styleCol = col.getFilteredByGlob("**/meta/bundle-styles.njk")
return {
script: scriptCol[0],
style: styleCol[0]
}
let script = col.getFilteredByGlob("**/meta/bundle-scripts.js.njk")[0]
let style = col.getFilteredByGlob("**/meta/bundle-styles.css.njk")[0]
return { script, style }
});


// configure syntax highlighting
let md = require("./plugins/customize-markdown.js")()
eleventyConfig.setLibrary("md", md);
Expand All @@ -77,8 +77,8 @@ module.exports = function(eleventyConfig) {
return {
dir: {
"data": "data",
includes: "assets",
layouts: "layouts"
"includes": "assets",
"layouts": "layouts"
},

// By default markdown files are pre-processing with liquid template engine
Expand Down
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Description

<!-- please explain the changes you made here ->
<!--
If you made multiple different types of edits,
please split them up into the following categories
which are used by the Changelog notes
-->

## Content Additions
## Enhancements
## Fixes
## Tech Debt


## Checklist

<!-- add an 'x' to any box that applies -->

* [ ] I have read the [contribution guidelines](https://docgov.dev/contributing/)
* [ ] I'd like a technical review on any code samples / concepts
* [ ] I'm open to getting feedback on copy
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@
"lifecycle",
"linkify",
"markdownlint",
"minification",
"minmax",
"netlify",
"nofollow",
"nwsprod",
"nwstest",
"passthroughs",
Expand All @@ -83,6 +85,7 @@
"preconnect",
"prepended",
"redgate",
"roadmap",
"scrollbar",
"shortcode",
"sidenav",
Expand Down
21 changes: 21 additions & 0 deletions .vscode/snippets.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"Frontmatter for Post" : {
"prefix": ["frontmatter-post"],
"description": "Adds yaml frontmatter for posts",
"body": [
"---",
"title_word: ${1:Single_Word}",
"title: '${2:Engaging Post Title}'",
"summary: '${3:Post description (1 to 2 sentences)}'",
"tags: ['post', '${4:tag}']",
"authors: ['${5:Your_Name}']",
"date: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE",
"draft: ${6|true,false|}",
"---",
"",
"$0"

],
"scope": "markdown,nunjucks"
}
}
Loading

0 comments on commit d928416

Please sign in to comment.