Skip to content

Commit

Permalink
Archives, improved generation and more
Browse files Browse the repository at this point in the history
Updated the _config files to help with incremental regeneration so you
don't have to fully rebuild the site all the time. Also added the
jekyll-archives gem to Jekyll with proper settings and some small
beginnings for the layouts.

Updated the atom.xml file to be more up to par and validate correctly
and added a small "Hello world!" log to one of the JS files so you can
see that it is included properly in the JS console.
  • Loading branch information
sondr3 committed Feb 4, 2015
1 parent 464733e commit caf91fc
Show file tree
Hide file tree
Showing 17 changed files with 165 additions and 40 deletions.
19 changes: 16 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<a name="HEAD"></a>
## HEAD

## BREAKING CHANGES
Gulp was updated to version 4.0 and much of the Gulpfile was updated
accordingly, hence a lot of old tasks were removed and a few new ones
introduced. This is breaking in the sense that people who have previously
installed Jekyllized have to learn some new commands, but for those who have
previously installed nothing will change, this is just an informal update.

#### Changes
* **Gulp:** Updated to Gulp 4.0 and changed the majority of the Gulpfile and
most of the tasks there as well, this should be considered a breaking
change.
* **Jekyll:** Updated to Jekyll 3.0-beta since both Jekyll and Gulp is currently
moving towards a new major version, the biggest change is the inclusion of
incremental regeneration. Also included a plugin for generating archives for
Jekyll.
incremental regeneration.
* **Archives:** Added yearly and monthly archives and archives for tags and
categories.
* **Jekyll directory:** Everything is now output to a `dist` folder instead of a
`site` folder to be more in line with most other tools.
* **Asset directories:** Moved most of the assets to live in a .tmp while working on
Expand All @@ -20,12 +28,17 @@
and JS files will now have sourcemaps generated, both Jekyll and the
asset-revitalizer now runs quietly to not clog the command line. All the JS
files are concated into a `index.js` file as well.
* **Jekyll:** Removed the URL setting from the `_config.build.yml` file into the
`_config.yml` file so getting the site ready for production doesn't involve
a full rebuild to better support incremental regeneration.
* **Feed:** Updated the feed to be more up to par and completely valid
* **Packages:** Updated the packages to be more up to date on NPM

<a name="0.7.1"></a>
## 0.7.1 - Bugfix

