diff --git a/.gitignore b/.gitignore index a1848f0..11e932c 100755 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,12 @@ # .gitignore for jekyllized projects # Folders that shouldn't be tracked node_modules/ -temp/ coverage/ .envrc .coveralls.yml -test/test-*/ +test/tmp/ +npm-shrinkwrap.json +.nyc_output # Ignore hidden folders # This takes care of .tmp, .sass-cache, and many others diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 84da426..0000000 --- a/.jshintrc +++ /dev/null @@ -1,21 +0,0 @@ -{ - "node": true, - "esnext": true, - "bitwise": false, - "camelcase": true, - "curly": false, - "eqeqeq": true, - "immed": true, - "indent": 2, - "latedef": false, - "newcap": true, - "noarg": true, - "quotmark": "double", - "regexp": true, - "undef": true, - "unused": true, - "strict": true, - "trailing": true, - "smarttabs": true, - "white": true -} diff --git a/.travis.yml b/.travis.yml index d592da3..1c5ed03 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,16 @@ language: node_js +sudo: false node_js: -- '0.10' -after_script: -- CODECLIMATE_REPO_TOKEN=7b0cbee1382c968a036868d26ec04d0ddc7b7aeef25ceead5ff9ff50a3c2ae8b codeclimate < coverage/lcov.info -- rm -rf ./coverage + - "6" + - "5" + - "4" +after_success: + - './node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls' notifications: - email: + email: false + webhooks: + urls: + - https://webhooks.gitter.im/e/82537018be323f7b8a08 on_success: change - on_failure: change + on_failure: always + on_start: never diff --git a/CHANGELOG.md b/CHANGELOG.md old mode 100755 new mode 100644 index 717ab3b..27dd054 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,465 @@ + +## 1.0.0-beta.23 +> 2016-05-29 + +Fixed the syntax for gulp-imagemin as it made the gulpfile error out, and also +updated the function to validate the URL to be smaller. + +#### Changelog: +* [[`3a142ef021`](https://github.com/sondr3/generator-jekyllized/commit/3a142ef021)] - Fix syntax for gulp-imagemin +* [[`3a39933bcc`](https://github.com/sondr3/generator-jekyllized/commit/3a39933bcc)] - Simplify validate function + + +## 1.0.0-beta.22 +> 2016-05-28 + +This is for the most part a pure backend update release and nothing too major +happened to the generator itself besides updating a few packages. Other than +that I moved to using AVA instead of Mocha for testing and had a heyday trying +to get that to work, it was quite the party. But it all works well, and quite a +lot faster as well. + +#### Changelog: +* [[`65a05d6050`](https://github.com/sondr3/generator-jekyllized/commit/65a05d6050)] - Update license year \[ci skip\] +* [[`d2479127ea`](https://github.com/sondr3/generator-jekyllized/commit/d2479127ea)] - Didn't read the documentation... +* [[`ca13406b2d`](https://github.com/sondr3/generator-jekyllized/commit/ca13406b2d)] - Readd welcome message, update skip-install message +* [[`63f97fbadc`](https://github.com/sondr3/generator-jekyllized/commit/63f97fbadc)] - Ignore some assert functions +* [[`5acea649c9`](https://github.com/sondr3/generator-jekyllized/commit/5acea649c9)] - Update packages, fix testing for versions +* [[`0415f99ef5`](https://github.com/sondr3/generator-jekyllized/commit/0415f99ef5)] - Fix checking dependencies, update AVA +* [[`19ea9665c3`](https://github.com/sondr3/generator-jekyllized/commit/19ea9665c3)] - Fix tests, update yeoman-generator +* [[`fa9e6b166a`](https://github.com/sondr3/generator-jekyllized/commit/fa9e6b166a)] - Nope, not working still... +* [[`07658812f4`](https://github.com/sondr3/generator-jekyllized/commit/07658812f4)] - Third time's the charm +* [[`c3eab364a5`](https://github.com/sondr3/generator-jekyllized/commit/c3eab364a5)] - Second try +* [[`8b03cea0e3`](https://github.com/sondr3/generator-jekyllized/commit/8b03cea0e3)] - Apparently you must tell it to install node packages as well +* [[`3c201a7f45`](https://github.com/sondr3/generator-jekyllized/commit/3c201a7f45)] - Install bundler when testing +* [[`deac0babc5`](https://github.com/sondr3/generator-jekyllized/commit/deac0babc5)] - Don't install dependencies +* [[`7e5b80a8f1`](https://github.com/sondr3/generator-jekyllized/commit/7e5b80a8f1)] - ***Revert*** "back from all the testing of the tests" +* [[`abe1489574`](https://github.com/sondr3/generator-jekyllized/commit/abe1489574)] - ***Revert*** "Try using --serial for AVA on Travis" +* [[`a3c1dd3ce4`](https://github.com/sondr3/generator-jekyllized/commit/a3c1dd3ce4)] - Fix syntax error +* [[`0971a893c8`](https://github.com/sondr3/generator-jekyllized/commit/0971a893c8)] - Even more testing the tests +* [[`64425a1497`](https://github.com/sondr3/generator-jekyllized/commit/64425a1497)] - Test testing +* [[`9b180fa433`](https://github.com/sondr3/generator-jekyllized/commit/9b180fa433)] - Try using --serial for AVA on Travis +* [[`069ba32849`](https://github.com/sondr3/generator-jekyllized/commit/069ba32849)] - Rename a test because having two of them got confusing +* [[`e5463ac2d6`](https://github.com/sondr3/generator-jekyllized/commit/e5463ac2d6)] - Try running AVA in serial +* [[`4a85a4f7e7`](https://github.com/sondr3/generator-jekyllized/commit/4a85a4f7e7)] - Update packages +* [[`b8db04b189`](https://github.com/sondr3/generator-jekyllized/commit/b8db04b189)] - Give me Travis updates on Gitter +* [[`6c9b516adb`](https://github.com/sondr3/generator-jekyllized/commit/6c9b516adb)] - Refactor testing of uploading a bit +* [[`fa3b95c818`](https://github.com/sondr3/generator-jekyllized/commit/fa3b95c818)] - Add gitter badge, remove some other badges +* [[`1ac45b380f`](https://github.com/sondr3/generator-jekyllized/commit/1ac45b380f)] - Remove gulpfile and unused files from root as well +* [[`a78b9cc6a1`](https://github.com/sondr3/generator-jekyllized/commit/a78b9cc6a1)] - Remove unused files +* [[`830b5dfee6`](https://github.com/sondr3/generator-jekyllized/commit/830b5dfee6)] - I dun goofed +* [[`b710300749`](https://github.com/sondr3/generator-jekyllized/commit/b710300749)] - Removed node v4 by accident +* [[`e77a1e5d50`](https://github.com/sondr3/generator-jekyllized/commit/e77a1e5d50)] - Move to using AVA for tests + + +## 1.0.0-beta.21 +> 2016-05-22 + +Forgot to remove a mention of a old gulp task. + +#### Changelog: +* [[`b46b1e57f8`](https://github.com/sondr3/generator-jekyllized/commit/b46b1e57f8)] - Remove mention of clean:metadata + + +## 1.0.0-beta.20 +> 2016-05-22 + +Big bugfix release, fixed how `jekyllized` processes the Jekyll site. It now +copies the `src` of your Jekyll site to `.tmp` and does it's processing there so +it doesn't infect your git history. It will also now properly reload your site +when changing your posts. + +Also removed the `jekyll-archives` gem because it wasn't being used for anything +nor is it being updated. And, finally, updated the packages for the generator. + +#### Changelog: +* [[`f27129fa5b`](https://github.com/sondr3/generator-jekyllized/commit/f27129fa5b)] - Remove asking for Github and Twitter +* [[`a28a5eaf30`](https://github.com/sondr3/generator-jekyllized/commit/a28a5eaf30)] - Fix regeneration of sites +* [[`cfc3eb17f1`](https://github.com/sondr3/generator-jekyllized/commit/cfc3eb17f1)] - Make it properly skip install when testing +* [[`3a2cc26659`](https://github.com/sondr3/generator-jekyllized/commit/3a2cc26659)] - ES2015, Travis and Syntax changes +* [[`96374df57f`](https://github.com/sondr3/generator-jekyllized/commit/96374df57f)] - Copy to a temporary directory, ES2015 updates +* [[`4a6b983d64`](https://github.com/sondr3/generator-jekyllized/commit/4a6b983d64)] - Remove jekyll-archives +* [[`5892ae79e9`](https://github.com/sondr3/generator-jekyllized/commit/5892ae79e9)] - Update packages + + +## 1.0.0-beta.19 +> 2016-04-23 + +Added validation to the URL because Jekyll requires them to at least include +`//`, so now URLs must include either `HTTP` or `HTTPS`. + +#### Changelog: +* [[`ee3264d1b5`](https://github.com/sondr3/generator-jekyllized/commit/ee3264d1b5)] - Fix URLs needing HTTP(s) + + +## 1.0.0-beta.18 +> 2016-04-17 + +Downgrade the version of `jekyll-feed`. Needed because Jekyll has changed how it +requires URLs to be written in `_config.yml` and doesn't support URLs without +`http://`. I'm going on vacation and don't have the time to fix it before my +flight leaves :D + +#### Changelog: +* [[`62c4255b0a`](https://github.com/sondr3/generator-jekyllized/commit/62c4255b0a)] - Fix error with jekyll-feed for now + + +## 1.0.0-beta.17 +> 2016-04-15 + +Updated the BrowserSync config in the gulpfile to the newer syntax. + +#### Changelog: +* [[`6365af1330`](https://github.com/sondr3/generator-jekyllized/commit/6365af1330)] - Update to latest BrowserSync config + + +## 1.0.0-beta.16 +> 2016-04-15 + +Fixed the issue where the generator would refuse to install because it couldn't +resolve the dependency on `yargs` because I didn't add it as a dependency but +added it as a devdependency instead. Whoops. + +#### Changelog: +* [[`94d0c54b42`](https://github.com/sondr3/generator-jekyllized/commit/94d0c54b42)] - Fix not installing properly + + +## 1.0.0-beta.15 +> 2016-04-15 + +Added support for updating your gulpfile and package.json with your specified +uploading settings, so you can now stay up to date pretty easily! Neat. + +#### Changelog: +* [[`dc32d51696`](https://github.com/sondr3/generator-jekyllized/commit/dc32d51696)] - Add support for updating your gulpfile + + +## 1.0.0-beta.14 +> 2016-04-14 + +Fixed a typo in the cache-headers for Amazon S3, thanks @xHN35RQ. + +#### Changelog: +* [[`8ca22fe71c`](https://github.com/sondr3/generator-jekyllized/commit/8ca22fe71c)] - max-age, not max-axe... sadly + + +## 1.0.0-beta.13 +> 2016-04-14 + +Fixed a issue where Jekyll wouldn't generate when run with LSI turned on, so +this was disabled as it isn't used for anything. And fixed the uploading for +AWS. + +#### Changelog: +* [[`a67e69c083`](https://github.com/sondre/generator-jekyllized/commit/a67e69c083)] - Fix uploading for AWS +* [[`d16c4944ef`](https://github.com/sondre/generator-jekyllized/commit/d16c4944ef)] - Remove LSI + + +## 1.0.0-beta.12 +> 2016-04-01 + +Updated to the latest theme of Jekyll and it's CSS and removed Octopress as it +wasn't used at all. Added support for the Github field in Jekyll as well and +rewrote parts of the REAMEs for the project. Mostly cosmetic changes. + +#### Changelog: +* [[`605026a5d2`](https://github.com/sondr3/generator-jekyllized/commit/605026a5d2)] - New beta release, update README and settings +* [[`c770bd97a8`](https://github.com/sondr3/generator-jekyllized/commit/c770bd97a8)] - Remove Octopress +* [[`a332153118`](https://github.com/sondr3/generator-jekyllized/commit/a332153118)] - Add Github information, minor fixes to generator +* [[`ca98d6b0df`](https://github.com/sondr3/generator-jekyllized/commit/ca98d6b0df)] - Forgot to add the new Github/Twitter files. Whoops +* [[`5f2f19dd43`](https://github.com/sondr3/generator-jekyllized/commit/5f2f19dd43)] - Update to latest Jekyll theme and settings +* [[`c1a9e25193`](https://github.com/sondr3/generator-jekyllized/commit/c1a9e25193)] - Installation instructions +* [[`dd314da58f`](https://github.com/sondr3/generator-jekyllized/commit/dd314da58f)] - New beta release + + +## 1.0.0-beta.11 +> 2016-03-30 + +Fix injecting JS as well, forgot that JS as well is injected into the browser. + +#### Changelog: +* [[`a60aa79ed2`](https://github.com/sondr3/generator-jekyllized/commit/a60aa79ed2)]: Fix injecting for JS as well +* [[`7bdf3908b5`](https://github.com/sondr3/generator-jekyllized/commit/7bdf3908b5)]: Update how versions works + + +## 1.0.0-beta.10 +> 2016-03-30 + +This was a test release to figure out how to use tags instead of specific +versions when publishing to NPM. `generator-jekyllized` is now available under +the `generator-jekyllized@next` version instead of various `beta.xx` releases. + + +## 1.0.0-beta.9 +> 2016-03-29 + +Fixes a couple of bugs and updates packages and documentation, nothing major. + +#### Changelog: + +* [[`13e74ebf04`](https://github.com/sondr3/generator-jekyllized/commit/13e74ebf04)]: New beta release +* [[`92dc47368b`](https://github.com/sondr3/generator-jekyllized/commit/92dc47368b)]: Update packages +* [[`2db01cec21`](https://github.com/sondr3/generator-jekyllized/commit/2db01cec21)]: Verify that dependencies are installed +* [[`3c6bc46569`](https://github.com/sondr3/generator-jekyllized/commit/3c6bc46569)]: Update README on dependencies, closes #116 +* [[`f8399d6cf3`](https://github.com/sondr3/generator-jekyllized/commit/f8399d6cf3)]: Add jekyll-seo-tag and update accordingly +* [[`a9ca289ff7`](https://github.com/sondr3/generator-jekyllized/commit/a9ca289ff7)]: Merge pull request #117 from chbachman/beta +* [[`1fbc5a21b5`](https://github.com/sondr3/generator-jekyllized/commit/1fbc5a21b5)]: Fix CSS Reloading +* [[`3ae95eabc7`](https://github.com/sondr3/generator-jekyllized/commit/3ae95eabc7)]: Prevent CSSNano from AutoPrefixing so as to not overwrite your own settings + + +## 1.0.0-beta.8 +> 2016-02-08 + +Managed to write the syntax wrong in one of the gulptasks which broke everything +and I made the gems listed in the Gemfile line up alphabetically because I like +it that way. Also updated the README that gets generated with your project for +the new commands. + +#### Changelog: + +* [[`cae8478`](https://github.com/sondr3/generator-jekyllized/commit/cae847815cdc0050e4cf9aeb8526180116a2dcc1)]: +Fix syntax error, alphabetize Gemfile, update docs + + +## 1.0.0-beta.7 +> 2016-02-07 + +Updated the packages, fixed some spacing and color issues when running the +generator and removed the Bower subgenerator as it did absolutely nothing +anymore. Also stopped supporting ancient versions of Node and such. + +#### Changelog: + +* [[`c5852fa`](https://github.com/sondr3/generator-jekyllized/commit/c5852fa7e286fc646934183064ab5980c28e8abc)]: +Add command to clean images and update docs. +* [[`1a20f35`](https://github.com/sondr3/generator-jekyllized/commit/1a20f356a5350502e2ff1acd6045cbc2bc7f61ee)]: +Update permalink settings and fix spacing/color on questions. +* [[`dd749de`](https://github.com/sondr3/generator-jekyllized/commit/dd749de4c00f910329325ddf439b630a8226e04d)]: +Remove bower subgenerator. +* [[`00598f8`](https://github.com/sondr3/generator-jekyllized/commit/00598f868c45957a129e37418e0a89fc3297f1e6)]: +Update packages. +* [[`0632d9f`](https://github.com/sondr3/generator-jekyllized/commit/0632d9fcc936ae138d4e865e0ee25dea7ae07070)]: +Move away from ancient Node versions. + + +## 1.0.0-beta.6 + +> 2016-01-14 + +Fixed a typo in the `aws-configuration.json` file. + +#### Changelog: + +* [[`cfa66e8`](https://github.com/sondr3/generator-jekyllized/commit/f8a1cb5757400f5505bf4733d0f0db31e4d05256)]: +Fix typo in AWS config file. + + +## 1.0.0-beta.5 + +> 2016-01-14 + +Updated the packages and applied some of the changes that were required from +them and moved from a deprecated gulp-plugin to the not deprecated one. + +#### Changelog: + +* [[`ccd7718`](https://github.com/sondr3/generator-jekyllized/commit/a5a1a92cfdc3863cec55fee93d96482aec14c0de)]: +Update packages and apply the needed changes. +* [[`a5a1a92`](https://github.com/sondr3/generator-jekyllized/commit/887dab1cd011c35c24053a7d263fa31119505cd3)]: +Move from deprecated gulp-plugin. + + +## 1.0.0-beta.4 + +> 2015-12-04 + +Fix a couple of typos and the output path for fonts. Huge thanks to @S1SYPHOS +for spotting them and sending a pull request. + +#### Changelog: + +* [[`833f9b6`](https://github.com/sondr3/generator-jekyllized/commit/833f9b6e5ff9d85c62455852bf6ccdb76c10d36d)]: +Fix typos and the output folder for fonts + + +## 1.0.0-beta.3 + +> 2015-11-19 + +Add documentation when running the generator and a line in `config.yml` about how +to format your Twitter handle. + +#### Changelog: + +* [[`055685a`](https://github.com/sondr3/generator-jekyllized/commit/055685a93935dd100056ad443e9b7ed3723e9ad9)]: +Twitter documentation and new beta + + +## 1.0.0-beta.2 + +> 2015-11-18 + +Fixed an error with Babel not properly working since it now needs a `.babelrc` file. + +#### Changelog: + +* [[`9472305`](https://github.com/sondr3/generator-jekyllized/commit/947230546c5fad2bfaf001680299d189c24f7b66)]: +Fix Babel 6.0 not working + + +## 1.0.0-beta.1 + +> 2015-11-07 + +## BREAKING +EVERYTHING. Not really, but pretty much every part of the generator has been +touched and fixed. Moved the generator over to Gulp 4.0 and Jekyll 3.0, +because moving too fast is fun. The main change here was Gulp 4.0 makes running +tasks in series/parallel a lot, and I mean a lot, easier. + +Technically this isn't breaking as it won't affect people who have previously +installed and are running a previous version but hey. Thanks to @nilsborchers, +@snrbrnjna, @SeanSith, @gjeck, @pope410211, @lvnilesh and @dcalhoun for finding +errors, fixing bugs, helping write new features and being cool people. + +#### Major changes +* **Gulp:** Upgraded to Gulp 4.0 and rewrote the whole Gulpfile in ES2015, no + line was spared the onslaught. No functions were lost but a whole lot was + updated and made better. Progress! +* **Command line arguments:** Instead of having lots of duplicated gulp tasks + and commands that you needed to run to build your site for either local + development and production, you now only add `--prod` to the commands and + voila, you are now building with production settings. Progress! +* **Jekyll:** Upgraded to Jekyll 3 with all the bells and whistles that come + with it. Added `jekyll-archives`, `jekyll-sitemap`, `jekyll-feed` and + `jekyll-gist` and kept `jekyll-paginate`. It will automatically create fully + compliant sitemaps and ATOM feeds for your site as well as automatic archive + pages for your tags and categories. Updated the `config.yml` accordingly. +* **Yeoman:** Updated to the latest version of Yeoman and split the generator + into several smaller subgenerators, so you can update only select components + instead of the whole thing at once. Progress! +* **Bower:** Kinda added support for Bower. Read the README for how it works. +* **Misc:** The built site now lives in `dist`, the assets live in `.tmp` while + being built, moved from Useref to `gulp-inject`, but that change should be + invisible unless you care about it. + +#### Minor changes +* **Packages**: Updated all the packages. +* **Assets:** Fixed how most of the assets are generated: + * **SCSS/CSS:** Now creates sourcemaps when you're not running it with + production settings, and uses PostCSS to run AutoPrefixer. When using + production settings it won't create sourcemaps, but will minify, gzip + and cache bust your `style.css`. + * **JS:** Same as with your SCSS/CSS, although it's concatenated into a + `index.js` file. + * **Injecting:** Moved from Useref to `gulp-inject`, this doesn't affect + much but it changes how your assets are injected into the HTML. This is + a background change for the most part and doesn't change the behaviour + in any way. + * **HTML:** Your HTML is automatically minified and has separate gzipped + files created when you run it with production settings. +* **Jekyll:** Updated to Jekyll 3.0: + * **`jekyll-archives`:** This gem automatically creates archive pages for + your tags and categories. Included in this generator are templates for + these. + * **`jekyll-sitemap`/`jekyll-feed`:** Moved from having to maintain these + myself to the official Jekyll gems for better support and such + * **`jekyll-gist`:** Added to support including Gists + * **`jekyll-paginate`:** Jekyll 3.0 doesn't include this by default, but + it's nice to have +* **Octopress:** Included Octopress into the gem, you should read up on what it + does because it's pretty swell! + +#### Behind the scenes +* **Tests:** Continued working on tests to make errors even less likely. Yay + tests. Also fixed timeouts thanks to @gjeck. +* **Git**: Fixed the gitignore for the new paths +* **Moar**: Made everything more awesome. + +#### CHANGELOG +* [[`ea4d58504a`](https://github.com/sondr3/generator-jekyllized/commit/ea4d58504a)]: Update documentation, changelog \[ci skip\] +* [[`5ff23edd71`](https://github.com/sondr3/generator-jekyllized/commit/5ff23edd71)]: Updated deployment configuration for AWS +* [[`92b2048206`](https://github.com/sondr3/generator-jekyllized/commit/92b2048206)]: Updated comments and style in gulpfile +* [[`9df2a7d8ee`](https://github.com/sondr3/generator-jekyllized/commit/9df2a7d8ee)]: Merge branches 'command-line-arguments', 'travis' and 'yeoman-generator' into beta +* [[`34b5b16dac`](https://github.com/sondr3/generator-jekyllized/commit/34b5b16dac)]: Add support for command line flags +* [[`ae185e5821`](https://github.com/sondr3/generator-jekyllized/commit/ae185e5821)]: Remove yeoman-generator from dev-deps and keep it in deps +* [[`d570b46900`](https://github.com/sondr3/generator-jekyllized/commit/d570b46900)]: Update Travis configuration +* [[`25350c90ee`](https://github.com/sondr3/generator-jekyllized/commit/25350c90ee)]: Update dependencies +* [[`eb6dd1d850`](https://github.com/sondr3/generator-jekyllized/commit/eb6dd1d850)]: Merge pull request #102 from dcalhoun/bug/remove-gulp-changed +* [[`74afd24932`](https://github.com/sondr3/generator-jekyllized/commit/74afd24932)]: Merge pull request #101 from dcalhoun/bug/missing-gulp-newer +* [[`f4471ec004`](https://github.com/sondr3/generator-jekyllized/commit/f4471ec004)]: Remove unused dependency: gulp-changed (David Calhoun) +* [[`2139e7321b`](https://github.com/sondr3/generator-jekyllized/commit/2139e7321b)]: Add missing dependency: gulp-newer (David Calhoun) +* [[`9a8a91fb36`](https://github.com/sondr3/generator-jekyllized/commit/9a8a91fb36)]: Merge pull request #100 from dcalhoun/bundler-dependency +* [[`70fb46ae19`](https://github.com/sondr3/generator-jekyllized/commit/70fb46ae19)]: List Bundler as a dependency, alphabetize footnotes (David Calhoun) +* [[`f462a883af`](https://github.com/sondr3/generator-jekyllized/commit/f462a883af)]: Updated gulpfile, fixed autoprefixer, gulp-inject +* [[`88153c102e`](https://github.com/sondr3/generator-jekyllized/commit/88153c102e)]: Typo in package version \[ci-skip\] +* [[`a377d46472`](https://github.com/sondr3/generator-jekyllized/commit/a377d46472)]: Update packages and tests, and update Rsync logic +* [[`e7f2c8b5a5`](https://github.com/sondr3/generator-jekyllized/commit/e7f2c8b5a5)]: Forgot to include removal of Bower files etc +* [[`428c827d53`](https://github.com/sondr3/generator-jekyllized/commit/428c827d53)]: Removed Wiredep etc because it's not needed +* [[`8dd8f858a4`](https://github.com/sondr3/generator-jekyllized/commit/8dd8f858a4)]: Minor updates to the gulpfile +* [[`d72df97c92`](https://github.com/sondr3/generator-jekyllized/commit/d72df97c92)]: Update tests with new syntax +* [[`9ee6dbab6f`](https://github.com/sondr3/generator-jekyllized/commit/9ee6dbab6f)]: Fixed generation of humans.txt +* [[`8dda8792bc`](https://github.com/sondr3/generator-jekyllized/commit/8dda8792bc)]: Change to default AWS location +* [[`117cfd03d4`](https://github.com/sondr3/generator-jekyllized/commit/117cfd03d4)]: Update to test node stable and remove pre-install +* [[`ad026ccb42`](https://github.com/sondr3/generator-jekyllized/commit/ad026ccb42)]: Updated skip-install +* [[`66e686e9d5`](https://github.com/sondr3/generator-jekyllized/commit/66e686e9d5)]: Updated to latest yeoman-assert +* [[`684a734739`](https://github.com/sondr3/generator-jekyllized/commit/684a734739)]: Remove execute permissions from files +* [[`b8c4d986ef`](https://github.com/sondr3/generator-jekyllized/commit/b8c4d986ef)]: Further updates to the Gulpfile +* [[`b5de5c755e`](https://github.com/sondr3/generator-jekyllized/commit/b5de5c755e)]: Update code style, continue overhaul of gulpfile +* [[`c9a1339efb`](https://github.com/sondr3/generator-jekyllized/commit/c9a1339efb)]: Overhauled the Gulpfile +* [[`1c314fe8e4`](https://github.com/sondr3/generator-jekyllized/commit/1c314fe8e4)]: Forgot to update packages in tests, whoops +* [[`ee8f2f13b0`](https://github.com/sondr3/generator-jekyllized/commit/ee8f2f13b0)]: Moved from JShint/JSCS to ESlint, updated Travis +* [[`6c32fcebb3`](https://github.com/sondr3/generator-jekyllized/commit/6c32fcebb3)]: Updated tests, changelog and packages/description +* [[`f945311174`](https://github.com/sondr3/generator-jekyllized/commit/f945311174)]: Various bugfixes and style improvements +* [[`6b5f70c5a6`](https://github.com/sondr3/generator-jekyllized/commit/6b5f70c5a6)]: Add classifier-reborn gem so related posts work +* [[`9278f73f0a`](https://github.com/sondr3/generator-jekyllized/commit/9278f73f0a)]: Add subgenerator for Bower +* [[`9b99b28be8`](https://github.com/sondr3/generator-jekyllized/commit/9b99b28be8)]: Forgot parts of the tests \[ci skip\] +* [[`2b9660b9d5`](https://github.com/sondr3/generator-jekyllized/commit/2b9660b9d5)]: Beginning of Bower +* [[`55785b530e`](https://github.com/sondr3/generator-jekyllized/commit/55785b530e)]: Updated packages +* [[`9ded303d4a`](https://github.com/sondr3/generator-jekyllized/commit/9ded303d4a)]: Reverting the test that installs dependencies +* [[`f3595118bb`](https://github.com/sondr3/generator-jekyllized/commit/f3595118bb)]: ES6, tests now test installation, updated JS checks +* [[`9f451dd548`](https://github.com/sondr3/generator-jekyllized/commit/9f451dd548)]: Fixed SCSS generation and updated Jekyll templates +* [[`0f075c8d82`](https://github.com/sondr3/generator-jekyllized/commit/0f075c8d82)]: Updated Gulpfile, packages, JShint and Jekyll +* [[`e772f0da28`](https://github.com/sondr3/generator-jekyllized/commit/e772f0da28)]: Updated packages for jekyllized and removed unused line +* [[`752f5979dd`](https://github.com/sondr3/generator-jekyllized/commit/752f5979dd)]: The boilerplate generator now creates a README +* [[`c787ca5ea5`](https://github.com/sondr3/generator-jekyllized/commit/c787ca5ea5)]: Fix errors with install and watching for changes +* [[`3256f72415`](https://github.com/sondr3/generator-jekyllized/commit/3256f72415)]: Updated packages and Jekyll tests +* [[`391f5f1d0e`](https://github.com/sondr3/generator-jekyllized/commit/391f5f1d0e)]: Updated Jekyll generator and removed some settings +* [[`b74a88b72d`](https://github.com/sondr3/generator-jekyllized/commit/b74a88b72d)]: Added subgenerator for jekyll +* [[`66e580dded`](https://github.com/sondr3/generator-jekyllized/commit/66e580dded)]: Updated tests and the test runner task +* [[`bf65d66542`](https://github.com/sondr3/generator-jekyllized/commit/bf65d66542)]: Updated packages, fixed errors on tests +* [[`24ad2df30d`](https://github.com/sondr3/generator-jekyllized/commit/24ad2df30d)]: More updates to the gulp subgenerator and tests +* [[`d314bebe12`](https://github.com/sondr3/generator-jekyllized/commit/d314bebe12)]: Probably a good idea to include the new directory +* [[`420aac0c02`](https://github.com/sondr3/generator-jekyllized/commit/420aac0c02)]: Move some subgenerators to a boilerplate generator +* [[`06677501c2`](https://github.com/sondr3/generator-jekyllized/commit/06677501c2)]: Initial commit for jekyllized:gulp +* [[`336e2693bc`](https://github.com/sondr3/generator-jekyllized/commit/336e2693bc)]: Merged package subgen with app generator +* [[`8cc242fd37`](https://github.com/sondr3/generator-jekyllized/commit/8cc242fd37)]: Updated ordering of importance, added config file +* [[`ee0b2b3a4a`](https://github.com/sondr3/generator-jekyllized/commit/ee0b2b3a4a)]: Somehow lodash vanished +* [[`dd974a2157`](https://github.com/sondr3/generator-jekyllized/commit/dd974a2157)]: Don't create a test directory \[ci-skip\] +* [[`21e356fee1`](https://github.com/sondr3/generator-jekyllized/commit/21e356fee1)]: Added subgenerator for packages and fixed a typo +* [[`729ec19acb`](https://github.com/sondr3/generator-jekyllized/commit/729ec19acb)]: Added git submodule and minor formatting changes +* [[`70eb5105bd`](https://github.com/sondr3/generator-jekyllized/commit/70eb5105bd)]: Updated code style +* [[`6b74b18e91`](https://github.com/sondr3/generator-jekyllized/commit/6b74b18e91)]: Update link to Gulp 4.0 +* [[`fe9b959b86`](https://github.com/sondr3/generator-jekyllized/commit/fe9b959b86)]: Added subgenerators for jshint/jscs/editorconfig +* [[`bf0f1902fa`](https://github.com/sondr3/generator-jekyllized/commit/bf0f1902fa)]: Towards Yeoman 0.19 +* [[`a083587c7c`](https://github.com/sondr3/generator-jekyllized/commit/a083587c7c)]: Updated the gulpfile and added trash to clean dirs +* [[`dff2a895e4`](https://github.com/sondr3/generator-jekyllized/commit/dff2a895e4)]: Updated tests, packages and Travis settings +* [[`d0de17a18c`](https://github.com/sondr3/generator-jekyllized/commit/d0de17a18c)]: Moved path settings to a JSON file, updated tests +* [[`a98227710b`](https://github.com/sondr3/generator-jekyllized/commit/a98227710b)]: Moved from Atom to RSS2.0 feed +* [[`953a8be7bd`](https://github.com/sondr3/generator-jekyllized/commit/953a8be7bd)]: Removed the welcome message, updated gulp-istanbul +* [[`f69533d3f2`](https://github.com/sondr3/generator-jekyllized/commit/f69533d3f2)]: Moved to jekyll-sitemaps and tweaks to the theme +* [[`67eaa12b67`](https://github.com/sondr3/generator-jekyllized/commit/67eaa12b67)]: Moved back to the default Jekyll theme +* [[`d577a8b3bb`](https://github.com/sondr3/generator-jekyllized/commit/d577a8b3bb)]: Updated all the tests and fixed the deploy task +* [[`caf91fc0b2`](https://github.com/sondr3/generator-jekyllized/commit/caf91fc0b2)]: Archives, improved generation and more +* [[`464733e700`](https://github.com/sondr3/generator-jekyllized/commit/464733e700)]: Updated documentation, directories and tests +* [[`ca13446e31`](https://github.com/sondr3/generator-jekyllized/commit/ca13446e31)]: More changes for the Gulpfile and moved JS to body +* [[`35dfe47120`](https://github.com/sondr3/generator-jekyllized/commit/35dfe47120)]: Started work on Gulp 4.0 and Jekyll 3.0 + ## 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. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md old mode 100755 new mode 100644 index 54d604f..733b386 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,2 +1,3 @@ # Contributing and Issue guidelines +Just don't be a dick. diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 index e075555..4498e35 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2015 Sondre Nilsen +Copyright (c) 2014-2016 Sondre Nilsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 3dabb1c..260d06d --- a/README.md +++ b/README.md @@ -1,154 +1,294 @@ # generator-jekyllized [![Build Status](https://travis-ci.org/sondr3/generator-jekyllized.png?branch=master)](https://travis-ci.org/sondr3/generator-jekyllized) -[![NPM version](https://badge.fury.io/js/generator-jekyllized.png)](http://badge.fury.io/js/generator-jekyllized) [![Coverage Status](https://coveralls.io/repos/sondr3/generator-jekyllized/badge.png)](https://coveralls.io/r/sondr3/generator-jekyllized) [![Code Climate](https://codeclimate.com/github/sondr3/generator-jekyllized/badges/gpa.svg)](https://codeclimate.com/github/sondr3/generator-jekyllized) +[![Coverage Status](https://coveralls.io/repos/sondr3/generator-jekyllized/badge.png)](https://coveralls.io/r/sondr3/generator-jekyllized) [![Gitter](https://badges.gitter.im/sondr3/generator-jekyllized.svg)](https://gitter.im/sondr3/generator-jekyllized?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -## Development is happening in the [beta][beta] version! +*Waiting on Gulp 4.0 to be released for the beta to go back to being the main +version of Jekyllized. If you want to try it as it is right now you can install +it from NPM under the `next` tag. Just read the installation instructions!* -If you want to try the newest version of Jekyllized running on Gulp 4.0 and -Jekyll 3.0 you should take a look at it on [Github][beta]. Should you want to -try it just follow the [installation instructions][installation] there and read -the README on how to use it. I promise you it's going to be worth it. Just -beware Gulp 4.0 is currently in beta. +## Introduction -**Stylized and opinionated Jekyll development** +`generator-jekyllized` is a very opinionated [Yeoman][yeoman] generator built +with [Jekyll][jekyll] and [gulp][gulp]. You will be able to quickly scaffold +your site and start developing. As you are working on your site your assets will +automatically be updated and injected into your browser as well as your posts. +When you are done developing and want to publish it you are two commands away +from having everything optimized and published. -Jekyllized is an opinionated [Yeoman][yeoman] generator for building -[Jekyll][jekyll] based websites. Easy scaffolding via [Yo][yo] to get started -quickly, [Bower][bower] for managing frontend packages and [Gulp][gulp] to -automate and optimize developing your site. +## Features +> Rapidly prototype -Based on [Jekyll][jekyll], Jekyllized is ideal for building highly optimized -static sites and prototyping sites. Quickly review changes with LiveReload, -optimize your stylesheets and images automatically and detect errors and unused -code in your project. +While developing locally everything you change will automatically be updated and +injected into your browser. Changing your SCSS or JavaScript files will +automatically updated them, create sourcemaps and inject them. Writing or +editing posts and pages for your website will do the same. Simple and effective. -## Features +> Jekyll -### Tools +Built on top of Jekyll 3, you get a mature and stable base with the full power +that Jekyll brings you. You'll have sitemaps, Atom feeds generated and SEO meta +data tags added to your posts and pages. -- SASS using [libsass][libsass] -- [AutoPrefixer][autoprefixer] for automatic vendor prefixing -- Upload your site to either Amazon S3 or to your server with Rsync -- [Lanyon][lanyon] theme based on [Poole][poole] from [mdo][mdo] -- Jekyll with sane configurations and lots of extras +> Optimize your assets -### Developing +When you are done developing you can have your assets optimized and injected +correctly into your HTML. Your assets will be minified, compressed with gzip, +cache busted and otherwise optimized. Your images will be run through +compressors to save space and even your HTML will be minified. -- Have your sites automatically refreshed across multiple devices with - [BrowserSync](browsersync) -- Detect errors and potential issues with your code using `jekyll doctor` and - [JShint][jshint] -- Optimize your assets and site: your CSS and JS is automatically concatenated, - both your CSS, JS and HTMl is minifiyed and all your text files are gzipped - for optimal performance. Your images are run through imagemin to optimize - them as well -- Cachebusting for your assets +> Deploying + +Finally, once everything is done and you are ready to publish your site, you can +do it via either Amazon S3, Github Pages or Rsync. With a single command your +new/updated site is uploaded to your platform of choice. ## Getting started -## Installation +### Installation + +#### Dependencies +* **Ruby**: `>2.0` with Bundler `>1.10` +* **Node**: `>4.2`, Gulp `>4.0` and Yo `>1.7.0` +* **Gulp:** Since the beta is running Gulp 4.0 you need to install `gulp-cli`: + `npm install gulpjs/gulp-cli#4.0 -g` +* **Jekyllized:** Then install Jekyllized: `npm install + generator-jekyllized@next -g` -To install you need [Node.js][nodejs] (`>0.10.0`) and [Ruby][rubylang] (`> 1.9`) -for Jekyll. Install Jekyllized via NPM: `npm install -g generator-jekyllized` -and finally run `yo jekyllized` in the directory you want to install in. +#### Install +* **Scaffold:** Run `yo jekyllized` in the directory you want scaffold your site + in +* **Start:** Run `gulp` and watch the magic unfold + +#### Update +It's recommended that you keep your `gulpfile` up to date with the generator. +First, update `generator-jekyllized`: `npm update generator-jekyllized -g` and +then run `yo jekyllized:gulp [--rsync|amazon|pages]`, or see the help: `yo +jekyllized:gulp --help`. Note that this will overwrite any local changes you've +made, so make sure to make a backup. ## Usage -#### `gulp` +#### `gulp [--prod]` -The default task, this will automatically compile and open the site in your -browser. A watch task runs in the background and detects when any files change, -recompiles them if nessecary and updates your browser with BrowserSync. +This is the default command, and probably the one you'll use the most. This +command will build your assets and site with development settings. You'll get +sourcemaps, your drafts will be generated and you'll only generate the last 10 +posts (for speed). As you are changing your posts, pages and assets they will +automatically update and inject into your browser via +[BrowserSync][browsersync]. -#### `gulp check` +> `--prod` + +Once you are done and want to verify that everything works with production +settings you add the flag `--prod` and your assets will be optimized. Your CSS, +JS and HTML will be minified and gzipped, plus the CSS and JS will be cache +busted. The images will be compressed and Jekyll will generate a site with all +your posts and no drafts. + +#### `gulp build [--prod]` + +This command is identical to the normal `gulp [--prod]` however it will not +create a BrowserSync session in your browser. + +#### `gulp (build) [--prod]` main subtasks +> `gulp jekyll [--prod]` + +Without production settings Jekyll will only create the 10 latest posts and will +create both future posts and drafts. With `--prod` none of that is true and it +will generate all your posts. + +> `gulp styles|scripts [--prod]` + +Both your CSS and JS will have sourcemaps generated for them under development +settings. Once you generate them with production settings sourcemap generation +is disabled. Both will be minified, gzipped and cache busted with production +settings. -Check the health of your JavaScript, CSS and Jekyll. You can change the settings -for what it looks for in `.jshintrc`. +> `gulp images` -#### `gulp build` +Optimizes and caches your images. This is a set it and forget it command for the +most part. -Almost the same as the default `gulp` task, but this won't start up a -preview/LiveReload server and open the browser, it will only build your site. +> `gulp html --prod` -#### `gulp publish` +**Does nothing without `--prod`.** Minifies and gzips your HTML files. -This will first run `gulp build` to make sure the changes you've made to your -site are included and then optimize all your assets (images, HTML, CSS, JS++). -If you want to display your optimized site to make sure everything is working -run `gulp serve:prod` to see the changes. +> `gulp serve` + +If you just want to watch your site you can run this command. If wanted you can +also edit the `serve` task to allow it to tunnel via [localtunnel][localtunnel] +so people outside your local network can view it as well: + +```js + // tunnel: true, +``` + +You can also change the behaviour for how it opens the URL when you run `gulp +[--prod]`, you can see the options [here][browsersync-open]: + +```js + // open: false, +``` #### `gulp deploy` -This will either upload your site to Amazon S3, Rsync your files to your server -or push them to GitHub Pages. +When you're done developing and have built your site with either `gulp --prod` +or `gulp build --prod` you can deploy your site to either Amazon S3, Github +Pages or with Rsync. -### Individual tasks +> Amazon S3 and Rsync -A lot of the tasks are built up of smaller tasks that can be run individually. -For example, the `gulp publish` task first runs `gulp build` (that also runs -`jekyll:prod`, `styles` and `images`) and `clean:prod` and then runs the `html` -and `copy` commands (`html` to optimize your site and `copy` to copy over some -files that `html` misses). If you want to you can run any of these tasks without -invoking their "parent" task. If you only wanted to optimize your assets and -such, run `gulp html` and it won't run any of the tasks used with `gulp -publish`. +If you chose either of these two, you'll have a `[rsync/aws]-credentials.json` +file in your root folder that you have to fill out. It should be pretty self +explanatory, however, if you need any help with configuring it, you should check +out either the [`gulp-awspublish`][awspublish] repo or [`gulp-rsync`][rsync] +repo for help. -For all the different tasks that can be run, see the [gulpfile][gulpfile] and -look through the code. Everything is commented and you can edit, change or -remove what you want/need. +> Github Pages -## Deploying +If you chose to upload to Github Pages there's no configuration besides starting +a git repo in your folder, setting an `origin` remote repo and run `gulp +deploy`. Your site will be automatically pushed to Github. See the +[FAQ][frequentlyasked] for configuring personal repos vs project repos. -#### Amazon AWS -If you are using Amazon S3 make sure you change the region you want to use in -the aws-credentials.json and have created a bucket already. If you don't want to -use Cloudfront you'll have to uncommend the last line in the `gulp deploy` task. -For Rsync it should be automatic as long as your details are correct. +#### `gulp check` -#### Rsync -If you are using Rsync make sure the credentials are filled out in the -rsync-credentials.json file, otherwise all you have to do is to run `gulp -deploy` and your site will be synced to your server. NOTE: For the moment your -site is not gzipped while uploading, this is going to be fixed in the future. +Lints your JavaScript files using ESLint with XO Space settings and run `jekyll +doctor` to look for potential errors. -#### GitHub Pages -If you are using GitHub Pages note that currently only personal repositories are -supported (`username.github.io`), however if you want to use it for project -repositories there are some things you need to do: +#### `gulp clean` -* Change the branch that the `gulp deploy` pushes to -* Change the [URL settings][jekyll-pages] for Jekyll. Note that the fourth step - isn't required as Jekyllized will automatically serve your local site on - `localhost:4000` +Deletes your assets from their `.tmp` directory as well as in `dist` and deletes +any gzipped files. **NOTE:** Does not delete your images from `.tmp` to reduce +the time to build your site due to image optimizations. Note that `gulp clean` +is built on top of a few other commands that you can run individually if that is +more to your liking. -### Bower +> `gulp clean:assets` -**Currently not implemented** +Erases out your assets from `.tmp` and `dist` but does not remove images. -## Roadmap +> `gulp clean:images` -- Write more documentation -- Implement Bower functionality -- And more things +Erases your images from `.tmp` and `dist`. -### [Changelog][changelog] +> `gulp clean:dist` +<<<<<<< HEAD [beta]: https://github.com/sondr3/generator-jekyllized/tree/beta [jekyll]: https://jekyllrb.com [yeoman]: http://yeoman.io [yo]: https://github.com/yeoman/yo [bower]: http://bower.io/ +======= +Erases your `dist` folder. + +> `gulp clean:gzip` + +Erases any gzipped files in your `dist` folder. + +> `gulp clean:metadata` + +Deletes the `.jekyll-metadata` file, this will force Jekyll to completely +rebuild your site. + +#### `gulp rebuild` + +Only run when you need to do a full rebuild! This will delete your built site +and all the assets with it. + +### Subtasks + +All of the commands listed above are the main commands, and are composed of +other smaller commands that have a small job that they do. You can find all the +command by running `gulp --tasks`, and look in the [gulpfile][gulpfile] for what they do. +All are commented about what they do. + +## Frequently Asked Questions + +> Inject more than one JavaScript file + +If you want to split up your JavaScript files into say a `index.js` and a +`vendor.js` file with files from [Bower][bower] you can do this quite easily. Create a +copy of the `scripts` gulp task and rename it to `scripts:vendor` and change the +`gulp.src` files you need: + +```js + gulp.src([ + 'bower_components/somelibrary.js/dist/somelibrary.js', + 'bower_components/otherthing.js/dist/otherthing.js' + ]) +``` + +and then change `.pipe($.concat('index.js'))` into +`.pipe($.concat('vendor.js'))`. Then you go to the bottom of the gulpfile and +change the `assets` task: + +```js +gulp.task('assets', gulp.series( + gulp.series('clean:assets'), + gulp.parallel('styles', 'scripts:vendor', 'scripts', 'fonts', 'images') +)); +``` + +Notice the `scripts:vendor` task that has been added. Also be ware that things +are injected in alphabetical order, so if you need your vendor scripts before +the `index.js` file you have to either rename the `index.js` file or rename the +`vendor.js` file. When you now run `gulp` or `gulp build` it will create a +`vendor.js` file and automatically inject it at the bottom of your HTML. When +running with `--prod` it'll automatically optimize and such as well. + +For more advanced uses, refer to the [`gulp-inject`][inject] documentation on +how to create individual inject tags and inject specific files into them. + +> Github Pages configuration + +By default if you select Github Pages as your deployment option your site will +be pushed to a `gh-pages` branch, this works fine for any project pages but +won't work for your personal repo. If you want to use a `username.github.io` +site you'll have to change it to this: + +```js +gulp.task('deploy', () => { + return gulp.src('dist/**/*') + .pipe($.ghPages({ + branch: "master" + })); +}); +``` + +You might also have to configure the URL for your site if you want to use Github +Pages. Luckily the Jekyll documentation [has you covered][jekyll-url]. + +> Why don't you support Stylus/LESS/Angular/etc + +Because I've never used them nor do I have any plans of using them. Furthermore, +they're a bit outside what I want with this generator anyways. I want a lean, +simple and opinionated generator, not a big complicated one. + +## Contributing + +See the [contribution][contribute] docs. + +## [Changelog][changelog] + +## License + +MIT © Sondre Nilsen (https://github.com/sondr3) + +[awspublish]: https://github.com/pgherveou/gulp-awspublish +[bower]: http://bower.io +[browsersync]: https://github.com/shakyShane/browser-sync +[browsersync-open]: https://browsersync.io/docs/options/#option-open +[contribute]: https://github.com/sondr3/generator-jekyllized/blob/beta/CONTRIBUTING.md +[changelog]: https://github.com/sondr3/generator-jekyllized/blob/master/CHANGELOG.md +[frequentlyasked]: https://github.com/sondr3/generator-jekyllized#frequently-asked-questions [gulp]: http://gulpjs.com/ +[gulpfile]: https://github.com/sondr3/generator-jekyllized/blob/beta/generators/gulp/templates/gulpfile.babel.js +[inject]: https://github.com/klei/gulp-inject +[jekyll-url]: http://jekyllrb.com/docs/github-pages/#project-page-url-structure +[jekyll]: https://jekyllrb.com [libsass]: https://github.com/hcatlin/libsass -[autoprefixer]: https://github.com/ai/autoprefixer -[poole]: https://github.com/poole -[lanyon]: https://github.com/poole/lanyon -[mdo]: https://github.com/mdo -[jshint]: http://www.jshint.com/ -[nodejs]: http://nodejs.org/ -[rubylang]: http://www.ruby-lang.org/ -[gulpfile]: https://github.com/sondr3/generator-jekyllized/blob/master/app/templates/gulpfile.js -[changelog]: https://github.com/sondr3/generator-jekyllized/blob/master/CHANGELOG.md -[browsersync]: https://github.com/shakyShane/browser-sync -[jekyll-pages]: http://jekyllrb.com/docs/github-pages/ -[installation]: https://github.com/sondr3/generator-jekyllized#installation +[localtunnel]: http://localtunnel.me/ +[rsync]: https://github.com/jerrysu/gulp-rsync +[yeoman]: http://yeoman.io diff --git a/app/index.js b/app/index.js deleted file mode 100644 index 44d7456..0000000 --- a/app/index.js +++ /dev/null @@ -1,277 +0,0 @@ -"use strict"; -var path = require("path"); -var chalk = require("chalk"); -var yeoman = require("yeoman-generator"); -var shelljs = require("shelljs"); - -module.exports = yeoman.generators.Base.extend({ - constructor: function () { - yeoman.generators.Base.apply(this, arguments); - - this.option("skip-install", { - desc: "Whether dependencies should be installed", - defaults: false - }); - - this.option("skip-install-message", { - desc: "Whether commands run should be shown", - defaults: false - }); - - var dependenciesInstalled = ["bundle", "ruby"].every(function (depend) { - return shelljs.which(depend); - }); - - if (!dependenciesInstalled) { - this.log("MISSING DEPENDENCIES:" + - "\nEither " + chalk.white("Ruby") + " or " + chalk.white("Bundler") + " is not installed or missing from $PATH." + - "\nMake sure that they are either installed or added to $PATH."); - shelljs.exit(1); - } - - this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, "../package.json"))); - }, - - projectPrompting: function () { - var cb = this.async(); - - this.log(this.yeoman); - this.log("\n" + - chalk.blue(" ____ ___ ___ ___") + chalk.yellow(" ___\n") + - chalk.blue(" `MM `MM `MM `MM") + chalk.yellow(" 68b `MM\n") + - chalk.blue(" MM MM MM MM") + chalk.yellow(" Y89 MM\n") + - chalk.blue(" MM ____ MM __ ____ ___ MM MM") + chalk.yellow(" ___ _________ ____ ____MM\n") + - chalk.blue(" MM 6MMMMb MM d` `MM( )M` MM MM") + chalk.yellow(" `MM MMMMMMMMP 6MMMMb 6MMMMMM\n") + - chalk.blue(" MM 6M` `Mb MM d` `Mb d` MM MM") + chalk.yellow(" MM / dMP 6M` `Mb 6M` `MM\n") + - chalk.blue(" MM MM MM MM d` YM. ,P MM MM") + chalk.yellow(" MM dMP MM MM MM MM\n") + - chalk.blue(" MM MMMMMMMM MMdM. MM M MM MM") + chalk.yellow(" MM dMP MMMMMMMM MM MM\n") + - chalk.blue("(8) MM MM MMPYM. `Mbd` MM MM") + chalk.yellow(" MM dMP MM MM MM\n") + - chalk.blue("(( ,M9 YM d9 MM YM. YMP MM MM") + chalk.yellow(" MM dMP /YM d9 YM. ,MM\n") + - chalk.blue(" YMMMM9 YMMMM9 _MM_ YM._ M _MM__MM") + chalk.yellow("__MM_dMMMMMMMM YMMMM9 YMMMMMM_\n") + - chalk.blue(" d` ") + chalk.yellow("\n") + - chalk.blue(" (8),P ") + chalk.yellow("\n") + - chalk.blue(" YMM ") + chalk.yellow("\n") - ); - - this.log(chalk.magenta("\nIt\"s time to get Jekyllized!")); - this.log(chalk.yellow("\nTell me a little about your project »")); - - var prompts = [{ - name: "projectName", - message: "What is the name of your project?" - }, { - name: "projectDescription", - message: "Describe your project for me:" - }, { - name: "projectTagline", - message: "What is the tagline for your project?" - }, { - name: "projectURL", - message: chalk.red("If you are using GitHub Pages use username.github.io") + "\nWhat will the URL for your project be?" - }]; - - this.prompt(prompts, function (props) { - this.projectName = props.projectName; - this.projectDescription = props.projectDescription; - this.projectTagline = props.projectTagline; - this.projectURL = props.projectURL; - - cb(); - }.bind(this)); - }, - - authorPrompting: function () { - var cb = this.async(); - - this.log(chalk.yellow("\nNow it\"s time to tell me about you. »")); - - var prompts = [{ - name: "authorName", - message: "What is your name?", - }, { - name: "authorEmail", - message: "What is your email?", - }, { - name: "authorBio", - message: "Write a short description of yourself:" - }, { - name: "authorTwitter", - message: "Your Twitter URL:" - }]; - - this.prompt(prompts, function (props) { - this.authorName = props.authorName; - this.authorEmail = props.authorEmail; - this.authorBio = props.authorBio; - this.authorTwitter = props.authorTwitter; - - cb(); - }.bind(this)); - }, - - jekyllPrompting: function () { - var cb = this.async(); - - this.log(chalk.yellow("\nNow on to set some Jekyll settings: »") + - chalk.red("\nYou can change all of this later in the _config.yml file")); - - var prompts = [{ - name: "jekyllPermalinks", - type: "list", - message: "Permalink style" + (chalk.red( - "\n pretty: /:year/:month/:day/:title/" + - "\n date: /:year/:month/:day/:title.html" + - "\n none: /:categories/:title.html")) + "\n", - choices: ["pretty", "date", "none"] - }, { - name: "jekyllPaginate", - message: "How many posts do you want to show on your front page?" + chalk.red("\nMust be a number or all"), - default: 10, - validate: function (input) { - if (/^[0-9]*$/.test(input)) { - return true; - } - if (/^all*$/i.test(input)) { - return true; - } - return "Must be a number or all"; - } - }]; - - this.prompt(prompts, function (props) { - this.jekyllPermalinks = props.jekyllPermalinks; - this.jekyllPaginate = props.jekyllPaginate; - - cb(); - }.bind(this)); - }, - - uploadPrompting: function () { - var cb = this.async(); - - this.log(chalk.yellow("\nNow we only need some details about how to upload your site: »") + - chalk.red("\nNOTE: Take whatever time you need to get these right/fill them in later in eithers credentials file.")); - - var prompts = [{ - name: "uploadChoices", - type: "list", - message: "How would you like to host/upload your site?", - choices: [{ - name: "Amazon S3 + Cloudfront", - value: "amazonCloudfrontS3", - }, { - name: "Rsync", - value: "rsync", - }, { - name: "Github Pages", - value: "githubPages", - }, { - name: "None", - value: "noUpload" - }] - }, { - name: "amazonKey", - message: chalk.yellow("\n\nNow we just need to fill out the detailes needed to configure your site for Amazon S3 and Cloudfront: »") + - chalk.red("\nNOTE: Take your time and get the correct settings from Amazon, or alternatively") + - chalk.red("\njust fill them in blankly and fill out the aws-credentials.json later.") + - "\nWhat is your key to AWS?", - when: function (answers) { - return answers.uploadChoices === "amazonCloudfrontS3"; - } - }, { - name: "amazonSecret", - message: "What is your AWS secret?", - when: function (answers) { - return answers.uploadChoices === "amazonCloudfrontS3"; - } - }, { - name: "amazonBucket", - message: "What do you want your S3 bucket to be called?", - when: function (answers) { - return answers.uploadChoices === "amazonCloudfrontS3"; - } - }, { - name: "amazonDistID", - message: "What is the Cloudfront distribution ID?", - when: function (answers) { - return answers.uploadChoices === "amazonCloudfrontS3"; - } - }, { - name: "rsyncUsername", - message: chalk.yellow("\n\nNow we just need to fill out the detailes needed to upload your site via Rsync: »") + - chalk.red("\nNOTE: Take your time and get the correct settings for your server, or alternatively") + - chalk.red("\njust fill them in blankly and fill out the rsync-credentials.json later.") + - "\nWhat is the username of the user you will be uploading with?", - when: function (answers) { - return answers.uploadChoices === "rsync"; - } - }, { - name: "rsyncHostname", - message: chalk.red("\n(eg. example.com or 192.168.1.1)") + - "\nWhat is the hostname?", - when: function (answers) { - return answers.uploadChoices === "rsync"; - } - }, { - name: "rsyncDestination", - message: chalk.red("\n(eg. /srv/www/site/public_html)") + - "\nWhere do you want to save the files?", - when: function (answers) { - return answers.uploadChoices === "rsync"; - } - }]; - - this.prompt(prompts, function (props) { - var features = props.uploadChoices; - - var hasFeature = function (feat) { - return features.indexOf(feat) !== -1; - }; - - this.amazonCloudfrontS3 = hasFeature("amazonCloudfrontS3"); - this.rsync = hasFeature("rsync"); - this.githubPages = hasFeature("githubPages"); - - this.amazonKey = props.amazonKey; - this.amazonSecret = props.amazonSecret; - this.amazonBucket = props.amazonBucket; - this.amazonDistID = props.amazonDistID; - - this.rsyncUsername = props.rsyncUsername; - this.rsyncHostname = props.rsyncHostname; - this.rsyncDestination = props.rsyncDestination; - - cb(); - }.bind(this)); - }, - - scaffolding: function () { - this.copy("Gemfile", "Gemfile"); - this.copy("bowerrc", ".bowerrc"); - this.copy("_bower.json", "bower.json"); - this.template("_package.json", "package.json"); - this.template("_config.yml", "_config.yml"); - this.template("_config.build.yml", "_config.build.yml"); - this.template("_README.md", "README.md"); - this.template("gulpfile.js", "gulpfile.js"); - this.copy("gitignore", ".gitignore"); - this.copy("gitattributes", ".gitattributes"); - this.copy("jshintrc", ".jshintrc"); - this.copy("editorconfig", ".editorconfig"); - this.directory("app", "src"); - - if (this.amazonCloudfrontS3) { - this.template("conditionals/_aws-credentials.json", "aws-credentials.json"); - } - else if (this.rsync) { - this.template("conditionals/_rsync-credentials.json", "rsync-credentials.json"); - } - }, - - install: function() { - this.installDependencies({ - skipInstall: this.options["skip-install"], - skipMessage: this.options["skip-install-message"] - }); - } -}); diff --git a/app/templates/Gemfile b/app/templates/Gemfile deleted file mode 100755 index 80d0344..0000000 --- a/app/templates/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -source "http://rubygems.org" - -gem 'jekyll' -gem 'redcarpet' -gem 'classifier-reborn' -gem 'fast-stemmer' diff --git a/app/templates/_README.md b/app/templates/_README.md deleted file mode 100755 index bad9b11..0000000 --- a/app/templates/_README.md +++ /dev/null @@ -1,3 +0,0 @@ -# <%= projectName %> - -[Describe the project.] diff --git a/app/templates/_bower.json b/app/templates/_bower.json deleted file mode 100755 index 885d2ad..0000000 --- a/app/templates/_bower.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "<%= _.slugify(appname) %>", - "version": "0.0.0", - "dependencies": {} -} diff --git a/app/templates/_package.json b/app/templates/_package.json deleted file mode 100755 index 06557ae..0000000 --- a/app/templates/_package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "<%= _.slugify(appname) %>", - "private": true, - "version": "0.0.0", - "description": "Yeoman workflow for <%= appname %>", - "dependencies": {}, - "devDependencies": { - "browser-sync": "^1.5.7",<% if (amazonCloudfrontS3) { %> - "concurrent-transform": "^1.0.0",<% } %> - "del": "^1.1.1", - "gulp": "^3.8.8", - "gulp-autoprefixer": "^2.0.0",<% if (amazonCloudfrontS3) { %> - "gulp-awspublish": "0.0.23", - "gulp-awspublish-router": "0.1.0",<% } %> - "gulp-cache": "~0.2.2", - "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-gzip": "0.0.8", - "gulp-htmlmin": "^0.2.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-rev-all": "^0.7.5", - "gulp-rev-replace": "^0.3.1",<% if (rsync) { %> - "gulp-rsync": "0.0.2",<% } %> - "gulp-sass": "^1.0.0", - "gulp-shell": "^0.2.9", - "gulp-size": "^1.1.0", - "gulp-uglify": "^1.0.1", - "gulp-uncss": "^0.5.0", - "gulp-useref": "^1.0.2", - "jshint-stylish": "^1.0.0", - "merge-stream": "^0.1.6" - }, - "engines": { - "node": ">0.10.0" - }, - "scripts": {} -} diff --git a/app/templates/app/_includes/head.html b/app/templates/app/_includes/head.html deleted file mode 100644 index 4e62d2e..0000000 --- a/app/templates/app/_includes/head.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - {% if page.title == "Home" %} - {{ site.title }} · {{ site.tagline }} - {% else %} - {{ page.title }} · {{ site.title }} - {% endif %} - - - - - - - - - - - - - - - - - - - - - diff --git a/app/templates/app/_includes/sidebar.html b/app/templates/app/_includes/sidebar.html deleted file mode 100644 index 0bf959c..0000000 --- a/app/templates/app/_includes/sidebar.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - diff --git a/app/templates/app/_layouts/default.html b/app/templates/app/_layouts/default.html deleted file mode 100644 index ed19ec7..0000000 --- a/app/templates/app/_layouts/default.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - {% include head.html %} - - - - {% include sidebar.html %} - - -
-
-
-

