indices is a simple, personal static-site generator written in Go. I made it for two reasons:
- I couldn't find any other static-site generators that met my desire for simplicity. With
indices, I can just drag my Markdown source to the binary and commit, and pages are simple and self-index. - I wanted a small project to help me learn Go.
Inspiration for the design and layout of pages comes from jrl.ninja and schollz.com.
indiceshas no customizability. If you want to make changes to its appearance, for example, you'll need to change the source and build a binary yourself, but this should not be a difficult process.
indicesis built like a file system. Imagine that you're writing a site like you would with HTML, but write it with Markdown instead. Other than that, it just adds a self-indexing system.- For example, in the root directory of your website, you might have an
index.mdfile as a homepage and anabout.mdfile for personal details. When you run the binary on your website source,index.mdwill compile toindex.htmland include a navigation section that links to the personal details page (and any other pages in the directory).about.mdwill compile toabout/index.htmland include a note at the bottom of the page that links to theindex.htmlof the directory. - For a more detailed example, see my website source.
- For example, in the root directory of your website, you might have an
- The title of each page is the first line of the
.mdwith anything excepta-z,A-Z,,.and-removed. - Use
\at the end of Markdown lines to end the paragraph/force a line break. - With a binary, just run
indices <website source directory>. Any files not ending in.mdwill be copied to the final static site.
- Make sure you have Go installed.
- Then get
blackfriday, the Markdown processor withgo get gopkg.in/russross/blackfriday.v2. - Then just run
go buildto build a binary.
indicesusesblackfridayand does NOT sanitize input! It will copy over HTML tags, scripts, etc.- The HTML used to generate the static sites is in
indices.go. If you want to change the appearance or something else about the sitesindicesgenerates, start there! - The code for this repository is sloppy! It's the first program I made with Go (I wanted to learn it), and it could definitely stand some refactoring. Here be dragons!