#### Fixes
* **LiveReload:** Fix from @thiago-om for generating and reloading JavaScript
* **LiveReload:** Fix from @[thiago-om](https://github.com/thiago-om) for generating and reloading JavaScript
files with BrowserSync.

<a name="0.7.0"></a>
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ optimize your CSS, JS, HTML and images, automatic vendor prefixing with
* Support for sourcemaps for ease of debugging for both your JS and CSS
* Cachebusting for your assets that is automatically updated in your HTML

### Jekyll

* Jekyll is configured with [Redcarpet][redcarpet] that adds a ton of extra functionality to
writing Markdown (footnotes etc) and lots of sane settings
* Automatic generation of year/month/category/tags archives
* Fully valid Atom 1.0 feed and sitemap

## Getting started

## Installation
Expand Down Expand Up @@ -149,6 +156,7 @@ repositories there are some things you need to do:
[aws]: http://aws.amazon.com/s3/
[ghpages]: https://pages.github.com/
[libsass]: https://github.com/hcatlin/libsass
[redcarpet]: https://github.com/vmg/redcarpet
[autoprefixer]: https://github.com/ai/autoprefixer
[poole]: https://github.com/poole
[lanyon]: https://github.com/poole/lanyon
Expand Down
3 changes: 1 addition & 2 deletions app/templates/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ source "http://rubygems.org"

gem 'jekyll'
gem 'redcarpet'
gem 'classifier-reborn'
gem 'fast-stemmer'
gem 'jekyll-archives'
7 changes: 2 additions & 5 deletions app/templates/_config.build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Run during the 'gulp build' command
# Overrides these options in _config.yml

# Overrides the default URL, needed for your atom feed and sitemap
url: <%= projectURL %>

# Hides your drafts and future posts
future: false
show_drafts: false
Expand All @@ -12,5 +9,5 @@ lsi: true
# Removes the upper limit for posts generated
limit_posts: 0

source: 'src'
destination: 'dist'
source: src
destination: dist
25 changes: 24 additions & 1 deletion app/templates/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
title: <%= projectName %>
description: <%= projectDescription %>
tagline: <%= projectTagline %>
url: localhost:4000
url: <%= projectURL %>

# Used so Jekyll outputs the site correctly so Gulp can do what it wants
source: src
destination: dist
exclude: ['assets']

# Same as the title etc for your site but can instead be
# called by using 'site.author.name' and so on
Expand Down Expand Up @@ -36,10 +37,32 @@ paginate: <%= jekyllPaginate%>
paginate_path: 'page:num'
excerpt_separator: '<!--more-->'

# Extras for Jekyll
gems:
- jekyll-archives

# Markdown library
markdown: redcarpet
# Markdown library options
redcarpet:
extensions: ['no_intra_emphasis', 'tables', 'fenced_code_blocks', 'autolink', 'smart',
'strikethrough', 'superscript', 'underline', 'highlight', 'footnotes']
highlighter: true

# Settings for archives
jekyll-archives:
enabled:
- year
- month
- categories
- tags
layouts:
year: 'year-archive'
month: 'month-archive'
category: 'category-archive'
tag: 'tag-archive'
permalinks:
year: '/:year/'
month: '/:year/:month/'
category: '/category/:name/'
tags: '/tag/:name/'
12 changes: 6 additions & 6 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
"del": "^1.1.1",
"gulp": "file:../../../../../var/folders/f1/l2svxmy91tbdk94t9259sq040000gn/T/npm-43577-622ebfd0/git-cache-efb05e57fc27/4dc9eb895b07cd87ea7af0009e2a9197aa21a3a6",
"gulp-autoprefixer": "^2.0.0",<% if (amazonCloudfrontS3) { %>
"gulp-awspublish": "0.0.23",
"gulp-awspublish-router": "0.1.0",<% } %>
"gulp-cache": "~0.2.2",
"gulp-awspublish": "1.0.0",
"gulp-awspublish-router": "0.1.1",<% } %>
"gulp-cache": "~0.2.4",
"gulp-cached": "^1.0.1",
"gulp-changed": "^1.0.0",<% if (amazonCloudfrontS3) { %>
"gulp-cloudfront": "0.0.14",<% } %>
"gulp-filter": "^2.0.0",<% if (githubPages) { %>
"gulp-gh-pages": "^0.4.0",<% } %>
"gulp-group-concat": "^1.1.4",
"gulp-gzip": "0.0.8",
"gulp-htmlmin": "^0.2.0",
"gulp-htmlmin": "^1.0.0",
"gulp-if": "^1.2.4",
"gulp-imagemin": "^2.1.0",
"gulp-jshint": "^1.8.5",
"gulp-load-plugins": "^0.8.0",
"gulp-minify-css": "^0.3.10",
"gulp-minify-css": "^0.4.4",
"gulp-rev-all": "^0.7.5",
"gulp-rev-replace": "^0.3.1",<% if (rsync) { %>
"gulp-rsync": "0.0.2",<% } %>
Expand All @@ -34,7 +34,7 @@
"gulp-size": "^1.1.0",
"gulp-sourcemaps": "^1.3.0",
"gulp-uglify": "^1.1.0",
"gulp-uncss": "^0.5.0",
"gulp-uncss": "^1.0.0",
"gulp-useref": "^1.0.2",
"jshint-stylish": "^1.0.0",
"merge-stream": "^0.1.6",
Expand Down
13 changes: 13 additions & 0 deletions app/templates/app/_layouts/category-archive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: default
---

<h1>Archive of posts with {{ page.type }} '{{ page.title }}'</h1>
<ul class="posts">
{% for post in page.posts %}
<li>
<span class="post-date">{{ post.date | date: "%b %-d, %Y" }}</span>
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
14 changes: 14 additions & 0 deletions app/templates/app/_layouts/month-archive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: default
---

<h1>Archive of posts from {{ page.date | date: "%B %Y" }}</h1>

<ul class="posts">
{% for post in page.posts %}
<li>
<span class="post-date">{{ post.date | date: "%b %-d, %Y" }}</span>
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
13 changes: 13 additions & 0 deletions app/templates/app/_layouts/tag-archive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: default
---

<h1>Archive of posts with {{ page.type }} '{{ page.title }}'</h1>
<ul class="posts">
{% for post in page.posts %}
<li>
<span class="post-date">{{ post.date | date: "%b %-d, %Y" }}</span>
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
14 changes: 14 additions & 0 deletions app/templates/app/_layouts/year-archive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: default
---

<h1>Archive of posts from {{ page.date | date: "%Y" }}</h1>

<ul class="posts">
{% for post in page.posts %}
<li>
<span class="post-date">{{ post.date | date: "%b %-d, %Y" }}</span>
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
2 changes: 1 addition & 1 deletion app/templates/app/_posts/2014-03-02-introducing-poole.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ investigating the connection of two persons, Dr. Henry Jekyll and Mr. Edward
Hyde. Chief among the novel's supporting cast is a man by the name of Mr. Poole,
Dr. Jekyll's loyal butler.

-----
<!--more-->

