Skip to content

Commit

Permalink
Add build process
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jun 9, 2017
1 parent 2ed552a commit 99cbc59
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 108 deletions.
4 changes: 4 additions & 0 deletions .bumpedrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ plugins:
postrelease:
'Generating CHANGELOG file':
plugin: 'bumped-changelog'

'Generating assets build':
plugin: 'bumped-terminal'
command: 'gulp build'

'Commiting new version':
plugin: 'bumped-terminal'
Expand Down
58 changes: 2 additions & 56 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,67 +32,13 @@
<meta name="og:type" content="website">

<link rel="canonical" href="https://mythbusters.js.org" />
<link rel="stylesheet" href="style.css">
<script>window.twttr = (function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
t = window.twttr || {};
if (d.getElementById(id)) return t;
js = d.createElement(s);
js.id = id;
js.src = "https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);

t._e = [];
t.ready = function(f) {
t._e.push(f);
};

return t;
}(document, "script", "twitter-wjs"));</script>
<link rel="stylesheet" href="style.min.css">
</head>

<body>
<div id="app"></div>
</body>
<script>
window.$docsify = {
alias: {
'/changelog': 'https://raw.githubusercontent.com/Kikobeats/js-mythbusters/master/CHANGELOG.md'
},
ga: 'UA-83295706-1',
name: 'JS MythBusters',
subMaxLevel: 2,
executeScript: true,
loadSidebar: true,
auto2top: true,
coverpage: true,
search: {
placeholder: 'Type to search',
paths: 'auto'
},
plugins: [
function(hook, vm) {
hook.beforeEach(function (markdown) {
var url = 'https://github.com/Kikobeats/js-mythbusters/edit/master/docs' + vm.router.getFile()
var editButton = '<a class="edit-button" href="' + url +'" target="_blank">edit this file</a>\n'
var metaContainer = '<div class="meta-container">' + editButton + '</div>\n'

return metaContainer + markdown
})
}
]
}
</script>
<script>
var HW_config = {
selector: '.sidebar>h1',
account: "xGn9Ay"
};

if (typeof navigator.serviceWorker !== 'undefined') {
navigator.serviceWorker.register('sw.js')
}
</script>
<script src="main.min.js"></script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/ga.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/external-script.min.js"></script>
Expand Down
1 change: 1 addition & 0 deletions docs/style.min.css

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
'use strict'

const strip = require('gulp-strip-css-comments')
const prefix = require('gulp-autoprefixer')
const cssnano = require('gulp-cssnano')
const uglify = require('gulp-uglify')
const concat = require('gulp-concat')
const gulp = require('gulp')

const src = {
css: ['src/css/style.css'],
js: ['src/js/main.js']
}

const dist = {
path: 'docs',
name: {
css: 'style',
js: 'main'
}
}

gulp.task('css', () => {
gulp
.src(src.css)
.pipe(concat(`${dist.name.css}.min.css`))
.pipe(prefix())
.pipe(strip({all: true}))
.pipe(cssnano())
.pipe(gulp.dest(dist.path))
})

gulp.task('js', () => {
gulp
.src(src.js)
.pipe(concat(`${dist.name.js}.min.js`))
.pipe(uglify())
.pipe(gulp.dest(dist.path))
})

gulp.task('build', ['css', 'js'])

gulp.task('default', () => {
gulp.start(['build'])
gulp.watch(src.css, ['css'])
gulp.watch(src.js, ['js'])
})
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
],
"devDependencies": {
"docsify-cli": "latest",
"standard-markdown": "latest"
"gulp": "latest",
"gulp-autoprefixer": "latest",
"gulp-concat": "latest",
"gulp-cssnano": "latest",
"gulp-strip-css-comments": "latest",
"gulp-uglify": "latest",
"standard-markdown": "latest",
"standard": "latest"
},
"engines": {
"node": "4"
"node": ">= 6"
},
"scripts": {
"dev": "docsify serve docs",
Expand Down
Loading

0 comments on commit 99cbc59

Please sign in to comment.