diff --git a/.eleventy.js b/.eleventy.js new file mode 100644 index 0000000..fdbf75c --- /dev/null +++ b/.eleventy.js @@ -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" + } + } +} diff --git a/.eleventyignore b/.eleventyignore new file mode 100644 index 0000000..376dbf5 --- /dev/null +++ b/.eleventyignore @@ -0,0 +1,8 @@ +Gemfile +Gemfile.lock +package.json +LICENSE +README.md +node_modules +scripts +.github diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..8351c19 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +14 diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 712388c..0000000 --- a/Gemfile +++ /dev/null @@ -1,25 +0,0 @@ -source "https://rubygems.org" -ruby "~> 2.0" - -# Hello! This is where you manage which Jekyll version is used to run. -# When you want to use a different version, change it below, save the -# file and run `bundle install`. Run Jekyll with `bundle exec`, like so: -# -# bundle exec jekyll serve -# -# This will help ensure the proper Jekyll version is running. -# Happy Jekylling! -gem "jekyll", ">= 3.4.2" - -# If you want to use GitHub Pages, remove the "gem "jekyll"" above and -# uncomment the line below. To upgrade, run `bundle update github-pages`. -# gem "github-pages", group: :jekyll_plugins - -# If you have any plugins, put them here! -group :jekyll_plugins do - gem "jekyll-feed", "~> 0.6" - gem "jekyll-paginate" -end - -# Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index f0ed9d1..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,70 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) - colorator (1.1.0) - concurrent-ruby (1.1.5) - em-websocket (0.5.1) - eventmachine (>= 0.12.9) - http_parser.rb (~> 0.6.0) - eventmachine (1.2.7) - ffi (1.12.1) - forwardable-extended (2.6.0) - http_parser.rb (0.6.0) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - jekyll (3.8.4) - addressable (~> 2.4) - colorator (~> 1.0) - em-websocket (~> 0.5) - i18n (~> 0.7) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 2.0) - kramdown (~> 1.14) - liquid (~> 4.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (>= 1.7, < 4) - safe_yaml (~> 1.0) - jekyll-feed (0.10.0) - jekyll (~> 3.3) - jekyll-paginate (1.1.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) - jekyll-watch (2.2.1) - listen (~> 3.0) - kramdown (1.17.0) - liquid (4.0.3) - listen (3.2.1) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.3.6) - pathutil (0.16.2) - forwardable-extended (~> 2.6) - public_suffix (4.0.3) - rb-fsevent (0.10.3) - rb-inotify (0.10.1) - ffi (~> 1.0) - rouge (3.15.0) - safe_yaml (1.0.5) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - -PLATFORMS - ruby - -DEPENDENCIES - jekyll (>= 3.4.2) - jekyll-feed (~> 0.6) - jekyll-paginate - tzinfo-data - -RUBY VERSION - ruby 2.3.2p217 - -BUNDLED WITH - 1.16.2 diff --git a/README.md b/README.md index c39e86c..cd30c79 100644 --- a/README.md +++ b/README.md @@ -8,25 +8,24 @@ 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 git@github.com: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: @@ -34,8 +33,6 @@ For a single build: npm run build ``` -View the local site at http://localhost:4000. - ### Fetching an icon for a PWA ```sh diff --git a/_data/site.json b/_data/site.json new file mode 100644 index 0000000..344aaf8 --- /dev/null +++ b/_data/site.json @@ -0,0 +1,17 @@ +{ + "title": "PWA Stats", + "email": "info@cloudfour.com", + "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" + } +} diff --git a/_includes/footer.html b/_includes/footer.html index 45aa73f..8bc326e 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -5,7 +5,7 @@ Cloud Four, Inc.
- 208 SW 1st Ave, Suite 240
+ 510 SW 3rd Ave, Suite 420
Portland, Oregon 97204 USA