Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pyx/flask-pure
Flask-Pure - a Flask extension for Pure.css
https://github.com/pyx/flask-pure
flask flask-extensions purecss
Last synced: about 1 month ago
JSON representation
Flask-Pure - a Flask extension for Pure.css
- Host: GitHub
- URL: https://github.com/pyx/flask-pure
- Owner: pyx
- License: other
- Created: 2016-02-22T10:28:46.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-19T04:11:09.000Z (over 7 years ago)
- Last Synced: 2024-10-13T16:09:11.221Z (2 months ago)
- Topics: flask, flask-extensions, purecss
- Language: CSS
- Homepage:
- Size: 54.7 KB
- Stars: 12
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
===========================================
Flask-Pure - a Flask extension for Pure.css
===========================================Flask-Pure is an extension to `Flask`_ that helps integrate `Pure.css`_ to your
Flask application... _Flask: http://flask.pocoo.org/
.. _Pure.css: http://purecss.io/Quick Start
===========0. Installation
.. code-block:: sh
pip install Flask-Pure
1. Configuration
.. code-block:: python
from flask import Flask, render_template
from flask_pure import Pureapp = Flask(__name__)
app.config['PURECSS_RESPONSIVE_GRIDS'] = True
app.config['PURECSS_USE_CDN'] = True
app.config['PURECSS_USE_MINIFIED'] = True
Pure(app)@app.route('/')
def hello():
return render_template('hello.html')if __name__ == '__main__':
app.run(debug=True)2. In :code:`templates/hello.html`:
.. code-block:: jinja
{% extends "pure/layout.html" %}
{% block title %}Hello world from flask-pure{% endblock %}{% block nav %}
{% endblock %}{% block content %}
Hello world
{% endblock %}3. Profit!
How It Works
============Once registered, this extension provides a template variable called
:code:`pure`, it has a property named :code:`css` that will be rendered
as HTML :code:`` tag to the Pure.css stylesheets either from free CDN or
be served from a bundled blueprint, also called :code:`pure`.A :code:`{{ pure.css }}` inside :code:`` tag is all you need.
A bare bone HTML5 template is also available as :code:`pure/layout.html`.
Please check out the example in code repository and documentation for details.License
=======BSD New, see LICENSE for details.
Links
=====- `Documentation `_
- `Issue Tracker `_
- `Source Package @ PyPI `_
- `Mercurial Repository @ bitbucket
`_- `Git Repository @ Github
`_- `Git Repository @ Gitlab
`_- `Development Version
`_