Skip to content

Commit

Permalink
Merge branch 'master' into js-tmpl
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
#	src/Template.js
#	src/UserConfig.js
  • Loading branch information
zachleat committed Nov 21, 2018
2 parents f33ba8c + b0f912c commit 69e4fd5
Show file tree
Hide file tree
Showing 121 changed files with 5,169 additions and 1,732 deletions.
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http:https://contributor-covenant.org/version/1/4][version]

[homepage]: http:https://contributor-covenant.org
[version]: http:https://contributor-covenant.org/version/1/4/
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@ Works with HTML, Markdown, Liquid, Nunjucks, Handlebars, Mustache, EJS, Haml, Pu

## [Documentation](https://www.11ty.io/docs/)

## Pay the piper
- Please star [this repo on GitHub](https://github.com/11ty/eleventy/)!
- Follow us on Twitter [@eleven_ty](https://twitter.com/eleven_ty)
- [@11ty on npm](https://www.npmjs.com/org/11ty)
- [@11ty on GitHub](https://github.com/11ty)

* Please star [this repo on GitHub](https://github.com/11ty/eleventy/)!
* Follow us on Twitter [@eleven_ty](https://twitter.com/eleven_ty)
* [@11ty on npm](https://www.npmjs.com/org/11ty)
* [@11ty on GitHub](https://github.com/11ty)
[![Build Status](https://img.shields.io/travis/11ty/eleventy/master.svg?style=for-the-badge)](https://travis-ci.org/11ty/eleventy) [![GitHub issues](https://img.shields.io/github/issues/11ty/eleventy.svg?style=for-the-badge)](https://github.com/11ty/eleventy/issues) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=for-the-badge)](https://github.com/prettier/prettier) [![npm Version](https://img.shields.io/npm/v/@11ty/eleventy.svg?style=for-the-badge)](https://www.npmjs.com/package/@11ty/eleventy) [![npm Downloads](https://img.shields.io/npm/dt/@11ty/eleventy.svg?style=for-the-badge)](https://www.npmjs.com/package/@11ty/eleventy)

## Tests

* Build Status: [![Build Status](https://travis-ci.org/11ty/eleventy.svg?branch=master)](https://travis-ci.org/11ty/eleventy)
* [Code Coverage Statistics](docs/coverage.md)

```
npm run test
```

- [Code Coverage Statistics](https://github.com/11ty/eleventy/blob/master/docs/coverage.md)

## Major Roadmapped Features

* [Top Feature Requests](https://github.com/11ty/eleventy/issues?q=label%3Aneeds-votes+sort%3Areactions-%2B1-desc) (Add your own votes using the 👍 reaction)
- [Top Feature Requests](https://github.com/11ty/eleventy/issues?q=label%3Aneeds-votes+sort%3Areactions-%2B1-desc) (Add your own votes using the 👍 reaction)
- [Top Bugs 😱](https://github.com/11ty/eleventy/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc) (Add your own votes using the 👍 reaction)
- [Newest Bugs 🙀](https://github.com/11ty/eleventy/issues?q=is%3Aopen+is%3Aissue+label%3Abug)
118 changes: 66 additions & 52 deletions cmd.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,71 @@
#!/usr/bin/env node
const pkg = require("./package.json");
const chalk = require("chalk"); // node 4+
require("please-upgrade-node")(pkg, {
message: function(requiredVersion) {
return chalk.red(
`Eleventy requires Node ${requiredVersion}. You’ll need to upgrade to use it!`
);
}
});

if (process.env.DEBUG) {
require("time-require");
}

const argv = require("minimist")(process.argv.slice(2));
const EleventyNodeVersionCheck = require("./src/VersionCheck");

EleventyNodeVersionCheck().then(
function() {
const chalk = require("chalk");
const Eleventy = require("./src/Eleventy");
const EleventyCommandCheck = require("./src/EleventyCommandCheck");

try {
let cmdCheck = new EleventyCommandCheck(argv);
cmdCheck.hasUnknownArguments();
} catch (e) {
console.log(chalk.red("Eleventy error:"), chalk.red(e.toString()));
return;
}

try {
let elev = new Eleventy(argv.input, argv.output);
elev.setConfigPath(argv.config);
elev.setPathPrefix(argv.pathprefix);
elev.setDryRun(argv.dryrun);
elev.setFormats(argv.formats);

let isVerbose = process.env.DEBUG ? false : !argv.quiet;
elev.setIsVerbose(isVerbose);

elev.init().then(function() {
if (argv.version) {
console.log(elev.getVersion());
} else if (argv.help) {
console.log(elev.getHelp());
} else if (argv.serve) {
elev.watch().then(function() {
elev.serve(argv.port);
});
} else if (argv.watch) {
elev.watch();
} else {
elev.write();
}
});
} catch (e) {
console.log(chalk.red("Eleventy error:"), e);
}
},
function(error) {
// EleventyNodeVersionCheck rejection
const chalk = require("chalk");
console.log(chalk.red(error.toString()));
}
);
const EleventyErrorHandler = require("./src/EleventyErrorHandler");

try {
const argv = require("minimist")(process.argv.slice(2));
const Eleventy = require("./src/Eleventy");
const EleventyCommandCheck = require("./src/EleventyCommandCheck");

process.on("unhandledRejection", (error, promise) => {
EleventyErrorHandler.error(promise, "Unhandled rejection in promise");
});
process.on("uncaughtException", e => {
EleventyErrorHandler.fatal(e, "Uncaught exception");
});
process.on("rejectionHandled", promise => {
EleventyErrorHandler.warn(
promise,
"A promise rejection was handled asynchronously"
);
});

let cmdCheck = new EleventyCommandCheck(argv);
cmdCheck.hasUnknownArguments();

let elev = new Eleventy(argv.input, argv.output);
elev.setConfigPath(argv.config);
elev.setPathPrefix(argv.pathprefix);
elev.setDryRun(argv.dryrun);
elev.setPassthroughAll(argv.passthroughall);
elev.setFormats(argv.formats);

let isVerbose = process.env.DEBUG ? false : !argv.quiet;
elev.setIsVerbose(isVerbose);

// careful, we can’t use async/await here to error properly
// with old node versions in `please-upgrade-node` above.
elev
.init()
.then(function() {
if (argv.version) {
console.log(elev.getVersion());
} else if (argv.help) {
console.log(elev.getHelp());
} else if (argv.serve) {
elev.watch().then(function() {
elev.serve(argv.port);
});
} else if (argv.watch) {
elev.watch();
} else {
elev.write();
}
})
.catch(EleventyErrorHandler.fatal);
} catch (e) {
EleventyErrorHandler.fatal(e, "Eleventy fatal error");
}
2 changes: 2 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = function(config) {
dataTemplateEngine: "liquid",
passthroughFileCopy: true,
htmlOutputSuffix: "-o",
jsDataFileSuffix: ".11tydata",
keys: {
package: "pkg",
layout: "layout",
Expand All @@ -38,6 +39,7 @@ module.exports = function(config) {
data: "_data",
output: "_site"
},
// deprecated, use config.addTransform
filters: {},
// deprecated, use config.addHandlebarsHelper
handlebarsHelpers: {},
Expand Down
Loading

0 comments on commit 69e4fd5

Please sign in to comment.