From 269ddc89139d178a27b6945f2ddaa5fa826854e8 Mon Sep 17 00:00:00 2001 From: "Aaron S. Hawley" Date: Thu, 14 Feb 2019 09:38:50 -0500 Subject: [PATCH 1/5] Add pixyll.gemspec --- .gitignore | 1 + .travis.yml | 23 +++++++++++++++++++++++ Gemfile | 5 +---- README.md | 41 ++++++++++++++++++++++++++++++++++++++++- _config.yml | 2 ++ appveyor.yml | 16 +++++++++++++++- pixyll.gemspec | 24 ++++++++++++++++++++++++ 7 files changed, 106 insertions(+), 6 deletions(-) create mode 100644 pixyll.gemspec diff --git a/.gitignore b/.gitignore index 259ce50e12..428ca56760 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ _site _config.gh-pages.yml Gemfile.lock +*.gem \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index c6c220f10d..687a67deb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,16 @@ rvm: - 2.4 - 2.5 - 2.6 +env: + - JEKYLL_VERSION: "~> 3.4.5" + - JEKYLL_VERSION: "~> 3.5.2" + - JEKYLL_VERSION: "~> 3.6.3" + - JEKYLL_VERSION: "~> 3.7.4" + - JEKYLL_VERSION: "~> 3.8" +before_install: + - gem install --no-document -v "${JEKYLL_VERSION}" jekyll script: + - bundle exec jekyll --version - bundle exec jekyll build - rake 'draft[Hello\, world]' - rake undraft[hello-world.md] @@ -15,3 +24,17 @@ script: - grep pagination-item _site/index.html - grep johnotander/pixyll _site/css/pixyll.css - grep 404 _site/404.html + - gem build pixyll.gemspec + - bundle exec jekyll new pixyll-example + - cd pixyll-example + - bundle install + - mv index.md index.html + - "sed -i~ -e 's/layout: home/layout: default/' index.html" + - "echo paginate: 1 >> _config.yml" + - "sed -i~ -e 's/minima/pixyll/' _config.yml" + - "sed -i~ -e '/^gems:/a\\\n\\ \\ -\\ jekyll-paginate\n' _config.yml" + - "sed -i~ -e '/^plugins:/a\\\n\\ \\ -\\ jekyll-paginate\n' _config.yml" + - "sed -i~ -e 's/minima/pixyll/' Gemfile" + - "sed -i~ -e '/the default theme/d' Gemfile" + - bundle exec jekyll build + - grep pixyll _site/index.html diff --git a/Gemfile b/Gemfile index 6c0a58801c..023cd9bf7d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,3 @@ source 'https://rubygems.org' - -# A simple Ruby Gem to bootstrap dependencies for setting up and -# maintaining a local Jekyll environment in sync with GitHub Pages -# https://github.com/github/pages-gem +gemspec gem 'github-pages' diff --git a/README.md b/README.md index ed6930ee08..eabac4af1f 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,29 @@ This Jekyll theme was crafted with <3 by [John Otander](http://johnotander.com) If you're completely new to Jekyll, I recommend checking out the documentation at or there's a tutorial by [Smashing Magazine](http://www.smashingmagazine.com/2014/08/01/build-blog-jekyll-github-pages/). ``` -$ git clone git@github.com:johnotander/pixyll.git +$ git clone -o upstream git@github.com:johnotander/pixyll.git $ cd pixyll $ gem install bundler # If you don't have bundler installed $ bundle install ``` +Alternatively, if want to install the theme as a Gem, you can add this +line to your Gemfile: + +```ruby +gem "pixyll" +``` + +Then, add this line to your Jekyll site: + +```yaml +theme: pixyll +``` + +And then execute: + + $ bundle install + #### Verify your Jekyll version It's important to also check your version of Jekyll since this project uses new `baseurl` features that are [only supported in 3.3+](https://jekyllrb.com/news/2016/10/06/jekyll-3-3-is-here/). @@ -32,6 +49,13 @@ It's important to also check your version of Jekyll since this project uses new Fork the repo, and then clone it so you've got the code locally. +If `git remote -v` doesn't have your fork listed, you can do the following to add it: + +``` +git remote add origin git@github.com:USER/pixyll.git +``` + +Where `USER` above is your GitHub user name. ### Modify the `_config.yml` @@ -67,6 +91,21 @@ Now you can navigate to `localhost:4000` in your browser to see the site. You can host your Jekyll site for free with Github Pages. [Click here](https://pages.github.com/) for more information. +If you are using the gem (see above), then you need to add the the +github-pages gem to your Gemfile: + +```ruby +gem 'github-pages' +``` + +Alternatively, you can enable Pixyll on Githug Pages using the `remote_theme` feature, by adding this line to your `_config.yml`: + +```yml +remote_theme: johno/pixyll +``` + +See [Adding a Jekyll theme to your GitHub pages](https://help.github.com/articles/adding-a-jekyll-theme-to-your-github-pages-site). + #### A configuration tweak if you're using a gh-pages sub-folder In addition to your github-username.github.io repo that maps to the root url, you can serve up sites by using a gh-pages branch for other repos so they're available at github-username.github.io/repo-name. diff --git a/_config.yml b/_config.yml index 1c1dbae1ca..e00d0a12a4 100644 --- a/_config.yml +++ b/_config.yml @@ -126,3 +126,5 @@ exclude: - Gemfile - Gemfile.lock - vendor + - pixyll.gemspec + - '*.gem' diff --git a/appveyor.yml b/appveyor.yml index 64545ee8b8..76515840b4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,19 @@ # appveyor.yml environment: - RUBY_VERSION: 25 + matrix: + - RUBY_VERSION: 24 + JEKYLL_VERSION: "~> 3.5.2" + - RUBY_VERSION: 24 + JEKYLL_VERSION: "~> 3.6.3" + - RUBY_VERSION: 25 + JEKYLL_VERSION: "~> 3.6.3" + - RUBY_VERSION: 25 + JEKYLL_VERSION: "~> 3.7.4" + - RUBY_VERSION: 26 + JEKYLL_VERSION: "~> 3.7.4" + - RUBY_VERSION: 26 + JEKYLL_VERSION: "~> 3.8" platform: - x64 @@ -9,6 +21,7 @@ platform: install: - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH% - bundle install + - gem install --no-document -v "%JEKYLL_VERSION%" jekyll before_build: - ruby -v @@ -21,3 +34,4 @@ build_script: - bundle exec jekyll build - rake 'draft[Hello\, world]' - rake undraft[hello-world.md] + - gem build pixyll.gemspec diff --git a/pixyll.gemspec b/pixyll.gemspec new file mode 100644 index 0000000000..b0f4255cac --- /dev/null +++ b/pixyll.gemspec @@ -0,0 +1,24 @@ +# coding: utf-8 + +Gem::Specification.new do |spec| + spec.name = "pixyll" + spec.version = "3.0.0" + spec.authors = ["John Otander"] + spec.email = ["johnotander@gmail.com"] + + spec.summary = %q{A simple, beautiful Jekyll theme that's mobile first.} + spec.homepage = "http://pixyll.com" + spec.license = "MIT" + + spec.metadata["plugin_type"] = "theme" + + spec.files = `git ls-files -z`.split("\x0").select do |f| + f.match(%r{^((_includes|_layouts|_sass|css)/|Rakefile|(LICENSE|README)((\.(txt|md|markdown)|$)))}i) + end + + spec.add_runtime_dependency "jekyll", "~> 3.3" + spec.add_runtime_dependency "jekyll-paginate", "~> 1.1" + spec.add_development_dependency "bundler", ">= 1.12" + spec.add_development_dependency "rake", "~> 10.0" + +end From 8c4c1c4785838836f6d7aa8746a5df3cdf339d54 Mon Sep 17 00:00:00 2001 From: "Aaron S. Hawley" Date: Thu, 14 Feb 2019 11:27:24 -0500 Subject: [PATCH 2/5] Move pixyll.scss to assets/css/main.scss --- .travis.yml | 2 +- _includes/head.html | 2 +- css/pixyll.scss => assets/css/main.scss | 0 pixyll.gemspec | 2 +- sw.js | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename css/pixyll.scss => assets/css/main.scss (100%) diff --git a/.travis.yml b/.travis.yml index 687a67deb0..54dc95c920 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ script: - grep johnotander/pixyll _site/index.html - grep post-title _site/index.html - grep pagination-item _site/index.html - - grep johnotander/pixyll _site/css/pixyll.css + - grep johnotander/pixyll _site/assets/css/main.css - grep 404 _site/404.html - gem build pixyll.gemspec - bundle exec jekyll new pixyll-example diff --git a/_includes/head.html b/_includes/head.html index 79c9dd00f9..619fbe424d 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -24,7 +24,7 @@ - + {% if site.extended_fonts %} diff --git a/css/pixyll.scss b/assets/css/main.scss similarity index 100% rename from css/pixyll.scss rename to assets/css/main.scss diff --git a/pixyll.gemspec b/pixyll.gemspec index b0f4255cac..ef88ae7654 100644 --- a/pixyll.gemspec +++ b/pixyll.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |spec| spec.metadata["plugin_type"] = "theme" spec.files = `git ls-files -z`.split("\x0").select do |f| - f.match(%r{^((_includes|_layouts|_sass|css)/|Rakefile|(LICENSE|README)((\.(txt|md|markdown)|$)))}i) + f.match(%r{^((_includes|_layouts|_sass|assets)/|Rakefile|(LICENSE|README)((\.(txt|md|markdown)|$)))}i) end spec.add_runtime_dependency "jekyll", "~> 3.3" diff --git a/sw.js b/sw.js index d6d0b7b9ee..5046ad651a 100644 --- a/sw.js +++ b/sw.js @@ -7,7 +7,7 @@ self.addEventListener("install", function(e) { e.waitUntil( caches.open(CACHE_NAME).then(function(cache) { return cache.addAll([ - "{{ '/css/pixyll.css' | relative_url }}?{{ site.time | date: '%Y%m%d%H%M' }}", + "{{ '/assets/css/main.css' | relative_url }}?{{ site.time | date: '%Y%m%d%H%M' }}", "{{ '/' | relative_url }}" ]); }) From 3cecf2343b9a9cf36e784bd77579afb33843e498 Mon Sep 17 00:00:00 2001 From: "Aaron S. Hawley" Date: Sat, 16 Feb 2019 00:48:58 -0500 Subject: [PATCH 3/5] Move index.html to _layouts/home.html --- .travis.yml | 11 ++++++++++- _layouts/home.html | 34 ++++++++++++++++++++++++++++++++++ index.html | 33 +-------------------------------- 3 files changed, 45 insertions(+), 33 deletions(-) create mode 100644 _layouts/home.html diff --git a/.travis.yml b/.travis.yml index 54dc95c920..87953c415c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,12 +29,21 @@ script: - cd pixyll-example - bundle install - mv index.md index.html - - "sed -i~ -e 's/layout: home/layout: default/' index.html" - "echo paginate: 1 >> _config.yml" - "sed -i~ -e 's/minima/pixyll/' _config.yml" - "sed -i~ -e '/^gems:/a\\\n\\ \\ -\\ jekyll-paginate\n' _config.yml" - "sed -i~ -e '/^plugins:/a\\\n\\ \\ -\\ jekyll-paginate\n' _config.yml" - "sed -i~ -e 's/minima/pixyll/' Gemfile" - "sed -i~ -e '/the default theme/d' Gemfile" + - "echo --- > _posts/$(date -u +'%Y-%m-%d')-hello-world.md" + - "echo layout: post >> _posts/$(date -u '+%Y-%m-%d')-hello-world.md" + - "echo title: Hello, world >> _posts/$(date -u '+%Y-%m-%d')-hello-world.md" + - "echo -n 'date: ' >> _posts/$(date -u '+%Y-%m-%d')-hello-world.md" + - "echo $(date -u +'%Y-%m-%d %H:%M:%S +0000') >> _posts/$(date -u '+%Y-%m-%d')-hello-world.md" + - "echo --- >> _posts/$(date -u '+%Y-%m-%d')-hello-world.md" + - "echo 'Hello, world!' >> _posts/$(date -u '+%Y-%m-%d')-hello-world.md" - bundle exec jekyll build - grep pixyll _site/index.html + - grep post-title _site/index.html + - grep pagination-item _site/index.html + - grep Newer _site/index.html diff --git a/_layouts/home.html b/_layouts/home.html new file mode 100644 index 0000000000..12083175fa --- /dev/null +++ b/_layouts/home.html @@ -0,0 +1,34 @@ +--- +layout: default +--- +{% assign posts_count = paginator.posts | size %} + +
+ {% if posts_count > 0 %} +
+ {% for post in paginator.posts %} +
+ +

