-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from cloudfour/eleventy
Eleventy refactor
- Loading branch information
Showing
55 changed files
with
6,734 additions
and
2,160 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,55 @@ | ||
const fs = require("fs"); | ||
const pluginRss = require("@11ty/eleventy-plugin-rss"); | ||
|
||
module.exports = function(eleventyConfig) { | ||
|
||
// aliases for backwards support of jekyll layouts | ||
eleventyConfig.addLayoutAlias('blank', 'layouts/blank.html'); | ||
eleventyConfig.addLayoutAlias('error', 'layouts/error.html'); | ||
eleventyConfig.addLayoutAlias('default', 'layouts/default.html'); | ||
eleventyConfig.addLayoutAlias('permalink', 'layouts/permalink.html'); | ||
eleventyConfig.addLayoutAlias('post', 'layouts/post.html'); | ||
eleventyConfig.addLayoutAlias('tag', 'layouts/tag.html'); | ||
|
||
// configure post collection | ||
eleventyConfig.addCollection('post', collection => { | ||
return collection.getFilteredByGlob('_posts/*.md'); | ||
}); | ||
|
||
// non-template files that we want to serve | ||
eleventyConfig.addPassthroughCopy("images"); | ||
eleventyConfig.addPassthroughCopy("js"); | ||
eleventyConfig.addPassthroughCopy("main.css"); | ||
eleventyConfig.addPassthroughCopy("*.png"); | ||
eleventyConfig.addPassthroughCopy("favicon.ico"); | ||
eleventyConfig.addPassthroughCopy("manifest.json"); | ||
eleventyConfig.addPassthroughCopy("*.svg"); | ||
eleventyConfig.addPassthroughCopy("sw.js"); | ||
|
||
// 404 page for local server | ||
eleventyConfig.setBrowserSyncConfig({ | ||
callbacks: { | ||
ready: function(err, bs) { | ||
bs.addMiddleware("*", (req, res) => { | ||
const content_404 = fs.readFileSync('_site/404.html'); | ||
// Provides the 404 content without redirect. | ||
res.write(content_404); | ||
// Add 404 http status code in request header. | ||
// res.writeHead(404, { "Content-Type": "text/html" }); | ||
res.writeHead(404); | ||
res.end(); | ||
}); | ||
} | ||
} | ||
}); | ||
|
||
// register rss plugin | ||
eleventyConfig.addPlugin(pluginRss); | ||
|
||
return { | ||
dir: { | ||
input: "./", | ||
output: "./_site" | ||
} | ||
} | ||
} |
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,8 @@ | ||
Gemfile | ||
Gemfile.lock | ||
package.json | ||
LICENSE | ||
README.md | ||
node_modules | ||
scripts | ||
.github |
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 @@ | ||
14 |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -8,34 +8,31 @@ See [CONTRIBUTING.md](.github/CONTRIBUTING.md) | |
|
||
## Developing | ||
|
||
This site is built with [Jekyll](https://jekyllrb.com/docs/home/). | ||
This site is built with [Eleventy](https://www.11ty.dev/). | ||
|
||
### Quick start | ||
|
||
This project relies on [Ruby](https://www.ruby-lang.org/en/), [Node](https://nodejs.org/), and [npm](https://www.npmjs.com/). Before following these steps you'll need to [set up a Ruby dev environment](https://jekyllrb.com/docs/installation/) as well as [install node and npm](https://blog.npmjs.org/post/85484771375/how-to-install-npm) if you haven't already. | ||
This project relies on [Node](https://nodejs.org/), and [npm](https://www.npmjs.com/). Before following these steps you'll need to [install node and npm](https://blog.npmjs.org/post/85484771375/how-to-install-npm) if you haven't already. | ||
|
||
```sh | ||
git clone [email protected]:cloudfour/pwastats.git | ||
cd pwastats | ||
gem install bundler | ||
bundle install | ||
npm install | ||
``` | ||
Installation: | ||
|
||
1. Clone this repository. | ||
1. `cd` into the directory. | ||
1. Run `npm ci` to install dependencies. | ||
|
||
For local development: | ||
|
||
``` | ||
npm start | ||
``` | ||
This will compile the site into the \_site directory and run a local file server where you can preview the site: http://localhost:8080 | ||
|
||
For a single build: | ||
|
||
``` | ||
npm run build | ||
``` | ||
|
||
View the local site at http://localhost:4000. | ||
|
||
### Fetching an icon for a PWA | ||
|
||
```sh | ||
|
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,17 @@ | ||
{ | ||
"title": "PWA Stats", | ||
"email": "[email protected]", | ||
"description": "A collection of Progressive Web App case studies.", | ||
"repository": "cloudfour/pwastats", | ||
"baseurl": "", | ||
"url": "https://www.pwastats.com", | ||
"twitter_username": "cloudfour", | ||
"github_username": "cloudfour", | ||
"author": "PWA Community", | ||
"timezone": "America/Los_Angeles", | ||
"permalink": "/:year/:month/:title/", | ||
"github": { | ||
"repository_url": "https://github.com/cloudfour/pwastats", | ||
"issues_url": "https://github.com/cloudfour/pwastats/issues/new" | ||
} | ||
} |
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
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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,16 @@ | ||
--- | ||
layout: default | ||
--- | ||
|
||
<div class="u-containProse u-md-textGrow1"> | ||
{% include resource-item.html, | ||
title: title, | ||
content: content, | ||
date: page.date, | ||
permalink: page.url, | ||
slug: page.fileSlug, | ||
tags: tags, | ||
sourceURL: sourceURL, | ||
imageExt: imageExt | ||
%} | ||
</div> |
File renamed without changes.
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
Oops, something went wrong.