Skip to content

Commit

Permalink
Merge pull request #12 from daveaglick/master
Browse files Browse the repository at this point in the history
Adds an implementation for Wyam
  • Loading branch information
remotesynth committed Nov 12, 2016
2 parents e6ab552 + 67200e8 commit 4b64968
Show file tree
Hide file tree
Showing 55 changed files with 3,210 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Expand Up @@ -130,6 +130,19 @@ Here's the full list of depencency installs if you choose to add them individual

[Eco](https://github.com/sstephenson/eco) was chosen for the template engine since it is what the docs specify - though other templating engines are supported via additional plugins.

##Wyam Example

Wyam is a .NET generator written in C#. It currently runs on Windows and can be [downloaded as an installer or as binaries](https://github.com/Wyamio/Wyam/releases).

To run the example, start the Wyam Command Prompt (if installed via the Windows installer), change the directory, and start the local preview server:

cd wyamsite
wyam -p

If you downloaded and extracted the binaries without the installer, just point to the `wyam.exe` executable wherever it was extracted when you run the site.

Wyam templates are built with Razor and Markdown is used for content pages with YAML front matter.

###Known Issues

Data was added as YAML "front matter" to the home page as (after much research), I could not find another way to include arbitrary data on a page via an external YAML or JSON file. This is not ideal as the data cannot be reused.
Expand Down
1 change: 1 addition & 0 deletions wyamsite/.gitignore
@@ -0,0 +1 @@
output/*
29 changes: 29 additions & 0 deletions wyamsite/config.wyam
@@ -0,0 +1,29 @@
#n Wyam.Yaml
#n Wyam.Markdown
#n Wyam.Razor
#n Wyam.Html

InitialMetadata["title"] = "Adventure Time!";
InitialMetadata["description"] = "Adventure Time is an American animated television series created by Pendleton Ward for Cartoon Network. The series follows the adventures of Finn, a human boy, and his best friend and adoptive brother Jake, a dog with magical powers to change shape and grow and shrink at will. Finn and Jake live in the post-apocalyptic Land of Ooo. Along the way, they interact with the other main characters of the show: Princess Bubblegum, The Ice King, and Marceline the Vampire Queen.";
InitialMetadata["banner"] = "/images/about.jpg";

Pipelines.Add("Characters",
ReadFiles("**/*.yaml"),
Yaml()
);

Pipelines.Add("Content",
ReadFiles("**/*.md"),
FrontMatter(Yaml()),
Markdown(),
Excerpt(),
Concat(
ReadFiles("index.cshtml")
),
Razor(),
WriteFiles(".html")
);

Pipelines.Add("Resources",
CopyFiles("**/*{!.cshtml,!.md,!.yaml,}")
);
21 changes: 21 additions & 0 deletions wyamsite/input/Shared/_default.cshtml
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>

@Html.Partial("partials/_head")

<body>

@Html.Partial("partials/_header")

<!-- Main -->
<div id="main-wrapper">
<div class="container">
@RenderBody()
</div>
</div>

@Html.Partial("partials/_footer")

</body>

</html>
13 changes: 13 additions & 0 deletions wyamsite/input/Shared/_post.cshtml
@@ -0,0 +1,13 @@
@{
Layout = @"_default.cshtml";
}

<!-- Content -->
<article class="box post">
<div class="image featured" style="background-image: url('@Model["banner"]');"></div>
<header>
<h2>@Model["title"]</h2>
<p>@Model["shortdesc"]</p>
</header>
@RenderBody()
</article>
47 changes: 47 additions & 0 deletions wyamsite/input/Shared/partials/_footer.cshtml
@@ -0,0 +1,47 @@
<!-- Footer -->
<div id="footer-wrapper">
<section id="footer" class="container">
<div class="row">
<div class="8u">
<section>
<header>
<h2>More Episodes</h2>
</header>
<ul class="dates">
@foreach(IDocument post in Documents["Content"]
.Where(x => x.String("collection") == "episodes")
.OrderByDescending(x => x.Get<DateTime>("date")))
{
<li>
<span class="date">@(post.Get<DateTime>("date").ToString("MMM")) <strong>@(post.Get<DateTime>("date").Day)</strong></span>
<h3><a href="@Context.GetLink(post)">@post["title"]</a></h3>
<p>@post["shortdesc"]</p>
</li>
}
</ul>
</section>
</div>
<div class="4u">
<section>
<header>
<h2>What's this all about?</h2>
</header>
<a href="#" class="image featured"><img src="@Model["banner"]" alt="" /></a>
<p>@Model["description"]</p>
</section>
</div>
</div>
<div class="row">
<div class="12u">