{{ post.title }}

+ + {% if post.summary %} + {{ post.summary }} + {% else %} + {{ post.excerpt }} + {% endif %} + +
+ {% endfor %} +
+ + {% include pagination.html %} + {% else %} +

{{ site.text.index.coming_soon | default: "Coming soon..." }}

+ {% endif %} +
diff --git a/index.html b/index.html index f7d227b90c..e4d427d215 100644 --- a/index.html +++ b/index.html @@ -1,34 +1,3 @@ --- -layout: default +layout: home --- -{% assign posts_count = paginator.posts | size %} - -
- {% if posts_count > 0 %} -
- {% for post in paginator.posts %} -
- -

{{ post.title }}

- - {% if post.summary %} - {{ post.summary }} - {% else %} - {{ post.excerpt }} - {% endif %} - -
- {% endfor %} -
- - {% include pagination.html %} - {% else %} -

{{ site.text.index.coming_soon }}

- {% endif %} -
From 9b1fa01721672554c4c84b634ea18472afa5e936 Mon Sep 17 00:00:00 2001 From: "Aaron S. Hawley" Date: Fri, 22 Feb 2019 19:50:20 -0500 Subject: [PATCH 4/5] Move favicons to assets/img --- _includes/head.html | 30 +++++++++--------- .../img/apple-touch-icon-114x114.png | Bin .../img/apple-touch-icon-120x120.png | Bin .../img/apple-touch-icon-144x144.png | Bin .../img/apple-touch-icon-152x152.png | Bin .../img/apple-touch-icon-180x180.png | Bin .../img/apple-touch-icon-57x57.png | Bin .../img/apple-touch-icon-60x60.png | Bin .../img/apple-touch-icon-72x72.png | Bin .../img/apple-touch-icon-76x76.png | Bin .../img/apple-touch-icon.png | Bin .../img/favicon-160x160.png | Bin .../img/favicon-16x16.png | Bin .../img/favicon-192x192.png | Bin .../img/favicon-32x32.png | Bin .../img/favicon-96x96.png | Bin favicon.ico => assets/img/favicon.ico | Bin 17 files changed, 15 insertions(+), 15 deletions(-) rename apple-touch-icon-114x114.png => assets/img/apple-touch-icon-114x114.png (100%) rename apple-touch-icon-120x120.png => assets/img/apple-touch-icon-120x120.png (100%) rename apple-touch-icon-144x144.png => assets/img/apple-touch-icon-144x144.png (100%) rename apple-touch-icon-152x152.png => assets/img/apple-touch-icon-152x152.png (100%) rename apple-touch-icon-180x180.png => assets/img/apple-touch-icon-180x180.png (100%) rename apple-touch-icon-57x57.png => assets/img/apple-touch-icon-57x57.png (100%) rename apple-touch-icon-60x60.png => assets/img/apple-touch-icon-60x60.png (100%) rename apple-touch-icon-72x72.png => assets/img/apple-touch-icon-72x72.png (100%) rename apple-touch-icon-76x76.png => assets/img/apple-touch-icon-76x76.png (100%) rename apple-touch-icon.png => assets/img/apple-touch-icon.png (100%) rename favicon-160x160.png => assets/img/favicon-160x160.png (100%) rename favicon-16x16.png => assets/img/favicon-16x16.png (100%) rename favicon-192x192.png => assets/img/favicon-192x192.png (100%) rename favicon-32x32.png => assets/img/favicon-32x32.png (100%) rename favicon-96x96.png => assets/img/favicon-96x96.png (100%) rename favicon.ico => assets/img/favicon.ico (100%) diff --git a/_includes/head.html b/_includes/head.html index 619fbe424d..6b6140e1b0 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -79,21 +79,21 @@ {% endif %} - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + {% if site.google_analytics %}