Permalink
Browse files

feature: Makes it much easier to generate a menu, better sample

  • Loading branch information...
MikeMitterer committed Oct 29, 2015
1 parent 45d9e46 commit 8884e95d750bfdc7bceeef8859ac2cfb7cdba5db
Showing with 1,730 additions and 761 deletions.
  1. +1 −0 README.md
  2. +4 −3 SiteGen.iml
  3. +5 −10 example/simple/.sitegen/html/_content/about/index.html
  4. BIN example/simple/.sitegen/html/_content/assets/images/android-desktop.png
  5. BIN example/simple/.sitegen/html/_content/assets/images/favicon.png
  6. BIN example/simple/.sitegen/html/_content/assets/images/ios-desktop.png
  7. +103 −0 example/simple/.sitegen/html/_content/assets/styles/styles.scss
  8. +0 −13 example/simple/.sitegen/html/_content/families.html
  9. +25 −0 example/simple/.sitegen/html/_content/features.html
  10. +8 −16 example/simple/.sitegen/html/_content/index.html
  11. +28 −0 example/simple/.sitegen/html/_content/main.dart
  12. +12 −12 example/simple/.sitegen/html/_content/markdown.md
  13. +0 −23 example/simple/.sitegen/html/_content/piratenames.json
  14. +3 −0 example/simple/.sitegen/html/_content/special/template.html
  15. 0 example/simple/.sitegen/html/_content/{ → special}/xtreme.html
  16. +5 −0 example/simple/.sitegen/html/_content/technology.html
  17. +0 −7 example/simple/.sitegen/html/_content/xmen.html
  18. +10 −0 example/simple/.sitegen/html/_data/menu.json
  19. +26 −0 example/simple/.sitegen/html/_partials/cards/wide.html
  20. +0 −2 example/simple/.sitegen/html/_partials/category/house.md
  21. +24 −0 example/simple/.sitegen/html/_partials/header.html
  22. +0 −1 example/simple/.sitegen/html/_partials/name.html
  23. +121 −32 example/simple/.sitegen/html/_templates/default.html
  24. +0 −5 example/simple/.sitegen/html/_templates/info_page.html
  25. +11 −0 example/simple/.sitegen/refreshDartium-1.0.applescript
  26. +3 −2 example/simple/.sitegen/site.yaml
  27. +0 −5 example/simple/CHANGELOG.md
  28. +0 −24 example/simple/LICENSE
  29. +0 −3 example/simple/README.md
  30. +17 −1 example/simple/pubspec.yaml
  31. +131 −38 example/simple/web/about/index.html
  32. BIN example/simple/web/assets/images/android-desktop.png
  33. BIN example/simple/web/assets/images/favicon.png
  34. BIN example/simple/web/assets/images/ios-desktop.png
  35. +129 −0 example/simple/web/assets/styles/styles.css
  36. +103 −0 example/simple/web/assets/styles/styles.scss
  37. +0 −51 example/simple/web/families.html
  38. +182 −0 example/simple/web/features.html
  39. +153 −43 example/simple/web/index.html
  40. +14 −133 example/simple/web/main.dart
  41. +156 −62 example/simple/web/markdown.html
  42. +0 −23 example/simple/web/piratenames.json
  43. +25 −0 example/simple/web/special/template.html
  44. +134 −0 example/simple/web/special/xtreme.html
  45. +0 −53 example/simple/web/styles/main.css
  46. +0 −71 example/simple/web/styles/main.scss
  47. +136 −0 example/simple/web/technology.html
  48. +0 −45 example/simple/web/xmen.html
  49. +0 −37 example/simple/web/xtreme.html
  50. +88 −5 lib/src/Generator.dart
  51. +59 −27 pubspec.lock
  52. +14 −14 pubspec.yaml
