GithubHelp home page GithubHelp logo

solarwind's Introduction

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:

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

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:

###
title: This is the Post Title
date: 06 Mar 15 13:30 PST
category: computers
###

I have long used computers because they rule.

Here I will write another paragraph about computers.

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.

solarwind's People

Contributors

kyleterry avatar

Stargazers

Tuan Duc Tran avatar Michael K avatar Justin Zwick avatar Marco Musella avatar Kevin Hatfield avatar  avatar Giacomo Tüfekci avatar Bryan Clement avatar Xe Iaso avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.