Skip to content

Commit 937d91a

Browse files
committed
added a blog
1 parent 1942aa8 commit 937d91a

File tree

14 files changed

+321
-56
lines changed

14 files changed

+321
-56
lines changed

config.ergo.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ module.exports = {
1717
layout: "article.html"
1818
, path: "articles"
1919
}
20+
, blog: {
21+
layout: "post.html"
22+
, default_fields: {
23+
"author_image": "author.jpg"
24+
, "author": "craig"
25+
, "author_nick": "cmroanirgo"
26+
, "author_website": "https://github.com/cmroanirgo"
27+
}
28+
}
2029
, page: {
2130
layout: "article.html"
2231
}

source/_layouts/homepage.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
{include:header.inc.html}
1+
{include:header.inc.html extracss:'home'}
22
{content}
33
{include:footer.inc.html}

source/_layouts/post.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{include:header.inc.html extracss:'post'}
2+
<h1><a href="/{uri}">{!:longtitle}{title}{else}{longtitle}{end}</a></h1>
3+
{content}
4+
</div>
5+
<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}

source/_partials/footer.inc.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
</div>
2-
</div>
1+
</div>
2+
</div>
33
</div>
44

55

66
<div id="footer" class="s">
7-
<div class="c">∴ ergo-cms is the official site for <a href="https://github.com/ergo-cms/">∴ ergo</a> - a <i>beautiful</i> cms. | <a href="/rss.xml">Feed</a> | <a href="/sitemap.xml">Sitemap</a></div>
7+
<div class="c"><a href="https://ergo-cms.github.io">∴ ergo-cms</a> is a <i>beautiful</i> cms. | <a href="/rss.xml">Feed</a> | <a href="/sitemap.xml">Sitemap</a></div>
88
</div>
99

1010
</body>

source/_partials/header.inc.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424
<h1 id="title"><a href="#content"><b></b> {title}</a></h1>
2525
</div>
26-
<div class="s">
27-
<div class="c">
28-
<div id="content">
26+
<div class="s {extracss}">
27+
<div class="c">
28+
<div id="content">
2929

source/_partials/menu.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
* "home":/
22
* "articles":/articles.html
3+
* "blog":/blog.html
34
* "about":/about.html

source/about.tex

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,33 @@
1717
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.
1818
That code exists still, but is horrible and clunky and not extensible.[1]
1919

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

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

2424

25-
This is what ergo-cms is:
25+
h2. What ergo-cms is
2626

2727
* 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).
2828
* Very extensible. If you like you _can_ use mustache, or less, etc.
2929
* 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.
3030
* Great at creating static websites.
3131
* Great at publishing minimal changes to your webserver (using rsync, or git)
32+
* Supportive of things Javascript. There will be plugins for heaps of native javascript solutions: less, jsuglify, etc.
3233

34+
h2. What ergo-cms isn't
3335

34-
What ergo-cms isn't:
36+
* 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.
37+
* 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.
3540

