-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #192 from quoid/v4.0.0
macOS v4.x iOS v1.x
- Loading branch information
Showing
166 changed files
with
60,142 additions
and
4,180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/node_modules/ | ||
/public/build/ | ||
codemirror/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ ehthumbs.db | |
Thumbs.db | ||
|
||
/node_modules/ | ||
/public/build/ | ||
/public/*/build/ | ||
/temp/ | ||
|
||
# xcode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# static-website-builder | ||
|
||
### Requirements: | ||
- [node](https://nodejs.org/en/) | ||
- [gulp](https://gulpjs.com) | ||
|
||
### Installation: | ||
1. Have the requirements installed on your local machine | ||
1. Clone this repository locally | ||
1. Navigate to where you cloned this repository | ||
1. Run `npm install` | ||
|
||
### Usage: | ||
- `npm run server` starts the dev server | ||
- **Only edit files with the `src` folder** | ||
- Navigate to `http://localhost:8888` to view output | ||
- LiveReload *is* enabled | ||
- `npm run build` builds the website to the `output` folder | ||
- **Do *not* rely on the server command to build the website** | ||
- `npm run clean` cleans the output folder | ||
- **The clean task is built into *both* the server and build commands**, you won't need to often run this command | ||
|
||
### Features | ||
- autoprefixing for css | ||
- @import enabled for css | ||
- minifying of css content | ||
- inlining and compression of all files (css, js, svgs, etc...) | ||
- easy deployment to Netlify | ||
- build command = `npm run build` | ||
- publish directory = `output/` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
const { dest, parallel, series, src, watch } = require("gulp"); | ||
var assets = require("postcss-assets"); | ||
const atImport = require("postcss-import"); | ||
const autoprefixer = require("autoprefixer"); | ||
const connect = require("gulp-connect"); | ||
const del = require("del"); | ||
const htmlmin = require("gulp-htmlmin"); | ||
const inline = require("gulp-inline-source"); | ||
const nano = require("cssnano"); | ||
const nunjucksRender = require("gulp-nunjucks-render"); | ||
const postcss = require("gulp-postcss"); | ||
const sourcemaps = require("gulp-sourcemaps"); | ||
|
||
const sourcePath = "./src"; | ||
const outputPath = "./output"; | ||
|
||
function clean() { | ||
// delete all files at the output path, except .gitignore | ||
const paths = [ | ||
`${outputPath}/**/*` | ||
]; | ||
return del(paths); | ||
} | ||
|
||
function css() { | ||
// NODE_ENV production is set when using the "npm run build" command | ||
// if NODE_ENV === production, no sourcemaps and minify the css | ||
if (process.env.NODE_ENV != "production") { | ||
return src(`${sourcePath}/css/_main.css`) | ||
.pipe(sourcemaps.init()) | ||
.pipe(postcss([ | ||
atImport(), | ||
assets(), | ||
autoprefixer({overrideBrowserslist: ["defaults"]}) | ||
])) | ||
.pipe(sourcemaps.write()) | ||
.pipe(dest(outputPath)); | ||
} else { | ||
return src(`${sourcePath}/css/_main.css`) | ||
.pipe(postcss([ | ||
atImport(), | ||
assets(), | ||
autoprefixer({overrideBrowserslist: ["defaults"]}), | ||
nano() | ||
])) | ||
.pipe(dest(outputPath)); | ||
} | ||
} | ||
|
||
function js() { | ||
// copy over the javascript files, as is | ||
return src(`${sourcePath}/js/**/*.js`) | ||
.pipe(dest(`${outputPath}/js/`)); | ||
} | ||
|
||
function html() { | ||
// set a var for whether or not we are in dev mode | ||
// development var will be false when running the npm run build command | ||
// during development we will NOT inline css or js files | ||
// that way we can properly debug | ||
// on builds everything will inlined to a single html file | ||
var development = true; | ||
var ignore = ["css", "js"]; | ||
if (process.env.NODE_ENV === "production") { | ||
development = false; | ||
ignore = []; | ||
} | ||
return src(`${sourcePath}/index.html`) | ||
.pipe(nunjucksRender({ | ||
// pass custom data to nunjucks for use throughout template(s) | ||
// can use custom data from package.json (ex. title) | ||
data: { | ||
development: development, | ||
title: process.env.npm_package_websiteTitle | ||
}, | ||
path: `${sourcePath}/html` | ||
})) | ||
.pipe(inline({ | ||
compress: true, | ||
ignore: ignore | ||
})) | ||
.pipe(htmlmin({ | ||
collapseWhitespace: true, | ||
minifyJS: false, | ||
removeComments: true | ||
})) | ||
.pipe(dest(outputPath)) | ||
.pipe(connect.reload()); | ||
} | ||
|
||
function complete() { | ||
// delete all the files at the output path except the index.html file | ||
// this is a separate function than the clean function above because | ||
// on the intial clean we want to remove EVERYTHING | ||
// on the build complete, we want to leave the index.html | ||
const paths = [ | ||
`${outputPath}/**/*`, | ||
`!${outputPath}/index.html` | ||
]; | ||
return del(paths); | ||
} | ||
|
||
function server(cb) { | ||
connect.server({ | ||
root: outputPath, | ||
livereload: true, | ||
port: 8888 | ||
}); | ||
cb(); | ||
} | ||
|
||
function watcher(cb) { | ||
const paths = [ | ||
`${sourcePath}/**/*.html`, | ||
`${sourcePath}/**/*.css`, | ||
`${sourcePath}/**/*.js`, | ||
`${sourcePath}/**/*.svg` | ||
]; | ||
watch(paths, series(css, js, html)); | ||
cb(); | ||
} | ||
|
||
exports.build = series(clean, css, js, html, complete); | ||
exports.clean = clean; | ||
exports.server = series(clean, css, js, html, parallel(server, watcher)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Ignore everything in this directory | ||
* | ||
# Except this file | ||
!.gitignore |
Oops, something went wrong.