All Projects → mna → Trofaf

mna / Trofaf

Licence: bsd-3-clause
Super simple live static blog generator in Go. Vraiment trofaf.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Trofaf

Eleventy
A simpler static site generator. An alternative to Jekyll. Transforms a directory of templates (of varying types) into HTML.
Stars: ✭ 10,867 (+8132.58%)
Mutual labels:  blog-engine
Jekyll
🌐 Jekyll is a blog-aware static site generator in Ruby
Stars: ✭ 43,803 (+33084.09%)
Mutual labels:  blog-engine
Infinitas
Infinitas is an open source content management framework that was developed using the CakePHP framework (v2.x). Amongst other things, its a blog, cms, newsletter emailing system and on-line shopping cart.
Stars: ✭ 126 (-4.55%)
Mutual labels:  blog-engine
Blogdown
Create Blogs and Websites with R Markdown
Stars: ✭ 1,327 (+905.3%)
Mutual labels:  blog-engine
Hexopress
A tiny blogging platform that lets you write posts in Google Docs and syncs with a Google Drive directory.
Stars: ✭ 102 (-22.73%)
Mutual labels:  blog-engine
Aws Lambda Blog
AWS Lambda serverless blogging platform
Stars: ✭ 119 (-9.85%)
Mutual labels:  blog-engine
Qblog
🐍A blog base on Python+Django.
Stars: ✭ 72 (-45.45%)
Mutual labels:  blog-engine
Dropplets
Welcome to an easier way to blog - A minimalist markdown blogging platform.
Stars: ✭ 1,616 (+1124.24%)
Mutual labels:  blog-engine
Nabo
Nabo (納博) - dead simple blog engine
Stars: ✭ 103 (-21.97%)
Mutual labels:  blog-engine
Hyde
A Python Static Website Generator
Stars: ✭ 1,599 (+1111.36%)
Mutual labels:  blog-engine
Amusewiki
Text::Amuse-based publishing platform
Stars: ✭ 95 (-28.03%)
Mutual labels:  blog-engine
Statiq.web
Statiq Web is a flexible static site generator written in .NET.
Stars: ✭ 1,358 (+928.79%)
Mutual labels:  blog-engine
Sio.core
✔ [ SIOC ] Swastika I/O Core is an all in one platform (e.g CMS, eCommerce, Forum, Q&A, CRM...) ASP.NET Core / Dotnet Core System based on SIOH Framework.
Stars: ✭ 121 (-8.33%)
Mutual labels:  blog-engine
Dpress
A simple blog powered by Django
Stars: ✭ 85 (-35.61%)
Mutual labels:  blog-engine
Blogotext
A little more than a lightweight SQLite Blog-Engine.
Stars: ✭ 129 (-2.27%)
Mutual labels:  blog-engine
Heckle
✒️ Jekyll in Haskell (feat. LaTeX)
Stars: ✭ 80 (-39.39%)
Mutual labels:  blog-engine
Plume
Federated blogging application, thanks to ActivityPub (now on https://git.joinplu.me/ — this is just a mirror)
Stars: ✭ 1,615 (+1123.48%)
Mutual labels:  blog-engine
Chyrp Lite
An ultra-lightweight blogging engine, written in PHP.
Stars: ✭ 131 (-0.76%)
Mutual labels:  blog-engine
Sunengine
SunEngine – site engine with blog, forum and articles sections features support.
Stars: ✭ 130 (-1.52%)
Mutual labels:  blog-engine
Nim websitecreator
Nim fullstack website framework - deploy a website within minutes
Stars: ✭ 124 (-6.06%)
Mutual labels:  blog-engine

trofaf

trofaf is a super-simple live static blog engine.

Install using: go get github.com/PuerkitoBio/trofaf

Description

It generates a static website from markdown files and front matter, and requires only a simple 3-directories structure to get going. It favors simplicity over features.

To get started, create the 3 subdirectories (you can look at the example/ subdirectory for... an example):

  • posts
  • public
  • templates

trofaf only cares about *.md files in the posts directory, and about *.amber (Amber templates) or *.html (native Go templates) files in the templates directory. It will watch for changes, creates or deletes on those files in these directories, and will re-generate automatically the website when required. This is the live part.

All files in the public directory are exposed by the web server. Posts in markdown format get translated to static html files at the root of the public directory. The html file name is an URL-friendly slug generated from the original markdown file name. There is no extension, so the URL looks clean and, uh, modern?

An RSS feed is automatically generated from a number of recent posts, and saved as a static XML file in the public directory.

There is no special template for an index page, the most recent post (based on the publication date found in the front matter of the markdown files) is saved twice - once under its own html file, once under the index.html file, so that this is the page displayed when the root of the web server is requested.

When the site is (re-)generated, the public directory must be cleaned, because some posts may have been deleted. Subdirectories are left untouched (so that css/ or js/ directories can coexist peacefully), as well as hidden (dot) files, and some special files are also graced from the destruction (robots.txt, favicon.ico, etc., see gen.go).

It currently uses my fork of the amber package, in order to make a fmttime(t time.Time, fmt string) string function available in the templates. This function makes it possible to format the PubTime or ModTime fields in the same way that the stdlib's time.Format() works. This function is also made available to native Go templates (you can check the examples for usage).

Command-line Options

The following options can be set at the command-line:

  • Port (-p) : the port number for the web server, defaults to 9000.
  • GenOnly (-g) : generate the static site and exit.
  • NoGen (-G) : prevents watching and live-generating the site. This is equivalent to running the static public directory.
  • SiteName (-n) : the name of the web site, passed to the template.
  • TagLine (-t) : a tag line for the web site, passed to the template.
  • RecentPostsCount (-r) : the number of posts in the recent posts list, passed to the template and used for the RSS feed.
  • BaseURL (-b) : the base URL of the web site, most likely the host name (i.e. http://www.mysite.com).

Front matter

Like many static blog generators, trofaf uses YAML front matter to get metadata for a post. This is a complicated way to say that you have to add blocks of text like this at the start of your posts:

---
Title: My title
Description: My short-ish description of the post.
Author: Me
Date: 2013-07-14
Lang: en
---

# Here is my post!

Etc.

The three dashes delimit the front matter. It must be there, beginning and end. Between the dashes, the part before the colon : is the key, and after is the value. Simple as that. Title, Description, Author, Date and Lang are recognized. Valid date formats are 2006-01-02, 2006-01-02 15h (or 2006-01-02 8h), 2006-01-02 15:04 (or 2006-01-02 8:17) or the RCF3339 format (2013-08-06T17:48:01-05:00).

License

The BSD 3-Clause License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].