36-
* A Jekyll, WordPress, or _<insert your cms name here>_ replacement.
37-
* 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 & not production hardened. There's no reason for such a thing, with a flat file generator.
38-
* Supportive of ruby-esque things. YAML is one of the most crazy things I've ever seen. But people like coffee script too. 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 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. I won't write an scss plugin though (because it's a ruby thing).
3941

40-
What it will (eventually) do:
4142

42-
# Have two admin interfaces: one running on php that uses ergo-cli (ie, with node installed on the server), and another that uses express (or something) so that you can just serve it - as is.
43-
# Have an offline editor. This will be a 'distraction free' app, with very minimal toys. It will probably run with "Electron":http://electron.atom.io/ and be _beautiful_ to behold (because sometimes you need to be inspired when writing, I've found). A mobile app will use "Cordova":http://cordova.apache.org/ and/or a touch of "Ionic":http://ionicframework.com/.
43+
h2. What ergo-cms will (eventually) do
44+
45+
# Have two admin interfaces: one running on php that uses ergo-cli (ie, with node installed on the server), and another that uses express (or something) so that you can just serve it - as is. As you can expect, they'll be simple things.
46+
# Have an offline editor for both desktop and mobile. This will be a 'distraction free' app, with very minimal toys. It will probably run with "Electron":http://electron.atom.io/ and be _beautiful_ to behold (because sometimes you need to be inspired when writing, I've found). A mobile app will use "Cordova":http://cordova.apache.org/ and/or a touch of "Ionic":http://ionicframework.com/ -- probably -- maybe.
4447
#* They'll require some comms extensions (DAV/SFTP/rsync/convoluted git hook/custom) to be figured out first.
4548
# Have a slew of plugins that can be downloaded and configured easily. I was thinking something a bit 'npm-ish', like: @ergo install plugin-name@. The actual mechanics of this will be ironed out later.
4649
# Have a Theme repository. n00bs love this stuff. Designers avoid them, except to sell them, of course ;). At the moment, I'll ship a few skeleton projects that should solve the 99% of websites. Hopefully.
@@ -52,7 +55,7 @@
5255

5356
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.
5457

55-
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.
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.
5659

5760

5861

source/articles.tem.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{include:header.inc.html}
22

3+
4+
<h1>Articles</h1>
35
More articles coming soon!
46

57
<dl>

source/articles/ANDF v1.tex

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
title: "ANDF v1.0 Spec [draft]"
3+
, miscdesc: "Specifications for A New Dawn Format, v1"
4+
}
5+
6+
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).
8+
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
12+
13+
In all cases @\n@ should be treated as @\r?\n@, to be line-endings agnostic.
14+
15+
The use-case of this specification is to produce a hierarchical data structure similar to that of JSON, or more specificially a Javascript object. Note however, that the format should be able to be searched for a value, just like an .INI file, without needing to decode and load the whole file.
16+
17+
Errors are to be expected in the file. They should _*never*_ generate an assert in production code, but is acceptable behaviour in test cases only. So, a prime use-case is to feed the deocder absolute junk (eg an image file). It will return an object, with nothing in it. This is an _error last_ approach. It is up to the rest of the code to decide that an empty object is acceptable or not.
18+
19+
h3. Natural Names & Section Names
20+
21+
We define a @natural-name@ as a regular expression: @[\w\-\.\/]*[\w]@. This a normal word (a-zA-Z0-9 & _) & '-', '/' & '.', but generally not ending with the symbols (except _). These are valid:
22+
23+
* SomeKey
24+
* Some__--..//key2
25+
* ../some/key_
26+
27+
These are NOT valid:
28+
29+
* key/../
30+
* #key
31+
* key-
32+
* some key
33+
34+
A @section-name@ is the same as a @natural-name@ except that spaces are allowed when used in the @[section name]@ blocks. See below.
35+
36+
h3. Embeded Code
37+
38+
The specification allows for code to be entered. The actual language of this code is up to the implementation, so a Perl implementation may render the code blocks as Perl. The Javascript implementation will render as Javascript and return a Javascript Object.
39+
40+
h3. The Rest
41+
42+
Where @section@ is: @/\n\s*\[(natural-name)\]\s*(?:\n)/@. @$1@ contains the section name. The one caveat is that a section name in @[ ]@ can also contain spaces.
43+
44+
Where @comment@ is: @/\n[#;].*?@
45+
46+
Where @key@ suits the regular expression: @/\n\s*(natural-name)\s*(?:\=\s*)/@. That is, a natural-word start at or near the start of a new line, with an equals sign after it. There need NOT be a value to the right of the equals. @$1@ contains the key
47+
48+
Where @line-starters@ is either a comment, key, or section: @/(?:comment|key|section)/@
49+
50+
Where @code-value@ suits the regular expression: @/\=\s*(\{ (.*)?\})\s*$/@. A code value continues to the end of a line. This may need ironing out a little more, to weigh security vs usability. This should always ONLY be a single line match, to encourage simplicity. @$1@ contains the 'code'.
51+
52+
Similarly, @value@ suits the regular expression: @/\=\s*([\s\S]*?)(?:line-starters|$)/@. Matches all text until the next 'key =', [section], #comment, or end. @$1@ contains the value.
53+
54+
Where @default-value@ is: @/\s*([\s\S])*\s*(?:line-starters|$)/@. Similar to @value@, but without need for the @\=\s*@ at the start. @$1@ contains the value.
55+
56+
A @escaped-value-block@ suits the regular expression: @/-{3,}\s*\n([\s\S])*\s*\n(?:-{3,}|$)\s*/@. A block with --- and --- surrounding it. @$1@ contains the value.
57+
58+
59+
60+
<pre style="min-width:860px"><code>title = Welcome to my homepage ; key + value
61+
uri = index.html ; key + value
62+
date={ (new Date()).toString + " OK"; } ; key + code+value
63+
metakeys = Some keys,other keys ; key + value
64+
metadesc = ; key + ...
65+
I like writing blogs and learning ; ... continues
66+
about myself. Trailing spaces are ; ... continue
67+
eaten ; ... value
68+
69+
[section1] ; section
70+
content = This is the content for some magical 'section 1' that exists. ; key + ...
71+
It keeps going until another '[section]' is found (on it's own line), ; ... continues
72+
or a 'key=' is met. Having a newline above [section] is optional. ; ... value
73+
extracss = green ; key + value
74+
75+
#This is a comment. It needs to start with a "#" or ; comment
76+
; a ";" ; comment
77+
78+
section2.content = Another sections, using 'dot' notation. ; key + ...
79+
These are also valid: [section.sub.subsub], section.sub.subsub.key = ; ... value
80+
81+
[main content] ; section
82+
extracss = orange ; key + value
83+
84+
Each section can also have it's own text. It must have a blank line ; default-value
85+
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.
88+
89+
[footer content]
90+
------------- ; escaped-value-block, for 'footer content' default
91+
#This is footer content. This is NOT a comment
92+
;This is NOT a comment
93+
not-a-key = NOT a value
94+
95+
All of this text is a 'default-value-block' (for footer.content). It is OK
96+
to forget the 3 dashes below, if the end of the file is reached.
97+
---
98+
99+
[final.footer]
100+
some.key = ; key (+ an empty value)
101+
--- ; escaped-value-block, for 'final.footer' default
102+
This is the last block of text.
103+
This is valid.
104+
</code></pre>
105+
106+
107+
108+
109+
110+

source/blog.tem.html

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

0 commit comments

Comments
 (0)