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('blog/**.md'))


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

# 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()]

# Syndicate RSS and Atom feeds.
[site.include(f'posts.{type}.xml', feed) for type, feed in feeds(site['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.dev16.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

lightweight-0.1.0.dev16-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file lightweight-0.1.0.dev16.tar.gz.

File metadata

  • Download URL: lightweight-0.1.0.dev16.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.0 CPython/3.7.4

File hashes

Hashes for lightweight-0.1.0.dev16.tar.gz
Algorithm Hash digest
SHA256 2e499146f079ed19be6a7063f8980a6dda3d86dd25d941cb45eafd9b5b52ef0a
MD5 e860356a2955e38c8a50b77c0e032812
BLAKE2b-256 67675e155fa18b31dbd8ad60e12fdcd43df951cecc440cf366c3620586b606ca

See more details on using hashes here.

File details

Details for the file lightweight-0.1.0.dev16-py3-none-any.whl.

File metadata

  • Download URL: lightweight-0.1.0.dev16-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.0 CPython/3.7.4

File hashes

Hashes for lightweight-0.1.0.dev16-py3-none-any.whl
Algorithm Hash digest
SHA256 d21aed03b0fd3caaeb754e1653e9fb42ea8636efd6c29980aa3dbd88d6c02b4a
MD5 99e1647226318c401cbdbb83f650fc7d
BLAKE2b-256 5c31023a82bf704c86dfeef16adacea4da0d027024cfdd3e01a0c12429344006

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