Meet {#Thoth}, a simple static blog generator.

{#Thoth} (or more commonly Thoth) is a new, simple static blog generator written in Swift.
Just write your articles in Markdown, put them in a directory, point Thoth to this directory, add a template, SFTP settings and an output directory, and voilĂ  ! Thoth will generate HTML pages for all articles, drafts, and index, and upload the output to your SFTP.

You can use it as a command-line tool :

$ thoth scribe /path/to/your/blog/folder

or launch it as an application which will display its own prompt :

Welcome in {#THOTH}, a static blog generator.
> scribe /path/to/your/blog/folder
Export done !
Uploading to FTP... Upload done !
> _

Install and setup


You can either download an archive containing the Thoth binary (to install in /usr/local/bin or wherever you want) and an example template from the release page, or you can download the sources and compile it using Xcode.


You can ask Thoth to create a folder containing a config file and all the needed directories by running the command setup /path/to/the/future/blog/directory. Then, fill the config file with the corresponding information, and register your SFTP password in the OS X keychain using the password /path/to/blog/directory -set "yourPassw0rd".

The config file is a plain text file, so you can create it yourself if you prefer (see the Config file section). In all cases, you must fill it before running other Thoth commands.

Don't forget to add a template in the corresponding folder. You can use the default template, stored in the download folder of this repository.

When you want to generate and upload your site for the first time, use the first /path/to/your/blog/folder command.


Each article markdown file should be put in the articles directory, and follow this header style :

#The title
The author (optional)

The beginning of the article content starts here. Nullam id dolor id nibh ultricies vehica  
ut id elit. Maecenas sed diam eget risus varius blandit sit amet non magna.

For drafts, just replace the date on the second line by the mention draft. Those files will be treated separately, and listed in an index-drafts.html file in the output.

Once you have finished writing your article, run the scribe /path/to/blog/folder command to automatically update the output and upload it. Do the same if you want to preview a draft online, or just call generate /path/to/blog/folder to generate it in the output folder.




Create your own HTML templates : Thoth expects at least two files in the template folder: index.html and article.html. All other files and folders will be also copied. Thoth uses a keywords system for inserting your articles content in the template you created or downloaded. Those keywords are simple and easy-to-use. You can use :

You can also provide a syntax.html file containing code for syntax highlighting. It will be inserted in the <head> section of each article that contains at least a block of code (<pre><code>...</code></pre>).

Config file

A simple, human-readable config file. No XML, JSON or YAML. Just a simple flat text file, nothing more. It should be put at the root of your blog folder, along with articles, template, output folders. The current settings are :

The password for the SFTP access is now stored in the OS X user keychain. See the password command for more details.

Extended markdown parsing

You can create inline footnotes using the common format :

[^ here's the content of my footnote]

Use the classes footnote-link and footnote in your template to style the footnotes links and content, respectively.

You can also easily manage your images size in markdown, either by setting a default width, or defining it using the following syntax :

![alt text](path/to/image.png "800,600,title")

or just

![alt text](path/to/image.png "800,title")

to automatically set the height according to the picture ratio. Pictures from your articles which are stored on your computer are also retrieved by Thoth and copied in article-specific folders, for an easier management.

You can also integrate HTML5 videos in your articles using the following syntax:

?[alt text](http://url/to/video.mp4 "800,600")

(There is not automatic copy of local videos yet.)

Comments and ignored files

In the config file, lines beginning with a # or a _ will be ignored.
During articles processing and copy, files beginning with _ or # won't be processed or copied.


Authors and Contributors

Created in Swift using Xcode by Simon Rodriguez.
See the license file for the licenses of third-party components and libraries.

Support or Contact

Having trouble with Thoth? Contact me at contact[...]simonrodriguez[...]fr and I'll try to help you.