Add base for theming

This commit is contained in:
Samy Pessé
2014-04-04 14:10:56 -07:00
parent 07101deaef
commit 446d486a0f
112 changed files with 14 additions and 5 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ module.exports = function (grunt) {
optimization: 2
},
files: {
"assets/static/style.css": "assets/stylesheets/main.less"
"theme/assets/style.css": "theme/stylesheets/main.less"
}
}
},
@@ -24,8 +24,8 @@ module.exports = function (grunt) {
compile: {
options: {
name: "app",
baseUrl: "assets/javascript/",
out: "assets/static/app.js",
baseUrl: "theme/javascript/",
out: "theme/assets/app.js",
preserveLicenseComments: false,
optimize: "uglify",
include: ["requireLib"],
+8 -2
View File
@@ -1,6 +1,7 @@
var util = require("util");
var path = require("path");
var Q = require("q");
var _ = require("lodash");
var swig = require('swig');
var fs = require("../fs");
@@ -20,8 +21,13 @@ swig.setFilter('mdLink', function(link) {
var Generator = function() {
BaseGenerator.apply(this, arguments);
// Options
this.options = _.defaults(this.options, {
theme: path.resolve(__dirname, '../../../theme')
});
// Load base template
this.template = swig.compileFile(path.resolve(__dirname, '../../templates/page.html'));
this.template = swig.compileFile(path.resolve(this.options.theme, 'templates/page.html'));
};
util.inherits(Generator, BaseGenerator);
@@ -82,7 +88,7 @@ Generator.prototype.finish = function() {
)
.then(function() {
return fs.copy(
path.join(__dirname, "../../assets/static"),
path.join(that.options.theme, "assets"),
path.join(that.options.output, "gitbook")
);
});
+3
View File
@@ -0,0 +1,3 @@
# GitBook Theme
For creating a theme for GitBook, just copy this folder. The theme folder should at least contains two folders: `assets` and `templates`.

Before

Width:  |  Height:  |  Size: 198 KiB

After

Width:  |  Height:  |  Size: 198 KiB

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Some files were not shown because too many files have changed in this diff Show More