项目作者: kyleterry

项目描述 :
No bullshit static site generator
高级语言: Go
项目地址: git://github.com/kyleterry/solarwind.git
创建时间: 2015-03-07T08:36:42Z
项目社区:https://github.com/kyleterry/solarwind

开源协议:MIT License

下载


Solarwind

Solarwind is the for-reals no-bullshit static site generator.

Static site generators have become confusing and bloated. I’ve tried 4 or 5 and
they don’t make sense, they have terrible defaults, the templates are hard to
understand, yadda yadda nerd rage yadda.

This is a simple and easy to use SSG.

Installation

You will need Solarwind:

go get github.com/kyleterry/solarwind

This shit will show up in your $GOPATH/bin.

Usage

All this assumes your project lives under ~/src/my-site.

Configuration

First things first, you will need a Solarwindfile. Put this shit ~/src/my-site/Solarwindfile:

  1. {
  2. "site-title": "My Site Title",
  3. "site-description: "This is a description that will be in my meta tags"
  4. }

It’s fucking JSON. How about that?

Now you will need to copy the starter template into your site root:

cp -r $GOPATH/src/github.com/kyleterry/solarwind/starter/templates ~/src/my-site/

Now create a content and posts dir:

mkdir -p ~/src/my-site/content/posts

File mappings

Non-markdown files are mapped pretty much 1 to 1 between source and destination,
so if you have a file called ~/src/my-site/content/index.html, it will be
rendered to ~/src/my-site/public/index.html.

Markdown post filenames are derived from the title of the post as a slug:
~/src/my-site/public/posts/my-first-post-title.html.

Add some html and markdown (use .md extension) to your
~/src/my-site/content{,posts} and generate your site:

Markdown and posts

Posts are markdown files with an optional header describing metadata about the
post. Below is an example of a markdown post:

  1. ###
  2. title: This is the Post Title
  3. date: 06 Mar 15 13:30 PST
  4. category: computers
  5. ###
  6. I have long used computers because they rule.
  7. Here I will write another paragraph about computers.
  8. I use [Google](https://google.com) to figure stuff out.

The above text should be stored in something like
~/my-site/content/posts/my-computer-post.md.

Generating the site

solarwind generate

All your shit shows up in ~/src/my-site/public

If you need static assets, just put them in ~/src/my-site/static/{css,js,images}
or whatever (really, I just copy that entire dir to ~/src/my-site/public/static).

Post ordering

Posts are currently ordered based on the filename. I’m going to later add the
ability to sort by post date.

Development Server

A development server is included. It will watch your content, templates, and
static directories for changes and regenerate the site when they occur.
It optionally takes a -bind param but will listen on localhost:8090 by default.

solarwind server [-bind :8091]

Now edit the templates to your liking and draw the rest of the fucking owl.