Poole is the butler for [Jekyll](http://jekyllrb.com), the static site
generator. It's designed and developed by [@mdo](https://twitter.com/mdo) to
Expand Down
6 changes: 3 additions & 3 deletions app/templates/app/_posts/2014-03-03-welcome-to-jekyll.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: post
date: 2014-03-03
date: 2015-02-03
title: Welcome to Jekyll!
categories: jekyll
---
Expand Down Expand Up @@ -34,6 +34,6 @@ Check out the [Jekyll docs][jekyll] for more info on how to get the most out of
Jekyll. File all bugs/feature requests at [Jekyll's GitHub repo][jekyll-gh].

[redcarpet]: https://github.com/vmg/redcarpet
[jekyll-gh]: https://github.com/mojombo/jekyll
[jekyll]: http://jekyllrb.com
[jekyll-gh]: https://github.com/jekyll/jekyll
[jekyll]: http://jekyllrb.com/docs/home/
[^1]: Who are quite handy
1 change: 1 addition & 0 deletions app/templates/app/assets/javascript/javascript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("Hello world!");
2 changes: 1 addition & 1 deletion app/templates/app/assets/scss/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
The main SCSS file for everything, yep
*/

Expand Down
34 changes: 22 additions & 12 deletions app/templates/app/atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,33 @@ layout: null
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

<title>{{ site.title }}</title>
<link href="{{ site.url }}/atom.xml" rel="self"/>
<link href="{{ site.url }}/"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ site.url }}</id>
<author>
<name>{{ site.author.name }}</name>
<email>{{ site.author.email }}</email>
</author>
<title>{{ site.title }}</title>
<subtitle>{{ site.tagline }}</subtitle>
<link href="{{ site.url }}/atom.xml" rel="self"/>
<link href="{{ site.url }}/"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ site.url }}/</id>
<author>
<name>{{ site.author.name }}</name>
<email>{{ site.author.email }}</email>
</author>

{% for post in site.posts %}
{% for post in site.posts limit:10 %}
<entry>
<title>{{ post.title }}</title>
<title type="html">{{ post.title | xml_escape }}</title>
<link href="{{ site.url }}{{ post.url }}"/>
<updated>{{ post.date | date_to_xmlschema }}</updated>
<published>{{ post.date | date_to_xmlschema }}</published>
<id>{{ site.url }}{{ post.id }}</id>
<content type="html">{{ post.content | xml_escape }}</content>
<category term="{{ post.categories }}"/>
{% if post.excerpt %}<summary type="html">{{ post.excerpt | xml_escape }}</summary>{% endif %}
<content type="html">
{{ post.content | xml_escape }}
</content>
<author>
<name>{{ site.author.name }}</name>
<email>{{ site.author.email }}</email>
</author>
</entry>
{% endfor %}

Expand Down
2 changes: 1 addition & 1 deletion app/templates/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function fonts() {
.pipe($.size({ title: "fonts" }));
}

// Copy optimized images and (not optimized) fonts to the "site" folder
// Copy optimized images and (not optimized) fonts to the "dist" folder
function copy() {
var images = gulp.src(".tmp/assets/images/**/*")
.pipe(gulp.dest("dist/assets/images"))
Expand Down
30 changes: 25 additions & 5 deletions test/test-jekyll.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,33 @@ describe("Jekyllized generator", function () {
tasks.assertJekyllSettings(this.jekyllized, "twitter", "olanordmann123123", done);
});

it("_config.build.yml contains the correct URL", function (done) {
tasks.assertJekyllBuildSettings(this.jekyllized, "url", "testing.com", done);
it("_config.build.yml contains the corrent setting for future posts", function (done) {
tasks.assertJekyllBuildSettings(this.jekyllized, "future", "false", done);
});

it("_config.build.yml contains the corrent setting for drafts", function (done) {
tasks.assertJekyllBuildSettings(this.jekyllized, "show_drafts", "false", done);
});

it("_config.build.yml contains the corrent setting for LSI", function (done) {
tasks.assertJekyllBuildSettings(this.jekyllized, "lsi", "true", done);
});

it("_config.build.yml contains the corrent setting for limiting posts", function (done) {
tasks.assertJekyllBuildSettings(this.jekyllized, "limit_posts", "0", done);
});

it("_config.build.yml contains the corrent setting for source dir", function (done) {
tasks.assertJekyllBuildSettings(this.jekyllized, "source", "src", done);
});

it("_config.build.yml contains the corrent setting for destination dir", function (done) {
tasks.assertJekyllBuildSettings(this.jekyllized, "destination", "dist", done);
});

});

describe("test for permalinks and pagination", function () {
describe("test pretty permalinks and 10 pages", function () {
before(function (done) {
helpers.run(path.join(__dirname, "../app"))
.inDir(path.join(__dirname, "./temp/test-jekyll-pagination"))
Expand All @@ -104,7 +124,7 @@ describe("Jekyllized generator", function () {

});

describe("", function () {
describe("test date permalinks and all pages", function () {
before(function (done) {
helpers.run(path.join(__dirname, "../app"))
.inDir(path.join(__dirname, "./temp/test-jekyll-pagination-1"))
Expand All @@ -127,7 +147,7 @@ describe("Jekyllized generator", function () {

});

describe("", function () {
describe("test no permalinks and 1 page", function () {
before(function (done) {
helpers.run(path.join(__dirname, "../app"))
.inDir(path.join(__dirname, "./temp/test-jekyll-pagination-2"))
Expand Down

0 comments on commit caf91fc

Please sign in to comment.