Skip to main content

Static site generator i actually can use.

Project description

lightweight

PyPI Build Status Test Coverage Supported Python Documentation

Static site generator i actually can use.

Documentation

Features

  • Clean and easily extensible API
  • Jinja2 templates
  • Markdown rendering
  • Markdown links
  • Sass/SCSS rendering
  • RSS/Atom feeds
  • Dev server

Installation

Available from PyPI:

pip install lightweight

Quick Example

from lightweight import Site, markdown, paths, render, template, sass


def blog_posts():
    post_template = template('blog-post.html')
    # Use globs to select files.
    return (markdown(path, post_template) for path in paths('blog/**.md'))


site = Site()

# Render a Jinja2 template.
site.include('index.html', render('index.html')) 

# Render list of Markdown files.
[site.include(f'posts/{post.file.stem}.html', post) for post in blog_posts()]

# Render SCSS.
site.include('static/css/style.css', sass('static/scss/lightweight.scss'))

# Include a copy of a directory.
site.include('static/img')

# Execute all included content. 
site.render()

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lightweight-0.1.0.dev15.tar.gz (10.0 kB view hashes)

Uploaded Source

Built Distribution

lightweight-0.1.0.dev15-py3-none-any.whl (14.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page