- {{ site.title }} - {{ site.tagline }} -

-
-
- -
- {{ content }} -
-
- - - - - diff --git a/app/templates/app/_layouts/page.html b/app/templates/app/_layouts/page.html deleted file mode 100644 index 4e0d4eb..0000000 --- a/app/templates/app/_layouts/page.html +++ /dev/null @@ -1,8 +0,0 @@ ---- -layout: default ---- - -
-

{{ page.title }}

- {{ content }} -
diff --git a/app/templates/app/_layouts/post.html b/app/templates/app/_layouts/post.html deleted file mode 100644 index 2a6c7c1..0000000 --- a/app/templates/app/_layouts/post.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -layout: default ---- - -
-

{{ page.title }}

- {{ page.date | date_to_string }} - {{ content }} -
- - diff --git a/app/templates/app/_posts/2014-03-02-introducing-poole.md b/app/templates/app/_posts/2014-03-02-introducing-poole.md deleted file mode 100644 index 5504435..0000000 --- a/app/templates/app/_posts/2014-03-02-introducing-poole.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -layout: post -date: 2014-03-02 -title: Introducing Poole -categories: jekyll poole ---- - -*The Strange Case of Dr. Jeykll and Mr. Hyde* tells the story of a lawyer -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. - ------ - -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 -provide a clear and concise foundational setup for any Jekyll site. It does so -by furnishing a full vanilla Jekyll install with example templates, pages, -posts, and styles. - -There are currently two themes built on Poole: - -* [Hyde](http://hyde.getpoole.com) -* [Lanyon](http://lanyon.getpoole.com) - -Learn more and contribute on [GitHub](https://github.com/poole). - -### What's included - -Poole is a streamlined Jekyll site designed and built as a foundation for -building more meaningful themes. Poole, and every theme built on it, includes -the following: - -* Complete Jekyll setup included (layouts, config, [404](/404), [RSS - feed](/atom.xml), posts, and [example page](/about)) -* Mobile friendly design and development -* Easily scalable text and component sizing with `rem` units in the CSS -* Support for a wide gamut of HTML elements -* Related posts (time-based, because Jekyll) below each post -* Syntax highlighting, courtesy Pygments (the Python-based code snippet - highlighter) - -Additional features are available in individual themes. - -### Browser support - -Poole and it's themes are by preference a forward-thinking project. In addition -to the latest versions of Chrome, Safari (mobile and desktop), and Firefox, it -is only compatible with Internet Explorer 9 and above. - -### Download - -Poole is developed on and hosted with GitHub. Head to the GitHub repository for downloads, bug -reports, and features requests. - -Thanks! diff --git a/app/templates/app/about.md b/app/templates/app/about.md deleted file mode 100644 index 9b2605b..0000000 --- a/app/templates/app/about.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -layout: page -title: About ---- - -

- Hey there! This page is included as an example. Feel free to customize it for your own use upon downloading. Carry on! -

- -In the novel, *The Strange Case of Dr. Jeykll and Mr. Hyde*, Mr. Poole is Dr. Jekyll's virtuous and loyal butler. Similarly, Poole is an upstanding and effective butler that helps you build Jekyll themes. It's made by [@mdo](https://twitter.com/mdo). - -There are currently two themes built on Poole: - -* [Hyde](http://hyde.getpoole.com) -* [Lanyon](http://lanyon.getpoole.com) - -Learn more and contribute on [GitHub](https://github.com/poole). - -## Setup - -Some fun facts about the setup of this project include: - -* Built for [Jekyll](http://jekyllrb.com) -* Developed on GitHub and hosted for free on [GitHub Pages](https://pages.github.com) -* Coded with [Sublime Text 2](http://sublimetext.com), an amazing code editor -* Designed and developed while listening to music like [Blood Bros Trilogy](https://soundcloud.com/maddecent/sets/blood-bros-series) - -Have questions or suggestions? Feel free to [open an issue on GitHub](https://github.com/poole/issues/new) or [ask me on Twitter](https://twitter.com/mdo). - -Thanks for reading! diff --git a/app/templates/app/assets/javascript/javascript.js b/app/templates/app/assets/javascript/javascript.js deleted file mode 100644 index e69de29..0000000 diff --git a/app/templates/app/assets/javascript/somejavascript.js b/app/templates/app/assets/javascript/somejavascript.js deleted file mode 100644 index e69de29..0000000 diff --git a/app/templates/app/assets/scss/lanyon.scss b/app/templates/app/assets/scss/lanyon.scss deleted file mode 100644 index 5fcad21..0000000 --- a/app/templates/app/assets/scss/lanyon.scss +++ /dev/null @@ -1,542 +0,0 @@ -/* - * ___ - * /\_ \ - * \//\ \ __ ___ __ __ ___ ___ - * \ \ \ /'__`\ /' _ `\/\ \/\ \ / __`\ /' _ `\ - * \_\ \_/\ \_\.\_/\ \/\ \ \ \_\ \/\ \_\ \/\ \/\ \ - * /\____\ \__/.\_\ \_\ \_\/`____ \ \____/\ \_\ \_\ - * \/____/\/__/\/_/\/_/\/_/`/___/> \/___/ \/_/\/_/ - * /\___/ - * \/__/ - * - * Designed, built, and released under MIT license by @mdo. Learn more at - * https://github.com/poole/lanyon. - */ - -/* - * Contents - * - * Global resets - * Masthead - * Sidebar - * Slide effect - * Posts and pages - * Pagination - * Reverse layout - * Themes - */ - -/* - * Global resets - * - * Update the foundational and global aspects of the page. - */ - -/* Prevent scroll on narrow devices */ - -html, body { - overflow-x: hidden; -} - -html { - font-family: "PT Serif", Georgia, "Times New Roman", serif; -} - -h1, h2, h3, h4, h5, h6 { - font-family: "PT Sans", Helvetica, Arial, sans-serif; - font-weight: 400; - color: #313131; - letter-spacing: -.025rem; -} - -/* - * Wrapper - * - * The wrapper is used to position site content when the sidebar is toggled. We - * use an outter wrap to position the sidebar without interferring with the - * regular page content. - */ - -.wrap { - position: relative; - width: 100%; -} - -/* - * Container - * - * Center the page content. - */ - -.container { - max-width: 28rem; -} - -@media (min-width: 38rem) { - .container { - max-width: 32rem; - } -} - -@media (min-width: 56rem) { - .container { - max-width: 38rem; - } -} - -/* - * Masthead - * - * Super small header above the content for site name and short description. - */ - -.masthead { - padding-top: 1rem; - padding-bottom: 1rem; - margin-bottom: 3rem; - border-bottom: 1px solid #eee; -} - -.masthead-title { - margin-top: 0; - margin-bottom: 0; - color: #505050; - a { - color: #505050; - } - small { - font-size: 75%; - font-weight: 400; - color: #c0c0c0; - letter-spacing: 0; - } -} - -@media (max-width: 48rem) { - .masthead-title { - text-align: center; - small { - display: none; - } - } -} - -/* - * Sidebar - * - * The sidebar is the drawer, the item we are toggling with our handy hamburger - * button in the corner of the page. - * - * This particular sidebar implementation was inspired by Chris Coyier's - * "Offcanvas Menu with CSS Target" article, and the checkbox variation from the - * comments by a reader. It modifies both implementations to continue using the - * checkbox (no change in URL means no polluted browser history), but this uses - * `position` for the menu to avoid some potential content reflow issues. - * - * Source: http://css-tricks.com/off-canvas-menu-with-css-target/#comment-207504 - */ - -/* Style and "hide" the sidebar */ - -.sidebar { - position: fixed; - top: 0; - bottom: 0; - left: -14rem; - width: 14rem; - visibility: hidden; - overflow-y: auto; - font-family: "PT Sans", Helvetica, Arial, sans-serif; - font-size: .875rem; - /* 15px */ - color: rgba(255, 255, 255, 0.6); - background-color: #202020; - -webkit-transition: all .3s ease-in-out; - transition: all .3s ease-in-out; - a { - font-weight: normal; - color: #fff; - } -} - -@media (min-width: 30rem) { - .sidebar { - font-size: .75rem; - /* 14px */ - } -} - -/* Sidebar content */ - -.sidebar-item { - padding: 1rem; - p:last-child { - margin-bottom: 0; - } -} - -/* Sidebar nav */ - -.sidebar-nav { - border-bottom: 1px solid rgba(255, 255, 255, 0.1); -} - -.sidebar-nav-item { - display: block; - padding: .5rem 1rem; - border-top: 1px solid rgba(255, 255, 255, 0.1); - &.active { - text-decoration: none; - background-color: rgba(255, 255, 255, 0.1); - border-color: transparent; - } -} - -a.sidebar-nav-item { - &:hover, &:focus { - text-decoration: none; - background-color: rgba(255, 255, 255, 0.1); - border-color: transparent; - } -} - -@media (min-width: 48rem) { - .sidebar-item { - padding: 1.5rem; - } - .sidebar-nav-item { - padding-left: 1.5rem; - padding-right: 1.5rem; - } -} - -/* Hide the sidebar checkbox that we toggle with `.sidebar-toggle` */ - -.sidebar-checkbox { - display: none; -} - -/* Style the `label` that we use to target the `.sidebar-checkbox` */ - -.sidebar-toggle { - position: absolute; - top: 1rem; - left: 1rem; - display: block; - width: 2.2rem; - padding: .5rem .65rem; - color: #505050; - background-color: #fff; - border-radius: 4px; - cursor: pointer; - &:before { - display: block; - content: ""; - width: 100%; - padding-bottom: .125rem; - border-top: .375rem double; - border-bottom: .125rem solid; - /* Make the border inside the box */ - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - } - &:active { - color: #fff; - background-color: #505050; - } -} - -#sidebar-checkbox:checked ~ .sidebar-toggle { - color: #fff; - background-color: #505050; -} - -@media (min-width: 30.1rem) { - .sidebar-toggle { - position: fixed; - width: 2.25rem; - &:before { - padding-bottom: .15rem; - border-top-width: .45rem; - border-bottom-width: .15rem; - } - } -} - -/* Slide effect - * - * Handle the sliding effects of the sidebar and content in one spot, seperate - * from the default styles. - * - * As an a heads up, we don't use `transform: translate3d()` here because when - * mixed with `position: fixed;` for the sidebar toggle, it creates a new - * containing block. Put simply, the fixed sidebar toggle behaves like - * `position: absolute;` when transformed. - * - * Read more about it at http://meyerweb.com/eric/thoughts/2011/09/12/. - */ - -.wrap, .sidebar, .sidebar-toggle { - -webkit-backface-visibility: hidden; - -ms-backface-visibility: hidden; - backface-visibility: hidden; -} - -.wrap, .sidebar-toggle { - -webkit-transition: -webkit-transform .3s ease-in-out; - transition: transform .3s ease-in-out; -} - -#sidebar-checkbox:checked { - + .sidebar { - visibility: visible; - } - ~ { - .sidebar, .wrap, .sidebar-toggle { - -webkit-transform: translateX(14rem); - -ms-transform: translateX(14rem); - transform: translateX(14rem); - } - } -} - -/* - * Posts and pages - * - * Each post is wrapped in `.post` and is used on default and post layouts. Each - * page is wrapped in `.page` and is only used on the page layout. - */ - -.page, .post { - margin-bottom: 4em; -} - -/* Blog post or page title */ - -.page-title { - color: #303030; -} - -.post-title { - color: #303030; - a { - color: #303030; - } -} - -.page-title, .post-title { - margin-top: 0; -} - -/* Meta data line below post title */ - -.post-date { - display: block; - margin-top: -.5rem; - margin-bottom: 1rem; - color: #9a9a9a; -} - -/* Related posts */ - -.related { - padding-top: 2rem; - padding-bottom: 2rem; - border-top: 1px solid #eee; -} - -.related-posts { - padding-left: 0; - list-style: none; - h3 { - margin-top: 0; - } - li { - small { - font-size: 75%; - color: #999; - } - a:hover { - color: #268bd2; - text-decoration: none; - small { - color: inherit; - } - } - } -} - -/* - * Pagination - * - * Super lightweight (HTML-wise) blog pagination. `span`s are provide for when - * there are no more previous or next posts to show. - */ - -.pagination { - overflow: hidden; - /* clearfix */ - margin-left: -1rem; - margin-right: -1rem; - font-family: "PT Sans", Helvetica, Arial, sans-serif; - color: #ccc; - text-align: center; -} - -/* Pagination items can be `span`s or `a`s */ - -.pagination-item { - display: block; - padding: 1rem; - border: 1px solid #eee; - &:first-child { - margin-bottom: -1px; - } -} - -/* Only provide a hover state for linked pagination items */ - -a.pagination-item:hover { - background-color: #f5f5f5; -} - -@media (min-width: 30rem) { - .pagination { - margin: 3rem 0; - } - .pagination-item { - float: left; - width: 50%; - &:first-child { - margin-bottom: 0; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; - } - &:last-child { - margin-left: -1px; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - } - } -} - -/* - * Reverse layout - * - * Flip the orientation of the page by placing the `.sidebar` and sidebar toggle - * on the right side. - */ - -.layout-reverse { - .sidebar { - left: auto; - right: -14rem; - } - .sidebar-toggle { - left: auto; - right: 1rem; - } - #sidebar-checkbox:checked ~ { - .sidebar, .wrap, .sidebar-toggle { - -webkit-transform: translateX(-14rem); - -ms-transform: translateX(-14rem); - transform: translateX(-14rem); - } - } -} - -/* - * Themes - * - * Apply custom color schemes by adding the appropriate class to the `body`. - * Based on colors from Base16: http://chriskempson.github.io/base16/#default. - */ - -/* Red */ - -.theme-base-08 { - .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { - background-color: #ac4142; - } - .container a, .sidebar-toggle, .related-posts li a:hover { - color: #ac4142; - } -} - -/* Orange */ - -.theme-base-09 { - .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { - background-color: #d28445; - } - .container a, .sidebar-toggle, .related-posts li a:hover { - color: #d28445; - } -} - -/* Yellow */ - -.theme-base-0a { - .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { - background-color: #f4bf75; - } - .container a, .sidebar-toggle, .related-posts li a:hover { - color: #f4bf75; - } -} - -/* Green */ - -.theme-base-0b { - .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { - background-color: #90a959; - } - .container a, .sidebar-toggle, .related-posts li a:hover { - color: #90a959; - } -} - -/* Cyan */ - -.theme-base-0c { - .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { - background-color: #75b5aa; - } - .container a, .sidebar-toggle, .related-posts li a:hover { - color: #75b5aa; - } -} - -/* Blue */ - -.theme-base-0d { - .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { - background-color: #6a9fb5; - } - .container a, .sidebar-toggle, .related-posts li a:hover { - color: #6a9fb5; - } -} - -/* Magenta */ - -.theme-base-0e { - .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { - background-color: #aa759f; - } - .container a, .sidebar-toggle, .related-posts li a:hover { - color: #aa759f; - } -} - -/* Brown */ - -.theme-base-0f { - .sidebar, .sidebar-toggle:active, #sidebar-checkbox:checked ~ .sidebar-toggle { - background-color: #8f5536; - } - .container a, .sidebar-toggle, .related-posts li a:hover { - color: #8f5536; - } -} diff --git a/app/templates/app/assets/scss/poole.scss b/app/templates/app/assets/scss/poole.scss deleted file mode 100644 index 69e6dd1..0000000 --- a/app/templates/app/assets/scss/poole.scss +++ /dev/null @@ -1,425 +0,0 @@ -/* - * ___ - * /\_ \ - * _____ ___ ___\//\ \ __ - * /\ '__`\ / __`\ / __`\\ \ \ /'__`\ - * \ \ \_\ \/\ \_\ \/\ \_\ \\_\ \_/\ __/ - * \ \ ,__/\ \____/\ \____//\____\ \____\ - * \ \ \/ \/___/ \/___/ \/____/\/____/ - * \ \_\ - * \/_/ - * - * Designed, built, and released under MIT license by @mdo. Learn more at - * https://github.com/poole/poole. - */ - -/* - * Contents - * - * Body resets - * Custom type - * Messages - * Container - * Masthead - * Posts and pages - * Pagination - * Reverse layout - * Themes - */ - -/* - * Body resets - * - * Update the foundational and global aspects of the page. - */ - -* { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -html, body { - margin: 0; - padding: 0; -} - -html { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 16px; - line-height: 1.5; -} - -@media (min-width: 38rem) { - html { - font-size: 20px; - } -} - -body { - color: #515151; - background-color: #fff; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; -} - -/* No `:visited` state is required by default (browsers will use `a`) */ - -a { - color: #268bd2; - text-decoration: none; - &:hover, &:focus { - text-decoration: underline; - } -} - -/* `:focus` is linked to `:hover` for basic accessibility */ - -/* Headings */ - -h1, h2, h3, h4, h5, h6 { - margin-bottom: .5rem; - font-weight: bold; - line-height: 1.25; - color: #313131; - text-rendering: optimizeLegibility; -} - -h1 { - font-size: 2rem; -} - -h2 { - margin-top: 1rem; - font-size: 1.5rem; -} - -h3 { - margin-top: 1.5rem; - font-size: 1.25rem; -} - -h4, h5, h6 { - margin-top: 1rem; - font-size: 1rem; -} - -/* Body text */ - -p { - margin-top: 0; - margin-bottom: 1rem; -} - -strong { - color: #303030; -} - -/* Lists */ - -ul, ol, dl { - margin-top: 0; - margin-bottom: 1rem; -} - -dt { - font-weight: bold; -} - -dd { - margin-bottom: .5rem; -} - -/* Misc */ - -hr { - position: relative; - margin: 1.5rem 0; - border: 0; - border-top: 1px solid #eee; - border-bottom: 1px solid #fff; -} - -abbr { - font-size: 85%; - font-weight: bold; - color: #555; - text-transform: uppercase; - &[title] { - cursor: help; - border-bottom: 1px dotted #e5e5e5; - } -} - -/* Code */ - -code, pre { - font-family: Menlo, Monaco, "Courier New", monospace; -} - -code { - padding: .25em .5em; - font-size: 85%; - color: #bf616a; - background-color: #f9f9f9; - border-radius: 3px; -} - -pre { - display: block; - margin-top: 0; - margin-bottom: 1rem; - padding: 1rem; - font-size: .8rem; - line-height: 1.4; - white-space: pre; - white-space: pre-wrap; - word-break: break-all; - word-wrap: break-word; - background-color: #f9f9f9; - code { - padding: 0; - font-size: 100%; - color: inherit; - background-color: transparent; - } -} - -.highlight { - margin-bottom: 1rem; - border-radius: 4px; - pre { - margin-bottom: 0; - } -} - -/* Quotes */ - -blockquote { - padding: .5rem 1rem; - margin: .8rem 0; - color: #7a7a7a; - border-left: .25rem solid #e5e5e5; - p:last-child { - margin-bottom: 0; - } -} - -@media (min-width: 30rem) { - blockquote { - padding-right: 5rem; - padding-left: 1.25rem; - } -} - -img { - display: block; - margin: 0 0 1rem; - border-radius: 5px; -} - -/* Tables */ - -table { - margin-bottom: 1rem; - width: 100%; - border: 1px solid #e5e5e5; - border-collapse: collapse; -} - -td, th { - padding: .25rem .5rem; - border: 1px solid #e5e5e5; -} - -tbody tr:nth-child(odd) { - td, th { - background-color: #f9f9f9; - } -} - -/* - * Custom type - * - * Extend paragraphs with `.lead` for larger introductory text. - */ - -.lead { - font-size: 1.25rem; - font-weight: 300; -} - -/* - * Messages - * - * Show alert messages to users. You may add it to single elements like a `

`, - * or to a parent if there are multiple elements to show. - */ - -.message { - margin-bottom: 1rem; - padding: 1rem; - color: #717171; - background-color: #f9f9f9; -} - -/* - * Container - * - * Center the page content. - */ - -.container { - max-width: 38rem; - padding-left: 1rem; - padding-right: 1rem; - margin-left: auto; - margin-right: auto; -} - -/* - * Masthead - * - * Super small header above the content for site name and short description. - */ - -.masthead { - padding-top: 1rem; - padding-bottom: 1rem; - margin-bottom: 3rem; -} - -.masthead-title { - margin-top: 0; - margin-bottom: 0; - color: #505050; - a { - color: #505050; - } - small { - font-size: 75%; - font-weight: 400; - color: #c0c0c0; - letter-spacing: 0; - } -} - -/* - * Posts and pages - * - * Each post is wrapped in `.post` and is used on default and post layouts. Each - * page is wrapped in `.page` and is only used on the page layout. - */ - -.page, .post { - margin-bottom: 4em; -} - -/* Blog post or page title */ - -.page-title { - color: #303030; -} - -.post-title { - color: #303030; - a { - color: #303030; - } -} - -.page-title, .post-title { - margin-top: 0; -} - -/* Meta data line below post title */ - -.post-date { - display: block; - margin-top: -.5rem; - margin-bottom: 1rem; - color: #9a9a9a; -} - -/* Related posts */ - -.related { - padding-top: 2rem; - padding-bottom: 2rem; - border-top: 1px solid #eee; -} - -.related-posts { - padding-left: 0; - list-style: none; - h3 { - margin-top: 0; - } - li { - small { - font-size: 75%; - color: #999; - } - a:hover { - color: #268bd2; - text-decoration: none; - small { - color: inherit; - } - } - } -} - -/* - * Pagination - * - * Super lightweight (HTML-wise) blog pagination. `span`s are provide for when - * there are no more previous or next posts to show. - */ - -.pagination { - overflow: hidden; - /* clearfix */ - margin-left: -1rem; - margin-right: -1rem; - font-family: "PT Sans", Helvetica, Arial, sans-serif; - color: #ccc; - text-align: center; -} - -/* Pagination items can be `span`s or `a`s */ - -.pagination-item { - display: block; - padding: 1rem; - border: 1px solid #eee; - &:first-child { - margin-bottom: -1px; - } -} - -/* Only provide a hover state for linked pagination items */ - -a.pagination-item:hover { - background-color: #f5f5f5; -} - -@media (min-width: 30rem) { - .pagination { - margin: 3rem 0; - } - .pagination-item { - float: left; - width: 50%; - &:first-child { - margin-bottom: 0; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; - } - &:last-child { - margin-left: -1px; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - } - } -} diff --git a/app/templates/app/assets/scss/style.scss b/app/templates/app/assets/scss/style.scss deleted file mode 100644 index 93e94eb..0000000 --- a/app/templates/app/assets/scss/style.scss +++ /dev/null @@ -1,7 +0,0 @@ -/* -The main SCSS file for everything, yep -*/ - -@import "poole"; -@import "syntax"; -@import "lanyon"; diff --git a/app/templates/app/assets/scss/syntax.scss b/app/templates/app/assets/scss/syntax.scss deleted file mode 100644 index 5aa1e8a..0000000 --- a/app/templates/app/assets/scss/syntax.scss +++ /dev/null @@ -1,66 +0,0 @@ -.hll { background-color: #ffffcc } - //{ background: #f0f3f3; } -.c { color: #999; } // Comment -.err { color: #AA0000; background-color: #FFAAAA } // Error -.k { color: #006699; } // Keyword -.o { color: #555555 } // Operator -.cm { color: #0099FF; font-style: italic } // Comment.Multiline -.cp { color: #009999 } // Comment.Preproc -.c1 { color: #999; } // Comment.Single -.cs { color: #999; } // Comment.Special -.gd { background-color: #FFCCCC; border: 1px solid #CC0000 } // Generic.Deleted -.ge { font-style: italic } // Generic.Emph -.gr { color: #FF0000 } // Generic.Error -.gh { color: #003300; } // Generic.Heading -.gi { background-color: #CCFFCC; border: 1px solid #00CC00 } // Generic.Inserted -.go { color: #AAAAAA } // Generic.Output -.gp { color: #000099; } // Generic.Prompt -.gs { } // Generic.Strong -.gu { color: #003300; } // Generic.Subheading -.gt { color: #99CC66 } // Generic.Traceback -.kc { color: #006699; } // Keyword.Constant -.kd { color: #006699; } // Keyword.Declaration -.kn { color: #006699; } // Keyword.Namespace -.kp { color: #006699 } // Keyword.Pseudo -.kr { color: #006699; } // Keyword.Reserved -.kt { color: #007788; } // Keyword.Type -.m { color: #FF6600 } // Literal.Number -.s { color: #d44950 } // Literal.String -.na { color: #4f9fcf } // Name.Attribute -.nb { color: #336666 } // Name.Builtin -.nc { color: #00AA88; } // Name.Class -.no { color: #336600 } // Name.Constant -.nd { color: #9999FF } // Name.Decorator -.ni { color: #999999; } // Name.Entity -.ne { color: #CC0000; } // Name.Exception -.nf { color: #CC00FF } // Name.Function -.nl { color: #9999FF } // Name.Label -.nn { color: #00CCFF; } // Name.Namespace -.nt { color: #2f6f9f; } // Name.Tag -.nv { color: #003333 } // Name.Variable -.ow { color: #000000; } // Operator.Word -.w { color: #bbbbbb } // Text.Whitespace -.mf { color: #FF6600 } // Literal.Number.Float -.mh { color: #FF6600 } // Literal.Number.Hex -.mi { color: #FF6600 } // Literal.Number.Integer -.mo { color: #FF6600 } // Literal.Number.Oct -.sb { color: #CC3300 } // Literal.String.Backtick -.sc { color: #CC3300 } // Literal.String.Char -.sd { color: #CC3300; font-style: italic } // Literal.String.Doc -.s2 { color: #CC3300 } // Literal.String.Double -.se { color: #CC3300; } // Literal.String.Escape -.sh { color: #CC3300 } // Literal.String.Heredoc -.si { color: #AA0000 } // Literal.String.Interpol -.sx { color: #CC3300 } // Literal.String.Other -.sr { color: #33AAAA } // Literal.String.Regex -.s1 { color: #CC3300 } // Literal.String.Single -.ss { color: #FFCC33 } // Literal.String.Symbol -.bp { color: #336666 } // Name.Builtin.Pseudo -.vc { color: #003333 } // Name.Variable.Class -.vg { color: #003333 } // Name.Variable.Global -.vi { color: #003333 } // Name.Variable.Instance -.il { color: #FF6600 } // Literal.Number.Integer.Long - -.css .o, -.css .o + .nt, -.css .nt + .nt { color: #999; } diff --git a/app/templates/app/atom.xml b/app/templates/app/atom.xml deleted file mode 100644 index 96c9681..0000000 --- a/app/templates/app/atom.xml +++ /dev/null @@ -1,28 +0,0 @@ ---- -layout: null ---- - - - - - {{ site.title }} - - - {{ site.time | date_to_xmlschema }} - {{ site.url }} - - {{ site.author.name }} - {{ site.author.email }} - - - {% for post in site.posts %} - - {{ post.title }} - - {{ post.date | date_to_xmlschema }} - {{ site.url }}{{ post.id }} - {{ post.content | xml_escape }} - - {% endfor %} - - diff --git a/app/templates/app/index.html b/app/templates/app/index.html deleted file mode 100644 index bc173f9..0000000 --- a/app/templates/app/index.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -layout: default -title: Home ---- - -

- {% for post in paginator.posts %} -
-

- - {{ post.title }} - -

- - - - {{ post.excerpt }} - - Read more » -
- {% endfor %} -
- - diff --git a/app/templates/app/sitemap.xml b/app/templates/app/sitemap.xml deleted file mode 100644 index 72f9372..0000000 --- a/app/templates/app/sitemap.xml +++ /dev/null @@ -1,56 +0,0 @@ ---- -layout: null ---- - - - - {{ site.url }}/ - {{ site.time | date_to_xmlschema }} - weekly - 1.0 - - {% for post in site.posts %} - - {{ site.url }}{{ post.url }} - {% if post.sitemap.lastmod %} - {{ post.sitemap.lastmod | date: "%Y-%m-%d" }} - {% elsif post.date %} - {{ post.date | date_to_xmlschema }} - {% else %} - {{ site.time | date_to_xmlschema }} - {% endif %} - {% if post.sitemap.changefreq %} - {{ post.sitemap.changefreq }} - {% else %} - monthly - {% endif %} - {% if post.sitemap.priority %} - {{ post.sitemap.priority }} - {% else %} - 0.5 - {% endif %} - - {% endfor %} - {% for page in site.pages %} - - {{ site.url }}{{ page.url }} - {% if page.sitemap.lastmod %} - {{ page.sitemap.lastmod | date: "%Y-%m-%d" }} - {% elsif page.date %} - {{ page.date | date_to_xmlschema }} - {% else %} - {{ site.time | date_to_xmlschema }} - {% endif %} - {% if page.sitemap.changefreq %} - {{ page.sitemap.changefreq }} - {% else %} - monthly - {% endif %} - {% if page.sitemap.priority %} - {{ page.sitemap.priority }} - {% else %} - 0.3 - {% endif %} - - {% endfor %} - diff --git a/app/templates/bowerrc b/app/templates/bowerrc deleted file mode 100644 index f79669e..0000000 --- a/app/templates/bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "src/_bower_components" -} diff --git a/app/templates/conditionals/_aws-credentials.json b/app/templates/conditionals/_aws-credentials.json deleted file mode 100644 index 7a16e0c..0000000 --- a/app/templates/conditionals/_aws-credentials.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "key": "<%= amazonKey %>", - "secret": "<%= amazonSecret %>", - "bucket": "<%= amazonBucket %>", - "region": "us-west-1", - "distributionId": "<%= amazonDistID %>" -} diff --git a/app/templates/conditionals/_rsync-credentials.json b/app/templates/conditionals/_rsync-credentials.json deleted file mode 100644 index 37fcc84..0000000 --- a/app/templates/conditionals/_rsync-credentials.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "username": "<%= rsyncUsername %>", - "hostname": "<%= rsyncHostname %>", - "destination": "<%= rsyncDestination %>" -} diff --git a/app/templates/gulpfile.js b/app/templates/gulpfile.js deleted file mode 100755 index 8a2a1e5..0000000 --- a/app/templates/gulpfile.js +++ /dev/null @@ -1,267 +0,0 @@ -// Generated on <%= (new Date).toISOString().split("T")[0] %> using <%= pkg.name %> <%= pkg.version %> -"use strict"; - -var gulp = require("gulp"); -// Loads the plugins without having to list all of them, but you need -// to call them as $.pluginname -var $ = require("gulp-load-plugins")(); -// "del" is used to clean out directories and such -var del = require("del"); -<% if (amazonCloudfrontS3) { %>// Parallelize the uploads when uploading to Amazon S3 -// "fs" is used to read files from the system (used for AWS uploading) -var fs = require("fs"); -var parallelize = require("concurrent-transform"); -<% } %>// BrowserSync isn"t a gulp package, and needs to be loaded manually -var browserSync = require("browser-sync"); -// merge is used to merge the output from two different streams into the same stream -var merge = require("merge-stream"); -// Need a command for reloading webpages using BrowserSync -var reload = browserSync.reload; -// And define a variable that BrowserSync uses in it"s function -var bs; - -// Deletes the directory that is used to serve the site during development -gulp.task("clean:dev", del.bind(null, ["serve"])); - -// Deletes the directory that the optimized site is output to -gulp.task("clean:prod", del.bind(null, ["site"])); - -// Runs the build command for Jekyll to compile the site locally -// This will build the site with the production settings -gulp.task("jekyll:dev", $.shell.task("jekyll build")); -gulp.task("jekyll-rebuild", ["jekyll:dev"], function () { - reload; -}); - -// Almost identical to the above task, but instead we load in the build configuration -// that overwrites some of the settings in the regular configuration so that you -// don"t end up publishing your drafts or future posts -gulp.task("jekyll:prod", $.shell.task("jekyll build --config _config.yml,_config.build.yml")); - -// Compiles the SASS files and moves them into the "assets/stylesheets" directory -gulp.task("styles", function () { - // Looks at the style.scss file for what to include and creates a style.css file - return gulp.src("src/assets/scss/style.scss") - .pipe($.sass()) - // AutoPrefix your CSS so it works between browsers - .pipe($.autoprefixer("last 1 version", { cascade: true })) - // Directory your CSS file goes to - .pipe(gulp.dest("src/assets/stylesheets/")) - .pipe(gulp.dest("serve/assets/stylesheets/")) - // Outputs the size of the CSS file - .pipe($.size({title: "styles"})) - // Injects the CSS changes to your browser since Jekyll doesn"t rebuild the CSS - .pipe(reload({stream: true})); -}); - -// Optimizes the images that exists -gulp.task("images", function () { - return gulp.src("src/assets/images/**") - .pipe($.changed("site/assets/images")) - .pipe($.imagemin({ - // Lossless conversion to progressive JPGs - progressive: true, - // Interlace GIFs for progressive rendering - interlaced: true - })) - .pipe(gulp.dest("site/assets/images")) - .pipe($.size({title: "images"})); -}); - -// Copy over fonts to the "site" directory -gulp.task("fonts", function () { - return gulp.src("src/assets/fonts/**") - .pipe(gulp.dest("site/assets/fonts")) - .pipe($.size({ title: "fonts" })); -}); - -// Copy xml and txt files to the "site" directory -gulp.task("copy", function () { - return gulp.src(["serve/*.txt", "serve/*.xml"]) - .pipe(gulp.dest("site")) - .pipe($.size({ title: "xml & txt" })) -}); - -// Optimizes all the CSS, HTML and concats the JS etc -gulp.task("html", ["styles"], function () { - var assets = $.useref.assets({searchPath: "serve"}); - - return gulp.src("serve/**/*.html") - .pipe(assets) - // Concatenate JavaScript files and preserve important comments - .pipe($.if("*.js", $.uglify({preserveComments: "some"}))) - // Minify CSS - .pipe($.if("*.css", $.minifyCss())) - // Start cache busting the files - .pipe($.revAll({ ignore: [".eot", ".svg", ".ttf", ".woff"] })) - .pipe(assets.restore()) - // Conctenate your files based on what you specified in _layout/header.html - .pipe($.useref()) - // Replace the asset names with their cache busted names - .pipe($.revReplace()) - // Minify HTML - .pipe($.if("*.html", $.htmlmin({ - removeComments: true, - removeCommentsFromCDATA: true, - removeCDATASectionsFromCDATA: true, - collapseWhitespace: true, - collapseBooleanAttributes: true, - removeAttributeQuotes: true, - removeRedundantAttributes: true - }))) - // Send the output to the correct folder - .pipe(gulp.dest("site")) - .pipe($.size({title: "optimizations"})); -}); - -<% if (amazonCloudfrontS3) { %>// Task to deploy your site to Amazon S3 and Cloudfront -gulp.task("deploy", function () { - // Generate the needed credentials (bucket, secret key etc) from a "hidden" JSON file - var credentials = JSON.parse(fs.readFileSync("aws-credentials.json", "utf8")); - var publisher = $.awspublish.create(credentials); - // Give your files the proper headers - var headers = { - "Cache-Control": "max-age=0, no-transform, public", - "Content-Encoding": "gzip" - }; - - gulp.src("site/**/*") - .pipe($.awspublishRouter({ - routes: { - "^assets/(?:.+)\\.(?:js|css)$": { - key: "$&", - headers: { - "Cache-Control": "max-age=315360000, no-transform, public", - "Content-Encoding": "gzip" - } - }, - - "^assets/(?:.+)\\.(?:jpg|png|gif)$": { - key: "$&", - headers: { - "Cache-Control": "max-age=315360000, no-transform, public", - "Content-Encoding": "gzip" - } - }, - - "^assets/fonts/(?:.+)\\.(?:eot|svg|ttf|woff)$": { - key: "$&", - headers: { - "Cache-Control": "max-age=315360000, no-transform, public" - } - }, - - "^.+\\.html": { - key: "$&", - headers: { - "Cache-Control": "max-age=0, no-transform, public", - "Content-Encoding": "gzip" - } - }, - "^.+$": "$&" - } - })) - // Gzip the files for moar speed - .pipe($.awspublish.gzip()) - // Parallelize the number of concurrent uploads, in this case 30 - .pipe(parallelize(publisher.publish(), 30)) - // Have your files in the system cache so you don"t have to recheck all the files every time - .pipe(publisher.cache()) - // Synchronize the contents of the bucket and local (this deletes everything that isn"t in local!) - .pipe(publisher.sync()) - // And print the ouput, glorious - .pipe($.awspublish.reporter()) - // And update the default root object - .pipe($.cloudfront(credentials)); -});<% } %><% if (rsync) { %> - -// Task to upload your site via Rsync to your server -gulp.task("deploy", function () { - // Load in the variables needed for our Rsync synchronization - var secret = require("./rsync-credentials.json"); - - return gulp.src("site/**") - .pipe($.rsync({ - // This uploads the contenst of "root", instead of the folder - root: "site", - // Find your username, hostname and destination from your rsync-credentials.json - hostname: secret.hostname, - username: secret.username, - destination: secret.destination, - // Incremental uploading, adds a small delay but minimizes the amount of files transferred - incremental: true, - // Shows the progress on your files while uploading - progress: true - })); -});<% } %><% if (githubPages) { %> -// Task to upload your site to your personal GH Pages repo -gulp.task("deploy", function () { - // Deploys your optimized site, you can change the settings in the html task if you want to - return gulp.src("./site/**/*") - .pipe($.ghPages({ - // Currently only personal GitHub Pages are supported so it will upload to the master - // branch and automatically overwrite anything that is in the directory - branch: "master" - })); -});<% } %> - -// Run JS Lint against your JS -gulp.task("jslint", function () { - gulp.src("./serve/assets/javascript/*.js") - // Checks your JS code quality against your .jshintrc file - .pipe($.jshint(".jshintrc")) - .pipe($.jshint.reporter()); -}); - -// Runs "jekyll doctor" on your site to check for errors with your configuration -// and will check for URL errors a well -gulp.task("doctor", $.shell.task("jekyll doctor")); - -// BrowserSync will serve our site on a local server for us and other devices to use -// It will also autoreload across all devices as well as keep the viewport synchronized -// between them. -gulp.task("serve:dev", ["styles", "jekyll:dev"], function () { - bs = browserSync({ - notify: true, - // tunnel: "", - server: { - baseDir: "serve" - } - }); -}); - -// These tasks will look for files that change while serving and will auto-regenerate or -// reload the website accordingly. Update or add other files you need to be watched. -gulp.task("watch", function () { - gulp.watch(["src/**/*.md", "src/**/*.html", "src/**/*.xml", "src/**/*.txt", "src/**/*.js"], ["jekyll-rebuild"]); - gulp.watch(["serve/assets/stylesheets/*.css"], reload); - gulp.watch(["src/assets/scss/**/*.scss"], ["styles"]); -}); - -// Serve the site after optimizations to see that everything looks fine -gulp.task("serve:prod", function () { - bs = browserSync({ - notify: false, - // tunnel: true, - server: { - baseDir: "site" - } - }); -}); - -// Default task, run when just writing "gulp" in the terminal -gulp.task("default", ["serve:dev", "watch"]); - -// Checks your CSS, JS and Jekyll for errors -gulp.task("check", ["jslint", "doctor"], function () { - // Better hope nothing is wrong. -}); - -// Builds the site but doesn"t serve it to you -gulp.task("build", ["jekyll:prod", "styles"], function () {}); - -// Builds your site with the "build" command and then runs all the optimizations on -// it and outputs it to "./site" -gulp.task("publish", ["build"], function () { - gulp.start("html", "copy", "images", "fonts"); -}); diff --git a/app/templates/jshintrc b/app/templates/jshintrc deleted file mode 100644 index 23ca7ec..0000000 --- a/app/templates/jshintrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "node": true, - "browser": true, - "esnext": true, - "bitwise": false, - "curly": false, - "eqeqeq": true, - "eqnull": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "quotmark": "single", - "undef": true, - "strict": false, - "trailing": true, - "smarttabs": true -} diff --git a/generators/app/index.js b/generators/app/index.js new file mode 100644 index 0000000..f29f768 --- /dev/null +++ b/generators/app/index.js @@ -0,0 +1,172 @@ +'use strict'; + +var _ = require('lodash'); +var chalk = require('chalk'); +var generators = require('yeoman-generator'); +var shelljs = require('shelljs'); +var yosay = require('yosay'); + +module.exports = generators.Base.extend({ + constructor: function () { + generators.Base.apply(this, arguments); + + this.option('skip-install', { + desc: 'Skip installing dependencies', + type: Boolean + }); + + this.option('skip-welcome-message', { + desc: 'Skips the welcome message', + type: Boolean + }); + + if (!this.options['skip-install']) { + var dependencies = ['ruby', 'bundle', 'yo', 'gulp', 'node'].every(function (depend) { + return shelljs.which(depend); + }); + + if (!dependencies) { + this.log(chalk.red('You are missing one or more dependencies!')); + this.log(chalk.yellow('Make sure you have the required dependencies, or that they are in $PATH')); + shelljs.exit(1); + } + } + }, + + initializing: function () { + this.props = {}; + this.pkg = this.fs.readJSON(this.destinationPath('package.json'), {}); + }, + + prompting: function () { + if (!this.options['skip-welcome-message']) { + this.log(yosay(`'Allo 'allo`)); + } + + var questions = [{ + name: 'projectName', + message: 'What is the name of your project?', + store: true + }, { + name: 'projectDescription', + message: 'Describe your project', + store: true + }, { + name: 'projectURL', + message: chalk.yellow('If you will be using Github Pages, use username.github.io\n') + + chalk.yellow('? ') + 'What will the URL for your project be?', + validate: i => i.startsWith('http') ? true : 'URL must contain either HTTP or HTTPs', + store: true + }, { + name: 'authorName', + message: 'What\'s your name?', + store: true + }, { + name: 'authorEmail', + message: 'What\'s your email?', + store: true + }, { + name: 'authorURI', + message: chalk.yellow('Can be the same as this site\n') + + chalk.yellow('? ') + 'What is your homepage?', + store: true + }, { + name: 'authorBio', + message: 'Write a short description about yourself', + store: true + }, { + name: 'uploading', + type: 'list', + message: 'How do you want to upload your site?', + choices: ['Amazon S3', 'Rsync', 'Github Pages', 'None'], + store: true + }, { + name: 'jekyllPermalinks', + type: 'list', + message: 'Permalink style' + (chalk.yellow( + '\n date: /:categories/:year/:month/:day/:title.html' + + '\n pretty: /:categories/:year/:month/:day/:title/' + + '\n ordinal: /:categories/:year/:y_day/:title.html' + + '\n none: /:categories/:title.html\n')), + choices: ['date', 'pretty', 'ordinal', 'none'], + store: true + }]; + + return this.prompt(questions).then(function (props) { + this.props = props; + }.bind(this)); + }, + + writing: function () { + var pkgJSONFields = { + name: _.kebabCase(this.props.projectName), + version: '0.0.0', + description: this.props.projectDescription, + homepage: this.props.projectURL, + author: { + name: this.props.authorName, + email: this.props.authorEmail + } + }; + + this.fs.writeJSON('package.json', _.extend(pkgJSONFields, this.pkg)); + }, + + default: function () { + this.composeWith('jekyllized:boilerplate', { + options: { + projectName: this.props.projectName, + projectDescription: this.props.projectDescription, + projectURL: this.props.projectURL, + authorName: this.props.authorName + } + }, { + local: require.resolve('../boilerplate') + }); + + this.composeWith('jekyllized:gulp', { + options: { + uploading: this.props.uploading + } + }, { + local: require.resolve('../gulp') + }); + + this.composeWith('jekyllized:jekyll', { + options: { + projectName: this.props.projectName, + projectDescription: this.props.projectDescription, + projectURL: this.props.projectURL, + authorName: this.props.authorName, + authorEmail: this.props.authorEmail, + authorURI: this.props.authorURI, + authorBio: this.props.authorBio, + jekyllPermalinks: this.props.jekyllPermalinks + } + }, { + local: require.resolve('../jekyll') + }); + }, + + installing: function () { + this.installDependencies({ + skipInstall: this.options['skip-install'] + }); + if (this.options['skip-install']) { + this.log('Please run bundle install to '); + } else { + this.spawnCommand('bundle', ['install', '--quiet']); + } + }, + + end: function () { + var skipInstallMessage = + '\nPlease run ' + chalk.blue('npm install') + ' and ' + + chalk.blue('bundle install') + ' to install dependencies'; + + if (this.options['skip-install']) { + this.log(skipInstallMessage); + return; + } + } +}); diff --git a/generators/boilerplate/index.js b/generators/boilerplate/index.js new file mode 100644 index 0000000..19a865d --- /dev/null +++ b/generators/boilerplate/index.js @@ -0,0 +1,61 @@ +'use strict'; + +var generators = require('yeoman-generator'); + +module.exports = generators.Base.extend({ + constructor: function () { + generators.Base.apply(this, arguments); + + this.option('projectName', { + type: String, + required: true, + desc: 'Project name' + }); + + this.option('projectDescription', { + type: String, + required: true, + desc: 'Project description' + }); + + this.option('projectURL', { + type: String, + required: true, + desc: 'Project URL' + }); + + this.option('authorName', { + type: String, + required: true, + desc: 'Author name' + }); + }, + + configuring: function () { + this.fs.copyTpl( + this.templatePath('README.md'), + this.destinationPath('README.md'), + { + projectName: this.options.projectName, + projectDescription: this.options.projectDescription, + projectURL: this.options.projectURL, + authorName: this.options.authorName + } + ); + + this.fs.copy( + this.templatePath('editorconfig'), + this.destinationPath('.editorconfig') + ); + + this.fs.copy( + this.templatePath('gitattributes'), + this.destinationPath('.gitattributes') + ); + + this.fs.copy( + this.templatePath('gitignore'), + this.destinationPath('.gitignore') + ); + } +}); diff --git a/generators/boilerplate/templates/README.md b/generators/boilerplate/templates/README.md new file mode 100644 index 0000000..73c0b09 --- /dev/null +++ b/generators/boilerplate/templates/README.md @@ -0,0 +1,45 @@ +# <%= projectName %> + +> <%= projectDescription %> + +## To get started + +```sh +$ gulp [--prod] +``` + +And you'll have a new Jekyll site generated for you and displayed in your +browser. Neato. If you want to run it with production settings, just add +`--prod`. + +#### Settings +In your `_config.yml` and `humans.txt` you should add your Github and Twitter +profile if you want to. + +## Usage + +```sh +$ gulp build [--prod] +``` + +```sh +$ gulp deploy +``` + +## Install +If you have cloned this repo or want to reinstall, make sure there's no +`node_modules` or `Gemfile.lock` folder/file and then run `npm install` and +`bundle install`. + +#### Update +To update: `npm update generator-jekyllized -g`, then run `yo jekyllized:gulp +[--rsync|amazon|pages]` in this directory. Note that this will overwrite any +local changes, so back it up. + +## Github +For more information on how to use your new project, please refer to the [README +on Github](https://github.com/sondr3/generator-jekyllized). + +## Owner + +> [<%= authorName %>](<%= projectURL %>) diff --git a/app/templates/editorconfig b/generators/boilerplate/templates/editorconfig similarity index 72% rename from app/templates/editorconfig rename to generators/boilerplate/templates/editorconfig index 8f6cc4f..4a7ea30 100644 --- a/app/templates/editorconfig +++ b/generators/boilerplate/templates/editorconfig @@ -1,4 +1,3 @@ -# http://editorconfig.org root = true [*] @@ -10,4 +9,4 @@ trim_trailing_whitespace = true insert_final_newline = true [*.md] -trim_trailing_whitespace = false \ No newline at end of file +trim_trailing_whitespace = false diff --git a/app/templates/gitattributes b/generators/boilerplate/templates/gitattributes similarity index 100% rename from app/templates/gitattributes rename to generators/boilerplate/templates/gitattributes diff --git a/app/templates/gitignore b/generators/boilerplate/templates/gitignore similarity index 93% rename from app/templates/gitignore rename to generators/boilerplate/templates/gitignore index 1ac3139..b48cd80 100644 --- a/app/templates/gitignore +++ b/generators/boilerplate/templates/gitignore @@ -50,7 +50,7 @@ tags *.zip # Packages -node_modules/* +node_modules/ .tmp test/ @@ -59,11 +59,10 @@ test/ *.sublime-workspace *.sublime-projectcompletions -app/_bower_components +bower_components # Output folders -serve -site +dist # hide the AWS and Rsync credentials file aws-credentials.json diff --git a/generators/gulp/USAGE b/generators/gulp/USAGE new file mode 100644 index 0000000..8579276 --- /dev/null +++ b/generators/gulp/USAGE @@ -0,0 +1,12 @@ +Updating: + When updating your gulpfile and packages you need to include a command line + flag specifying how you want to upload your site, if no flag is specified it + will generate a gulpfile without any uploading task. For example: + + yo jekyllized:gulp + yo jekyllized:gulp --rsync + + Options: + --amazon + --rsync + --pages diff --git a/generators/gulp/index.js b/generators/gulp/index.js new file mode 100644 index 0000000..359e2e9 --- /dev/null +++ b/generators/gulp/index.js @@ -0,0 +1,108 @@ +'use strict'; + +var _ = require('lodash'); +var generators = require('yeoman-generator'); +var argv = require('yargs').argv; + +module.exports = generators.Base.extend({ + constructor: function () { + generators.Base.apply(this, arguments); + + this.option('uploading', { + required: true, + name: 'uploading', + type: 'list', + message: 'How do you want to upload your site?', + choices: ['Amazon S3', 'Rsync', 'Github Pages', 'None'] + }); + + if (argv.amazon) { + this.options.uploading = 'Amazon S3'; + } + + if (argv.rsync) { + this.options.uploading = 'Rsync'; + } + + if (argv.pages) { + this.options.uploading = 'Github Pages'; + } + }, + + writing: { + package: function () { + var pkg = this.fs.readJSON(this.destinationPath('package.json'), {}); + + pkg.devDependencies = pkg.devDependencies || {}; + _.extend(pkg.devDependencies, { + 'autoprefixer': '^6.2.3', + 'browser-sync': '^2.11.0', + 'del': '^2.2.0', + 'gulp': 'git://github.com/gulpjs/gulp.git#4.0', + 'gulp-cache': '^0.4.1', + 'gulp-concat': '^2.6.0', + 'gulp-cssnano': '^2.1.0', + 'gulp-eslint': '^2.0.0', + 'gulp-gzip': '^1.1.0', + 'gulp-htmlmin': '^2.0.0', + 'gulp-if': '^2.0.0', + 'gulp-imagemin': '^3.0.0', + 'gulp-inject': '^4.0.0', + 'gulp-load-plugins': '^1.2.0', + 'gulp-newer': '^1.1.0', + 'gulp-postcss': '^6.0.0', + 'gulp-rename': '^1.2.2', + 'gulp-rev': '^7.0.0', + 'gulp-sass': '^2.1.1', + 'gulp-size': '^2.0.0', + 'gulp-sourcemaps': '^1.3.0', + 'gulp-uglify': '^1.5.1', + 'gulp-uncss': '^1.0.0', + 'shelljs': '^0.7.0', + 'yargs': '^4.7.0' + }); + + if (this.options.uploading === 'Amazon S3') { + pkg.devDependencies['gulp-awspublish'] = '^3.2.0'; + pkg.devDependencies['concurrent-transform'] = '^1.0.0'; + } + + if (this.options.uploading === 'Rsync') { + pkg.devDependencies['gulp-rsync'] = '^0.0.6'; + } + + if (this.options.uploading === 'Github Pages') { + pkg.devDependencies['gulp-gh-pages'] = '^0.5.2'; + } + + this.fs.writeJSON(this.destinationPath('package.json'), pkg); + }, + + gulpfile: function () { + this.fs.copyTpl( + this.templatePath('gulpfile.js'), + this.destinationPath('gulpfile.js'), + { + amazonS3: this.options.uploading === 'Amazon S3', + rsync: this.options.uploading === 'Rsync', + ghpages: this.options.uploading === 'Github Pages', + noUpload: this.options.uploading === 'None' + } + ); + + if (this.options.uploading === 'Amazon S3') { + this.fs.copyTpl( + this.templatePath('aws-credentials.json'), + this.destinationPath('aws-credentials.json') + ); + } + + if (this.options.uploading === 'Rsync') { + this.fs.copyTpl( + this.templatePath('rsync-credentials.json'), + this.destinationPath('rsync-credentials.json') + ); + } + } + } +}); diff --git a/generators/gulp/templates/aws-credentials.json b/generators/gulp/templates/aws-credentials.json new file mode 100644 index 0000000..bff1f71 --- /dev/null +++ b/generators/gulp/templates/aws-credentials.json @@ -0,0 +1,7 @@ +{ + "params": { + "Bucket": "" + }, + "accessKeyId": "1231923123", + "secretAccessKey": "ABC123ACB12" +} diff --git a/generators/gulp/templates/gulpfile.js b/generators/gulp/templates/gulpfile.js new file mode 100644 index 0000000..6551e2f --- /dev/null +++ b/generators/gulp/templates/gulpfile.js @@ -0,0 +1,322 @@ +'use strict'; + +<% if (amazonS3 || rsync) { -%> +// 'fs' is used to read files from the system (used for uploading) +const fs = require('fs'); +<% } -%> +const gulp = require('gulp'); +// Loads the plugins without having to list all of them, but you need +// to call them as $.pluginname +const gulpLoadPlugins = require('gulp-load-plugins'); +const $ = gulpLoadPlugins(); +// Delete stuff +const del = require('del'); +// Used to run shell commands +const shell = require('shelljs'); +<% if (amazonS3) { -%> +// Parallelize the uploads when uploading to Amazon S3 +const parallelize = require('concurrent-transform'); +<% } -%> +// BrowserSync is used to live-reload your website +const browserSync = require('browser-sync').create(); +// AutoPrefixer +const autoprefixer = require('autoprefixer'); +// Yargs for command line arguments +const argv = require('yargs').argv; + +// 'gulp clean:assets' -- deletes all assets except for images +// 'gulp clean:images' -- deletes your images +// 'gulp clean:dist' -- erases the dist directory +// 'gulp clean:gzip' -- erases all the gzipped files +// 'gulp clean:jekyll' -- deletes the temporary Jekyll site +gulp.task('clean:assets', () => { + return del(['.tmp/**/*', '!.tmp/assets', '!.tmp/assets/images', '!.tmp/assets/images/**/*', 'dist/assets']); +}); +gulp.task('clean:images', () => { + return del(['.tmp/assets/images', 'dist/assets/images']); +}); +gulp.task('clean:dist', () => { + return del(['dist/', '.tmp/dist']); +}); +gulp.task('clean:gzip', () => { + return del(['dist/**/*.gz']); +}); +gulp.task('clean:jekyll', () => { + return del(['.tmp/jekyll']); +}); + +// 'gulp jekyll:tmp' -- copies your Jekyll site to a temporary directory +// to be processed +gulp.task('jekyll:tmp', () => + gulp.src(['src/**/*', '!src/assets/**/*', '!src/assets']) + .pipe(gulp.dest('.tmp/jekyll')) + .pipe($.size({title: 'Jekyll'})) +); + +// 'gulp jekyll' -- builds your site with development settings +// 'gulp jekyll --prod' -- builds your site with production settings +gulp.task('jekyll', done => { + if (!argv.prod) { + shell.exec('jekyll build'); + done(); + } else if (argv.prod) { + shell.exec('jekyll build --config _config.yml,_config.build.yml'); + done(); + } +}); + +// 'gulp doctor' -- literally just runs jekyll doctor +gulp.task('jekyll:doctor', done => { + shell.exec('jekyll doctor'); + done(); +}); + +// 'gulp styles' -- creates a CSS file from your SASS, adds prefixes and +// creates a Sourcemap +// 'gulp styles --prod' -- creates a CSS file from your SASS, adds prefixes and +// then minifies, gzips and cache busts it. Does not create a Sourcemap +gulp.task('styles', () => + gulp.src('src/assets/scss/style.scss') + .pipe($.if(!argv.prod, $.sourcemaps.init())) + .pipe($.sass({ + precision: 10 + }).on('error', $.sass.logError)) + .pipe($.postcss([ + autoprefixer({browsers: 'last 1 version'}) + ])) + .pipe($.size({ + title: 'styles', + showFiles: true + })) + .pipe($.if(argv.prod, $.rename({suffix: '.min'}))) + .pipe($.if(argv.prod, $.if('*.css', $.cssnano({autoprefixer: false})))) + .pipe($.if(argv.prod, $.size({ + title: 'minified styles', + showFiles: true + }))) + .pipe($.if(argv.prod, $.rev())) + .pipe($.if(!argv.prod, $.sourcemaps.write('.'))) + .pipe($.if(argv.prod, gulp.dest('.tmp/assets/stylesheets'))) + .pipe($.if(argv.prod, $.if('*.css', $.gzip({append: true})))) + .pipe($.if(argv.prod, $.size({ + title: 'gzipped styles', + gzip: true, + showFiles: true + }))) + .pipe(gulp.dest('.tmp/assets/stylesheets')) + .pipe($.if(!argv.prod, browserSync.stream({match: '**/*.css'}))) +); + +// 'gulp scripts' -- creates a index.js file from your JavaScript files and +// creates a Sourcemap for it +// 'gulp scripts --prod' -- creates a index.js file from your JavaScript files, +// minifies, gzips and cache busts it. Does not create a Sourcemap +gulp.task('scripts', () => + // NOTE: The order here is important since it's concatenated in order from + // top to bottom, so you want vendor scripts etc on top + gulp.src([ + 'src/assets/javascript/vendor.js', + 'src/assets/javascript/main.js' + ]) + .pipe($.newer('.tmp/assets/javascript/index.js', {dest: '.tmp/assets/javascript', ext: '.js'})) + .pipe($.if(!argv.prod, $.sourcemaps.init())) + .pipe($.concat('index.js')) + .pipe($.size({ + title: 'scripts', + showFiles: true + })) + .pipe($.if(argv.prod, $.rename({suffix: '.min'}))) + .pipe($.if(argv.prod, $.if('*.js', $.uglify({preserveComments: 'some'})))) + .pipe($.if(argv.prod, $.size({ + title: 'minified scripts', + showFiles: true + }))) + .pipe($.if(argv.prod, $.rev())) + .pipe($.if(!argv.prod, $.sourcemaps.write('.'))) + .pipe($.if(argv.prod, gulp.dest('.tmp/assets/javascript'))) + .pipe($.if(argv.prod, $.if('*.js', $.gzip({append: true})))) + .pipe($.if(argv.prod, $.size({ + title: 'gzipped scripts', + gzip: true, + showFiles: true + }))) + .pipe(gulp.dest('.tmp/assets/javascript')) + .pipe($.if(!argv.prod, browserSync.stream({match: '**/*.js'}))) +); + +// 'gulp inject:head' -- injects our style.css file into the head of our HTML +gulp.task('inject:head', () => + gulp.src('.tmp/jekyll/_includes/head.html') + .pipe($.inject(gulp.src('.tmp/assets/stylesheets/*.css', + {read: false}), {ignorePath: '.tmp'})) + .pipe(gulp.dest('.tmp/jekyll/_includes')) +); + +// 'gulp inject:footer' -- injects our index.js file into the end of our HTML +gulp.task('inject:footer', () => + gulp.src('.tmp/jekyll/_layouts/default.html') + .pipe($.inject(gulp.src('.tmp/assets/javascript/*.js', + {read: false}), {ignorePath: '.tmp'})) + .pipe(gulp.dest('.tmp/jekyll/_layouts')) +); + +// 'gulp images' -- optimizes and caches your images +gulp.task('images', () => + gulp.src('src/assets/images/**/*') + .pipe($.cache($.imagemin([ + $.imagemin.gifsicle({interlaced: true}), + $.imagemin.jpegtran({progressive: true}), + $.imagemin.optipng(), + $.imagemin.svgo({plugins: [{cleanupIDs: false}]}) + ]))) + .pipe(gulp.dest('.tmp/assets/images')) + .pipe($.size({title: 'images'})) +); + +// 'gulp fonts' -- copies your fonts to the temporary assets directory +gulp.task('fonts', () => + gulp.src('src/assets/fonts/**/*') + .pipe(gulp.dest('.tmp/assets/fonts')) + .pipe($.size({title: 'fonts'})) +); + +// 'gulp html' -- does nothing +// 'gulp html --prod' -- minifies and gzips our HTML files +gulp.task('html', () => + gulp.src('dist/**/*.html') + .pipe($.if(argv.prod, $.htmlmin({ + removeComments: true, + collapseWhitespace: true, + collapseBooleanAttributes: true, + removeAttributeQuotes: true, + removeRedundantAttributes: true + }))) + .pipe($.if(argv.prod, $.size({title: 'optimized HTML'}))) + .pipe($.if(argv.prod, gulp.dest('dist'))) + .pipe($.if(argv.prod, $.gzip({append: true}))) + .pipe($.if(argv.prod, $.size({ + title: 'gzipped HTML', + gzip: true + }))) + .pipe($.if(argv.prod, gulp.dest('dist'))) +); + +<% if (amazonS3) { -%> +// 'gulp deploy' -- reads from your AWS Credentials file, creates the correct +// headers for your files and uploads them to S3 +gulp.task('deploy', () => { + var credentials = JSON.parse(fs.readFileSync('aws-credentials.json', 'utf8')); + var publisher = $.awspublish.create(credentials); + + var headers = { + 'Cache-Control': 'max-age=315360000, no-transform, public' + }; + + return gulp.src('dist/**/*') + .pipe($.awspublish.gzip()) + .pipe(parallelize(publisher.publish(headers), 30)) + .pipe(publisher.cache()) + .pipe(publisher.sync()) + .pipe($.awspublish.reporter()); +}); + +<% } -%><% if (rsync) { -%> +// 'gulp deploy' -- reads from your Rsync credentials file and incrementally +// uploads your site to your server +gulp.task('deploy', () => { + var credentials = JSON.parse(fs.readFileSync('rsync-credentials.json', 'utf8')); + + return gulp.src('dist/**') + .pipe($.rsync({ + root: 'dist', + hostname: credentials.hostname, + username: credentials.username, + destination: credentials.destination, + incremental: true + })); +}); + +<% } -%><% if (ghpages) { -%> +// 'gulp deploy' -- pushes your dist folder to Github +gulp.task('deploy', () => { + return gulp.src('dist/**/*') + .pipe($.ghPages()); +}); + +<% } -%> +<% if (noUpload) { -%><% } -%> +// 'gulp assets:copy' -- copies the assets into the dist directory, needs to be +// done this way because Jekyll overwrites the whole directory otherwise +gulp.task('copy:assets', () => + gulp.src('.tmp/assets/**/*') + .pipe(gulp.dest('dist/assets')) +); + +// 'gulp jekyll:copy' -- copies your processed Jekyll site to the dist directory +gulp.task('copy:jekyll', () => + gulp.src('.tmp/dist/**/*') + .pipe(gulp.dest('dist')) +); + +// 'gulp inject' -- injects your CSS and JS into either the header or the footer +gulp.task('inject', gulp.parallel('inject:head', 'inject:footer')); + +// 'gulp build:jekyll' -- copies, builds, and then copies it again +gulp.task('build:jekyll', gulp.series('jekyll:tmp', 'inject', 'jekyll', 'copy:jekyll')); + +// Function to properly reload your browser +function reload(done) { + browserSync.reload(); + done(); +} +// 'gulp serve' -- open up your website in your browser and watch for changes +// in all your files and update them when needed +gulp.task('serve', (done) => { + browserSync.init({ + // tunnel: true, + // open: false, + server: ['.tmp', 'dist'] + }); + done(); + + // Watch various files for changes and do the needful + gulp.watch(['src/**/*.md', 'src/**/*.html', 'src/**/*.yml'], gulp.series('build:jekyll', reload)); + gulp.watch(['src/**/*.xml', 'src/**/*.txt'], gulp.series('jekyll')); + gulp.watch('src/assets/javascript/**/*.js', gulp.series('scripts')); + gulp.watch('src/assets/scss/**/*.scss', gulp.series('styles')); + gulp.watch('src/assets/images/**/*', reload); +}); + +// 'gulp assets' -- cleans out your assets and rebuilds them +// 'gulp assets --prod' -- cleans out your assets and rebuilds them with +// production settings +gulp.task('assets', gulp.series( + gulp.parallel('styles', 'scripts', 'fonts', 'images'), + gulp.series('copy:assets') +)); + +// 'gulp clean' -- erases your assets and gzipped files +gulp.task('clean', gulp.series('clean:assets', 'clean:gzip', 'clean:dist', 'clean:jekyll')); + +// 'gulp build' -- same as 'gulp' but doesn't serve your site in your browser +// 'gulp build --prod' -- same as above but with production settings +gulp.task('build', gulp.series( + gulp.series('clean:assets', 'clean:gzip'), + gulp.series('clean', 'assets', 'build:jekyll'), + gulp.series('html') +)); + +// 'gulp rebuild' -- WARNING: Erases your assets and built site, use only when +// you need to do a complete rebuild +gulp.task('rebuild', gulp.series('clean:dist', 'clean:assets', 'clean:images')); + +// 'gulp check' -- checks your Jekyll configuration for errors and lint your JS +gulp.task('check', gulp.series('jekyll:doctor')); + +// 'gulp' -- cleans your assets and gzipped files, creates your assets and +// injects them into the templates, then builds your site, copied the assets +// into their directory and serves the site +// 'gulp --prod' -- same as above but with production settings +gulp.task('default', gulp.series( + gulp.series('build', 'serve') +)); diff --git a/generators/gulp/templates/rsync-credentials.json b/generators/gulp/templates/rsync-credentials.json new file mode 100644 index 0000000..7fbb6ab --- /dev/null +++ b/generators/gulp/templates/rsync-credentials.json @@ -0,0 +1,5 @@ +{ + "username": "example", + "hostname": "192.168.1.1", + "destination": "/srv/example.com/www/" +} diff --git a/generators/jekyll/index.js b/generators/jekyll/index.js new file mode 100644 index 0000000..9746e64 --- /dev/null +++ b/generators/jekyll/index.js @@ -0,0 +1,112 @@ +'use strict'; + +var generators = require('yeoman-generator'); + +module.exports = generators.Base.extend({ + constructor: function () { + generators.Base.apply(this, arguments); + + this.option('projectName', { + type: String, + required: true, + desc: 'Project name' + }); + + this.option('projectDescription', { + type: String, + required: true, + desc: 'Project description' + }); + + this.option('projectURL', { + type: String, + required: true, + desc: 'Project URL' + }); + + this.option('authorName', { + type: String, + required: true, + desc: 'Author name' + }); + + this.option('authorEmail', { + type: String, + required: true, + desc: 'Author email' + }); + + this.option('authorURI', { + type: String, + required: true, + desc: 'Author URI' + }); + + this.option('authorBio', { + type: String, + required: true, + desc: 'Author bio' + }); + + this.option('authorTwitter', { + type: String, + required: true, + desc: 'Author Twitter' + }); + + this.option('authorGithub', { + type: String, + required: true, + desc: 'Author Github' + }); + + this.option('jekyllPermalinks', { + type: String, + required: true, + desc: 'Jekyll permalinks' + }); + }, + + writing: function () { + this.fs.copy( + this.templatePath('Gemfile'), + this.destinationPath('Gemfile') + ); + + this.fs.copyTpl( + this.templatePath('config.yml'), + this.destinationPath('_config.yml'), + { + projectName: this.options.projectName, + projectDescription: this.options.projectDescription, + projectURL: this.options.projectURL, + authorName: this.options.authorName, + authorEmail: this.options.authorEmail, + authorURI: this.options.authorURI, + authorBio: this.options.authorBio, + authorTwitter: this.options.authorTwitter, + authorGithub: this.options.authorGithub, + jekyllPermalinks: this.options.jekyllPermalinks + } + ); + + this.fs.copyTpl( + this.templatePath('config.build.yml'), + this.destinationPath('_config.build.yml') + ); + + this.fs.copyTpl( + this.templatePath('humans.txt'), + this.destinationPath('src/humans.txt'), + { + authorName: this.options.authorName, + authorTwitter: this.options.authorTwitter + } + ); + + this.fs.copy( + this.templatePath('app'), + this.destinationPath('src') + ); + } +}); diff --git a/generators/jekyll/templates/Gemfile b/generators/jekyll/templates/Gemfile new file mode 100644 index 0000000..4b55c70 --- /dev/null +++ b/generators/jekyll/templates/Gemfile @@ -0,0 +1,11 @@ +source "http://rubygems.org" + +gem 'jekyll' +gem 'redcarpet' + +# jekyll plugins +gem 'jekyll-feed' +gem 'jekyll-gist' +gem 'jekyll-paginate' +gem 'jekyll-sitemap' +gem 'jekyll-seo-tag' diff --git a/app/templates/app/404.html b/generators/jekyll/templates/app/404.html similarity index 65% rename from app/templates/app/404.html rename to generators/jekyll/templates/app/404.html index 5f5b9bf..46f2d7b 100644 --- a/app/templates/app/404.html +++ b/generators/jekyll/templates/app/404.html @@ -5,5 +5,7 @@

404: Page not found

-

Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. Head back home to try finding it again.

+

Sorry, we've misplaced that URL or it's pointing to something + that doesn't exist. Head back home to try finding it + again.

diff --git a/app/templates/app/_drafts/2014-03-01-example-content.md b/generators/jekyll/templates/app/_drafts/2014-03-01-example-content.md similarity index 58% rename from app/templates/app/_drafts/2014-03-01-example-content.md rename to generators/jekyll/templates/app/_drafts/2014-03-01-example-content.md index e6e5462..fb41e06 100644 --- a/app/templates/app/_drafts/2014-03-01-example-content.md +++ b/generators/jekyll/templates/app/_drafts/2014-03-01-example-content.md @@ -5,74 +5,99 @@ title: Example content categories: jekyll example --- +
Howdy! This is an example blog post that shows several +types of HTML content supported in this theme.
-
- Howdy! This is an example blog post that shows several types of HTML content supported in this theme. -
+Cum sociis natoque penatibus et magnis dis parturient montes, +nascetur ridiculus mus. *Aenean eu leo quam.* Pellentesque ornare sem lacinia +quam venenatis vestibulum. Sed posuere consectetur est at lobortis. Cras mattis +consectetur purus sit amet fermentum. -Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. *Aenean eu leo quam.* Pellentesque ornare sem lacinia quam venenatis vestibulum. Sed posuere consectetur est at lobortis. Cras mattis consectetur purus sit amet fermentum. +> Curabitur blandit tempus porttitor. Nullam quis risus eget urna mollis ornare +> vel eu leo. Nullam id dolor id nibh ultricies vehicula ut id elit. -> Curabitur blandit tempus porttitor. Nullam quis risus eget urna mollis ornare vel eu leo. Nullam id dolor id nibh ultricies vehicula ut id elit. +Etiam porta **sem malesuada magna** mollis euismod. Cras mattis consectetur +purus sit amet fermentum. Aenean lacinia bibendum nulla sed consectetur. -Etiam porta **sem malesuada magna** mollis euismod. Cras mattis consectetur purus sit amet fermentum. Aenean lacinia bibendum nulla sed consectetur. + ## Inline HTML elements -HTML defines a long list of available inline tags, a complete list of which can be found on the [Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web/HTML/Element). +HTML defines a long list of available inline tags, a complete list of which can +be found on the [Mozilla Developer +Network](https://developer.mozilla.org/en-US/docs/Web/HTML/Element). - **To bold text**, use ``. - *To italicize text*, use ``. -- Abbreviations, like HTML should use ``, with an optional `title` attribute for the full phrase. +- Abbreviations, like HTML should + use ``, with an optional `title` attribute for the full phrase. - Citations, like — Mark otto, should use ``. -- Deleted text should use `` and inserted text should use ``. -- Superscript text uses `` and subscript text uses ``. +- Deleted text should use `` and inserted text should + use ``. +- Superscript text uses `` and subscript text uses + ``. Most of these elements are styled by browsers with few modifications on our part. ## Heading -Vivamus sagittis lacus vel augue rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. +Vivamus sagittis lacus vel augue rutrum faucibus dolor auctor. Duis mollis, est +non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. +Morbi leo risus, porta ac consectetur ac, vestibulum at eros. ### Code -Cum sociis natoque penatibus et magnis dis `code element` montes, nascetur ridiculus mus. +Cum sociis natoque penatibus et magnis dis `code element` montes, nascetur +ridiculus mus. {% highlight js %} // Example can be run directly in your JavaScript console -// Create a function that takes two arguments and returns the sum of those arguments -var adder = new Function("a", "b", "return a + b"); +// Create a function that takes two arguments and returns the sum of those +arguments var adder = new Function("a", "b", "return a + b"); // Call the function adder(2, 6); // > 8 {% endhighlight %} -Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa. +Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna +mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris +condimentum nibh, ut fermentum massa. ### Gists via GitHub Pages -Vestibulum id ligula porta felis euismod semper. Nullam quis risus eget urna mollis ornare vel eu leo. Donec sed odio dui. +Vestibulum id ligula porta felis euismod semper. Nullam quis risus eget urna +mollis ornare vel eu leo. Donec sed odio dui. {% gist 5555251 gist.md %} -Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec sed odio dui. Vestibulum id ligula porta felis euismod semper. +Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. +Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque +penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec sed +odio dui. Vestibulum id ligula porta felis euismod semper. ### Lists -Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. +Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus +mus. Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada +magna mollis euismod. Fusce dapibus, tellus ac cursus commodo, tortor mauris +condimentum nibh, ut fermentum massa justo sit amet risus. * Praesent commodo cursus magna, vel scelerisque nisl consectetur et. * Donec id elit non mi porta gravida at eget metus. * Nulla vitae elit libero, a pharetra augue. -Donec ullamcorper nulla non metus auctor fringilla. Nulla vitae elit libero, a pharetra augue. +Donec ullamcorper nulla non metus auctor fringilla. Nulla vitae elit libero, a +pharetra augue. 1. Vestibulum id ligula porta felis euismod semper. -2. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. +2. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur + ridiculus mus. 3. Maecenas sed diam eget risus varius blandit sit amet non magna. -Cras mattis consectetur purus sit amet fermentum. Sed posuere consectetur est at lobortis. +Cras mattis consectetur purus sit amet fermentum. Sed posuere consectetur est at +lobortis.
HyperText Markup Language (HTML)
@@ -85,11 +110,14 @@ Cras mattis consectetur purus sit amet fermentum. Sed posuere consectetur est at
The programming language used to build advanced Web sites and applications
-Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nullam quis risus eget urna mollis ornare vel eu leo. +Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Morbi leo +risus, porta ac consectetur ac, vestibulum at eros. Nullam quis risus eget urna +mollis ornare vel eu leo. ### Tables -Aenean lacinia bibendum nulla sed consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. +Aenean lacinia bibendum nulla sed consectetur. Lorem ipsum dolor sit amet, +consectetur adipiscing elit. @@ -125,8 +153,5 @@ Aenean lacinia bibendum nulla sed consectetur. Lorem ipsum dolor sit amet, conse
-Nullam id dolor id nibh ultricies vehicula ut id elit. Sed posuere consectetur est at lobortis. Nullam quis risus eget urna mollis ornare vel eu leo. - ------ - -Want to see something else added? Open an issue. +Nullam id dolor id nibh ultricies vehicula ut id elit. Sed posuere consectetur +est at lobortis. Nullam quis risus eget urna mollis ornare vel eu leo. diff --git a/generators/jekyll/templates/app/_includes/footer.html b/generators/jekyll/templates/app/_includes/footer.html new file mode 100644 index 0000000..73e6df4 --- /dev/null +++ b/generators/jekyll/templates/app/_includes/footer.html @@ -0,0 +1,38 @@ +
+ +
+ + + + + +
+ +
diff --git a/generators/jekyll/templates/app/_includes/head.html b/generators/jekyll/templates/app/_includes/head.html new file mode 100644 index 0000000..abe2035 --- /dev/null +++ b/generators/jekyll/templates/app/_includes/head.html @@ -0,0 +1,23 @@ + + + + + + {% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %} + + + + + + + + + + + + + {% feed_meta %} + + + {% seo %} + diff --git a/generators/jekyll/templates/app/_includes/header.html b/generators/jekyll/templates/app/_includes/header.html new file mode 100644 index 0000000..ee39294 --- /dev/null +++ b/generators/jekyll/templates/app/_includes/header.html @@ -0,0 +1,27 @@ + diff --git a/generators/jekyll/templates/app/_includes/icon-github.html b/generators/jekyll/templates/app/_includes/icon-github.html new file mode 100644 index 0000000..e501a16 --- /dev/null +++ b/generators/jekyll/templates/app/_includes/icon-github.html @@ -0,0 +1 @@ +{% include icon-github.svg %}{{ include.username }} diff --git a/generators/jekyll/templates/app/_includes/icon-github.svg b/generators/jekyll/templates/app/_includes/icon-github.svg new file mode 100644 index 0000000..4422c4f --- /dev/null +++ b/generators/jekyll/templates/app/_includes/icon-github.svg @@ -0,0 +1 @@ + diff --git a/generators/jekyll/templates/app/_includes/icon-twitter.html b/generators/jekyll/templates/app/_includes/icon-twitter.html new file mode 100644 index 0000000..e623dbd --- /dev/null +++ b/generators/jekyll/templates/app/_includes/icon-twitter.html @@ -0,0 +1 @@ +{{ include.username }} diff --git a/generators/jekyll/templates/app/_includes/icon-twitter.svg b/generators/jekyll/templates/app/_includes/icon-twitter.svg new file mode 100644 index 0000000..dcf660e --- /dev/null +++ b/generators/jekyll/templates/app/_includes/icon-twitter.svg @@ -0,0 +1 @@ + diff --git a/generators/jekyll/templates/app/_layouts/category-archive.html b/generators/jekyll/templates/app/_layouts/category-archive.html new file mode 100644 index 0000000..5875994 --- /dev/null +++ b/generators/jekyll/templates/app/_layouts/category-archive.html @@ -0,0 +1,13 @@ +--- +layout: default +--- + +

Archive of posts with {{ page.type }} '{{ page.title }}'

+
    + {% for post in page.posts %} +
  • + + {{ post.title }} +
  • + {% endfor %} +
diff --git a/generators/jekyll/templates/app/_layouts/default.html b/generators/jekyll/templates/app/_layouts/default.html new file mode 100644 index 0000000..d63389d --- /dev/null +++ b/generators/jekyll/templates/app/_layouts/default.html @@ -0,0 +1,24 @@ + + + + {% include head.html %} + + + + {% include header.html %} + +
+
+ {{ content }} +
+
+ + {% include footer.html %} + + + + + + + + diff --git a/generators/jekyll/templates/app/_layouts/month-archive.html b/generators/jekyll/templates/app/_layouts/month-archive.html new file mode 100644 index 0000000..a42bd21 --- /dev/null +++ b/generators/jekyll/templates/app/_layouts/month-archive.html @@ -0,0 +1,14 @@ +--- +layout: default +--- + +

Archive of posts from {{ page.date | date: "%B %Y" }}

+ +
    +{% for post in page.posts %} +
  • + + {{ post.title }} +
  • +{% endfor %} +
diff --git a/generators/jekyll/templates/app/_layouts/page.html b/generators/jekyll/templates/app/_layouts/page.html new file mode 100644 index 0000000..ce233ad --- /dev/null +++ b/generators/jekyll/templates/app/_layouts/page.html @@ -0,0 +1,14 @@ +--- +layout: default +--- +
+ +
+

{{ page.title }}

+
+ +
+ {{ content }} +
+ +
diff --git a/generators/jekyll/templates/app/_layouts/post.html b/generators/jekyll/templates/app/_layouts/post.html new file mode 100644 index 0000000..3a0fb52 --- /dev/null +++ b/generators/jekyll/templates/app/_layouts/post.html @@ -0,0 +1,15 @@ +--- +layout: default +--- +
+ +
+

{{ page.title }}

+ +
+ +
+ {{ content }} +
+ +
diff --git a/generators/jekyll/templates/app/_layouts/tag-archive.html b/generators/jekyll/templates/app/_layouts/tag-archive.html new file mode 100644 index 0000000..5875994 --- /dev/null +++ b/generators/jekyll/templates/app/_layouts/tag-archive.html @@ -0,0 +1,13 @@ +--- +layout: default +--- + +

Archive of posts with {{ page.type }} '{{ page.title }}'

+
    + {% for post in page.posts %} +
  • + + {{ post.title }} +
  • + {% endfor %} +
diff --git a/generators/jekyll/templates/app/_layouts/year-archive.html b/generators/jekyll/templates/app/_layouts/year-archive.html new file mode 100644 index 0000000..1884340 --- /dev/null +++ b/generators/jekyll/templates/app/_layouts/year-archive.html @@ -0,0 +1,14 @@ +--- +layout: default +--- + +

Archive of posts from {{ page.date | date: "%Y" }}

+ +
    +{% for post in page.posts %} +
  • + + {{ post.title }} +
  • +{% endfor %} +
diff --git a/app/templates/app/_posts/2014-03-03-welcome-to-jekyll.md b/generators/jekyll/templates/app/_posts/2014-03-03-welcome-to-jekyll.md similarity index 91% rename from app/templates/app/_posts/2014-03-03-welcome-to-jekyll.md rename to generators/jekyll/templates/app/_posts/2014-03-03-welcome-to-jekyll.md index f861ee6..b4aa00e 100644 --- a/app/templates/app/_posts/2014-03-03-welcome-to-jekyll.md +++ b/generators/jekyll/templates/app/_posts/2014-03-03-welcome-to-jekyll.md @@ -1,6 +1,6 @@ --- layout: post -date: 2014-03-03 +date: 2015-02-03 title: Welcome to Jekyll! categories: jekyll --- @@ -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 diff --git a/generators/jekyll/templates/app/about.md b/generators/jekyll/templates/app/about.md new file mode 100644 index 0000000..d0e6de5 --- /dev/null +++ b/generators/jekyll/templates/app/about.md @@ -0,0 +1,15 @@ +--- +layout: page +title: About +permalink: /about/ +--- + +This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](http://jekyllrb.com/) + +You can find the source code for the Jekyll new theme at: +{% include icon-github.html username="jglovier" %} / +[jekyll-new](https://github.com/jglovier/jekyll-new) + +You can find the source code for Jekyll at +{% include icon-github.html username="jekyll" %} / +[jekyll](https://github.com/jekyll/jekyll) diff --git a/app/templates/app/assets/favicon.ico b/generators/jekyll/templates/app/assets/favicon.ico similarity index 100% rename from app/templates/app/assets/favicon.ico rename to generators/jekyll/templates/app/assets/favicon.ico diff --git a/app/templates/app/assets/images/touch/apple-touch-icon-144-precomposed.png b/generators/jekyll/templates/app/assets/images/touch/apple-touch-icon-144-precomposed.png similarity index 100% rename from app/templates/app/assets/images/touch/apple-touch-icon-144-precomposed.png rename to generators/jekyll/templates/app/assets/images/touch/apple-touch-icon-144-precomposed.png diff --git a/generators/jekyll/templates/app/assets/javascript/main.js b/generators/jekyll/templates/app/assets/javascript/main.js new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/generators/jekyll/templates/app/assets/javascript/main.js @@ -0,0 +1 @@ + diff --git a/generators/jekyll/templates/app/assets/javascript/vendor.js b/generators/jekyll/templates/app/assets/javascript/vendor.js new file mode 100644 index 0000000..7e6a672 --- /dev/null +++ b/generators/jekyll/templates/app/assets/javascript/vendor.js @@ -0,0 +1,3 @@ +'use strict'; + +console.log('Hello world!'); diff --git a/generators/jekyll/templates/app/assets/scss/base.scss b/generators/jekyll/templates/app/assets/scss/base.scss new file mode 100644 index 0000000..0883c3c --- /dev/null +++ b/generators/jekyll/templates/app/assets/scss/base.scss @@ -0,0 +1,206 @@ +/** + * Reset some basic elements + */ +body, h1, h2, h3, h4, h5, h6, +p, blockquote, pre, hr, +dl, dd, ol, ul, figure { + margin: 0; + padding: 0; +} + + + +/** + * Basic styling + */ +body { + font: $base-font-weight #{$base-font-size}/#{$base-line-height} $base-font-family; + color: $text-color; + background-color: $background-color; + -webkit-text-size-adjust: 100%; + -webkit-font-feature-settings: "kern" 1; + -moz-font-feature-settings: "kern" 1; + -o-font-feature-settings: "kern" 1; + font-feature-settings: "kern" 1; + font-kerning: normal; +} + + + +/** + * Set `margin-bottom` to maintain vertical rhythm + */ +h1, h2, h3, h4, h5, h6, +p, blockquote, pre, +ul, ol, dl, figure, +%vertical-rhythm { + margin-bottom: $spacing-unit / 2; +} + + + +/** + * Images + */ +img { + max-width: 100%; + vertical-align: middle; +} + + + +/** + * Figures + */ +figure > img { + display: block; +} + +figcaption { + font-size: $small-font-size; +} + + + +/** + * Lists + */ +ul, ol { + margin-left: $spacing-unit; +} + +li { + > ul, + > ol { + margin-bottom: 0; + } +} + + + +/** + * Headings + */ +h1, h2, h3, h4, h5, h6 { + font-weight: $base-font-weight; +} + + + +/** + * Links + */ +a { + color: $brand-color; + text-decoration: none; + + &:visited { + color: darken($brand-color, 15%); + } + + &:hover { + color: $text-color; + text-decoration: underline; + } +} + + + +/** + * Blockquotes + */ +blockquote { + color: $grey-color; + border-left: 4px solid $grey-color-light; + padding-left: $spacing-unit / 2; + font-size: 18px; + letter-spacing: -1px; + font-style: italic; + + > :last-child { + margin-bottom: 0; + } +} + + + +/** + * Code formatting + */ +pre, +code { + font-size: 15px; + border: 1px solid $grey-color-light; + border-radius: 3px; + background-color: #eef; +} + +code { + padding: 1px 5px; +} + +pre { + padding: 8px 12px; + overflow-x: auto; + + > code { + border: 0; + padding-right: 0; + padding-left: 0; + } +} + + + +/** + * Wrapper + */ +.wrapper { + max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit} * 2)); + max-width: calc(#{$content-width} - (#{$spacing-unit} * 2)); + margin-right: auto; + margin-left: auto; + padding-right: $spacing-unit; + padding-left: $spacing-unit; + @extend %clearfix; + + @include media-query($on-laptop) { + max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit})); + max-width: calc(#{$content-width} - (#{$spacing-unit})); + padding-right: $spacing-unit / 2; + padding-left: $spacing-unit / 2; + } +} + + + +/** + * Clearfix + */ +%clearfix { + + &:after { + content: ""; + display: table; + clear: both; + } +} + + + +/** + * Icons + */ +.icon { + + > svg { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + + path { + fill: $grey-color; + } + } +} diff --git a/generators/jekyll/templates/app/assets/scss/layout.scss b/generators/jekyll/templates/app/assets/scss/layout.scss new file mode 100644 index 0000000..9cbfdde --- /dev/null +++ b/generators/jekyll/templates/app/assets/scss/layout.scss @@ -0,0 +1,242 @@ +/** + * Site header + */ +.site-header { + border-top: 5px solid $grey-color-dark; + border-bottom: 1px solid $grey-color-light; + min-height: 56px; + + // Positioning context for the mobile navigation icon + position: relative; +} + +.site-title { + font-size: 26px; + font-weight: 300; + line-height: 56px; + letter-spacing: -1px; + margin-bottom: 0; + float: left; + + &, + &:visited { + color: $grey-color-dark; + } +} + +.site-nav { + float: right; + line-height: 56px; + + .menu-icon { + display: none; + } + + .page-link { + color: $text-color; + line-height: $base-line-height; + + // Gaps between nav items, but not on the last one + &:not(:last-child) { + margin-right: 20px; + } + } + + @include media-query($on-palm) { + position: absolute; + top: 9px; + right: $spacing-unit / 2; + background-color: $background-color; + border: 1px solid $grey-color-light; + border-radius: 5px; + text-align: right; + + .menu-icon { + display: block; + float: right; + width: 36px; + height: 26px; + line-height: 0; + padding-top: 10px; + text-align: center; + + > svg { + width: 18px; + height: 15px; + + path { + fill: $grey-color-dark; + } + } + } + + .trigger { + clear: both; + display: none; + } + + &:hover .trigger { + display: block; + padding-bottom: 5px; + } + + .page-link { + display: block; + padding: 5px 10px; + + &:not(:last-child) { + margin-right: 0; + } + margin-left: 20px; + } + } +} + + + +/** + * Site footer + */ +.site-footer { + border-top: 1px solid $grey-color-light; + padding: $spacing-unit 0; +} + +.footer-heading { + font-size: 18px; + margin-bottom: $spacing-unit / 2; +} + +.contact-list, +.social-media-list { + list-style: none; + margin-left: 0; +} + +.footer-col-wrapper { + font-size: 15px; + color: $grey-color; + margin-left: -$spacing-unit / 2; + @extend %clearfix; +} + +.footer-col { + float: left; + margin-bottom: $spacing-unit / 2; + padding-left: $spacing-unit / 2; +} + +.footer-col-1 { + width: -webkit-calc(35% - (#{$spacing-unit} / 2)); + width: calc(35% - (#{$spacing-unit} / 2)); +} + +.footer-col-2 { + width: -webkit-calc(20% - (#{$spacing-unit} / 2)); + width: calc(20% - (#{$spacing-unit} / 2)); +} + +.footer-col-3 { + width: -webkit-calc(45% - (#{$spacing-unit} / 2)); + width: calc(45% - (#{$spacing-unit} / 2)); +} + +@include media-query($on-laptop) { + .footer-col-1, + .footer-col-2 { + width: -webkit-calc(50% - (#{$spacing-unit} / 2)); + width: calc(50% - (#{$spacing-unit} / 2)); + } + + .footer-col-3 { + width: -webkit-calc(100% - (#{$spacing-unit} / 2)); + width: calc(100% - (#{$spacing-unit} / 2)); + } +} + +@include media-query($on-palm) { + .footer-col { + float: none; + width: -webkit-calc(100% - (#{$spacing-unit} / 2)); + width: calc(100% - (#{$spacing-unit} / 2)); + } +} + + + +/** + * Page content + */ +.page-content { + padding: $spacing-unit 0; +} + +.page-heading { + font-size: 20px; +} + +.post-list { + margin-left: 0; + list-style: none; + + > li { + margin-bottom: $spacing-unit; + } +} + +.post-meta { + font-size: $small-font-size; + color: $grey-color; +} + +.post-link { + display: block; + font-size: 24px; +} + + + +/** + * Posts + */ +.post-header { + margin-bottom: $spacing-unit; +} + +.post-title { + font-size: 42px; + letter-spacing: -1px; + line-height: 1; + + @include media-query($on-laptop) { + font-size: 36px; + } +} + +.post-content { + margin-bottom: $spacing-unit; + + h2 { + font-size: 32px; + + @include media-query($on-laptop) { + font-size: 28px; + } + } + + h3 { + font-size: 26px; + + @include media-query($on-laptop) { + font-size: 22px; + } + } + + h4 { + font-size: 20px; + + @include media-query($on-laptop) { + font-size: 18px; + } + } +} diff --git a/generators/jekyll/templates/app/assets/scss/main.scss b/generators/jekyll/templates/app/assets/scss/main.scss new file mode 100644 index 0000000..fa4bf56 --- /dev/null +++ b/generators/jekyll/templates/app/assets/scss/main.scss @@ -0,0 +1,39 @@ +@charset "utf-8"; + +// Our variables +$base-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +$base-font-size: 16px; +$base-font-weight: 400; +$small-font-size: $base-font-size * 0.875; +$base-line-height: 1.5; + +$spacing-unit: 30px; + +$text-color: #111; +$background-color: #fdfdfd; +$brand-color: #2a7ae2; + +$grey-color: #828282; +$grey-color-light: lighten($grey-color, 40%); +$grey-color-dark: darken($grey-color, 25%); + +// Width of the content area +$content-width: 800px; + +$on-palm: 600px; +$on-laptop: 800px; + + + +// Use media queries like this: +// @include media-query($on-palm) { +// .wrapper { +// padding-right: $spacing-unit / 2; +// padding-left: $spacing-unit / 2; +// } +// } +@mixin media-query($device) { + @media screen and (max-width: $device) { + @content; + } +} diff --git a/generators/jekyll/templates/app/assets/scss/style.scss b/generators/jekyll/templates/app/assets/scss/style.scss new file mode 100644 index 0000000..f265500 --- /dev/null +++ b/generators/jekyll/templates/app/assets/scss/style.scss @@ -0,0 +1,8 @@ +/* +The main SCSS file for everything, yep +*/ + +@import "main"; +@import "base"; +@import "layout"; +@import "syntax-highlighting"; diff --git a/generators/jekyll/templates/app/assets/scss/syntax-highlighting.scss b/generators/jekyll/templates/app/assets/scss/syntax-highlighting.scss new file mode 100644 index 0000000..8fac597 --- /dev/null +++ b/generators/jekyll/templates/app/assets/scss/syntax-highlighting.scss @@ -0,0 +1,71 @@ +/** + * Syntax highlighting styles + */ +.highlight { + background: #fff; + @extend %vertical-rhythm; + + .highlighter-rouge & { + background: #eef; + } + + .c { color: #998; font-style: italic } // Comment + .err { color: #a61717; background-color: #e3d2d2 } // Error + .k { font-weight: bold } // Keyword + .o { font-weight: bold } // Operator + .cm { color: #998; font-style: italic } // Comment.Multiline + .cp { color: #999; font-weight: bold } // Comment.Preproc + .c1 { color: #998; font-style: italic } // Comment.Single + .cs { color: #999; font-weight: bold; font-style: italic } // Comment.Special + .gd { color: #000; background-color: #fdd } // Generic.Deleted + .gd .x { color: #000; background-color: #faa } // Generic.Deleted.Specific + .ge { font-style: italic } // Generic.Emph + .gr { color: #a00 } // Generic.Error + .gh { color: #999 } // Generic.Heading + .gi { color: #000; background-color: #dfd } // Generic.Inserted + .gi .x { color: #000; background-color: #afa } // Generic.Inserted.Specific + .go { color: #888 } // Generic.Output + .gp { color: #555 } // Generic.Prompt + .gs { font-weight: bold } // Generic.Strong + .gu { color: #aaa } // Generic.Subheading + .gt { color: #a00 } // Generic.Traceback + .kc { font-weight: bold } // Keyword.Constant + .kd { font-weight: bold } // Keyword.Declaration + .kp { font-weight: bold } // Keyword.Pseudo + .kr { font-weight: bold } // Keyword.Reserved + .kt { color: #458; font-weight: bold } // Keyword.Type + .m { color: #099 } // Literal.Number + .s { color: #d14 } // Literal.String + .na { color: #008080 } // Name.Attribute + .nb { color: #0086B3 } // Name.Builtin + .nc { color: #458; font-weight: bold } // Name.Class + .no { color: #008080 } // Name.Constant + .ni { color: #800080 } // Name.Entity + .ne { color: #900; font-weight: bold } // Name.Exception + .nf { color: #900; font-weight: bold } // Name.Function + .nn { color: #555 } // Name.Namespace + .nt { color: #000080 } // Name.Tag + .nv { color: #008080 } // Name.Variable + .ow { font-weight: bold } // Operator.Word + .w { color: #bbb } // Text.Whitespace + .mf { color: #099 } // Literal.Number.Float + .mh { color: #099 } // Literal.Number.Hex + .mi { color: #099 } // Literal.Number.Integer + .mo { color: #099 } // Literal.Number.Oct + .sb { color: #d14 } // Literal.String.Backtick + .sc { color: #d14 } // Literal.String.Char + .sd { color: #d14 } // Literal.String.Doc + .s2 { color: #d14 } // Literal.String.Double + .se { color: #d14 } // Literal.String.Escape + .sh { color: #d14 } // Literal.String.Heredoc + .si { color: #d14 } // Literal.String.Interpol + .sx { color: #d14 } // Literal.String.Other + .sr { color: #009926 } // Literal.String.Regex + .s1 { color: #d14 } // Literal.String.Single + .ss { color: #990073 } // Literal.String.Symbol + .bp { color: #999 } // Name.Builtin.Pseudo + .vc { color: #008080 } // Name.Variable.Class + .vg { color: #008080 } // Name.Variable.Global + .vi { color: #008080 } // Name.Variable.Instance + .il { color: #099 } // Literal.Number.Integer.Long +} diff --git a/app/templates/app/crossdomain.xml b/generators/jekyll/templates/app/crossdomain.xml similarity index 100% rename from app/templates/app/crossdomain.xml rename to generators/jekyll/templates/app/crossdomain.xml diff --git a/generators/jekyll/templates/app/index.html b/generators/jekyll/templates/app/index.html new file mode 100644 index 0000000..97ae9c2 --- /dev/null +++ b/generators/jekyll/templates/app/index.html @@ -0,0 +1,22 @@ +--- +layout: default +--- + +
+ +

Posts

+ +
    + {% for post in site.posts %} +
  • + + +

    + {{ post.title }} +

    +
  • + {% endfor %} +
+ +

subscribe via RSS

+
diff --git a/app/templates/app/robots.txt b/generators/jekyll/templates/app/robots.txt similarity index 100% rename from app/templates/app/robots.txt rename to generators/jekyll/templates/app/robots.txt diff --git a/app/templates/_config.build.yml b/generators/jekyll/templates/config.build.yml similarity index 54% rename from app/templates/_config.build.yml rename to generators/jekyll/templates/config.build.yml index f2e0177..9416832 100644 --- a/app/templates/_config.build.yml +++ b/generators/jekyll/templates/config.build.yml @@ -1,16 +1,8 @@ # 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 -# Gives you more accurate related posts -lsi: true # Removes the upper limit for posts generated limit_posts: 0 - -source: 'src' -destination: 'serve' diff --git a/app/templates/_config.yml b/generators/jekyll/templates/config.yml old mode 100755 new mode 100644 similarity index 76% rename from app/templates/_config.yml rename to generators/jekyll/templates/config.yml index 5664e5c..86231bf --- a/app/templates/_config.yml +++ b/generators/jekyll/templates/config.yml @@ -2,23 +2,23 @@ # Can be used in your theme by calling 'site.title' and so on 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: serve +source: .tmp/jekyll +destination: .tmp/dist +exclude: ['assets'] # Same as the title etc for your site but can instead be # called by using 'site.author.name' and so on +# NOTE: Don't use @ in front of your Twitter username author: name: <%= authorName %> email: <%= authorEmail %> + uri: <%= authorURI %> bio: <%= authorBio %> - twitter: <%= authorTwitter %> - -# general setting for Jekyll -googleAnalytics: UA-XXXXX-X + twitter: + github: # _config.build.yml overwrites these options when you run `gulp build` # Enables future posts (posts with dates in the future) and drafts @@ -30,16 +30,22 @@ lsi: false limit_posts: 10 # Permalink structure and pagination options -relative_permalinks: true permalink: <%= jekyllPermalinks %> -paginate: <%= jekyllPaginate%> +paginate: 10 paginate_path: 'page:num' excerpt_separator: '' -# Markdown library +# Markdown library and options markdown: redcarpet -# Markdown library options redcarpet: extensions: ['no_intra_emphasis', 'tables', 'fenced_code_blocks', 'autolink', 'smart', 'strikethrough', 'superscript', 'underline', 'highlight', 'footnotes'] highlighter: true + +# Extending Jekyll +gems: + - jekyll-feed + - jekyll-gist + - jekyll-paginate + - jekyll-sitemap + - jekyll-seo-tag diff --git a/app/templates/app/humans.txt b/generators/jekyll/templates/humans.txt similarity index 78% rename from app/templates/app/humans.txt rename to generators/jekyll/templates/humans.txt index 9955e38..12ebe80 100644 --- a/app/templates/app/humans.txt +++ b/generators/jekyll/templates/humans.txt @@ -3,7 +3,7 @@ # TEAM - <%= authorName %> -- -- @<%= authorTwitter %> + <%= authorName %> -- -- @ # THANKS diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index 83f2327..0000000 --- a/gulpfile.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -var path = require("path"); -var gulp = require("gulp"); -var jshint = require("gulp-jshint"); -var istanbul = require("gulp-istanbul"); -var plumber = require("gulp-plumber"); -var mocha = require("gulp-mocha"); -var coveralls = require("gulp-coveralls"); - -var handleErr = function (err) { - console.log(err.message); - process.exit(1); -}; - -gulp.task("static", function () { - return gulp.src([ - "test/*.js", - "app/index.js", - "gulpfile.js" - ]) - .pipe(jshint(".jshintrc")) - .pipe(jshint.reporter("jshint-stylish")) - .pipe(jshint.reporter("fail")) - .on("error", handleErr); -}); - -gulp.task("test", function (cb) { - gulp.src([ - "app/index.js" - ]) - .pipe(istanbul({ - includeUntested: true - })) - .pipe(istanbul.hookRequire()) - .on("finish", function () { - gulp.src(["test/*.js"]) - .pipe(plumber()) - .pipe(mocha({ - reporter: "spec" - })) - .pipe(istanbul.writeReports()) - .on("end", cb); - }); -}); - -gulp.task("coveralls", ["test"], function () { - if (!process.env.CI) return; - return gulp.src(path.join(__dirname, "coverage/lcov.info")) - .pipe(coveralls()); -}); - -gulp.task("default", ["static", "test", "coveralls"]); diff --git a/index.js b/index.js new file mode 100644 index 0000000..c2d63ed --- /dev/null +++ b/index.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = { + app: require.resolve('./generators/app'), + boilerplate: require.resolve('./generators/boilerplate'), + gulp: require.resolve('./generators/gulp'), + jekyll: require.resolve('./generators/jekyll') +}; diff --git a/package.json b/package.json index 5283f45..fd5984f 100644 --- a/package.json +++ b/package.json @@ -1,64 +1,48 @@ { "name": "generator-jekyllized", - "version": "0.7.4", - "description": "Jekyll workflow with Gulp, SASS, AutoPrefixer, asset optimization and cache busting and much more. Can you really want more?", + "version": "1.0.0-beta.23", + "main": "index.js", + "description": "Use Jekyll with Gulp: Sass, sourcemaps, AutoPrefixer, asset optimization and cache busting and much, much more. Can you really want more?", "keywords": [ "yeoman-generator", "jekyll", "static", - "h5bp", - "sass" - ], - "bugs": "https://github.com/sondr3/generator-jekyllized/issues", - "author": { - "name": "Sondre Nilsen", - "email": "nilsen.sondre@gmail.com", - "url": "https://github.com/sondr3" - }, - "main": "app/index.js", - "repository": { - "type": "git", - "url": "git://github.com/sondr3/generator-jekyllized.git" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/sondr3/generator-jekyllized/blob/master/LICENSE" - } + "gulp" ], + "author": "Sondre Nilsen", + "repository": "sondr3/generator-jekyllized", + "license": "MIT", "scripts": { - "test": "gulp" + "test": "xo && nyc ava" }, + "files": [ + "index.js", + "generators" + ], "dependencies": { - "chalk": "^0.5.1", - "globule": "~0.2.0", - "shelljs": "~0.3.0", - "yeoman-generator": "^0.18.6" + "chalk": "^1.1.0", + "lodash": "^4.11.1", + "shelljs": "^0.7.0", + "yargs": "^4.6.0", + "yeoman-generator": "^0.23.3", + "yosay": "^1.1.1" }, "devDependencies": { - "codeclimate-test-reporter": "0.0.4", - "coveralls": "^2.11.2", - "gulp": "^3.8.10", - "gulp-coveralls": "^0.1.3", - "gulp-istanbul": "^0.5.0", - "gulp-jscs": "^1.4.0", - "gulp-jshint": "^1.9.0", - "gulp-load-plugins": "^0.8.0", - "gulp-mocha": "^2.0.0", - "gulp-plumber": "^0.6.6", - "istanbul": "~0.3.5", - "jshint": "^2.5.11", - "jshint-stylish": "^1.0.0", - "mocha": "~2.1.0", - "mocha-lcov-reporter": "0.0.1" - }, - "peerDependencies": { - "generator-mocha": ">=0.1.6", - "yo": ">=1.3.3", - "gulp": ">=3.8.10" + "ava": "^0.15.1", + "coveralls": "^2.11.9", + "nyc": "^6.4.4", + "xo": "^0.15.1", + "yeoman-assert": "^2.2.1", + "yeoman-test": "^1.1.0", + "yo": "^1.7.0" }, - "engines": { - "node": ">=0.10", - "npm": ">=1.2.10" + "xo": { + "space": true, + "ignores": [ + "generators/app/templates/**", + "generators/boilerplate/templates/**", + "generators/gulp/templates/**", + "generators/jekyll/templates/**" + ] } } diff --git a/test-util.js b/test-util.js deleted file mode 100644 index 41b04b6..0000000 --- a/test-util.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; - -var fs = require("fs"); -var assert = require("assert"); - -exports.assertTaskExists = function (generator, taskName, features, done) { - var gulpFile = fs.readFileSync("./gulpfile.js", "utf8"); - var regExpGulp = new RegExp("gulp.task\\(\"" + taskName + "\""); - - assert.ok( - regExpGulp.test(gulpFile), - "gulpfile.js does not contain " + taskName + " task" - ); - done(); -}; - -exports.assertJekyllSettings = function (generator, settingName, settingValue, done) { - var configFile = fs.readFileSync("./_config.yml", "utf8"); - var settingRegExp = new RegExp(settingName + ": " + settingValue); - - assert.ok( - settingRegExp.test(configFile), - "_config.yml setting " + settingName + " does not contain the right value" - ); - done(); -}; - -exports.assertJekyllBuildSettings = function (generator, settingName, settingValue, done) { - var configBuildFile = fs.readFileSync("./_config.build.yml", "utf8"); - var settingRegExp = new RegExp(settingName + ": " + settingValue); - - assert.ok( - settingRegExp.test(configBuildFile), - "_config.build.yml setting " + settingName + " does not contain the right value" - ); - done(); -}; diff --git a/test/app.js b/test/app.js new file mode 100644 index 0000000..9a452b3 --- /dev/null +++ b/test/app.js @@ -0,0 +1,55 @@ +'use strict'; +var path = require('path'); +var test = require('ava'); +var assert = require('yeoman-assert'); +var helpers = require('yeoman-test'); + +test.before(() => { + var deps = [ + [helpers.createDummyGenerator(), 'jekyllized:boilerplate'], + [helpers.createDummyGenerator(), 'jekyllized:jekyll'], + [helpers.createDummyGenerator(), 'jekyllized:gulp'] + ]; + + return helpers.run(path.join(__dirname, '../generators/app')) + .withPrompts({ + projectName: 'jekyllized', + projectDescription: 'Test site for Jekyllized', + projectURL: 'www.test.com', + authorName: 'Ola Nordmann', + authorEmail: 'ola.nordmann@gmail.com', + authorBio: 'A norwegian dude', + uploading: 'None', + jekyllPermalinks: 'pretty' + }) + .withOptions({'skip-install': true}) + .withGenerators(deps) + .toPromise(); +}); + +test('generates expected files', () => { + assert.file([ + '.editorconfig', + '.gitignore', + '.gitattributes', + 'package.json', + 'gulpfile.js', + 'README.md', + '_config.yml', + '_config.build.yml', + 'Gemfile' + ]); +}); + +test('creates package.json correctly', () => { + assert.file('package.json'); + [ + '"name": "jekyllized"', + '"description": "Test site for Jekyllized"', + '"homepage": "www.test.com', + '"name": "Ola Nordmann"', + '"email": "ola.nordmann@gmail.com"' + ].forEach(field => { + assert.fileContent('package.json', field); + }); +}); diff --git a/test/boilerplate.js b/test/boilerplate.js new file mode 100644 index 0000000..8af4274 --- /dev/null +++ b/test/boilerplate.js @@ -0,0 +1,42 @@ +'use strict'; +var path = require('path'); +var test = require('ava'); +var assert = require('yeoman-assert'); +var helpers = require('yeoman-test'); + +test.before(() => { + return helpers.run(path.join(__dirname, '../generators/boilerplate')) + .withOptions({ + projectName: 'README', + projectDescription: 'This is a great README', + projectURL: 'hello-world.com', + authorName: 'Ola Nordmann' + }) + .toPromise(); +}); + +test('creates .editorconfig', () => { + assert.file('.editorconfig'); +}); + +test('creates .gitignore', () => { + assert.file('.gitignore'); +}); + +test('creates .gitattributes', () => { + assert.file('.gitattributes'); +}); + +test('creates README.md', () => { + assert.file('README.md'); +}); + +test('README is correct', () => { + [ + '# README', + '> This is a great README', + '[Ola Nordmann](hello-world.com)' + ].forEach(field => { + assert.fileContent('README.md', field); + }); +}); diff --git a/test/gulp.js b/test/gulp.js new file mode 100644 index 0000000..529fa48 --- /dev/null +++ b/test/gulp.js @@ -0,0 +1,107 @@ +'use strict'; +var path = require('path'); +var test = require('ava'); +var assert = require('yeoman-assert'); +var helpers = require('yeoman-test'); + +test.before(() => { + return helpers.run(path.join(__dirname, '../generators/gulp')) + .withOptions({uploading: 'None'}) + .toPromise(); +}); + +test('creates gulpfile', () => { + assert.file('gulpfile.js'); +}); + +test('creates package.json', () => { + assert.file('package.json'); +}); + +test('package.json contains correct packages', () => { + assert.jsonFileContent('package.json', { + devDependencies: { + 'autoprefixer': '^6.2.3', + 'browser-sync': '^2.11.0', + 'del': '^2.2.0', + 'gulp': 'git://github.com/gulpjs/gulp.git#4.0', + 'gulp-cache': '^0.4.1', + 'gulp-concat': '^2.6.0', + 'gulp-cssnano': '^2.1.0', + 'gulp-eslint': '^2.0.0', + 'gulp-gzip': '^1.1.0', + 'gulp-htmlmin': '^2.0.0', + 'gulp-if': '^2.0.0', + 'gulp-imagemin': '^3.0.0', + 'gulp-inject': '^4.0.0', + 'gulp-load-plugins': '^1.2.0', + 'gulp-newer': '^1.1.0', + 'gulp-postcss': '^6.0.0', + 'gulp-rename': '^1.2.2', + 'gulp-rev': '^7.0.0', + 'gulp-sass': '^2.1.1', + 'gulp-size': '^2.0.0', + 'gulp-sourcemaps': '^1.3.0', + 'gulp-uglify': '^1.5.1', + 'gulp-uncss': '^1.0.0', + 'shelljs': '^0.7.0', + 'yargs': '^4.7.0' + } + }); +}); + +test('does not create credentials files', () => { + assert.noFile([ + 'aws-credentials.json', + 'rsync-credentials.json' + ]); +}); + +test('does not contain uploading packages', () => { + assert.noJsonFileContent('package.json', { + devDependencies: { + 'gulp-awspublish': '', + 'concurrent-transform': '', + 'gulp-rsync': '', + 'gulp-gh-pages': '' + } + }); +}); + +test('contains default gulp tasks', () => { + [ + 'clean:assets', + 'clean:images', + 'clean:dist', + 'clean:gzip', + 'clean:jekyll', + 'jekyll:tmp', + 'jekyll', + 'jekyll:doctor', + 'styles', + 'scripts', + 'inject:head', + 'inject:footer', + 'images', + 'fonts', + 'html', + 'copy:assets', + 'copy:jekyll', + 'inject', + 'build:jekyll', + 'serve', + 'assets', + 'clean', + 'rebuild', + 'build', + 'check', + 'default' + ].forEach(function (task) { + assert.fileContent('gulpfile.js', 'gulp.task(\'' + task); + }); +}); + +test('does not contain deploy task', () => { + assert.noFileContent('gulpfile.js', 'gulp.task(\'deploy\''); +}); + diff --git a/test/jekyll.js b/test/jekyll.js new file mode 100644 index 0000000..e506f01 --- /dev/null +++ b/test/jekyll.js @@ -0,0 +1,69 @@ +'use strict'; +var path = require('path'); +var test = require('ava'); +var assert = require('yeoman-assert'); +var helpers = require('yeoman-test'); + +test.before(() => { + return helpers.run(path.join(__dirname, '../generators/jekyll')) + .withOptions({ + projectName: 'jekyllized', + projectDescription: 'Tests for Jekyllized', + projectURL: 'example.org', + authorName: 'Ola Nordmann', + authorEmail: 'ola.nordmann@email.com', + authorURI: 'homepage.com', + authorBio: 'I am a tester for tests' + }) + .toPromise(); +}); + +test('creates Gemfile', () => { + assert.file('Gemfile'); +}); + +test('creates _config.yml files', () => { + assert.file([ + '_config.yml', + '_config.build.yml' + ]); +}); + +test('creates src directory', () => { + assert.file([ + 'src/404.html', + 'src/about.md', + 'src/crossdomain.xml', + 'src/humans.txt', + 'src/index.html', + 'src/robots.txt' + ]); +}); + +test('_config.yml contains the correct settings', () => { + [ + 'title: jekyllized', + 'description: Tests for Jekyllized', + 'url: example.org', + 'name: Ola Nordmann', + 'email: ola.nordmann@email.com', + 'uri: homepage.com', + 'bio: I am a tester for tests' + ].forEach(function (config) { + assert.fileContent('_config.yml', config); + }); +}); + +test('_config.build.yml contains the correct settings', () => { + [ + 'future: false', + 'show_drafts: false', + 'limit_posts: 0' + ].forEach(function (config) { + assert.fileContent('_config.build.yml', config); + }); +}); + +test('fills out humans.txt correctly', () => { + assert.fileContent('src/humans.txt', 'Ola Nordmann -- -- @'); +}); diff --git a/test/permalinks/date.js b/test/permalinks/date.js new file mode 100644 index 0000000..87e1031 --- /dev/null +++ b/test/permalinks/date.js @@ -0,0 +1,15 @@ +'use strict'; +var path = require('path'); +var test = require('ava'); +var assert = require('yeoman-assert'); +var helpers = require('yeoman-test'); + +test.before(() => { + return helpers.run(path.join(__dirname, '../../generators/jekyll')) + .withOptions({jekyllPermalinks: 'date'}) + .toPromise(); +}); + +test('sets date permalinks', () => { + assert.fileContent('_config.yml', 'permalink: date'); +}); diff --git a/test/permalinks/none.js b/test/permalinks/none.js new file mode 100644 index 0000000..33178c6 --- /dev/null +++ b/test/permalinks/none.js @@ -0,0 +1,15 @@ +'use strict'; +var path = require('path'); +var test = require('ava'); +var assert = require('yeoman-assert'); +var helpers = require('yeoman-test'); + +test.before(() => { + return helpers.run(path.join(__dirname, '../../generators/jekyll')) + .withOptions({jekyllPermalinks: 'none'}) + .toPromise(); +}); + +test('sets none permalinks', () => { + assert.fileContent('_config.yml', 'permalink: none'); +}); diff --git a/test/permalinks/ordinal.js b/test/permalinks/ordinal.js new file mode 100644 index 0000000..cd835c9 --- /dev/null +++ b/test/permalinks/ordinal.js @@ -0,0 +1,16 @@ +'use strict'; +var path = require('path'); +var test = require('ava'); +var assert = require('yeoman-assert'); +var helpers = require('yeoman-test'); + +test.before(() => { + return helpers.run(path.join(__dirname, '../../generators/jekyll')) + .withOptions({jekyllPermalinks: 'ordinal'}) + .toPromise(); +}); + +test('sets ordinal permalinks', () => { + assert.fileContent('_config.yml', 'permalink: ordinal'); +}); + diff --git a/test/permalinks/pretty.js b/test/permalinks/pretty.js new file mode 100644 index 0000000..71fbcb1 --- /dev/null +++ b/test/permalinks/pretty.js @@ -0,0 +1,15 @@ +'use strict'; +var path = require('path'); +var test = require('ava'); +var assert = require('yeoman-assert'); +var helpers = require('yeoman-test'); + +test.before(() => { + return helpers.run(path.join(__dirname, '../../generators/jekyll')) + .withOptions({jekyllPermalinks: 'pretty'}) + .toPromise(); +}); + +test('sets pretty permalinks', () => { + assert.fileContent('_config.yml', 'permalink: pretty'); +}); diff --git a/test/test-creation-aws.js b/test/test-creation-aws.js deleted file mode 100755 index 81577c9..0000000 --- a/test/test-creation-aws.js +++ /dev/null @@ -1,43 +0,0 @@ -/*global describe, before, it*/ -"use strict"; - -var path = require("path"); -var helpers = require("yeoman-generator").test; -var assert = require("yeoman-generator").assert; -var tasks = require("../test-util.js"); - -describe("Jekyllized generator test when using Amazon AWS", function () { - before(function (done) { - helpers.run(path.join(__dirname, "../app")) - .inDir(path.join(__dirname, "./temp/test-aws")) - .withArguments(["--skip-install"]) - .withPrompt({ - uploadChoices: ["amazonCloudfrontS3"], - amazonKey: ["123123123123123"], - amazonSecret: ["14141414141414"], - amazonBucket: ["135135135135135"], - amazonDistID: ["2121212121212121"] - }) - .on("end", done); - }); - - it("creates expected files", function () { - var expected = [ - "bower.json", - "package.json", - "gulpfile.js", - "src/index.html", - "src/robots.txt", - "src/assets/favicon.ico", - "src/assets/scss/style.scss", - "aws-credentials.json" - ]; - - assert.file(expected); - }); - - it("should contain deploy tasks", function (done) { - tasks.assertTaskExists(this.jekyllized, "deploy", [], done); - }); - -}); diff --git a/test/test-creation-ghpages.js b/test/test-creation-ghpages.js deleted file mode 100644 index 15d56bb..0000000 --- a/test/test-creation-ghpages.js +++ /dev/null @@ -1,38 +0,0 @@ -/*global describe, before, it*/ -"use strict"; - -var path = require("path"); -var helpers = require("yeoman-generator").test; -var assert = require("yeoman-generator").assert; -var tasks = require("../test-util.js"); - -describe("Jekyllized generator test when using GitHub Pages", function () { - before(function (done) { - helpers.run(path.join(__dirname, "../app")) - .inDir(path.join(__dirname, "./temp/test-pages")) - .withArguments(["--skip-install"]) - .withPrompt({ - uploadChoices: ["githubPages"] - }) - .on("end", done); - }); - - it("creates expected files", function () { - var expected = [ - "bower.json", - "package.json", - "gulpfile.js", - "src/index.html", - "src/robots.txt", - "src/assets/favicon.ico", - "src/assets/scss/style.scss" - ]; - - assert.file(expected); - }); - - it("should contain deploy task", function (done) { - tasks.assertTaskExists(this.jekyllized, "deploy", [], done); - }); - -}); diff --git a/test/test-creation-rsync.js b/test/test-creation-rsync.js deleted file mode 100755 index 7a333c3..0000000 --- a/test/test-creation-rsync.js +++ /dev/null @@ -1,42 +0,0 @@ -/*global describe, before, it*/ -"use strict"; - -var path = require("path"); -var helpers = require("yeoman-generator").test; -var assert = require("yeoman-generator").assert; -var tasks = require("../test-util.js"); - -describe("Jekyllized generator test when using Rsync", function () { - before(function (done) { - helpers.run(path.join(__dirname, "../app")) - .inDir(path.join(__dirname, "./temp/test-rsync")) - .withArguments(["--skip-install"]) - .withPrompt({ - uploadChoices: ["rsync"], - rsyncUsername: ["olanordmann"], - rsyncHostname: ["example.com"], - rsyncDestination: ["/srv/www/example.com/public_html"] - }) - .on("end", done); - }); - - it("creates expected files", function () { - var expected = [ - "bower.json", - "package.json", - "gulpfile.js", - "src/index.html", - "src/robots.txt", - "src/assets/favicon.ico", - "src/assets/scss/style.scss", - "rsync-credentials.json" - ]; - - assert.file(expected); - }); - - it("should contain deploy task", function (done) { - tasks.assertTaskExists(this.jekyllized, "deploy", [], done); - }); - -}); diff --git a/test/test-gulp.js b/test/test-gulp.js deleted file mode 100644 index 998a06b..0000000 --- a/test/test-gulp.js +++ /dev/null @@ -1,129 +0,0 @@ -/*global describe, before, it*/ -"use strict"; - -var path = require("path"); -var assert = require("assert"); -var helpers = require("yeoman-generator").test; -var tasks = require("../test-util.js"); - -describe("Jekyllized generator test for Gulp tasks without any uploading", function () { - before(function (done) { - helpers.run(path.join(__dirname, "../app")) - .inDir(path.join(__dirname, "./temp/test-gulp")) - .withArguments(["--skip-install"]) - .withPrompt({ - projectName: ["Mocha Test"], - projectDescription: ["Mocha tests for Jekyllized"], - projectTagline: ["Better hope this doesn\"t blow up"], - projectURL: ["testing.com"], - authorName: ["Ola Nordmann"], - authorEmail: ["ola.nordmann@email.com"], - authorBio: ["Just your average Norwegian"], - authorTwitter: ["olanordmann123123"], - jekyllPermalinks: ["pretty"], - jekyllPaginate: ["10"], - uploadChoices: ["noUpload"] - }) - .on("end", done); - }); - - it("creates expected files", function () { - var expected = [ - "bower.json", - "package.json", - "gulpfile.js", - "src/index.html", - "src/robots.txt", - "src/assets/favicon.ico", - "src/assets/scss/style.scss" - ]; - - assert.file(expected); - }); - - it("does not create unexpected files", function () { - var unexpected = [ - "aws-credentials.json", - "rsync-redentials.json" - ]; - - assert.noFile(unexpected); - }); - - it("should contain clean:dev task", function (done) { - tasks.assertTaskExists(this.jekyllized, "clean:dev", [], done); - }); - - it("should contain clean:prod task", function (done) { - tasks.assertTaskExists(this.jekyllized, "clean:prod", [], done); - }); - - it("should contain jekyll:dev task", function (done) { - tasks.assertTaskExists(this.jekyllized, "jekyll:dev", [], done); - }); - - it("should contain jekyll-rebuild task with jekyll:dev included", function (done) { - tasks.assertTaskExists(this.jekyllized, "jekyll-rebuild", ["jekyll:dev"], done); - }); - - it("should contain jekyll:prod task", function (done) { - tasks.assertTaskExists(this.jekyllized, "jekyll:prod", [], done); - }); - - it("should contain styles task", function (done) { - tasks.assertTaskExists(this.jekyllized, "styles", [], done); - }); - - it("should contain images task", function (done) { - tasks.assertTaskExists(this.jekyllized, "images", [], done); - }); - - it("should contain fonts task", function (done) { - tasks.assertTaskExists(this.jekyllized, "fonts", [], done); - }); - - it("should contain copy task", function (done) { - tasks.assertTaskExists(this.jekyllized, "copy", [], done); - }); - - it("should contain html task with styles included", function (done) { - tasks.assertTaskExists(this.jekyllized, "html", ["styles"], done); - }); - - it("should contain jslint task", function (done) { - tasks.assertTaskExists(this.jekyllized, "jslint", [], done); - }); - - it("should contain doctor task", function (done) { - tasks.assertTaskExists(this.jekyllized, "doctor", [], done); - }); - - it("should contain serve:dev task with styles and jekyll:dev included", function (done) { - tasks.assertTaskExists(this.jekyllized, "serve:dev", ["styles", "jekyll:dev"], done); - }); - - it("should contain watch task", function (done) { - tasks.assertTaskExists(this.jekyllized, "watch", [], done); - }); - - it("should contain serve:prod task", function (done) { - tasks.assertTaskExists(this.jekyllized, "serve:prod", [], done); - }); - - it("should contain default task with serve:dev and watch included", function (done) { - tasks.assertTaskExists(this.jekyllized, "default", ["serve:dev", "watch"], done); - }); - - it("should contain check task with jslint and doctor included", function (done) { - tasks.assertTaskExists(this.jekyllized, "check", ["jslint", "doctor"], done); - }); - - it("should contain build task with jekyll:prod and styles included", function (done) { - tasks.assertTaskExists(this.jekyllized, "build", [], done); - }); - - it("should contain publish task with build included", function (done) { - tasks.assertTaskExists(this.jekyllized, "publish", ["build"], done); - }); - -}); diff --git a/test/test-jekyll.js b/test/test-jekyll.js deleted file mode 100644 index 5d2a65e..0000000 --- a/test/test-jekyll.js +++ /dev/null @@ -1,153 +0,0 @@ -/*global describe, before, it*/ -"use strict"; - -var path = require("path"); -var helpers = require("yeoman-generator").test; -var assert = require("yeoman-generator").assert; -var tasks = require("../test-util.js"); - -describe("Jekyllized generator", function () { - describe("test for Jekyll settings", function () { - before(function (done) { - helpers.run(path.join(__dirname, "../app")) - .inDir(path.join(__dirname, "./temp/test-jekyll")) - .withArguments(["--skip-install"]) - .withPrompt({ - projectName: ["Mocha Test"], - projectDescription: ["Mocha tests for Jekyllized"], - projectTagline: ["Better hope this doesn\"t blow up"], - projectURL: ["testing.com"], - authorName: ["Ola Nordmann"], - authorEmail: ["ola.nordmann@email.com"], - authorBio: ["Just your average Norwegian"], - authorTwitter: ["olanordmann123123"], - jekyllPermalinks: ["pretty"], - jekyllPaginate: ["10"], - uploadChoices: ["noUpload"] - }) - .on("end", done); - }); - - it("creates the expected files", function () { - var expected = [ - "src/404.html", - "src/about.md", - "src/atom.xml", - "src/crossdomain.xml", - "src/humans.txt", - "src/index.html", - "src/robots.txt", - "src/sitemap.xml" - ]; - - assert.file(expected); - }); - - it("gulpfile.js does NOT contain a deploy task", function () { - assert.noFileContent("gulpfile.js", /gulp.task \("deploy"\)/); - }); - - it("_config.yml contains the correct title", function (done) { - tasks.assertJekyllSettings(this.jekyllized, "title", "Mocha Test", done); - }); - - it("_config.yml contains the correct description", function (done) { - tasks.assertJekyllSettings(this.jekyllized, "description", "Mocha tests for Jekyllized", done); - }); - - it("_config.yml contains the correct tagline", function (done) { - tasks.assertJekyllSettings(this.jekyllized, "tagline", "Better hope this doesn\"t blow up", done); - }); - - it("_config.yml contains the correct author name", function (done) { - tasks.assertJekyllSettings(this.jekyllized, "name", "Ola Nordmann", done); - }); - - it("_config.yml contains the correct author email", function (done) { - tasks.assertJekyllSettings(this.jekyllized, "email", "ola.nordmann@email.com", done); - }); - - it("_config.yml contains the correct author bio", function (done) { - tasks.assertJekyllSettings(this.jekyllized, "bio", "Just your average Norwegian", done); - }); - - it("_config.yml contains the correct author Twitter", function (done) { - 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); - }); - - }); - - describe("test for permalinks and pagination", function () { - before(function (done) { - helpers.run(path.join(__dirname, "../app")) - .inDir(path.join(__dirname, "./temp/test-jekyll-pagination")) - .withArguments(["--skip-install"]) - .withPrompt({ - jekyllPermalinks: ["pretty"], - jekyllPaginate: ["10"], - uploadChoices: ["noUpload"] - }) - .on("end", done); - }); - - it("_config.yml permalink setting is 'pretty'", function (done) { - tasks.assertJekyllSettings(this.jekyllized, "permalink", "pretty", done); - }); - - it("_config.yml pagination setting is '10'", function (done) { - tasks.assertJekyllSettings(this.jekyllized, "paginate", "10", done); - }); - - }); - - describe("", function () { - before(function (done) { - helpers.run(path.join(__dirname, "../app")) - .inDir(path.join(__dirname, "./temp/test-jekyll-pagination-1")) - .withArguments(["--skip-install"]) - .withPrompt({ - jekyllPermalinks: ["date"], - jekyllPaginate: ["all"], - uploadChoices: ["noUpload"] - }) - .on("end", done); - }); - - it("_config.yml permalink setting is 'date'", function (done) { - tasks.assertJekyllSettings(this.jekyllized, "permalink", "date", done); - }); - - it("_config.yml pagination setting is 'all'", function (done) { - tasks.assertJekyllSettings(this.jekyllized, "paginate", "all", done); - }); - - }); - - describe("", function () { - before(function (done) { - helpers.run(path.join(__dirname, "../app")) - .inDir(path.join(__dirname, "./temp/test-jekyll-pagination-2")) - .withArguments(["--skip-install"]) - .withPrompt({ - jekyllPermalinks: ["none"], - jekyllPaginate: ["1"], - uploadChoices: ["noUpload"] - }) - .on("end", done); - }); - - it("_config.yml permalink setting is 'none'", function (done) { - tasks.assertJekyllSettings(this.jekyllized, "permalink", "none", done); - }); - - it("_config.yml pagination setting is '1'", function (done) { - tasks.assertJekyllSettings(this.jekyllized, "paginate", "1", done); - }); - - }); - -}); diff --git a/test/test-load.js b/test/test-load.js deleted file mode 100644 index 8ac30f6..0000000 --- a/test/test-load.js +++ /dev/null @@ -1,11 +0,0 @@ -/*global describe, it*/ -"use strict"; - -var assert = require("assert"); - -describe("jekyll generator", function () { - it("can be imported without blowing up", function () { - var app = require("../app"); - assert(app !== undefined); - }); -}); diff --git a/test/uploading/aws.js b/test/uploading/aws.js new file mode 100644 index 0000000..dd99e70 --- /dev/null +++ b/test/uploading/aws.js @@ -0,0 +1,53 @@ +'use strict'; +var path = require('path'); +var test = require('ava'); +var assert = require('yeoman-assert'); +var helpers = require('yeoman-test'); + +test.before(() => { + return helpers.run(path.join(__dirname, '../../generators/gulp')) + .withOptions({uploading: 'Amazon S3'}) + .toPromise(); +}); + +test('creates gulpfile', () => { + assert.file('gulpfile.js'); +}); + +test('creates package.json file', () => { + assert.file('package.json'); +}); + +test('contain correct uploading packages', () => { + assert.jsonFileContent('package.json', { + devDependencies: { + 'gulp-awspublish': '^3.2.0', + 'concurrent-transform': '^1.0.0' + } + }); +}); + +test('does not contain wrong uploading packages', () => { + assert.noJsonFileContent('package.json', { + devDependencies: { + 'gulp-rsync': '', + 'gulp-gh-pages': '' + } + }); +}); + +test('contains deploy task', () => { + assert.fileContent('gulpfile.js', '// \'gulp deploy\' -- reads from your AWS Credentials file, creates the correct'); + assert.fileContent('gulpfile.js', '// headers for your files and uploads them to S3'); + assert.fileContent('gulpfile.js', 'gulp.task(\'deploy\''); +}); + +test('does not contain wrong uploading tasks', () => { + assert.noFileContent('gulpfile.js', '// \'gulp deploy\' -- reads from your Rsync credentials file and incrementally'); + assert.noFileContent('gulpfile.js', '// uploads your site to your server'); + assert.noFileContent('gulpfile.js', '// \'gulp deploy\' -- pushes your dist folder to Github'); +}); + +test('creates credentials file', () => { + assert.file('aws-credentials.json'); +}); diff --git a/test/uploading/ghpages.js b/test/uploading/ghpages.js new file mode 100644 index 0000000..65e7bf2 --- /dev/null +++ b/test/uploading/ghpages.js @@ -0,0 +1,49 @@ +'use strict'; +var path = require('path'); +var test = require('ava'); +var assert = require('yeoman-assert'); +var helpers = require('yeoman-test'); + +test.before(() => { + return helpers.run(path.join(__dirname, '../../generators/gulp')) + .withOptions({uploading: 'Github Pages'}) + .toPromise(); +}); + +test('creates gulpfile', () => { + assert.file('gulpfile.js'); +}); + +test('creates package.json file', () => { + assert.file('package.json'); +}); + +test('contain correct uploading packages', () => { + assert.jsonFileContent('package.json', { + devDependencies: { + 'gulp-gh-pages': '^0.5.2' + } + }); +}); + +test('does not contain wrong uploading packages', () => { + assert.noJsonFileContent('package.json', { + devDependencies: { + 'gulp-awspublish': '', + 'concurrent-transform': '', + 'gulp-rsync': '' + } + }); +}); + +test('contains deploy function', () => { + assert.fileContent('gulpfile.js', '// \'gulp deploy\' -- pushes your dist folder to Github'); + assert.fileContent('gulpfile.js', 'gulp.task(\'deploy\''); +}); + +test('does not contain the wrong uploading task', () => { + assert.noFileContent('gulpfile.js', '// \'gulp deploy\' -- reads from your AWS Credentials file, creates the correct'); + assert.noFileContent('gulpfile.js', '// headers for your files and uploads them to S3'); + assert.noFileContent('gulpfile.js', '// \'gulp deploy\' -- reads from your Rsync credentials file and incrementally'); + assert.noFileContent('gulpfile.js', '// uploads your site to your server'); +}); diff --git a/test/uploading/no-uploading.js b/test/uploading/no-uploading.js new file mode 100644 index 0000000..a2d2ece --- /dev/null +++ b/test/uploading/no-uploading.js @@ -0,0 +1,41 @@ +'use strict'; +var path = require('path'); +var test = require('ava'); +var assert = require('yeoman-assert'); +var helpers = require('yeoman-test'); + +test.before(() => { + return helpers.run(path.join(__dirname, '../../generators/gulp')) + .withOptions({uploading: 'None'}) + .toPromise(); +}); + +test('creates gulpfile', () => { + assert.file('gulpfile.js'); +}); + +test('creates package.json file', () => { + assert.file('package.json'); +}); + +test('does not create credentials files', () => { + assert.noFile([ + 'aws-credentials.json', + 'rsync-credentials.json' + ]); +}); + +test('does not contain uploading packages', () => { + assert.noJsonFileContent('package.json', { + devDependencies: { + 'gulp-awspublish': '', + 'concurrent-transform': '', + 'gulp-rsync': '', + 'gulp-gh-pages': '' + } + }); +}); + +test('does not contain deploy task', () => { + assert.noFileContent('gulpfile.js', 'gulp.task(\'deploy\''); +}); diff --git a/test/uploading/rsync.js b/test/uploading/rsync.js new file mode 100644 index 0000000..4318977 --- /dev/null +++ b/test/uploading/rsync.js @@ -0,0 +1,53 @@ +'use strict'; +var path = require('path'); +var test = require('ava'); +var assert = require('yeoman-assert'); +var helpers = require('yeoman-test'); + +test.before(() => { + return helpers.run(path.join(__dirname, '../../generators/gulp')) + .withOptions({uploading: 'Rsync'}) + .toPromise(); +}); + +test('creates gulpfile', () => { + assert.file('gulpfile.js'); +}); + +test('creates package.json file', () => { + assert.file('package.json'); +}); + +test('contain correct uploading packages', () => { + assert.jsonFileContent('package.json', { + devDependencies: { + 'gulp-rsync': '^0.0.6' + } + }); +}); + +test('does not contain wrong uploading packages', () => { + assert.noJsonFileContent('package.json', { + devDependencies: { + 'gulp-awspublish': '', + 'concurrent-transform': '', + 'gulp-gh-pages': '' + } + }); +}); + +test('contains deploy function', () => { + assert.fileContent('gulpfile.js', '// \'gulp deploy\' -- reads from your Rsync credentials file and incrementally'); + assert.fileContent('gulpfile.js', '// uploads your site to your server'); + assert.fileContent('gulpfile.js', 'gulp.task(\'deploy\''); +}); + +test('does not contain the wrong uploading task', () => { + assert.noFileContent('gulpfile.js', '// \'gulp deploy\' -- reads from your AWS Credentials file, creates the correct'); + assert.noFileContent('gulpfile.js', '// headers for your files and uploads them to S3'); + assert.noFileContent('gulpfile.js', '// \'gulp deploy\' -- pushes your dist folder to Github'); +}); + +test('creates credentials file', () => { + assert.file('rsync-credentials.json'); +});