-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c86db0c
Showing
19 changed files
with
268 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const { DateTime } = require("luxon"); | ||
|
||
function dateToISO(str) { | ||
return DateTime.fromJSDate(str).toISO({ includeOffset: true, suppressMilliseconds: true }); | ||
} | ||
|
||
module.exports = function(config) { | ||
return { | ||
templateFormats: [ | ||
"md", | ||
"njk", | ||
"html", | ||
"png", | ||
"css" | ||
], | ||
markdownTemplateEngine: "njk", | ||
htmlTemplateEngine: "njk", | ||
dataTemplateEngine: "njk", | ||
passthroughFileCopy: true, | ||
dir: { | ||
input: ".", | ||
includes: "_includes", | ||
data: "_data", | ||
output: "_site" | ||
}, | ||
nunjucksFilters: { | ||
lastUpdatedDate: collection => { | ||
// Newest date in the collection | ||
return dateToISO(collection[ collection.length - 1 ].date); | ||
}, | ||
rssDate: dateObj => { | ||
return dateToISO(dateObj); | ||
}, | ||
absoluteUrl: url => { | ||
// If your blog lives in a subdirectory, change this: | ||
let rootDir = "/"; | ||
if( !url || url === "/" ) { | ||
return rootDir; | ||
} | ||
return rootDir + url; | ||
} | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_site/ | ||
node_modules/ | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# eleventy-base-blog | ||
|
||
A starter repository for eleventy static site generator projects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"title": "Eleventy, the Blog", | ||
"subtitle": "This is a sample project to showcase the Eleventy Static Site Generator.", | ||
"feedurl": "https://11ty.io/feed/", | ||
"url": "https://11ty.io/", | ||
"id": "https://11ty.io/", | ||
"author": { | ||
"name": "Zach Leatherman", | ||
"email": "[email protected]" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!doctype html> | ||
<html lang="en"{% if templateClass %} class="{{ templateClass }}"{% endif %}> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>{{ title }}</title> | ||
<link rel="stylesheet" href="/css/index.css"> | ||
<link rel="stylesheet" href="/posts/posts.css"> | ||
</head> | ||
<body> | ||
<header> | ||
<a href="/""><img src="/img/logo.png" class="logo"></a> | ||
<ul class="nav"> | ||
{%- for nav in collections.nav -%} | ||
<li class="nav-item"><a href="{{ nav.url | absoluteUrl }}">{{ nav.data.navtitle }}</a></li> | ||
{%- endfor -%} | ||
</header> | ||
{{ layoutContent | safe }} | ||
<footer> | ||
<p><em><a href="/feed/">Subscribe to my feed</a></em></p> | ||
<p><em>Current page: <code>{{ page.url }}</code></em></p> | ||
</footer> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
layout: layouts/base.njk | ||
templateClass: tmpl-home | ||
--- | ||
<h1>My Blog</h1> | ||
|
||
{{ layoutContent | safe }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
layout: layouts/base.njk | ||
templateClass: tmpl-post | ||
--- | ||
<h1>{{ title }}</h1> | ||
|
||
{{ layoutContent | safe }} | ||
|
||
<h2>Posts: </h2> | ||
|
||
{% import "postlist.njk" as postsm %} | ||
{{ postsm.list(collections.post, page.url) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% macro list(posts, url) %} | ||
<ul> | ||
{%- for post in posts -%} | ||
<li{% if post.url == url %} class="post-active"{% endif %}> | ||
<a href="{{ post.url | absoluteUrl }}">{{ post.data.title }}</a> | ||
Tags: {{ post.data.tags | join(", ") }} | ||
{%- if post.url == url %} | ||
(You are here) | ||
{% endif -%} | ||
</li> | ||
{%- endfor -%} | ||
</ul> | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
layout: layouts/home.njk | ||
title: About Me | ||
tags: nav | ||
navtitle: About | ||
templateClass: tmpl-page | ||
--- | ||
## About Me | ||
|
||
I am a person that writes stuff. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
p { | ||
max-width: 37.5em; /* 600px /16 */ | ||
} | ||
|
||
/* Logo */ | ||
.logo { | ||
max-width: 12.5em; /* 200px /16 */ | ||
} | ||
.tmpl-page .logo, | ||
.tmpl-post .logo { | ||
max-width: 8.75em; /* 140px /16 */ | ||
} | ||
@media (min-width: 31.25em) { /* 500px */ | ||
.tmpl-page .logo, | ||
.tmpl-post .logo { | ||
position: absolute; | ||
right: 1em; | ||
top: 1em; | ||
} | ||
.tmpl-page body, | ||
.tmpl-post body { | ||
padding-right: 10em; /* 160px /16 */ | ||
} | ||
} | ||
/* Nav */ | ||
.nav { | ||
padding: 0; | ||
list-style: none; | ||
} | ||
.nav-item { | ||
display: inline-block; | ||
margin-right: 1em; | ||
} | ||
/* Posts list */ | ||
.post-active { | ||
font-weight: bold; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
permalink: feed/atom.xml | ||
--- | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<feed xmlns="http://www.w3.org/2005/Atom"> | ||
<title>{{ metadata.title }}</title> | ||
<subtitle>{{ metadata.subtitle }}</subtitle> | ||
<link href="{{ metadata.feedurl }}" rel="self"/> | ||
<link href="{{ metadata.url }}"/> | ||
<updated>{{ collections.post | lastUpdatedDate }}</updated> | ||
<id>{{ metadata.id }}</id> | ||
<author> | ||
<name>{{ metadata.author.name }}</name> | ||
<email>{{ metadata.author.email }}</email> | ||
</author> | ||
{% for post in collections.post %} | ||
<entry> | ||
<title>{{ post.data.title }}</title> | ||
<link href="{{ metadata.url }}{{ post.url }}"/> | ||
<updated>{{ post.date | rssDate }}</updated> | ||
<id>{{ metadata.url }}{{ post.url }}</id> | ||
<content type="html">{{ post.templateContent }}</content> | ||
</entry> | ||
{% endfor %} | ||
</feed> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
permalink: feed/.htaccess | ||
--- | ||
# For Apache, to show `atom.xml` when browsing to directory /feed/ (hide the file!) | ||
DirectoryIndex atom.xml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
layout: layouts/home.njk | ||
title: My Blog | ||
tags: nav | ||
navtitle: Home | ||
--- | ||
{% import "postlist.njk" as postsm %} | ||
{{ postsm.list(collections.post, page) }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "eleventy-base-blog", | ||
"version": "1.0.0", | ||
"description": "A starter repository for a blog web site using the Eleventy static site generator.", | ||
"scripts": { | ||
"build": "npx eleventy", | ||
"build-debug": "DEBUG=* npx eleventy", | ||
"build-debug-watch": "DEBUG=* npx eleventy --watch" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/11ty/eleventy-base-blog.git" | ||
}, | ||
"author": { | ||
"name": "Zach Leatherman", | ||
"email": "[email protected]", | ||
"url": "https://zachleat.com/" | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/11ty/eleventy-base-blog/issues" | ||
}, | ||
"homepage": "https://github.com/11ty/eleventy-base-blog#readme", | ||
"devDependencies": { | ||
"@11ty/eleventy": "^0.2.7", | ||
"luxon": "^0.3.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: This is my first post. | ||
tags: | ||
- post | ||
- another-tag | ||
layout: layouts/post.njk | ||
--- | ||
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. | ||
|
||
Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. | ||
|
||
Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: This is my second post. | ||
tags: | ||
- post | ||
layout: layouts/post.njk | ||
--- | ||
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. | ||
|
||
Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. | ||
|
||
Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: This is my third post. | ||
tags: | ||
- post | ||
layout: layouts/post.njk | ||
--- | ||
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. | ||
|
||
Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring. | ||
|
||
Capitalize on low hanging fruit to identify a ballpark value added activity to beta test. Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line. |