Skip to content

Commit

Permalink
Use README.rst as website home page and move jekyll dirs around.
Browse files Browse the repository at this point in the history
  • Loading branch information
mightyiam committed Sep 9, 2014
1 parent 5bce862 commit 2358a1a
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 133 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dist/package.json
dist/README.md
dist/*.gz
dist/examples/vendor/redundant/*
src/jekyll/_dev-serve/**
src/website/**
src/jekyll/index.html
docs/.build/*
src/lib/*
44 changes: 37 additions & 7 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ module.exports = function (grunt) {
require('time-grunt')(grunt);

// Oldest supported version of jQuery is used by default
var jqueryVersion = grunt.option("jquery") || "1.4.4",
var humanName = 'WYMeditor',
projectPage = "https://github.com/wymeditor/wymeditor/",
releaseArchive = projectPage +
'releases/download/v<%= pkg.version %>/<%= pkg.name %>' +
'-<%= pkg.version %>' + '.tag.gz',
sourceArchive = projectPage + 'archive/v<%= pkg.version %>.zip',
jqueryVersion = grunt.option("jquery") || "1.4.4",
yeomanConfig = {
app: 'src',
dist: 'dist'
Expand All @@ -18,9 +24,10 @@ module.exports = function (grunt) {
editorFiles = ['{.tmp,<%= yeoman.app %>}/wymeditor/{,*/}*.js'],
stylesFiles = ['.tmp/styles/{,*/}*.css'],
examplesFiles = ['{.tmp,<%= yeoman.app %>}/examples/{,*/}*.{js,html}'],
readmePath = 'README.rst',
jekyllDir = '<%= yeoman.app %>/jekyll',
jekyllFiles = [jekyllDir + '/**'],
jekyllDevServeDir = jekyllDir + '/_dev-serve',
jekyllDevServeDir = '<% yeoman.app %>/website',
jekyllDevServeFiles = [jekyllDevServeDir + '/*'];

grunt.initConfig({
Expand All @@ -45,8 +52,14 @@ module.exports = function (grunt) {
},
// Rebuilds the website on changes
jekyll: {
files: jekyllFiles,
tasks: ['jekyll:dev']
files: [].concat(
jekyllFiles,
[readmePath]
),
tasks: [
'shell:convertReadmeToHomePage',
'jekyll:dev'
]
},
// Convenience. LiveReload must be only in one concurrent
// watch because you can't have more than one at the same time,
Expand All @@ -63,11 +76,15 @@ module.exports = function (grunt) {
)
},
dist: {
options: {
livereload: true
},
files: [].concat(
stylesFiles,
examplesFiles,
editorFiles,
jekyllFiles
jekyllFiles,
[readmePath]
),
tasks: ['build']
}
Expand Down Expand Up @@ -150,6 +167,13 @@ module.exports = function (grunt) {
'<%= yeoman.app %>/test/unit/{,*/}*.js'
]
},
shell: {
convertReadmeToHomePage: {
command: 'rst2html --template ' + jekyllDir +
'/_index.template ' + readmePath + ' ' + jekyllDir +
'/index.html'
}
},
qunit: {
all: {
options: {
Expand Down Expand Up @@ -361,7 +385,11 @@ module.exports = function (grunt) {
},
jekyll: {
options: {
src: jekyllDir
src: jekyllDir,
raw: 'name: ' + humanName + '\n' +
'projectPage: ' + projectPage + '\n' +
'releaseArchive: ' + releaseArchive + '\n' +
'sourceArchive: ' + sourceArchive + '\n'
},
dev: {
options: {
Expand All @@ -370,7 +398,7 @@ module.exports = function (grunt) {
},
dist: {
options: {
dest: '<%= yeoman.dist %>/jekyll'
dest: '<%= yeoman.dist %>/website'
}
}
},
Expand Down Expand Up @@ -470,6 +498,7 @@ module.exports = function (grunt) {
'usemin',
'replace',
'compress',
'shell:convertReadmeToHomePage',
'jekyll:dist'
]);

Expand Down Expand Up @@ -502,4 +531,5 @@ module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-bower-linker");
grunt.loadNpmTasks("grunt-jekyll");
grunt.loadNpmTasks("grunt-concurrent");
grunt.loadNpmTasks("grunt-shell");
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"grunt-jekyll": "^0.4.2",
"grunt-replace": "~0.4.4",
"grunt-rev": "~0.1.0",
"grunt-shell": "^1.1.1",
"grunt-usemin": "~0.1.10",
"time-grunt": "~0.1.1"
},
Expand Down
7 changes: 7 additions & 0 deletions src/jekyll/_index.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: home
title: WYMeditor
base_url: "./"
---

%(body)s
6 changes: 3 additions & 3 deletions src/jekyll/_layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ <h1>{{ site.name }}</h1>
<div id="banner">
<span id="logo"></span>

<a href="{{ site.repo }}" class="button fork"><strong>View On GitHub</strong></a>
<a href="{{ site.projectPage }}" class="button fork"><strong>View On GitHub</strong></a>
<div class="downloads">
<span>Downloads:</span>
<ul>
<li><a href="{{ site.download_dist }}" class="button">Distribution</a></li>
<li><a href="{{ site.download_source }}" class="button">Source</a></li>
<li><a href="{{ site.releaseArchive }}" class="button">Distribution</a></li>
<li><a href="{{ site.sourceArchive }}" class="button">Source</a></li>
</ul>
</div>
</div><!-- end banner -->
Expand Down
122 changes: 0 additions & 122 deletions src/jekyll/index.html

This file was deleted.

0 comments on commit 2358a1a

Please sign in to comment.