2

I'm looking into Wintersmith-ifying my site, which is currently hand-written. I have a couple pages: index.html, projects.html, gpg.html, etc. I want to have a blog/ subdirectory, so that the final site looks like this:

.
|- index.html
|- gpg.html
|- project.html
|- blog/
|  |- look-a-new-wintersmith-blog.md
|  |- monkeys-are-really-cool.md

Is this possible? I've searched and looked at the Wintersmith documentation (and even the featured Wintersmith-powered sites), and come up with nothing. It seems like the only way is to have two instances of Wintersmith or something, but it also seems like there must be a better way.

strugee
  • 2,752
  • 4
  • 19
  • 30

1 Answers1

2

You should get the desired result with something like this:

├── config.json               <- site configuration
├── contents
│   ├── index.html            <- these will just be outputted as-is
│   ├── gpg.html
│   ├── project.html
│   ├── blog                  <– each article has its own directory
│   │   ├── index.json        <- this is your blog index at /blog/index.html
│   │   ├── look-a-new-wintersmith-blog
│   │   │   └── index.md
│   │   └── monkeys-are-really-cool
│   │       └── index.md
│   ├── authors               <- author metadata, check author.jade
│   │   └── the-wintersmith.json
│   ├── css
│   │   └── main.css
│   └── feed.json
├── plugins
│   └── paginator.coffee      <- paginator plugin
├── templates
│   ├── archive.jade
│   ├── article.jade
│   ├── author.jade
│   ├── feed.jade
│   ├── index.jade
│   └── layout.jade
└── views
    └── articles.coffee       <- view that lists articles

index.json is just a renamed and moved archive.json to give a /blog/index.html URL instead. If you want the default Wintersmith index instead of an archive layout, edit the file to use the index.jade layout instead of archive.jade.

If you change your current HTML files to Markdown and put them in the same spot, then they'll be outputted as HTML as your blog posts would.

You might want to add some sort of navigation menu to your article layout, too.

Edit: To create a static page, create a Markdown file in contents similar to the following:

---
title: GPG
author: baker
date: 2014-03-23
template: article.jade
---

Content

If you named this file gpg.md, it should be accessible at http://localhost:8080/gpg.html. Because we used the article.jade template, it expects an author and a date field for completeness (it would work without, however it would still include "Written by" without an author), but you could make a custom template that doesn't use those fields.

ipavl
  • 828
  • 11
  • 20
  • this seems good, but it isn't quite what I want. if you make it so that I can render `index.html`, `gpg.html`, etc. with the templating system, I'll accept this answer - although I have since stopped looking at Wintersmith for static site generation, so I'm assuming good faith. – strugee Oct 02 '14 at 16:49
  • I think what you're asking is what's shown in the default about.md file that is generated with the default Wintersmith site; you give it a markdown file (gpg.md) and it generates a static HTML page (gpg.html). You could give it a different layout, etc. if desired in the metadata block. – ipavl Oct 05 '14 at 15:09
  • I don't see the file you're talking about, except for the footer file (defined in `contents/about.md`). – strugee Oct 06 '14 at 18:20
  • Sorry, I forgot Wintersmith had that as the footer by default. Updated my answer with a more generic solution, although using a default template for simplicity. – ipavl Oct 07 '14 at 01:18