diff --git a/README.md b/README.md index 0d3e209..54ec89a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # SiteGen - -A simple static site generator in [Dart][dart], webserver included. +Now with partials-support. A static site generator in [Dart][dart], webserver included. You can write your pages in HTML or [Markdown][markdown]. For Templates [Mustache][mustache] is supported. A webserver for a quick review is included. On Mac you also get automatic page refresh. On other @@ -107,6 +106,7 @@ Supported vars: - content_dir: html/_content - template_dir: html/_templates +- partials_dir: html/_partials - output_dir: web - workspace: . - date_format: dd.MM.yyyy @@ -115,7 +115,8 @@ Supported vars: - default_template: default.html - sasscompiler: sassc - usesass: true -- useapfx: true +- autoprefixer: true +- browser: Chromium ## Markdown **SiteGen** lets you use [markdown][markdown] to write your site content. At the beginning of each markdown file, you @@ -173,6 +174,22 @@ The default template is 'default.html' but you can overwrite this behavior if yo template: info_page + +## Partials +**Optional** +Files / Directories in your _partials-Folder will be translated into partials-names. +For example: _partials/category/house.md translates into {{>category.house}} +A partial can be either a .md or a .html file + +You can also use partials in the files yaml block: +```yaml +template: default.html +dart: ->usage.badge.dart +~~~ +``` + + + ## SASS If SiteGen finds a .scss file in your output dir (web) it compiles it to the corresponding .css file. Install instruction for SASS can be found [here][installsass] @@ -206,25 +223,26 @@ Uninstall ## Usage ```shell Usage: sitegen [options] - -s, --settings Prints settings - -h, --help Shows this message - -g, --generate Generate site - -w, --watch Observes SRC-dir - -i, --init Initializes your site - (not combinable with other options) + -s, --settings Prints settings + -h, --help Shows this message + -g, --generate Generate site + -w, --watch Observes SRC-dir + -x, --watchandserve Shortcut to watch and serve + -i, --init Initializes your site + (not combinable with other options) - --serve Serves your site - --[no-]usesass Enables / disables SASS to CSS compiler - (defaults to on) + --serve Serves your site + --[no-]usesass Enables / disables SASS to CSS compiler + (defaults to on) - --[no-]useapfx Enables / disables Autoprefixer - (defaults to on) + --[no-]useapfx Enables / disables Autoprefixer + (defaults to on) - --port Sets the port to listen on - (defaults to "8000") + --port Sets the port to listen on + (defaults to "8000") - -v, --loglevel Sets the appropriate loglevel - [info, debug, warning] + -v, --loglevel Sets the appropriate loglevel + [info, debug, warning] Sample: @@ -249,6 +267,8 @@ If you are using Chromium on Mac you will get a automatic page refresh for free! Now play with sitegen and watch my screencast... +Check out the [sample!][sample] + ### Features and bugs Please file feature requests and bugs at the [issue tracker][tracker]. @@ -287,4 +307,5 @@ or **star** this repo here on GitHub. [promoimage]: https://github.com/MikeMitterer/dart-sitegen/blob/master/assets/screenshot.jpg?raw=true [video]: http://goo.gl/uUTg8s [installsass]: http://sass-lang.com/install +[sample]: https://github.com/MikeMitterer/dart-sitegen/tree/master/example/simple diff --git a/example/simple/.sitegen/refreshChrome-1.0.applescript b/example/simple/.sitegen/refreshChrome-1.0.applescript new file mode 100644 index 0000000..d70d0e5 --- /dev/null +++ b/example/simple/.sitegen/refreshChrome-1.0.applescript @@ -0,0 +1,11 @@ +tell application "Chrome" + set windowList to every window + repeat with aWindow in windowList + set tabList to every tab of aWindow + repeat with atab in tabList + if (URL of atab contains "localhost") then + tell atab to reload + end if + end repeat + end repeat + end tell \ No newline at end of file diff --git a/example/simple/.sitegen/site.yaml b/example/simple/.sitegen/site.yaml index f43d66c..71c9b2e 100644 --- a/example/simple/.sitegen/site.yaml +++ b/example/simple/.sitegen/site.yaml @@ -3,4 +3,6 @@ site_options: name: Mike site_name: HudriWudri - author: Mike Mitterer \ No newline at end of file + author: Mike Mitterer + +browser: Chrome \ No newline at end of file diff --git a/example/simple/html/_content/index.html b/example/simple/html/_content/index.html index 2328f23..8ab2777 100644 --- a/example/simple/html/_content/index.html +++ b/example/simple/html/_content/index.html @@ -10,7 +10,7 @@
- Arrr! Me name is + Arrr! Me name is {{> name }}{{>category.house}}
diff --git a/example/simple/html/_partials/category/house.md b/example/simple/html/_partials/category/house.md new file mode 100644 index 0000000..14ac0fa --- /dev/null +++ b/example/simple/html/_partials/category/house.md @@ -0,0 +1,2 @@ +## This is my house +and this is my kitchen! \ No newline at end of file diff --git a/example/simple/html/_partials/name.html b/example/simple/html/_partials/name.html new file mode 100644 index 0000000..31422e6 --- /dev/null +++ b/example/simple/html/_partials/name.html @@ -0,0 +1 @@ +
This is my name4
diff --git a/example/simple/html/_templates/default.html b/example/simple/html/_templates/default.html index c60dda1..76340ea 100644 --- a/example/simple/html/_templates/default.html +++ b/example/simple/html/_templates/default.html @@ -21,7 +21,7 @@

{{title}}

{{_content}} - +{{> name }}