Skip to content

Commit d7f7036

Browse files
authored
Revert "Revert "Taking GitHub Pages to Eleventy""
1 parent 3c3dfc8 commit d7f7036

File tree

230 files changed

+10595
-2757
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+10595
-2757
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# https://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
end_of_line = lf
7+
indent_style = space
8+
indent_size = 2
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
# Set default charset
13+
[*.{js,py}]
14+
charset = utf-8

.eleventy.js

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
const fs = require('fs');
2+
const pluginRss = require('@11ty/eleventy-plugin-rss');
3+
const sassWatch = require('./_includes/sass-watch');
4+
const filterFullDate = require('./_includes/filters/full-date');
5+
const filterLimitTo = require('./_includes/filters/limit-to');
6+
const filterMarkdown = require('./_includes/filters/markdown');
7+
const filterRegexReplace = require('./_includes/filters/regex-replace');
8+
const scMeetupDetails = require('./_includes/shortcodes/meetup-details');
9+
const scVideoPlayer = require('./_includes/shortcodes/video-player');
10+
11+
/**
12+
* Add date properties to collections.
13+
*
14+
* @param {object} posts Collection to add date properties to.
15+
* @return {object} Augmented posts collection.
16+
*/
17+
const addFileDates = (posts) => posts.map((post) => {
18+
if (!(post && post.inputPath)) return post;
19+
20+
const stat = fs.statSync(post.inputPath) || {};
21+
const newPost = post;
22+
23+
newPost.dateCreated = stat.birthtime;
24+
newPost.dateModified = stat.mtime;
25+
26+
return newPost;
27+
});
28+
29+
module.exports = (eleventyConfig) => {
30+
// Watch Sass directory for styling changes.
31+
// Works only in dev mode. Though it throws and error and then continues on.
32+
if (process.env.ELEVENTY_ENV === 'dev') {
33+
sassWatch('./_sass/_main.scss', './_site/assets/css/main.css');
34+
}
35+
36+
// PASSTHRU: Copy the `assets` directory to the compiled site folder
37+
eleventyConfig.addPassthroughCopy('assets');
38+
eleventyConfig.addPassthroughCopy('robots.txt');
39+
eleventyConfig.addPassthroughCopy('CNAME');
40+
41+
// COLLECTION: Create meetup collection.
42+
eleventyConfig.addCollection('meetups', (collection) => {
43+
const posts = collection.getFilteredByGlob('./_meetups/**');
44+
45+
return addFileDates(posts);
46+
});
47+
48+
// COLLECTION: Create post collection.
49+
eleventyConfig.addCollection('posts', (collection) => {
50+
const posts = collection.getFilteredByGlob(['./_meetups/**', './_posts/**']);
51+
52+
return addFileDates(posts);
53+
});
54+
55+
// FILTER: Convert dates to MMMM D, YYYY format.
56+
eleventyConfig.addFilter('fullDate', filterFullDate);
57+
58+
// FILTER: Limit collection length.
59+
eleventyConfig.addFilter('limitTo', filterLimitTo);
60+
61+
// FILTER: Run content thru Markdown-it.
62+
eleventyConfig.addFilter('markdown', filterMarkdown);
63+
64+
// FILTER: Replace text with regex capabilities.
65+
eleventyConfig.addFilter('regexReplace', filterRegexReplace);
66+
67+
// SHORTCODE: Format meeting details message block.
68+
eleventyConfig.addShortcode('meetupDetails', scMeetupDetails);
69+
70+
// SHORTCODE: Embed video players for event replay.
71+
eleventyConfig.addShortcode('videoPlayer', scVideoPlayer);
72+
73+
// PLUGIN: RSS feed
74+
eleventyConfig.addPlugin(pluginRss);
75+
76+
// BROWSERSYNC: add ability to see 404.html in dev mode
77+
eleventyConfig.setBrowserSyncConfig({
78+
callbacks: {
79+
ready(err, bs) {
80+
bs.addMiddleware('*', (req, res) => {
81+
const content_404 = fs.readFileSync('_site/404.html');
82+
// Provides the 404 content without redirect.
83+
84+
res.write(content_404);
85+
// Add 404 http status code in request header.
86+
// res.writeHead(404, { "Content-Type": "text/html" });
87+
res.writeHead(404);
88+
res.end();
89+
});
90+
},
91+
},
92+
});
93+
94+
return {
95+
dir: {
96+
input: './',
97+
output: './_site',
98+
layouts: './_layouts',
99+
},
100+
templateFormats: [
101+
'njk',
102+
'liquid',
103+
'md',
104+
'html',
105+
],
106+
htmlTemplateEngine: 'njk',
107+
dataTemplateEngine: 'njk',
108+
};
109+
};

