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, feeds, sass


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


site = Site(url='https://example.com')

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

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

# Syndicate RSS and Atom feeds.
[site.include(f'posts.{type}.xml', feed) for type, feed in feeds(site['posts'])]

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

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

# 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-1.0.0.dev18.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

lightweight-1.0.0.dev18-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file lightweight-1.0.0.dev18.tar.gz.

File metadata

  • Download URL: lightweight-1.0.0.dev18.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for lightweight-1.0.0.dev18.tar.gz
Algorithm Hash digest
SHA256 9eba94168bacb381b464da61dc49ab2537610f68b857f959801c780d25b36cc6
MD5 46832363d51de22a9e9e0b1c0b9e1e4b
BLAKE2b-256 1b528eb6ba5e7e6d8a6bee4a4658c724e5aac33975019610b07fe4362177fe19

See more details on using hashes here.

File details

Details for the file lightweight-1.0.0.dev18-py3-none-any.whl.

File metadata

  • Download URL: lightweight-1.0.0.dev18-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for lightweight-1.0.0.dev18-py3-none-any.whl
Algorithm Hash digest
SHA256 863158f142946d1f4b8f33137f43a368bcb4dc5f39c6add6ba09cea3bcf21fb0
MD5 6a812166a922d26d22a169e0cb786c19
BLAKE2b-256 21e20597f7e6f270f62c1ec4ff8659ba592d13a5ee3d16894ae9718a8a126989

See more details on using hashes here.

Supported by

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