Skip to content

Commit 86dee8a

Browse files
committed
upgrade to use JSINF & usematch + an article
1 parent 937d91a commit 86dee8a

18 files changed

+268
-122
lines changed

config.ergo.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ module.exports = {
77
, default_fields: {
88
site_url: "https://ergo-cms.github.io/"
99
, title: "ergo-cms ∴" // this goes in <title>tags generally, but also used in rss
10+
, author: "craig"
1011
}
11-
, plugin_optins: {
12-
textile: {breaks:true}
12+
, verbose:2
13+
, debug:-1
14+
, log_options: {
15+
//match_file: /(using jsinf.tex)/
1316
}
1417
, default_post_type: "page"
1518
, post_types: {
@@ -21,7 +24,6 @@ module.exports = {
2124
layout: "post.html"
2225
, default_fields: {
2326
"author_image": "author.jpg"
24-
, "author": "craig"
2527
, "author_nick": "cmroanirgo"
2628
, "author_website": "https://github.com/cmroanirgo"
2729
}

source/_layouts/article.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{include:header.inc.html}
2-
<h1><a href="/{uri}">{!:longtitle}{title}{else}{longtitle}{end}</a></h1>
3-
{content}
4-
{include:footer.inc.html}
1+
{{>header.inc.html}}
2+
<h1><a href="/{{uri}}">{{^longtitle}}{{title}}{{/longtitle}}{{longtitle}}</a></h1>
3+
{{{content}}}
4+
{{>footer.inc.html}}

source/_layouts/homepage.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
{include:header.inc.html extracss:'home'}
2-
{content}
3-
{include:footer.inc.html}
1+
{{>header.inc.html {extracss:'home'} }}
2+
{{{content}}}
3+
{{>footer.inc.html}}

source/_layouts/post.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
{include:header.inc.html extracss:'post'}
2-
<h1><a href="/{uri}">{!:longtitle}{title}{else}{longtitle}{end}</a></h1>
3-
{content}
1+
{{>header.inc.html {extracss:'post'} }}
2+
<h1><a href="/{{uri}}">{{^longtitle}}{{title}}{{/longtitle}}{{longtitle}}</a></h1>
3+
{{{content}}}
44
</div>
55
<div id="sidebar">
6-
<p><img id="author_img" src="/images/{author_image}" /></p>
7-
<p><a href="{author_website}" id="author">{author}</a></p>
8-
<p><a href="{author_website}" id="author_nick">{author_nick}</a></p>
9-
<p>{date.formatted}</p>
10-
{include:footer.inc.html}
6+
<p><img id="author_img" src="/images/{{author_image}}" /></p>
7+
<p><a href="{{author_website}}" id="author">{{author}}</a></p>
8+
<p><a href="{{author_website}}" id="author_nick">{{author_nick}}</a></p>
9+
<p>{{date.formatted}}</p>
10+
{{>footer.inc.html}}

source/_partials/header.inc.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<html>
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5-
<title>{title}</title>
6-
{if:metadesc}<meta name="description" content="{metadesc}" />{end}
7-
{if:metakeys}<meta name="keywords" content="{metakeys}" />{end}
5+
<title>{{title}}</title>
6+
{{#metadesc}}<meta name="description" content="{{metadesc}}" />{{/metadesc}}
7+
{{#metakeys}}<meta name="keywords" content="{{metakeys}}" />{{/metakeys}}
88
<link href="/styles.css" rel="stylesheet" type="text/css" />
99
<link rel="alternate" type="application/rss+xml" title="Articles Feed" href="/rss.xml" />
1010
<meta name="viewport" content="width=device-width,maximum-scale=1.0" />
11-
<meta property="author" content="{author}" />
11+
<meta property="author" content="{{author}}" />
1212
<!--
1313
____ ____ ___ __ ___ _ _ ____
1414
O ( __)( _ \ / __) / \ ___ / __)( \/ )/ ___)
@@ -17,13 +17,13 @@
1717
-->
1818
</head>
1919
<body>
20-
<div id="banner" class="s {extracss}">
20+
<div id="banner" class="s {{extracss}}">
2121
<div id="nav">
22-
{include:menu.tex}
22+
{{>menu}}
2323
</div>
24-
<h1 id="title"><a href="#content"><b></b> {title}</a></h1>
24+
<h1 id="title"><a href="#content"><b></b> {{title}}</a></h1>
2525
</div>
26-
<div class="s {extracss}">
26+
<div class="s {{extracss}}">
2727
<div class="c">
2828
<div id="content">
2929

source/about.tex

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
{
2-
date:"2012-2-11 8:27",
3-
title:"About ergo-cms",
4-
metadesc: "An introduction on ergo-cms",
5-
metakeys: "about",
6-
extracss: "aboutpage",
7-
}
1+
date = 2012-2-11 8:27
2+
title = About ergo-cms
3+
metadesc = An introduction on ergo-cms
4+
metakeys = about
5+
extracss = aboutpage
6+
###
87

98
Ergo was written, mainly to scratch an _itch_. I had been waiting for several years for Jekyll, Hyde, Ghost, etc, etc to make some realisations:
109

@@ -13,19 +12,19 @@
1312
* I can't sail around the ocean without taking a fat development environment to write my pages. I need an app.
1413

1514
This project originally started as a C++ static website generator before node.js was even born. It used markdown...
16-
Then "node.js":http://nodejs.org came along and I found "Textile":http://txstyle.org and then ported it to node.js as quickly as my fingers could type. I think it took a few hours.
15+
Then "node.js":http://nodejs.org came along and I found "Textile":http://txstyle.org and then ported my generator to node.js as quickly as my fingers could type. I think it took a few hours.
1716
At one point I gave some notion to refactoring a lot of the code and got 99% of the way, but realised it was all spectacularly ill-designed. It wasn't production ready, and my websites have limped along since then.
1817
That code exists still, but is horrible and clunky and not extensible.[1]
1918

20-
Seeing the rise and rise of various static generators, I was dismayed to see them not satisfy the above-mentioned points.[2]
19+
Seeing the rise and rise of various static generators, I was dismayed to see them not satisfy the above-mentioned points.
2120

2221
So, this project is the 4th generation of something that has never otherwise seen the light of day.
2322

2423

2524
h2. What ergo-cms is
2625

27-
* A _very_ lightweight cms. I was shocked to discover than an install of Ghost currently clocks in at around 185MB! Ergo doesn't use _anyone_ else's fancy modules, unless it's vital. Hence there's no mustache, less, or any of that stuff here. (plugins for those will come, however).
28-
* Very extensible. If you like you _can_ use mustache, or less, etc.
26+
* A _very_ lightweight cms. I was shocked to discover than an install of Ghost currently clocks in at around 185MB! Ergo doesn't use _anyone_ else's fancy modules, unless it's vital. By comparison WordPress is lightweight!
27+
* Very extensible. The templating engine is a modified mustache. If you know mustache, you'll be at home with this. If you like you _can_ use mustache, or less, etc.
2928
* Database-less. It uses flat files. It natively supports Markdown (for those who haven't seen the light), and Textile (for those that have). Being very extensible, it can support a whatever you can dream up.
3029
* Great at creating static websites.
3130
* Great at publishing minimal changes to your webserver (using rsync, or git)
@@ -35,8 +34,9 @@
3534

3635
* A Jekyll, WordPress, or _<insert your cms name here>_ replacement. Each platform has it's own idiosyncrasies, due to it's own feature set. As such, there may be features in those other platforms that don't match well here.
3736
* A web server. Although there's the ability to view your files in a locally hosted server (http:localhost:8181), it's nothing more than a simple file server & it's not production hardened. Since ergo-cms is a flat file generator, there's no reason for such a thing.
38-
* Supportive of ruby-esque things. There's a huge swell of support for things ruby, including it's many offshoots, such as YAML or SCSS. To me though, it's is one of the most crazy things I've ever seen emerge. If it requires _you_ to tell _me_ how good it is, and then get frustrated when I remain unconvinced, then it's a sure sign, _you're_ suffering fan-boi-isms. I've seen lots of it.
39-
* Supportive of _<flavour of the month markups>_, or _<too lazy to write a brace? use X>_, like coffee script. It seems that people who love coffee script love ruby and have an aversion to commas and curly braces. If you want to write a plugin for _<insert your markup language here>_, by all means, it'll work nicely - but I won't write it. I'm not a fan of fan-boi-itis. By supporting markdown, I believe I've supported enough of all of _that_ kind of craziness, & won't go a step further... unless it's LaTeX -- I've heard good things with it. So, I might write a LateX plugin.
37+
* Supportive of ruby-esque things[2]. There's a huge swell of support for things ruby, including it's many offshoots, such as YAML or SCSS, even Mustache. To me though, it's is one of the most crazy things I've ever seen emerge. If it requires _you_ to tell _me_ how good it is, and then get frustrated when I remain unconvinced, then it's a sure sign, _you're_ suffering fan-boi-isms. I've seen lots of it.
38+
** The proof of such is that ergo cms uses feature laden "usematch":https://github.com/cmroanirgo/usematch, rather than boring old mustache. It was written to support the needs of ergo CMS, because mustache fell flat.
39+
* Supportive of _<flavour of the month markups>_, or _<too lazy to write a brace? use X>_, like coffee script, HJSON, YAML, etc. It seems that people who love coffee script love ruby and have an aversion to commas and curly braces. If you want to write a plugin for _<insert your markup language here>_, by all means, it'll work nicely - but I won't write it. I'm not a fan of fan-boi-itis. By supporting markdown, I believe I've supported enough of all of _that_ kind of craziness, & won't go a step further... unless it's LaTeX -- I've heard good things with it. So, I might write a LateX plugin.
4040

4141

4242

@@ -55,7 +55,7 @@
5555

5656
fn1(small). I actually wrote it on a Galaxy Tab 2 7" while backpacking through Spain, on a rooted Android with a debian/xfce platform & jacked in with a mini keyboard attachment. Fun times.
5757

58-
fn2(small). The continued use of ruby dismays me still. Ruby and I don't get along. We never have. I tried. But I started with assembler (motorla/intel) and didn't see the need for such a language. If you love it, great. I don't, and I never will. Assembler doesn't need hours of frustration to get started. Ruby, in my experience, does.
58+
fn2(small). The continued use of ruby dismays me greatly. Ruby and I don't get along. We never have. I tried several times. Having started with assembler (motorla/intel), I don't see the need for such a language. If you love it, great. I don't, and I never will. Assembler doesn't need hours of frustration to get started, nor does Pascal, Javascript, C++ (ok, there are bits of frustration), Basic nor C# (and a whole slew of other languages). Ruby, in my experience, is full of frustration and pointlessness. Node.js on the other hand seems to be the breath of fresh air that Ruby failed to deliver. __(Now, where are those punch cards, I had laying around...?)__ Despite all my bashing of ruby, there's one thing that sprang out of it: Textile. <3.
5959

6060

6161

source/articles.tem.html

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
{include:header.inc.html}
2-
3-
1+
{{>header.inc.html}}
42
<h1>Articles</h1>
53
More articles coming soon!
64

7-
<dl>
8-
{begin:article}
9-
<dt><a href="{uri}">{title}</a></dt>
10-
<dd>{metadesc}</dd>
11-
{end:article}
5+
<dl>{{#article}}
6+
<dt><a href="{{uri}}">{{title}}</a></dt>
7+
<dd>{{metadesc}}</dd>{{/article}}
128
</dl>
139

1410
<p>&nbsp;</p>
15-
{include:footer.inc.html}
11+
{{>footer.inc.html}}

source/articles/ANDF v1.tex renamed to source/articles/JSINF v1.tex

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
{
2-
title: "ANDF v1.0 Spec [draft]"
3-
, miscdesc: "Specifications for A New Dawn Format, v1"
4-
}
1+
title = JSINF v1.0 Spec [draft]
2+
metadesc = Specifications for JSINF, a human readable configuration, v1
3+
###
54

5+
Here's a table of what I suggest for the JSINF, and what I'll be using for "ergo-cms":https://ergo-cms.github.io. This spec will be updated here (or links to updated spec). The javascript implementation shall be the final arbitrar of ambiguity (unless there's a clear fault in it).
66

7-
Here's a table of what I suggest for the 'A New Dawn Format', and what I'll be using for "ergo-cms":https://ergo-cms.github.io. This spec will be updated here (or links to updated spec). The javascript implementation shall be the final arbitrar of ambiguity (unless there's a clear fault in it).
7+
A Javascript implementation and this spec will be available at "https://github.com/cmroanirgo/jsinf":https://github.com/cmroanirgo/jsinf.
88

9-
A Javascript implementation and this spec will be available at "https://github.com/cmroanirgo/andf":https://github.com/cmroanirgo/andf.
10-
11-
h2. Specification
9+
h2. Specification [draft]
1210

1311
In all cases @\n@ should be treated as @\r?\n@, to be line-endings agnostic.
1412

@@ -83,8 +81,8 @@
8381
8482
Each section can also have it's own text. It must have a blank line ; default-value
8583
above it, OR be directly beneath a [section] mark ; ...(for main.content)
86-
And keeps on going until a valid [section], #comment, [section] or
87-
key= is reached.
84+
And keeps on going until a valid [section], #comment, [section] or key=
85+
is reached.
8886
8987
[footer content]
9088
------------- ; escaped-value-block, for 'footer content' default
@@ -94,7 +92,7 @@
9492
9593
All of this text is a 'default-value-block' (for footer.content). It is OK
9694
to forget the 3 dashes below, if the end of the file is reached.
97-
---
95+
--- ; the end of the block
9896
9997
[final.footer]
10098
some.key = ; key (+ an empty value)

source/articles/faq.tex

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
{
2-
date:"2012-06-22",
3-
title: "Frequently Asked Questions",
4-
metakeys:"faw,frequently asked questions",
5-
metadesc:"Get your answers here, in Frequently Asked Questions.",
6-
}
1+
date = 2012-06-22
2+
title = Frequently Asked Questions
3+
metakeys = faq,frequently asked questions
4+
metadesc = Get your answers here, in Frequently Asked Questions.
5+
###
76

87
Since no one's asked any questions yet, then this list is empty ;)
98

source/blog.tem.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
{include:header.inc.html}
1+
{{>header.inc.html}}
22
<h1>Blog Posts</h1>
3-
<dl>
4-
{begin:blog}
5-
<dt><a href="{uri}">{title}</a></dt>
6-
<dd>{metadesc}</dd>
7-
{end:blog}
3+
4+
<dl>{{#blog}}
5+
<dt><a href="{{uri}}">{{title}}</a></dt>
6+
<dd>{{metadesc}}</dd>{{/blog}}
87
</dl>
98

109
<p>&nbsp;</p>
11-
{include:footer.inc.html}
10+
{{>footer.inc.html}}

0 commit comments

Comments
 (0)