Skip to content
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
12 changes: 12 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
const moment = require("moment");

moment.locale("en");

module.exports = function(eleventyConfig) {
eleventyConfig.addFilter("dateIso", date => {
return moment(date).toISOString();
});

eleventyConfig.addFilter("dateReadable", date => {
return moment(date).format("LL"); // E.g. May 31, 2019
});

eleventyConfig.addPassthroughCopy("css");
eleventyConfig.addPassthroughCopy("js");
eleventyConfig.addPassthroughCopy("CNAME");
Expand Down
14 changes: 14 additions & 0 deletions _data/authors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"john": {
"name": "John Behan",
"link": "/about/#john"
},
"ian": {
"name": "Ian Read",
"link": "/about/#ian"
},
"donovan": {
"name": "Donovan Hutchinson",
"link": "/about/#donovan"
}
}
68 changes: 68 additions & 0 deletions _includes/base.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: OpenJS NodeJS Application Developer Study Guide
---
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }}</title>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.css">
<link rel="stylesheet" href="{{ "/css/main.css" | url }}">
<link rel="stylesheet"
href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.16.2/build/styles/default.min.css">
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.16.2/build/highlight.min.js"></script>
<script>
hljs.initHighlightingOnLoad();
</script>
<script src="{{ "/js/main.js" | url }}"></script>
</head>
<body>
<header class="container">
<div class="row">
<div class="column column-50">
<h1 class="logo">
<a href="/">ONAD Study Guide</a>
</h1>
</div>
<div class="top-links column column-50">
<ul>
<li>
<a href="https://training.linuxfoundation.org/certification/jsnad/" target="_blank" title="OpenJS Node.js Application Developer (JSNAD)">JSNAD Certification</a>
</li>
</ul>
</div>
</div>
</header>
<main class="container">
<div class="row">
<div class="sidebar column">
<nav>
<ul class="topics">
{% for topic in topics %}
<li data-topic="{{topic.url}}">
<a href="{{ topic.url | url }}" {% if page.url === topic.url %} class="current" {% endif %}>{{topic.title}}</a>
</li>
{% endfor %}
</ul>
</nav>
</div>
<div class="main-content column column-75">
{{ content | safe }}
</div>
</div>
</main>
<footer class="container">
<div class="row">
<div class="column column-75 column-offset-25">
<p>
<a href="https://github.com/Node-Study-Guide/openjs-nodejs-application-developer-study-guide/tree/master/{{ page.inputPath }}">Edit this page on GitHub</a>
</p>
</div>
</div>

</footer>
</body>
</html>
65 changes: 6 additions & 59 deletions _includes/default.njk
Original file line number Diff line number Diff line change
@@ -1,61 +1,8 @@
---
title: OpenJS NodeJS Application Developer Study Guide
layout: base.njk
templateClass: tmpl-post
---
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }}</title>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.css">
<link rel="stylesheet" href="{{ "/css/main.css" | url }}">
<link rel="stylesheet"
href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.16.2/build/styles/default.min.css">
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.16.2/build/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="{{ "/js/main.js" | url }}"></script>
</head>
<body>
<header class="container">
<div class="row">
<div class="column column-50">
<h1 class="logo"><a href="/">ONAD Study Guide</a></h1>
</div>
<div class="top-links column column-50">
<ul>
<li><a href="https://training.linuxfoundation.org/certification/jsnad/" target="_blank" title="OpenJS Node.js Application Developer (JSNAD)">JSNAD Certification</a></li>
</ul>
</div>
</div>
</header>
<main class="container">
<div class="row">
<div class="sidebar column">
<nav>
<ul class="topics">
{% for topic in topics %}
<li data-topic="{{topic.url}}">
<a href="{{ topic.url | url }}" {% if page.url === topic.url %} class="current" {% endif %}>{{topic.title}}</a>
</li>
{% endfor %}
</ul>
</nav>
</div>
<div class="main-content column column-75">
<h1>{{ title }}</h1>
{{ content | safe }}
</div>
</div>
</main>
<footer class="container">
<div class="row">
<div class="column column-75 column-offset-25">
<p><a href="https://github.com/Node-Study-Guide/openjs-nodejs-application-developer-study-guide/tree/master/{{ page.inputPath }}">Edit this page on GitHub</a></p>
</div>
</div>

</footer>
</body>
</html>

<h1>{{ title }}</h1>

{{ content | safe }}
11 changes: 10 additions & 1 deletion _includes/post.njk
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
---
layout: default.njk
layout: base.njk
templateClass: tmpl-post
---

<h1>{{ title }}</h1>

<p class="metadata">
<span class="author">Author: <a href="{{ authors[author].link | url }}">{{authors[author].name}}</a>
</span>
<br/>
<time datetime="{{ date | dateIso }}">{{ date | dateReadable }}</time>
</p>

{{ content | safe }}

<h3>Ready to mark {{title}} as completed?</h3>
Expand Down
2 changes: 2 additions & 0 deletions events/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
layout: post.njk
title: Events
url: events
author: ian
date: 2019-11-09
---

The Node.js core API is built around the idea of events being "emitted" and "listened" to. Objects called "emitters" emit _named_ events, that are picked up by "listener" functions.
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@11ty/eleventy": "^0.9.0"
},
"devDependencies": {
"gh-pages": "^2.1.1"
"gh-pages": "^2.1.1",
"moment": "^2.24.0"
}
}