Initial commit
This commit is contained in:
commit
486b68145e
|
@ -0,0 +1,2 @@
|
|||
nimcache
|
||||
quotesite
|
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2016 Christine Dodrill <xena@yolo-swag.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
|
@ -0,0 +1,4 @@
|
|||
quotesite
|
||||
=========
|
||||
|
||||
Archiving my friends insanity for your amusement.
|
|
@ -0,0 +1,18 @@
|
|||
body { font-family: sans-serif; background: #eee; }
|
||||
a, h1, h2 { color: #377ba8; }
|
||||
h1, h2 { font-family: 'Georgia', serif; margin: 0; }
|
||||
h1 { border-bottom: 2px solid #eee; }
|
||||
h2 { font-size: 1.2em; }
|
||||
|
||||
.page { margin: 2em auto; width: 35em; border: 5px solid #ccc;
|
||||
padding: 0.8em; background: white; }
|
||||
.entries { list-style: none; margin: 0; padding: 0; }
|
||||
.entries li { margin: 0.8em 1.2em; }
|
||||
.entries li h2 { margin-left: -1em; }
|
||||
.add-entry { font-size: 0.9em; border-bottom: 1px solid #ccc; }
|
||||
.add-entry dl { font-weight: bold; }
|
||||
.metanav { text-align: right; font-size: 0.8em; padding: 0.3em;
|
||||
margin-bottom: 1em; background: #fafafa; }
|
||||
.flash { background: #cee5F5; padding: 0.5em;
|
||||
border: 1px solid #aacbe2; }
|
||||
.error { background: #f0d6d6; padding: 0.5em; }
|
|
@ -0,0 +1,13 @@
|
|||
# Package
|
||||
|
||||
version = "0.1.0"
|
||||
author = "Christine Dodrill"
|
||||
description = "A quote site for my friends"
|
||||
license = "MIT"
|
||||
srcDir = "src"
|
||||
bin = @["quotesite"]
|
||||
|
||||
# Dependencies
|
||||
|
||||
requires "nim >= 0.13.0", "jester", "moustachu"
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
import asyncdispatch, jester, moustachu, os, strutils
|
||||
|
||||
const
|
||||
baseTemplate = staticRead "../templates/layout.mustache"
|
||||
|
||||
settings:
|
||||
port = 5000.Port
|
||||
bindAddr = "0.0.0.0"
|
||||
|
||||
routes:
|
||||
get "/":
|
||||
var ctx = newContext()
|
||||
|
||||
ctx["title"] = "Test"
|
||||
ctx["body"] = "<p>Test!</p>"
|
||||
|
||||
resp render(baseTemplate, ctx)
|
||||
|
||||
runForever()
|
|
@ -0,0 +1,11 @@
|
|||
<!doctype html>
|
||||
<title>Quotes{{# title }} - {{ title }}{{/title}}</title>
|
||||
<link rel=stylesheet type=text/css href="/css/style.css">
|
||||
<div class=page>
|
||||
<h1>Quotes</h1>
|
||||
<div class=metanav>
|
||||
<a href="/network">Network</a>
|
||||
<a href="/channel">Channel</a>
|
||||
</div>
|
||||
{{{ body }}}
|
||||
</div>
|
Loading…
Reference in New Issue