commit c86db0c9ce0e15e12278edb9f913ea1b6f0d40b9 Author: Zach Leatherman Date: Tue Jan 16 21:08:47 2018 -0600 Initial commit. diff --git a/.eleventy.js b/.eleventy.js new file mode 100644 index 0000000..1d473a6 --- /dev/null +++ b/.eleventy.js @@ -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; + } + } + }; +}; \ No newline at end of file diff --git a/.eleventyignore b/.eleventyignore new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/.eleventyignore @@ -0,0 +1 @@ +README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ab338d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +_site/ +node_modules/ +package-lock.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..4bddb8f --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# eleventy-base-blog + +A starter repository for eleventy static site generator projects. diff --git a/_data/metadata.json b/_data/metadata.json new file mode 100644 index 0000000..930064f --- /dev/null +++ b/_data/metadata.json @@ -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": "zachleat@zachleat.com" + } +} \ No newline at end of file diff --git a/_includes/layouts/base.njk b/_includes/layouts/base.njk new file mode 100644 index 0000000..adc49cb --- /dev/null +++ b/_includes/layouts/base.njk @@ -0,0 +1,26 @@ + + + + + + {{ title }} + + + + +
+ +
+ + {{ layoutContent | safe }} + + + + \ No newline at end of file diff --git a/_includes/layouts/home.njk b/_includes/layouts/home.njk new file mode 100644 index 0000000..90e3e94 --- /dev/null +++ b/_includes/layouts/home.njk @@ -0,0 +1,7 @@ +--- +layout: layouts/base.njk +templateClass: tmpl-home +--- +

My Blog

+ +{{ layoutContent | safe }} diff --git a/_includes/layouts/post.njk b/_includes/layouts/post.njk new file mode 100644 index 0000000..b45a371 --- /dev/null +++ b/_includes/layouts/post.njk @@ -0,0 +1,12 @@ +--- +layout: layouts/base.njk +templateClass: tmpl-post +--- +

{{ title }}

+ +{{ layoutContent | safe }} + +

Posts:

+ +{% import "postlist.njk" as postsm %} +{{ postsm.list(collections.post, page.url) }} diff --git a/_includes/postlist.njk b/_includes/postlist.njk new file mode 100644 index 0000000..7722235 --- /dev/null +++ b/_includes/postlist.njk @@ -0,0 +1,13 @@ +{% macro list(posts, url) %} + +{% endmacro %} \ No newline at end of file diff --git a/about/index.md b/about/index.md new file mode 100644 index 0000000..8748f70 --- /dev/null +++ b/about/index.md @@ -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. \ No newline at end of file diff --git a/css/index.css b/css/index.css new file mode 100644 index 0000000..da29745 --- /dev/null +++ b/css/index.css @@ -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; +} \ No newline at end of file diff --git a/feed/feed.njk b/feed/feed.njk new file mode 100644 index 0000000..f044575 --- /dev/null +++ b/feed/feed.njk @@ -0,0 +1,25 @@ +--- +permalink: feed/atom.xml +--- + + + {{ metadata.title }} + {{ metadata.subtitle }} + + + {{ collections.post | lastUpdatedDate }} + {{ metadata.id }} + + {{ metadata.author.name }} + {{ metadata.author.email }} + + {% for post in collections.post %} + + {{ post.data.title }} + + {{ post.date | rssDate }} + {{ metadata.url }}{{ post.url }} + {{ post.templateContent }} + + {% endfor %} + \ No newline at end of file diff --git a/feed/htaccess.njk b/feed/htaccess.njk new file mode 100644 index 0000000..a91bb00 --- /dev/null +++ b/feed/htaccess.njk @@ -0,0 +1,5 @@ +--- +permalink: feed/.htaccess +--- +# For Apache, to show `atom.xml` when browsing to directory /feed/ (hide the file!) +DirectoryIndex atom.xml \ No newline at end of file diff --git a/img/logo.png b/img/logo.png new file mode 100644 index 0000000..45ec594 Binary files /dev/null and b/img/logo.png differ diff --git a/index.njk b/index.njk new file mode 100644 index 0000000..e6f000e --- /dev/null +++ b/index.njk @@ -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) }} + diff --git a/package.json b/package.json new file mode 100644 index 0000000..bdcbf21 --- /dev/null +++ b/package.json @@ -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": "zachleatherman@gmail.com", + "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" + } +} diff --git a/posts/firstpost.md b/posts/firstpost.md new file mode 100644 index 0000000..1fe5497 --- /dev/null +++ b/posts/firstpost.md @@ -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. \ No newline at end of file diff --git a/posts/secondpost.md b/posts/secondpost.md new file mode 100644 index 0000000..bbaa46b --- /dev/null +++ b/posts/secondpost.md @@ -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. \ No newline at end of file diff --git a/posts/thirdpost.md b/posts/thirdpost.md new file mode 100644 index 0000000..ee280f7 --- /dev/null +++ b/posts/thirdpost.md @@ -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. \ No newline at end of file