.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# include
2+
!.eleventy.js

.eslintrc.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"extends": "airbnb-base",
3+
"rules": {
4+
// Require spaces before comments...
5+
"lines-around-comment": [
6+
"error",
7+
{
8+
// ...except when first line of array, or...
9+
"allowArrayStart": true,
10+
// ...except when first line of block, or...
11+
"allowBlockStart": true,
12+
// ...except when first line of object.
13+
"allowObjectStart": true
14+
}
15+
],
16+
// Visually set-off the var assignment from the rest of code.
17+
"newline-after-var": "error",
18+
// Visually set-off the return from the rest of code.
19+
"newline-before-return": "error",
20+
// Require developers to describe function purpose, arguments, and returns.
21+
"require-jsdoc": "error",
22+
// Require valid JSDoc.
23+
"valid-jsdoc": [
24+
"error",
25+
{
26+
// Only require @return if there's a return statement.
27+
"requireReturn": false
28+
}
29+
]
30+
}
31+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Eleventy Build
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the master branch
5+
on:
6+
push:
7+
branches: [ master ]
8+
9+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
10+
jobs:
11+
# This workflow contains a single job called "build"
12+
build:
13+
# The type of runner that the job will run on
14+
runs-on: ubuntu-latest
15+
16+
# Steps represent a sequence of tasks that will be executed as part of the job
17+
steps:
18+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
19+
- uses: actions/checkout@v2
20+
21+
- name: Setup Node.js environment
22+
uses: actions/setup-node@v1.4.1
23+
24+
- name: Install packages
25+
run: npm ci
26+
27+
- name: Run npm build
28+
run: npm run build
29+
30+
- name: Deploy to gh-pages
31+
uses: peaceiris/actions-gh-pages@v3
32+
with:
33+
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
34+
publish_dir: ./_site

.gitignore

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
.sass-cache
1+
# OS generated #
2+
#--------------------#
3+
.DS_Store
4+
5+
# IDE-generated
6+
#--------------------#
7+
.vscode
8+
9+
# App-generated
10+
#--------------------#
211
_site
3-
.bundle
4-
vendor
5-
Gemfile.lock
12+
node_modules
13+
tmp

.markdownlint.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"default": false,
3+
"MD001": true,
4+
"MD002": {
5+
"level": 2
6+
},
7+
"MD003": {
8+
"style": "atx"
9+
},
10+
"MD004": {
11+
"style": "asterisk"
12+
},
13+
"MD005": true,
14+
"MD006": true,
15+
"MD007": {
16+
"indent": 4
17+
},
18+
"MD009": false,
19+
"MD010": true,
20+
"MD011": true,
21+
"MD012": {
22+
"maximum": 2
23+
},
24+
"MD013": false,
25+
"MD014": false,
26+
"MD018": true,
27+
"MD019": true,
28+
"MD020": true,
29+
"MD021": true,
30+
"MD022": true,
31+
"MD023": true,
32+
"MD025": true,
33+
"MD026": {
34+
"punctuation": ".,;:!"
35+
},
36+
"MD027": true,
37+
"MD028": false,
38+
"MD029": false,
39+
"MD030": true,
40+
"MD031": true,
41+
"MD032": true,
42+
"MD033": false,
43+
"MD034": false,
44+
"MD035": {
45+
"style": "---"
46+
},
47+
"MD036": true,
48+
"MD037": true,
49+
"MD038": true,
50+
"MD039": true,
51+
"MD040": false,
52+
"MD041": false,
53+
"MD042": true,
54+
"MD043": false,
55+
"MD044": false,
56+
"MD045": false
57+
}

.nojekyll

Whitespace-only changes.

.travis.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)