Skip to content

tylerkrupicka/staticky

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

Staticky

A simple static site builder written in Python. Create layouts to be populated with posts, content, and variables easily--using standard html and css. Take any site template and populate content quickly.

Setup

Staticky has an automated setup command that will create the necessary directories and files to get started. Just place staticky.py in to an empty directory (or near empty) and run the script. It will ask you if you want to setup, and then create all the necessary base files and directories.

Layouts

The layouts folder is where all new pages are placed; any files in there will be propigated when the site is generated. All elements in the elements folder will be inserted in to layouts. For example: if you create a navbar.html file in the elements folder, this code will be placed everywhere you place [[navbar]] in the layouts.

Config

The config files allows you to define site-wide variables. Any created variables will be replaced in layouts where [[variable_name]] is found.

Creating a Post or Post Thumbnail page

Post and post_thumb are default files created by the setup that allow for the creation of post pages as well as post "thumnails" or short blurbs on pages that dont display all of the content. Here are the usable post attributes when creating your layouts:

  • [[post.title]]
  • [[post.date]]
  • [[post.content]] (all of the posts content html)
  • [[post.thumbContent]] (post content html before the " more " tag in the post file)
  • [[post.link]] (link to the blog post)

Using the [[post_thumb]] tag will insert the amount of post thumbnails specified in your config. [[post_thumb_all]] tag will insert all of your thumbnails (for creating an all posts page).

I also added a post.thumbnail attribute for adding image thumbnails to each post. The new post function now asks you for a link.

Demo

There is a demo branch of this repository that contains a simple website tutorial on basic features. Feel free to download it as an example, however the staticky.py in that branch might not be the most recent version. Make sure to use the staticky.py from the master branch.

You can view a live site using the generator at tylerkrupicka.com. Enjoy.

About

Stripped down static site generator in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages