All Projects → thanethomson → Statik

thanethomson / Statik

Licence: mit
Multi-purpose static web site generator aimed at developers.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Statik

Structopt
Parse command line arguments by defining a struct
Stars: ✭ 323 (+29.72%)
Mutual labels:  command-line, library
Papis
Powerful and highly extensible command-line based document and bibliography manager.
Stars: ✭ 636 (+155.42%)
Mutual labels:  command-line, library
Towel
Throw in the towel.
Stars: ✭ 333 (+33.73%)
Mutual labels:  command-line, library
flaskbooks
A very light social network & RESTful API for sharing books using flask!
Stars: ✭ 19 (-92.37%)
Mutual labels:  sqlalchemy, jinja2
Argumentum
C++ command line parsing library
Stars: ✭ 92 (-63.05%)
Mutual labels:  command-line, library
reactant
Generate code for "models, views, and urls" based on Python type annotations. Supports Django REST, SQLAlchemy, Peewee.
Stars: ✭ 14 (-94.38%)
Mutual labels:  sqlalchemy, jinja2
Nve
Run any command on specific Node.js versions
Stars: ✭ 531 (+113.25%)
Mutual labels:  command-line, library
gpp
General PreProcessor
Stars: ✭ 25 (-89.96%)
Mutual labels:  static-site-generator, jinja2
Text Minimap
Generate text minimap/preview using Braille Patterns
Stars: ✭ 21 (-91.57%)
Mutual labels:  command-line, library
Dotdrop
Save your dotfiles once, deploy them everywhere
Stars: ✭ 813 (+226.51%)
Mutual labels:  command-line, jinja2
voldemort
A simple static site generator using Jinja2 and Markdown templates.
Stars: ✭ 48 (-80.72%)
Mutual labels:  static-site-generator, jinja2
Progressbar
A really basic thread-safe progress bar for Golang applications
Stars: ✭ 2,212 (+788.35%)
Mutual labels:  command-line, library
pyramid-cookiecutter-alchemy
[DEPRECATED - Please use https://github.com/pylons/pyramid-cookiecutter-starter instead] A Cookiecutter (project template) for creating a Pyramid project using SQLite for persistent storage, SQLAlchemy for an ORM, Alembic for database migrations, URL dispatch for routing, and Jinja2 for templating.
Stars: ✭ 39 (-84.34%)
Mutual labels:  sqlalchemy, jinja2
logya
Logya is a static site generator written in Python designed to be easy to use and flexible.
Stars: ✭ 16 (-93.57%)
Mutual labels:  static-site-generator, jinja2
nene
Nēnē: A no-frills static site generator
Stars: ✭ 22 (-91.16%)
Mutual labels:  static-site-generator, jinja2
Grow
A declarative website generator designed for high-quality websites, with a focus on easy maintenance and localization.
Stars: ✭ 360 (+44.58%)
Mutual labels:  static-site-generator, jinja2
flask-tweeeter
A full-stack Twitter clone made using the Flask framework for Python 🐦
Stars: ✭ 28 (-88.76%)
Mutual labels:  sqlalchemy, jinja2
chm-documentation
chm documentation PostgreSQL pgadmin3 SQLAlchemy Django Flask jinja2 webpy doc chm compiled html help Postgres Postgre документация russian
Stars: ✭ 17 (-93.17%)
Mutual labels:  sqlalchemy, jinja2
Portray
Your Project with Great Documentation.
Stars: ✭ 726 (+191.57%)
Mutual labels:  command-line, static-site-generator
Typin
Declarative framework for interactive CLI applications
Stars: ✭ 126 (-49.4%)
Mutual labels:  command-line, library

Statik

Build Status PyPI PyPI

Overview

Statik aims to be a simple, yet powerful, generic static web site generator. Instead of forcing you to adhere to a particular data structure/model (like the standard blog data model, with posts, pages and tags), Statik allows you to define your own data models in YAML format, and instances of those data models either in YAML or Markdown. This is all loaded into an in-memory SQLAlchemy SQLite database when rendering your views.

Then, code up your templates using the Jinja2 templating engine (very similar to the Django templating engine), or Mustache templates.

Finally, define your views (either complex or simple) in YAML format, telling Statik how to render your data and templates to specific URLs for your shiny new static web site. Write queries for your views in SQLAlchemy's ORM syntax, or MLAlchemy to make your life easier.

See the wiki for more details.

Requirements

In order to install Statik, you will need:

  • Python 3.6+
  • pip or easy_install

Installation

Simply run the following:

> pip install statik

To upgrade, just run the following:

> pip install --upgrade statik

Usage

To build the project in the current directory, writing output files to the public directory within the current directory:

> statik

To build a project in another directory, writing output files to the public directory within that directory:

> statik -p /path/to/project/folder

To build a project in another directory, with control over where to place the output files:

> statik -p /path/to/project/folder -o /path/to/output/folder

Project QuickStart

To create an empty project folder with the required project structure, simply run:

> statik -p /path/to/project/ --quickstart

Statik Projects

A Statik project must adhere to the directory structure as follows:

config.yml    - YAML configuration file for the overall project.
assets/       - Static assets for the project (images, CSS files,
                scripts, etc.). Ignored if themes are used.
data/         - Instances for each of the different models, defined either in
                YAML or Markdown format.
models/       - A folder specifically dedicated to model definitions, in YAML
                format.
templates/    - Jinja2/Mustache template files. Ignored if themes are used.
templatetags/ - Python scripts defining custom Jinja2 template tags and
                filters.
themes/       - If your project uses themes, place them here. Each theme
                must be uniquely named, and must contain an "assets"
                and "templates" folder.
views/        - Configuration files, in YAML format, defining "recipes" for how
                to generate various different URLs (which models to use, which
                data and which templates).

For example projects, see the examples directory in the source repository. For more information, see the wiki.

Themes

Themes for Statik will slowly start appearing in the Statik Themes repository. Watch that space!

Remote upload

Statik can publish your generated site for you through SFTP or through Netlify.

SFTP

To publish your website via SFTP, you can configure certain values by way of configuration file or environment variable-based options. Some sensitive options, however, must be configured exclusively by way of environment variables.

For your configuration file:

deploy:
  sftp:
    host: your-server.com
    dest-path: /folder/on/your/server/
    user: youruserforyourserver

    # you can also optionally specify which SSH private key to use
    key-file: ~/.ssh/my-private-key

    # optionally specify SFTP port (default: 22)
    port: 2222

Set up your sensitive environment variables prior to running Statik:

# If your server requires password-based authentication
> export SFTP_PASSWORD=mysftppassword

# If your SSH key file is encrypted and it requires a password to decrypt
> export SFTP_KEY_FILE_PASSWORD=mysftpkeyfilepassword

Alternatively, you could set up all SFTP variables through environment variables alone:

> export SFTP_HOST=your-server.com
> export SFTP_PORT=2222                  # optionally set SFTP port
> export SFTP_DEST_PATH=/folder/on/your/server
> export SFTP_USER=youruserforyourserver
> export SFTP_PASSWORD=mysftppassword
> export SFTP_KEY_FILE=~/.ssh/my-private-key
> export SFTP_KEY_FILE_PASSWORD=mysftpkeyfilepassword

Then run Statik using the following deployment command:

> statik --deploy sftp

For troubleshooting SFTP connections, run this using the -v flag to increase output verbosity:

> statik --deploy sftp -v

Netlify

To publish your website via Netlify, you will need 2 things: your Netlify access token and your Netlify site ID.

First, specify your access token and site ID as environment variables:

Linux:

> export NETLIFY_AUTH_TOKEN=<netlify_token>
> export NETLIFY_SITE_ID=<netlify_site_id>

Windows

> set NETLIFY_AUTH_TOKEN=<netlify_token>
> set NETLIFY_SITE_ID=<netlify_site_id>

Then, run Statik by passing in --deploy=netlify.

statik --deploy netlify

Statik will upload the static site that it outputs.

License

The MIT License (MIT)

Copyright (c) 2016-2019 Thane Thomson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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].