Static site generator based on staticjinja with support for templates (Jinja), translations (pyBabel), optimized thumbnail generation (Pillow), and build size minimization by excluding unreferenced files.
Project description
bSSG – B Static Site Generator
bSSG is an extensible static site generator that builds on top of staticjinja. It includes support for templates (Jinja), translations (pyBabel), optimized thumbnail generation (Pillow), and build size minimization by excluding unreferenced files.
Features:
- Support for templates (with Jinja)
- Support for translations (with pyBabel)
- Includes a thumbnail generator for responsive images (uses Pillow)
- Efficient output by including only referenced static files
- Opinionated on URL structure
Architecture
A site that uses bSSG will have this URL a source structure as:
input/
+- templates/
| +- <tree>
+- static/
| +- <static files used in templates>
+- translations/
+- <language code>/
| +- LC_MESSAGES/
| +- messages.po
...
+- <language code>/
+- LC_MESSAGES/
+- messages.po
And the generated site will be structured as:
output/
+- <language code>/
| +- <tree>
...
+- <language code>/
| +- <tree>
+- <static files used in templates>
+- thumb/
+- <generated thumbnails>
And after generation, it can be accessed by an URL with the form {URL_PREFIX}/[{LANG_CODE}/]{SUFFIX}. Since the generated site is static, a web server has to be configured so that URL_PREFIX points to the path of the output directory.
An additional prefix (STATIC_PREFIX) can be added for static files so that they are not all placed directly at the root. Thumbnails are generated to the static files directory, but an additional prefix (THUMB_PREFIX) may be added to use an exclusive directory for thumbnails.
Usage
Creating a website with bSSG can be done as follows:
- Write the jinja templates, using
_('...')for localized strings, thestaticfilter for static files, and thethumbandthumb_srcfilters for images that want to thumbnailize. - Translate (if applicable).
- Extract the translations from the templates to a
.potfile. - Update (or init, if it is the first time) the message catalogs (one
.pofile for each language). - Compile the message catalogs (generates one
.mofile for each language).
- Extract the translations from the templates to a
- Build the site. The script will make the thumbnails, use the compiled translations, and generate the localized trees following the structure of the templates.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bssg-0.1.0.tar.gz.
File metadata
- Download URL: bssg-0.1.0.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f86d8de5a0a6885837f847c73557fb1996f89a43ecc41216fcd6d3a756e1efa9
|
|
| MD5 |
be463e42137032513c3bb85ccad75c27
|
|
| BLAKE2b-256 |
89b49574942ac3dc7f6e5b99546355d41bba3e6be83838731bcd18f3d7fdf698
|
File details
Details for the file bssg-0.1.0-py3-none-any.whl.
File metadata
- Download URL: bssg-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1bc1e5a05aa107e16fef284908f895507936be82e2662b3a79926fb1cf0d5fe
|
|
| MD5 |
0a038330ee27880fc5872f51938dbac3
|
|
| BLAKE2b-256 |
f281b018e62f91bfe5d9a961048e5f4780705767640de609fe3f5a60ea7d9494
|