View
@@ -2,6 +2,7 @@
Static site generator. Includes a webserver, sass + autoprefix support
### New
**--v debug** - shows you all the vars available for your page
**--ip** option - now you can set the IP the server listens to. (Defaults to 127.0.0.1)
Helps to test your site from within a VM for example.
View
@@ -6,6 +6,7 @@
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/bin/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/html/_content/about/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/html/_content/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/html/_data/packages" />
@@ -14,13 +15,13 @@
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/html/_templates/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/html/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/.sitegen/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/web/about/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/web/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/simple/web/styles/packages" />
<excludeFolder url="file://$MODULE_DIR$/packages/sitegen" />
<excludeFolder url="file://$MODULE_DIR$/packages" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="application" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>
@@ -1,11 +1,6 @@
title: About
title: XTreme
~~~
<h2>Headline II</h2>
<div class="badge">
<div class="greeting">
Arrr! Me name is
</div>
<div class="name">
<span id="badgeName"> </span>
</div>
</div>
<div class="mdl-panel mdl-shadow--2dp">
I live in a subfolder
</div>
@@ -0,0 +1,103 @@
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
html, body {
font-family: 'Roboto', 'Helvetica', sans-serif;
margin: 0;
padding: 0;
}
body {
.loading {
color: white;
font-size: 24px;
z-index: 99;
display: none;
position: absolute;
opacity: 0.8;
top: 0;
left: 0;
width: 100%;
height: 100%;
flex-direction: row;
flex-wrap: wrap;
justify-content: center; // ⇾
align-content: stretch; // ||
align-items: center; // ↓
}
&.mdl-upgrading {
.loading { display: flex; }
}
}
.tab-bar {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start; // ⇾
align-content: space-between; // ||
align-items: flex-end; // ↓
min-height: 56px;
//width: calc(100% - 112px);
//margin: 0 0 0 56px;
}
.main-section {
width: calc(100% - 112px);
margin: 24px 0 0 56px;
min-height: 480px;
.mdl-panel {
margin-bottom: 24px;
}
.mdl-card {
.mdl-card__title { background-color: darkslateblue; }
&.demo-card-wide {
width: 600px;
.is-small-screen & {
width: auto;
}
}
}
}
/**
Overwrites some essential MDL-Styles
This should go into the main MDL-Branch
*/
.mdl-card {
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: flex-start; // ↓
align-content: space-between; // =
align-items: stretch; // ⇾
.mdl-card__supporting-text {
flex-grow: 1;
}
}

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,25 @@
title: Features
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div class="mdl-panel mdl-shadow--2dp">
<h5 class="mdl-color-text--primary">Use as JSON-File</h5>
<h7>families.json</h7>
<ul>
{{#_data.families}}
<li>{{surname}}
<ul>
{{#members}}
<li>{{given}}</li>
{{/members}}
</ul>
</li>
{{/_data.families}}
</ul>
<h5 class="mdl-color-text--primary">Here it is a YAML-File</h5>
<h7>xmen.yaml</h7>
<ul>
{{#_data.xmen}}
<li>{{.}}</li>
{{/_data.xmen}}
</ul>
</div>
@@ -1,18 +1,10 @@
title: Pirate badge1
title: Welcome
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div class="widgets">
<div>
<input type="text" id="inputName" maxlength="15" disabled>
</div>
<div>
<button id="generateButton" disabled>Aye! Gimme a name!</button>
</div>
<div class="mdl-panel mdl-shadow--2dp">
Hi, I am content
</div>
<div class="badge">
<div class="greeting">
Arrr! Me name is {{> name }}{{>category.house}}
</div>
<div class="name">
<span id="badgeName"> </span>
</div>
</div>
<div class="mdl-panel mdl-shadow--2dp">
<a href="special/xtreme.html">XTREME</a> is for testing minimal content!<br>
<a href="special/template.html">TEMPLATE</a> uses the "info_page" template<br>
</div>
{{>cards.wide}}
@@ -0,0 +1,28 @@
// template: none
// logger: I am your logger
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import 'dart:html' as html;
import 'package:logging/logging.dart';
import 'package:console_log_handler/console_log_handler.dart';
import 'package:mdl/mdl.dart';
final Logger _logger = new Logger('{{logger}}');
main() async {
configLogging();
registerMdl();
await componentFactory().run();
}
void configLogging() {
hierarchicalLoggingEnabled = false; // set this to true - its part of Logging SDK
// now control the logging.
// Turn off all logging first
Logger.root.level = Level.INFO;
Logger.root.onRecord.listen(new LogConsoleHandler());
}
@@ -3,7 +3,7 @@
# This is an example of a YAML comment which will be completely ignored.
# A basic variable definition
title: About SiteGen
title: Markdown
# A list of strings. Surrounding your strings in quotes is optional,
# but some may require it so they don't interfere with YAML syntax.
@@ -43,16 +43,16 @@ date_format: yMd
# with any template file-type, though mustache embedded in plain
# old HTML is the default. If no template is defined here, SiteGen
# will use the one listed for 'default_template' in your site.yaml
# template: info_page
#template: info_page
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#{{title}} (Content)
###Subheadline
### {{title}} (Content)
#### Subheadline
3 `~`'s is the minimum for designating and separating a [YAML][yaml] block, but they can be extended longer -- all that matters
is that the tildes (`~`) are on their own line.
And anything beyond that gets interpreted as [Markdown][markdown]!
[Markdown][markdown]!
You can even use template tags in here, for any variables you set in in the top YAML block, or in your `site.yaml` file:
@@ -61,28 +61,28 @@ This post's title is: "{{ title }}"
This file was last modified on {{ _date }}
Note that variables beginning with an underscore designate *implicit* metadata added by __SiteGen__.
Note that variables beginning with an underscore designate *implicit* metadata added by __SiteGen__.
Some vars that are always available by default:
{{#default_vars}}
{{.}}
{{/default_vars}}
You can see all the vars you can use if you start __SiteGen__ with `--loglevel debug`.
And as you can see, you can also use mustache logic to iterate through yaml maps and lists:
Links are rendered incorrectly.
Bug: [https://github.com/dpeek/dart-markdown/issues/35](https://github.com/dpeek/dart-markdown/issues/35)
{{#links}}
- [{{name}}]({{url}})
[{{name}}]({{url}})
{{/links}}
{{#tags}}
* {{.}}
* {{.}}
{{/tags}}
{{#authors}}
- {{.}}
- {{.}}
{{/authors}}
Note how you need to use a `.` to access a list item, but can access map/dict keys directly.

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,3 @@
template: info_page
~~~
I'm using another Template!
@@ -0,0 +1,5 @@
title: Technology
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div class="mdl-panel mdl-shadow--2dp">
Some more content. No Card on this page!
</div>

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,10 @@
[
{
"link" : "Google",
"url" : "http://www.google.com/"
},
{
"link" : "Mike Mitterer",
"url" : "http://www.mikemitterer.at/"
}
]
Oops, something went wrong.

0 comments on commit 8884e95

Please sign in to comment.