Skip to main content

Bracket is an Elegant static site generator.

Project description

Bracket

Bracket is an Elegant static site generator. It encapsulates Jinja2. Its biggest highlight is to render the static pages in the form of view function, and support real-time debugging. It can also support CSS framework, international routing and more functions through ecological extension.

The project is being updated continuously, and the official version has not been completed yet

Installing

Install and update using pip:

$ pip install bracket

A Simple Example

from bracket import WebSite
from jinja2 import Template

app = WebSite(__name__)

@app.pages("/")
def helloworld(context):
    return context({
    "title":"Welcome to Bracket",
    "content":Template('''
        <h1>{{ messages }}</h1>
        <img src="{{ bracket.res('/logo.png')}}">
    '''),
    "resources":{
        "messages":"Welcome to Bracket"
    }
})

app.dispatch("/")
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="Bracket & Jinja2 ">
    
    <title>Welcome to Bracket</title>
</head>
<body>
    <div id="bracketapp">
    
        <h1>Welcome to Bracket</h1>
        <img src="/static/logo.png">
        
    </div>
</body>
</html>

Contributing

How to contribute to this project, report problems, and build a development environment, please refer to the contribution guide

Links

License

The project is open source under MIT license in GitHub Community. No one is allowed to infringe the copyright. Please follow LICENSE

Project details


Download files

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

Source Distribution

bracket-0.1.3.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

bracket-0.1.3-py3.8.egg (17.9 kB view details)

Uploaded Source

File details

Details for the file bracket-0.1.3.tar.gz.

File metadata

  • Download URL: bracket-0.1.3.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for bracket-0.1.3.tar.gz
Algorithm Hash digest
SHA256 933b8b6d85505b0c01d5371ca1f1f1813811a3b97748c8e213181e03ffd54104
MD5 90c1099ea5f3b95ee0a7878909209097
BLAKE2b-256 99b5b8ea4f3479478e45ae08740ebda13ee31f8624ef7f8a0532e12da9b35caa

See more details on using hashes here.

File details

Details for the file bracket-0.1.3-py3.8.egg.

File metadata

  • Download URL: bracket-0.1.3-py3.8.egg
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for bracket-0.1.3-py3.8.egg
Algorithm Hash digest
SHA256 3d537351720b60675be174b74c0c6158d6c6b74e868c5ee92fd99a50d6fbe67b
MD5 0e7f8f5844d9270c5f59d8b4e25ec64d
BLAKE2b-256 1734b6e31e13581da6bfd87f0b8a9492704a6b418044e1d882a7a74d026cab35

See more details on using hashes here.

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