Skip to content

Commit

Permalink
move test site to example/ folder, add site name to tpl data
Browse files Browse the repository at this point in the history
  • Loading branch information
mna committed Jul 11, 2013
1 parent a0d58be commit 5845dd8
Show file tree
Hide file tree
Showing 27 changed files with 61 additions and 8 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions public/002-meta-billet → example/public/002-meta-billet
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</head>
<body>

<div class="header">
<a href="/">Some Name</a>
</div>
<article>
<div><p>Date: 2012-02-29
Title: Méta-billet: un mot sur le Calepin
Expand Down
3 changes: 3 additions & 0 deletions public/003-dependances → example/public/003-dependances
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</head>
<body>

<div class="header">
<a href="/">Some Name</a>
</div>
<article>
<div><p>Date: 2012-03-05
Title: npm: la base essentielle pour débuter avec node.js
Expand Down
3 changes: 3 additions & 0 deletions public/004-npm-packages → example/public/004-npm-packages
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</head>
<body>

<div class="header">
<a href="/">Some Name</a>
</div>
<article>
<div><p>Date: 2012-03-12
Title: npm shrinkwrap: Comment contrôler ses dépendances
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</head>
<body>

<div class="header">
<a href="/">Some Name</a>
</div>
<article>
<div><p>Date: 2012-03-19
Title: Structurer une application Web avec Express et Node.js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</head>
<body>

<div class="header">
<a href="/">Some Name</a>
</div>
<article>
<div><p>Date: 2012-03-27
Title: Expérimentations sur l&rsquo;injection de dépendance avec node.js
Expand Down
3 changes: 3 additions & 0 deletions public/007-implement-js → example/public/007-implement-js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</head>
<body>

<div class="header">
<a href="/">Some Name</a>
</div>
<article>
<div><p>Date: 2012-04-02
Title: implement.js: typage fort et Javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</head>
<body>

<div class="header">
<a href="/">Some Name</a>
</div>
<article>
<div><p>Date: 2012-04-13
Title: Propriétés calculées avec Backbone
Expand Down
3 changes: 3 additions & 0 deletions public/009-je-men-vais → example/public/009-je-men-vais
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</head>
<body>

<div class="header">
<a href="/">Some Name</a>
</div>
<article>
<div><p>Date: 2012-04-23
Title: Je suis venu te dire que je m&rsquo;en vais
Expand Down
3 changes: 3 additions & 0 deletions public/010-demenagement → example/public/010-demenagement
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</head>
<body>

<div class="header">
<a href="/">Some Name</a>
</div>
<article>
<div><p>Date: 2012-04-30
Title: Ce blogue a déménagé sur GitHub
Expand Down
18 changes: 15 additions & 3 deletions public/css/main.css → example/public/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ textarea {
}

body {
font-family: 'Helvetica Neue', 'Sans Serif';
font-size: 1em;
line-height: 1.4;
}
Expand Down Expand Up @@ -97,12 +98,23 @@ textarea {
Author's custom styles
========================================================================== */

body {
font-family: 'Helvetica Neue', 'Sans Serif';
article {
padding: 0 10% 0 10%;
}

.pager {
.header {
background-color: #000000;
padding: 10px 10% 10px 10%;
height: 60px;
}

.header a {
color: #FFFFFF;
font-size: 2.5em;
text-decoration:none;
}

.pager, .pager:hover, .pager:active, .pager:visited, .pager:link {
color: blue;
}

Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions public/index.html → example/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</head>
<body>

<div class="header">
<a href="/">Some Name</a>
</div>
<article>
<div><p>Date: 2012-02-29
Title: Méta-billet: un mot sur le Calepin
Expand Down
3 changes: 3 additions & 0 deletions public/j-42-preparation → example/public/j-42-preparation
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</head>
<body>

<div class="header">
<a href="/">Some Name</a>
</div>
<article>
<div><p>Date: 2012-02-21
Title: Propulsé par node.js
Expand Down
3 changes: 3 additions & 0 deletions templates/layout.amber → example/templates/layout.amber
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ html.no-js
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

div.header
a[href="/"] #{SiteName}

article
block content

Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import (
"path/filepath"
)

const (
SiteName = "Some Name"
)

type options struct {
Port int `short:"p" long:"port" description:"the port to use for the web server" default:"9000"`
}
Expand Down
11 changes: 6 additions & 5 deletions watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ func regeneratePosts() {
}

type TemplateData struct {
Post *LongPost
Recent []*ShortPost
Prev *ShortPost
Next *ShortPost
SiteName string
Post *LongPost
Recent []*ShortPost
Prev *ShortPost
Next *ShortPost
}

func newTemplateData(p *LongPost, i int, r []*ShortPost, all []*LongPost) *TemplateData {
td := &TemplateData{Post: p, Recent: r}
td := &TemplateData{SiteName: SiteName, Post: p, Recent: r}

if i > 0 {
td.Prev = all[i-1].Short()
Expand Down

0 comments on commit 5845dd8

Please sign in to comment.