staticjinjaplus


Namestaticjinjaplus JSON
Version 1.1.2 PyPI version JSON
download
home_pagehttps://github.com/EpocDotFr/staticjinjaplus
SummaryA sweet spot between staticjinja and a full-blown static site generator.
upload_time2024-04-16 07:38:12
maintainerNone
docs_urlNone
authorMaxime "Epoc" Gross
requires_python>=3.9
licenseDBAD
keywords static website site generator staticjinja jinja jinja2
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# staticjinjaplus

A sweet spot between [staticjinja](https://staticjinja.readthedocs.io/en/latest/) and a full-blown static  site generator.

![Python versions](https://img.shields.io/pypi/pyversions/staticjinjaplus.svg) ![Version](https://img.shields.io/pypi/v/staticjinjaplus.svg) ![License](https://img.shields.io/pypi/l/staticjinjaplus.svg)

[PyPI](https://pypi.org/project/staticjinjaplus/) - [Documentation](https://github.com/EpocDotFr/staticjinjaplus?tab=readme-ov-file#readme) - [Source Code](https://github.com/EpocDotFr/staticjinjaplus) - [Issue Tracker](https://github.com/EpocDotFr/staticjinjaplus/issues) - [Changelog](https://github.com/EpocDotFr/staticjinjaplus/releases)

Citing staticjinja's documentation, "most static site generators are cumbersome to use". While I fully agree, and while
I find staticjinja to be an awesome piece of software, there's still some gaps here and there that needs to be filled in
order to be able to generate a static website that will actually be ready for real world usage.

staticjinjaplus try to fill these gaps, while still being built on staticjinja and its philosophy: keep it simple, stupid.
Note staticjinjaplus is opinionated: choices have been made to cover some use cases, but not all. This is not your average
static site generator.

## Features

All of [staticjinja](https://staticjinja.readthedocs.io/en/latest/)'s features, plus:

  - Simple, file-based configuration to centralize *a handful* of configuration values
  - Build improvements
    - Set system locale before building anything (useful when formatting dates to localized strings)
    - Automatically copy static files to output directory
    - Define staticjinja contexts in config file
    - Define [webassets](https://webassets.readthedocs.io/en/latest/) bundles to allow CSS/JS concatenation/minification
    - Automatically minify XML (including HTML, RSS and Atom)/JSON output
  - Jinja improvements
    - A few new Jinja globals/filters to make your life easier
    - Autoescape is enabled for XML, HTML, RSS and Atom templates
  - Serve the generated site through a local HTTP server
    - URL rewrite emulation (for HTML files)
    - Custom HTTP error pages emulation
    - IPv6 loopback address support
  - Publish the generated site through rsync over SSH

**Planned:**

  - Generic support of Markdown-formatted templates collections (forget about the usual "pages" or "articles/blog posts" feature)

## Prerequisites

  - Python >= 3.9

## Installation

From PyPI:

```bash
$ pip install staticjinjaplus
```

Locally, after cloning/downloading the repo:

```bash
$ pip install .
```

A CLI (`staticjinjaplus`) will be made available upon installation.

## Usage

### Templates

You'll want to write your site's Jinja templates first: write them as usual. By default, staticjinjaplus searches for
Jinja templates in the `templates` directory where it is invoked. You can change that by using the `TEMPLATES_DIR`
[configuration value](#configpy).

staticjinjaplus offers the following additional Jinja facilities.

#### Globals

| Name/signature                                  | Type     | Description                                                                                                                                                                                                         |
|-------------------------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `config`                                        | Dict     | Configuration values loaded from [`config.py`](#configpy) (defaults are guaranteed to be provided for built-in values). Only uppercase variables are loaded by staticjinjaplus                                      |
| `url(path: str, absolute: bool = False) -> str` | Callable | Build (by default) a relative URL to a file located in the `OUTPUT_DIR` directory. Setting `absolute` to `True` prefixes the URL with `BASE_URL`. See [configuration values](#configpy)                             |
| `icon(name: str) -> markupsafe.Markup`          | Callable | Return the file content of the given SVG icon, marked as safe to be rendered by Jinja. Icons must be saved in the form of `{ASSETS_DIR}/icons/{name}.svg`. Useful to embed SVG icons directly in the generated HTML |

**Usage examples:**

```html+jinja
{{ config.BASE_URL }}         {# http://localhost:8080/ (by default) #}
{{ config.MY_CUSTOM_CONFIG }} {# Whatever you defined in your config.py (uppercase variables only) #}

{# url() doesn't care whether an extension is given or not #}
{{ url('/about.html') }} {# /about.html #}
{{ url('/about') }}      {# /about #}
{{ url('about') }}       {# /about #}

{# url() doesn't care about whether a static file is targeted or not #}
{{ url('/images/logo.png') }} {# /images/logo.png #}
{{ url('images/logo.png') }}  {# /images/logo.png #}

{# URL is simply prefixed with BASE_URL when generating absolute URLs #}
{{ url('/images/logo.png', absolute=True) }} {# http://localhost:8080/images/logo.png (by default) #}
{{ url('images/logo.png', absolute=True) }}  {# http://localhost:8080/images/logo.png (by default) #}

{{ icon('github') }} {# <svg xmlns="http://www.w3.org/2000/svg" ... </svg> #}
```

#### Filters

| Signature                                      | Description                                                                                                                                                                                                                                                         |
|------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `<data: Dict>\|tojsonm -> str`                 | Serialize the given dictionary to a JSON string. Automatically takes into account the `MINIFY_JSON` [configuration value](#configpy) to minify (or not) the resulting output. Useful for e.g serializing [Schema.org](https://schema.org/)'s JSON-LD-formatted data |
| `<left: Dict>\|dictmerge(right: Dict) -> Dict` | Merge two dictionaries. Does not modify existing ones, a new one will be created. Does **not** merge deeply                                                                                                                                                         |

**Usage examples:**

```html+jinja
{{ dict(yes=True)|tojsonm }} {# With config['MINIFY_JSON'] == False:
                                 {
                                     "yes": true
                                 }
                             #}

{{ dict(yes=True)|tojsonm }} {# With config['MINIFY_JSON'] == True:
                                 {"yes":true}
                             #}

{{ dict(yes=True)|dictmerge(dict(no=False)) }} {# {"yes": True, "no": False} #}
```

### Command line interface

The `staticjinjaplus` CLI is your main and only way to interact with staticjinjaplus. The following commands are available.

#### `staticjinjaplus build`

Build the site by rendering your templates from the `TEMPLATES_DIR` directory in the `OUTPUT_DIR` directory.

**Options:**

  - `-w, --watch` Automatically rebuild the site when templates are modified

staticjinjaplus will first try to set the system's locale to the first working locale identifier set in the `LOCALE`
[configuration value](#configpy) (if set).

It will then copy the tree contained in the `STATIC_DIR` directory in the `OUTPUT_DIR`, as-is.

staticjinja will be then initialized with the given `CONTEXTS` and Jinja's `GLOBALS`/`FILTERS`/`EXTENSIONS`,
[webassets bundles](https://webassets.readthedocs.io/en/latest/bundles.html) will be registered, and the actual rendering
process is started.

`.html`, `.xml`, `.rss`, `.atom` and `.json` template output will be automatically minified, according to the `MINIFY_XML`
and `MINIFY_JSON` configuration values.

#### `staticjinjaplus clean`

Delete and recreate the `OUTPUT_DIR` directory.

#### `staticjinjaplus publish`

> [!NOTE]
> This feature requires a Linux-like environment.

Apply configuration values override from [environment variables](#environment-variables), then successively run
`staticjinjaplus build` and `staticjinjaplus clean` prior remotely syncing the `OUTPUT_DIR` directory content using
`rsync` through SSH.

#### `staticjinjaplus serve`

Serve the `OUTPUT_DIR` directory using Python's built-in HTTP server, plus a couple improvements:

  - URL rewrite for HTML files is emulated, i.e. both `/about.html` and `/about` will work
  - Custom HTTP error pages are emulated, if they are found saved as `{status code}.html` in the output directory
  - The server will listen to both IPv4 *and* IPv6 loopback addresses if possible

By default, you can browse your generated site at http://localhost:8080/ or http://[::1]:8080/. Port can be changed
by defining the `SERVE_PORT` [configuration value](#configpy).

## Configuration

### `config.py`

Your project's configuration happens in a single `config.py` file in the root directory (where the `staticjinjaplus`
CLI should be executed). You'll find the available configuration values below.

> [!NOTE]
>   - All paths are relative to the root directory, unless otherwise stated.
>   - None of these configuration values are required, so is `config.py`.
>   - Only uppercase variables are loaded by staticjinjaplus.

| Name             | Type                                            | Default                          | Description                                                                                                                                                                                                                                                                            |
|------------------|-------------------------------------------------|----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `LOCALE`         | List[str]                                       | `None`                           | Locale identifiers passed to [`locale.setlocale()`](https://docs.python.org/3.12/library/locale.html#locale.setlocale) before a build is executed. The first working identifier will be used                                                                                           |
| `SERVE_PORT`     | int                                             | `8080`                           | Listening port of the HTTP server started by `staticjinjaplus serve`                                                                                                                                                                                                                   |
| `BASE_URL`       | str                                             | `http://localhost:{SERVE_PORT}/` | Protocol and domain name to use to generate meaningful absolute URLs. Set host part to `[::1]` if you plan to use IPv6                                                                                                                                                                 |
| `MINIFY_XML`     | bool                                            | `False`                          | Enable XML minification                                                                                                                                                                                                                                                                |
| `MINIFY_JSON`    | bool                                            | `False`                          | Enable JSON minification                                                                                                                                                                                                                                                               |
| `TEMPLATES_DIR`  | str                                             | `templates`                      | Directory containing the Jinja templates to be processed                                                                                                                                                                                                                               |
| `OUTPUT_DIR`     | str                                             | `output`                         | Directory where the rendered site will be saved                                                                                                                                                                                                                                        |
| `STATIC_DIR`     | str                                             | `static`                         | Directory containing static files                                                                                                                                                                                                                                                      |
| `ASSETS_DIR`     | str                                             | `assets`                         | Directory containing assets, i.e. files that needs prior processing before being able to be used by the rendered site                                                                                                                                                                  |
| `ASSETS_BUNDLES` | List[Tuple[str, Tuple[str,...], Dict[str, str]] | `[]`                             | [webassets bundles](https://webassets.readthedocs.io/en/latest/bundles.html) to be registered. These are passed to [`register()`](https://webassets.readthedocs.io/en/latest/environment.html#registering-bundles). Sources are relative to `ASSETS_DIR`, destinations to `OUTPUT_DIR` |
| `CONTEXTS`       | List[Tuple[str, Any]]                           | `[]`                             | [staticjinja contexts](https://staticjinja.readthedocs.io/en/stable/user/advanced.html#loading-data) to be used by templates                                                                                                                                                           |
| `GLOBALS`        | Dict                                            | `{}`                             | [jinja globals](https://jinja.palletsprojects.com/en/3.1.x/api/#jinja2.Environment.globals) to be made available in all templates                                                                                                                                                      |
| `FILTERS`        | Dict                                            | `{}`                             | [jinja filters](https://jinja.palletsprojects.com/en/3.1.x/api/#jinja2.Environment.filters) to be made available in all templates                                                                                                                                                      |
| `EXTENSIONS`     | List[Union[str, jinja2.ext.Extension]]          | `[]`                             | [jinja extensions](https://jinja.palletsprojects.com/en/3.1.x/extensions/) to load                                                                                                                                                                                                     |

### Environment variables

Some configuration values may/must be overridden by environment variables of the same name when publishing your site
(`staticjinjaplus publish` command), typically in a deployment environment. You'll find the list below.

| Name          | Type   | Required?                      | Default                           | Description                                                          |
|---------------|--------|--------------------------------|-----------------------------------|----------------------------------------------------------------------|
| `BASE_URL`    | str    | Yes                            |                                   | Protocol and domain name to use to generate meaningful absolute URLs |
| `MINIFY_XML`  | bool ¹ | No, but activation recommended | `MINIFY_XML` configuration value  | Enable XML minification                                              |
| `MINIFY_JSON` | bool ¹ | No, but activation recommended | `MINIFY_JSON` configuration value | Enable JSON minification                                             |
| `SSH_USER`    | str    | Yes                            |                                   | SSH username                                                         |
| `SSH_HOST`    | str    | Yes                            |                                   | SSH hostname                                                         |
| `SSH_PORT`    | int    | No                             | `22`                              | SSH port                                                             |
| `SSH_PATH`    | str    | Yes                            |                                   | Absolute path to the deployment directory on the SSH host            |

¹ Any [falsy](https://marshmallow.readthedocs.io/en/stable/marshmallow.fields.html#marshmallow.fields.Boolean.falsy) or
[truthy](https://marshmallow.readthedocs.io/en/stable/marshmallow.fields.html#marshmallow.fields.Boolean.truthy) string
representation of boolean values allowed by marshmallow

## Development

### Getting source code and installing the package with dev dependencies

  1. Clone the repository
  2. From the root directory, run: `pip install -e .[dev]` on Linux or `pip install -e ".[dev]"` on Windows

### Releasing the package

From the root directory, run `python setup.py upload`. This will build the package, create a git tag and publish on PyPI.

`__version__` in `staticjinjaplus/__version__.py` must be updated beforehand. It should adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

An associated GitHub release must be created following the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/EpocDotFr/staticjinjaplus",
    "name": "staticjinjaplus",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "static, website, site, generator, staticjinja, jinja, jinja2",
    "author": "Maxime \"Epoc\" Gross",
    "author_email": "contact.nospam@epoc.nospam.fr",
    "download_url": "https://files.pythonhosted.org/packages/7b/d4/4c4d219d196234b2d8e1c099a30e29dd1fb2a1fe36c7379319a602b622e9/staticjinjaplus-1.1.2.tar.gz",
    "platform": null,
    "description": "\n# staticjinjaplus\n\nA sweet spot between [staticjinja](https://staticjinja.readthedocs.io/en/latest/) and a full-blown static  site generator.\n\n![Python versions](https://img.shields.io/pypi/pyversions/staticjinjaplus.svg) ![Version](https://img.shields.io/pypi/v/staticjinjaplus.svg) ![License](https://img.shields.io/pypi/l/staticjinjaplus.svg)\n\n[PyPI](https://pypi.org/project/staticjinjaplus/) - [Documentation](https://github.com/EpocDotFr/staticjinjaplus?tab=readme-ov-file#readme) - [Source Code](https://github.com/EpocDotFr/staticjinjaplus) - [Issue Tracker](https://github.com/EpocDotFr/staticjinjaplus/issues) - [Changelog](https://github.com/EpocDotFr/staticjinjaplus/releases)\n\nCiting staticjinja's documentation, \"most static site generators are cumbersome to use\". While I fully agree, and while\nI find staticjinja to be an awesome piece of software, there's still some gaps here and there that needs to be filled in\norder to be able to generate a static website that will actually be ready for real world usage.\n\nstaticjinjaplus try to fill these gaps, while still being built on staticjinja and its philosophy: keep it simple, stupid.\nNote staticjinjaplus is opinionated: choices have been made to cover some use cases, but not all. This is not your average\nstatic site generator.\n\n## Features\n\nAll of [staticjinja](https://staticjinja.readthedocs.io/en/latest/)'s features, plus:\n\n  - Simple, file-based configuration to centralize *a handful* of configuration values\n  - Build improvements\n    - Set system locale before building anything (useful when formatting dates to localized strings)\n    - Automatically copy static files to output directory\n    - Define staticjinja contexts in config file\n    - Define [webassets](https://webassets.readthedocs.io/en/latest/) bundles to allow CSS/JS concatenation/minification\n    - Automatically minify XML (including HTML, RSS and Atom)/JSON output\n  - Jinja improvements\n    - A few new Jinja globals/filters to make your life easier\n    - Autoescape is enabled for XML, HTML, RSS and Atom templates\n  - Serve the generated site through a local HTTP server\n    - URL rewrite emulation (for HTML files)\n    - Custom HTTP error pages emulation\n    - IPv6 loopback address support\n  - Publish the generated site through rsync over SSH\n\n**Planned:**\n\n  - Generic support of Markdown-formatted templates collections (forget about the usual \"pages\" or \"articles/blog posts\" feature)\n\n## Prerequisites\n\n  - Python >= 3.9\n\n## Installation\n\nFrom PyPI:\n\n```bash\n$ pip install staticjinjaplus\n```\n\nLocally, after cloning/downloading the repo:\n\n```bash\n$ pip install .\n```\n\nA CLI (`staticjinjaplus`) will be made available upon installation.\n\n## Usage\n\n### Templates\n\nYou'll want to write your site's Jinja templates first: write them as usual. By default, staticjinjaplus searches for\nJinja templates in the `templates` directory where it is invoked. You can change that by using the `TEMPLATES_DIR`\n[configuration value](#configpy).\n\nstaticjinjaplus offers the following additional Jinja facilities.\n\n#### Globals\n\n| Name/signature                                  | Type     | Description                                                                                                                                                                                                         |\n|-------------------------------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `config`                                        | Dict     | Configuration values loaded from [`config.py`](#configpy) (defaults are guaranteed to be provided for built-in values). Only uppercase variables are loaded by staticjinjaplus                                      |\n| `url(path: str, absolute: bool = False) -> str` | Callable | Build (by default) a relative URL to a file located in the `OUTPUT_DIR` directory. Setting `absolute` to `True` prefixes the URL with `BASE_URL`. See [configuration values](#configpy)                             |\n| `icon(name: str) -> markupsafe.Markup`          | Callable | Return the file content of the given SVG icon, marked as safe to be rendered by Jinja. Icons must be saved in the form of `{ASSETS_DIR}/icons/{name}.svg`. Useful to embed SVG icons directly in the generated HTML |\n\n**Usage examples:**\n\n```html+jinja\n{{ config.BASE_URL }}         {# http://localhost:8080/ (by default) #}\n{{ config.MY_CUSTOM_CONFIG }} {# Whatever you defined in your config.py (uppercase variables only) #}\n\n{# url() doesn't care whether an extension is given or not #}\n{{ url('/about.html') }} {# /about.html #}\n{{ url('/about') }}      {# /about #}\n{{ url('about') }}       {# /about #}\n\n{# url() doesn't care about whether a static file is targeted or not #}\n{{ url('/images/logo.png') }} {# /images/logo.png #}\n{{ url('images/logo.png') }}  {# /images/logo.png #}\n\n{# URL is simply prefixed with BASE_URL when generating absolute URLs #}\n{{ url('/images/logo.png', absolute=True) }} {# http://localhost:8080/images/logo.png (by default) #}\n{{ url('images/logo.png', absolute=True) }}  {# http://localhost:8080/images/logo.png (by default) #}\n\n{{ icon('github') }} {# <svg xmlns=\"http://www.w3.org/2000/svg\" ... </svg> #}\n```\n\n#### Filters\n\n| Signature                                      | Description                                                                                                                                                                                                                                                         |\n|------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `<data: Dict>\\|tojsonm -> str`                 | Serialize the given dictionary to a JSON string. Automatically takes into account the `MINIFY_JSON` [configuration value](#configpy) to minify (or not) the resulting output. Useful for e.g serializing [Schema.org](https://schema.org/)'s JSON-LD-formatted data |\n| `<left: Dict>\\|dictmerge(right: Dict) -> Dict` | Merge two dictionaries. Does not modify existing ones, a new one will be created. Does **not** merge deeply                                                                                                                                                         |\n\n**Usage examples:**\n\n```html+jinja\n{{ dict(yes=True)|tojsonm }} {# With config['MINIFY_JSON'] == False:\n                                 {\n                                     \"yes\": true\n                                 }\n                             #}\n\n{{ dict(yes=True)|tojsonm }} {# With config['MINIFY_JSON'] == True:\n                                 {\"yes\":true}\n                             #}\n\n{{ dict(yes=True)|dictmerge(dict(no=False)) }} {# {\"yes\": True, \"no\": False} #}\n```\n\n### Command line interface\n\nThe `staticjinjaplus` CLI is your main and only way to interact with staticjinjaplus. The following commands are available.\n\n#### `staticjinjaplus build`\n\nBuild the site by rendering your templates from the `TEMPLATES_DIR` directory in the `OUTPUT_DIR` directory.\n\n**Options:**\n\n  - `-w, --watch` Automatically rebuild the site when templates are modified\n\nstaticjinjaplus will first try to set the system's locale to the first working locale identifier set in the `LOCALE`\n[configuration value](#configpy) (if set).\n\nIt will then copy the tree contained in the `STATIC_DIR` directory in the `OUTPUT_DIR`, as-is.\n\nstaticjinja will be then initialized with the given `CONTEXTS` and Jinja's `GLOBALS`/`FILTERS`/`EXTENSIONS`,\n[webassets bundles](https://webassets.readthedocs.io/en/latest/bundles.html) will be registered, and the actual rendering\nprocess is started.\n\n`.html`, `.xml`, `.rss`, `.atom` and `.json` template output will be automatically minified, according to the `MINIFY_XML`\nand `MINIFY_JSON` configuration values.\n\n#### `staticjinjaplus clean`\n\nDelete and recreate the `OUTPUT_DIR` directory.\n\n#### `staticjinjaplus publish`\n\n> [!NOTE]\n> This feature requires a Linux-like environment.\n\nApply configuration values override from [environment variables](#environment-variables), then successively run\n`staticjinjaplus build` and `staticjinjaplus clean` prior remotely syncing the `OUTPUT_DIR` directory content using\n`rsync` through SSH.\n\n#### `staticjinjaplus serve`\n\nServe the `OUTPUT_DIR` directory using Python's built-in HTTP server, plus a couple improvements:\n\n  - URL rewrite for HTML files is emulated, i.e. both `/about.html` and `/about` will work\n  - Custom HTTP error pages are emulated, if they are found saved as `{status code}.html` in the output directory\n  - The server will listen to both IPv4 *and* IPv6 loopback addresses if possible\n\nBy default, you can browse your generated site at http://localhost:8080/ or http://[::1]:8080/. Port can be changed\nby defining the `SERVE_PORT` [configuration value](#configpy).\n\n## Configuration\n\n### `config.py`\n\nYour project's configuration happens in a single `config.py` file in the root directory (where the `staticjinjaplus`\nCLI should be executed). You'll find the available configuration values below.\n\n> [!NOTE]\n>   - All paths are relative to the root directory, unless otherwise stated.\n>   - None of these configuration values are required, so is `config.py`.\n>   - Only uppercase variables are loaded by staticjinjaplus.\n\n| Name             | Type                                            | Default                          | Description                                                                                                                                                                                                                                                                            |\n|------------------|-------------------------------------------------|----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `LOCALE`         | List[str]                                       | `None`                           | Locale identifiers passed to [`locale.setlocale()`](https://docs.python.org/3.12/library/locale.html#locale.setlocale) before a build is executed. The first working identifier will be used                                                                                           |\n| `SERVE_PORT`     | int                                             | `8080`                           | Listening port of the HTTP server started by `staticjinjaplus serve`                                                                                                                                                                                                                   |\n| `BASE_URL`       | str                                             | `http://localhost:{SERVE_PORT}/` | Protocol and domain name to use to generate meaningful absolute URLs. Set host part to `[::1]` if you plan to use IPv6                                                                                                                                                                 |\n| `MINIFY_XML`     | bool                                            | `False`                          | Enable XML minification                                                                                                                                                                                                                                                                |\n| `MINIFY_JSON`    | bool                                            | `False`                          | Enable JSON minification                                                                                                                                                                                                                                                               |\n| `TEMPLATES_DIR`  | str                                             | `templates`                      | Directory containing the Jinja templates to be processed                                                                                                                                                                                                                               |\n| `OUTPUT_DIR`     | str                                             | `output`                         | Directory where the rendered site will be saved                                                                                                                                                                                                                                        |\n| `STATIC_DIR`     | str                                             | `static`                         | Directory containing static files                                                                                                                                                                                                                                                      |\n| `ASSETS_DIR`     | str                                             | `assets`                         | Directory containing assets, i.e. files that needs prior processing before being able to be used by the rendered site                                                                                                                                                                  |\n| `ASSETS_BUNDLES` | List[Tuple[str, Tuple[str,...], Dict[str, str]] | `[]`                             | [webassets bundles](https://webassets.readthedocs.io/en/latest/bundles.html) to be registered. These are passed to [`register()`](https://webassets.readthedocs.io/en/latest/environment.html#registering-bundles). Sources are relative to `ASSETS_DIR`, destinations to `OUTPUT_DIR` |\n| `CONTEXTS`       | List[Tuple[str, Any]]                           | `[]`                             | [staticjinja contexts](https://staticjinja.readthedocs.io/en/stable/user/advanced.html#loading-data) to be used by templates                                                                                                                                                           |\n| `GLOBALS`        | Dict                                            | `{}`                             | [jinja globals](https://jinja.palletsprojects.com/en/3.1.x/api/#jinja2.Environment.globals) to be made available in all templates                                                                                                                                                      |\n| `FILTERS`        | Dict                                            | `{}`                             | [jinja filters](https://jinja.palletsprojects.com/en/3.1.x/api/#jinja2.Environment.filters) to be made available in all templates                                                                                                                                                      |\n| `EXTENSIONS`     | List[Union[str, jinja2.ext.Extension]]          | `[]`                             | [jinja extensions](https://jinja.palletsprojects.com/en/3.1.x/extensions/) to load                                                                                                                                                                                                     |\n\n### Environment variables\n\nSome configuration values may/must be overridden by environment variables of the same name when publishing your site\n(`staticjinjaplus publish` command), typically in a deployment environment. You'll find the list below.\n\n| Name          | Type   | Required?                      | Default                           | Description                                                          |\n|---------------|--------|--------------------------------|-----------------------------------|----------------------------------------------------------------------|\n| `BASE_URL`    | str    | Yes                            |                                   | Protocol and domain name to use to generate meaningful absolute URLs |\n| `MINIFY_XML`  | bool \u00b9 | No, but activation recommended | `MINIFY_XML` configuration value  | Enable XML minification                                              |\n| `MINIFY_JSON` | bool \u00b9 | No, but activation recommended | `MINIFY_JSON` configuration value | Enable JSON minification                                             |\n| `SSH_USER`    | str    | Yes                            |                                   | SSH username                                                         |\n| `SSH_HOST`    | str    | Yes                            |                                   | SSH hostname                                                         |\n| `SSH_PORT`    | int    | No                             | `22`                              | SSH port                                                             |\n| `SSH_PATH`    | str    | Yes                            |                                   | Absolute path to the deployment directory on the SSH host            |\n\n\u00b9 Any [falsy](https://marshmallow.readthedocs.io/en/stable/marshmallow.fields.html#marshmallow.fields.Boolean.falsy) or\n[truthy](https://marshmallow.readthedocs.io/en/stable/marshmallow.fields.html#marshmallow.fields.Boolean.truthy) string\nrepresentation of boolean values allowed by marshmallow\n\n## Development\n\n### Getting source code and installing the package with dev dependencies\n\n  1. Clone the repository\n  2. From the root directory, run: `pip install -e .[dev]` on Linux or `pip install -e \".[dev]\"` on Windows\n\n### Releasing the package\n\nFrom the root directory, run `python setup.py upload`. This will build the package, create a git tag and publish on PyPI.\n\n`__version__` in `staticjinjaplus/__version__.py` must be updated beforehand. It should adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\nAn associated GitHub release must be created following the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.\n",
    "bugtrack_url": null,
    "license": "DBAD",
    "summary": "A sweet spot between staticjinja and a full-blown static site generator.",
    "version": "1.1.2",
    "project_urls": {
        "Changelog": "https://github.com/EpocDotFr/staticjinjaplus/releases",
        "Documentation": "https://github.com/EpocDotFr/staticjinjaplus?tab=readme-ov-file#readme",
        "Homepage": "https://github.com/EpocDotFr/staticjinjaplus",
        "Source": "https://github.com/EpocDotFr/staticjinjaplus",
        "Tracker": "https://github.com/EpocDotFr/staticjinjaplus/issues"
    },
    "split_keywords": [
        "static",
        " website",
        " site",
        " generator",
        " staticjinja",
        " jinja",
        " jinja2"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "48b63e517dd99e6da76c04c11aa3ffb14109e69c1a8377f3d25a170376dcabe9",
                "md5": "d0f2a3244b01c8380c9b07e25cebc7c6",
                "sha256": "dcc16dfbf166eab5fd4fd30e2b2630798bcb9ee5f84adf8ba63b5ca4b22c9938"
            },
            "downloads": -1,
            "filename": "staticjinjaplus-1.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d0f2a3244b01c8380c9b07e25cebc7c6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 13157,
            "upload_time": "2024-04-16T07:38:10",
            "upload_time_iso_8601": "2024-04-16T07:38:10.216953Z",
            "url": "https://files.pythonhosted.org/packages/48/b6/3e517dd99e6da76c04c11aa3ffb14109e69c1a8377f3d25a170376dcabe9/staticjinjaplus-1.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7bd44c4d219d196234b2d8e1c099a30e29dd1fb2a1fe36c7379319a602b622e9",
                "md5": "3ffd990a2820f09e3c38d27e99ef21f5",
                "sha256": "82a2476e8e73d0af83016d88bc8139315543843a1039d8fa92debbc22c4855fe"
            },
            "downloads": -1,
            "filename": "staticjinjaplus-1.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "3ffd990a2820f09e3c38d27e99ef21f5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 17145,
            "upload_time": "2024-04-16T07:38:12",
            "upload_time_iso_8601": "2024-04-16T07:38:12.056579Z",
            "url": "https://files.pythonhosted.org/packages/7b/d4/4c4d219d196234b2d8e1c099a30e29dd1fb2a1fe36c7379319a602b622e9/staticjinjaplus-1.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-16 07:38:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "EpocDotFr",
    "github_project": "staticjinjaplus",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "staticjinjaplus"
}
        
Elapsed time: 0.22929s