<!-- Copyright -->
<div id="copyright">
<ul class="links">
<li>&copy; @Model["title"]. All rights reserved.</li><li>Design: <a href="http://html5up.net">HTML5 UP</a></li>
</ul>
</div>

</div>
</div>
</section>
</div>
17 changes: 17 additions & 0 deletions wyamsite/input/Shared/partials/_head.cshtml
@@ -0,0 +1,17 @@
<head>
<title>@Model["title"]</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="@Model["description"]" />

<meta name="keywords" content="adventure time,cartoon network,cartoons,finn,jake,princess bubblegum" />
<!--[if lte IE 8]><script src="/css/ie/html5shiv.js"></script><![endif]-->
<script src="/js/jquery.min.js"></script>
<script src="/js/skel.min.js"></script>
<script src="/js/skel-layers.min.js"></script>
<script src="/js/init.js"></script>
<link rel="stylesheet" href="/css/skel.css" />
<link rel="stylesheet" href="/css/style.css" />
<link rel="stylesheet" href="/css/style-desktop.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="/css/ie/v8.css" /><![endif]-->
<link rel="alternate" type="application/rss+xml" title="@Model["title"]" href="feed.xml" />
</head>
17 changes: 17 additions & 0 deletions wyamsite/input/Shared/partials/_header.cshtml
@@ -0,0 +1,17 @@
<!-- Header -->
<div id="header-wrapper">
<div id="header">
<!-- Logo -->
<h1><a href="/">Adventure Time!</a></h1>
@if(Model.FilePath("RelativeFilePath").Equals("index.cshtml"))
{
<!-- Banner -->
<section id="banner">
<header>
<h2>Explore the Land of Ooo...</h2>
<p>...and its many kingdoms!</p>
</header>
</section>
}
</div>
</div>
3 changes: 3 additions & 0 deletions wyamsite/input/_ViewStart.cshtml
@@ -0,0 +1,3 @@
@{
Layout = "_default";
}
18 changes: 18 additions & 0 deletions wyamsite/input/characters.yaml
@@ -0,0 +1,18 @@
- name: "Finn the Human"
image: "/images/finn.jpg"
description: "Finn is a 15-year-old human. He is roughly five feet tall and is missing several teeth due to his habit of biting trees and rocks among other things."
- name: "Jake the Dog"
image: "/images/jake.jpg"
description: "Jake can morph into all sorts of fantastic shapes with his powers, but typically takes the form of an average sized yellow-orange bulldog."
- name: "Princess Bubblegum"
image: "/images/bubblegum.jpg"
description: "Princess Bubblegum loves (most of) her subjects and defends them tirelessly when trouble brews and is perhaps the most intelligent person in the Land of Ooo."
- name: "Ice King"
image: "/images/iceking.jpg"
description: "Ice King, formerly Simon Petrikov, is a blue-skinned, elderly man with unusually pointy fingers, pointy toes, sharp teeth, and a long, goblin-like nose."
- name: "Lumpy Space Princess"
image: "/images/lsp.jpg"
description: "Lumpy Space Princess (LSP) acts like a bratty, apathetic, sassy, attention-seeking and willfully ignorant teenager, often texting on her phone."
- name: "Marceline"
image: "/images/marceline.jpg"
description: "Marceline is over a thousand years old. Centuries of wandering the Land of Ooo have made her a fearless daredevil and a a lover of all things exotic."
4 changes: 4 additions & 0 deletions wyamsite/input/css/font-awesome.min.css

Large diffs are not rendered by default.

0 comments on commit 4b64968

Please sign in to comment.