Skip to content

Commit

Permalink
feature: Makes it much easier to generate a menu, better sample
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMitterer committed Oct 29, 2015
1 parent 45d9e46 commit 8884e95
Show file tree
Hide file tree
Showing 52 changed files with 1,730 additions and 761 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -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.

Expand Down
7 changes: 4 additions & 3 deletions SiteGen.iml
Expand Up @@ -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" />
Expand All @@ -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>
15 changes: 5 additions & 10 deletions example/simple/.sitegen/html/_content/about/index.html
@@ -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>

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
103 changes: 103 additions & 0 deletions example/simple/.sitegen/html/_content/assets/styles/styles.scss
@@ -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;
}
}
13 changes: 0 additions & 13 deletions example/simple/.sitegen/html/_content/families.html

This file was deleted.

25 changes: 25 additions & 0 deletions example/simple/.sitegen/html/_content/features.html
@@ -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>
24 changes: 8 additions & 16 deletions example/simple/.sitegen/html/_content/index.html
@@ -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}}
28 changes: 28 additions & 0 deletions example/simple/.sitegen/html/_content/main.dart
@@ -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());
}

24 changes: 12 additions & 12 deletions example/simple/.sitegen/html/_content/markdown.md
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand All @@ -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.
Expand Down
23 changes: 0 additions & 23 deletions example/simple/.sitegen/html/_content/piratenames.json

This file was deleted.

3 changes: 3 additions & 0 deletions example/simple/.sitegen/html/_content/special/template.html
@@ -0,0 +1,3 @@
template: info_page
~~~
I'm using another Template!
5 changes: 5 additions & 0 deletions example/simple/.sitegen/html/_content/technology.html
@@ -0,0 +1,5 @@
title: Technology
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<div class="mdl-panel mdl-shadow--2dp">
Some more content. No Card on this page!
</div>
7 changes: 0 additions & 7 deletions example/simple/.sitegen/html/_content/xmen.html

This file was deleted.

10 changes: 10 additions & 0 deletions example/simple/.sitegen/html/_data/menu.json
@@ -0,0 +1,10 @@
[
{
"link" : "Google",
"url" : "http://www.google.com/"
},
{
"link" : "Mike Mitterer",
"url" : "http://www.mikemitterer.at/"
}
]

0 comments on commit 8884e95

Please sign in to comment.