Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikku/kartoffeldruck
A all-in-one, opinionated, swiss army knife, hackable static site generator.
https://github.com/nikku/kartoffeldruck
jamstack javascript site-generator
Last synced: 24 days ago
JSON representation
A all-in-one, opinionated, swiss army knife, hackable static site generator.
- Host: GitHub
- URL: https://github.com/nikku/kartoffeldruck
- Owner: nikku
- License: other
- Created: 2015-02-10T23:16:59.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-12-16T23:45:06.000Z (11 months ago)
- Last Synced: 2024-09-29T14:02:12.107Z (about 1 month ago)
- Topics: jamstack, javascript, site-generator
- Language: JavaScript
- Homepage:
- Size: 807 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# kartoffeldruck
[![CI](https://github.com/nikku/kartoffeldruck/workflows/CI/badge.svg)](https://github.com/nikku/kartoffeldruck/actions?query=workflow%3ACI)
An intentionally non-pluggable, all-in-one, opinionated static site generator. Built with the zen of [kartoffeldruck](https://de.wikipedia.org/wiki/Kartoffeldruck).
![kartoffeldruck image](https://c1.staticflickr.com/9/8087/8373666593_b3dd99259c_z.jpg)
[Image CC BY-SA 2.0, Walter Stempelo](https://www.flickr.com/photos/stempelo/8373666593)
## Features
[kartoffeldruck](https://github.com/nikku/kartoffeldruck) is a full fledged site generation solution. An incomplete list of features:
* [Markdown](https://github.com/chjj/marked) and [Nunjucks](https://mozilla.github.io/nunjucks/) templating support
* Front matters
* Pagination
* Draft posts
* Fetch tags and generate tag clouds
* Generate table of contents
* Custom urls (slugify, ...)
* Custom helpers
* Custom content processorsWe intentionally _do not_ provide any css processing pipelines or asset copy utilities. Use other tools [that](https://github.com/gruntjs/grunt-contrib-less) [do](https://github.com/dlmanning/gulp-sass) the [job](https://github.com/gruntjs/grunt-contrib-copy).
## Resources
* [Issues](https://github.com/nikku/kartoffeldruck/issues)
* [Example Project](https://github.com/nikku/kartoffeldruck/tree/master/example)## Usage
Place a `kartoffeldruck.js` file in your current project directory:
```javascript
/**
* @param { import('kartoffeldruck').Kartoffeldruck } druck
*/
module.exports = async function(druck) {// initialize the kartoffeldruck instance
// you may specify (global) template locals
// as well as the place for templates, pages, assets and dest more
druck.init({
locals: {
site: {
title: 'My Site'
}
}
});await druck.generate({
source: '*.md',
dest: ':name/index.html'
});
};
```Install the `kartoffeldruck` globally via [npm](https://npmjs.org):
```shell
$ npm i -g kartoffeldruck
```Run `kartoffeldruck` in the current directory. It will pick up your runner file and generate the site into the `dist` directory (or whatever is specified as `dest` via `druck.init(options)`.
```
$ kartoffeldruck
Generating site in /some-dir
Done
```Alternatively, run `kartoffeldruck` directly via `npx`:
```
$ npx kartoffeldruck
```Check out the [example project](https://github.com/nikku/kartoffeldruck/tree/master/example) to learn more about what is possible with the library.
## Alternatives
You would like to spend hours composing a site generation solution yourself? Try out [metalsmith](http://metalsmith.io/). You would rather like to use Ruby anyway? Try [jekyll](http://jekyllrb.com/). You want to experiment? Role your own.
## Grunt Integration
Simply add the following task to your `Gruntfile.js`:
```javascript
grunt.registerTask('kartoffeldruck', function() {
var done = this.async();var {
Kartoffeldruck
} = require('kartoffeldruck');Kartoffeldruck.run({
logger: {
debug: grunt.log.ok,
info: grunt.log.ok
}
}).then(
() => done(),
(err) => done(err)
);
});
```It will pick up your local `kartoffeldruck.js` file and generate the blog from there.
## License
MIT