Skip to content

Latest commit

 

History

History
91 lines (66 loc) · 2.31 KB

index.rst

File metadata and controls

91 lines (66 loc) · 2.31 KB

Flask-FontAwesome

flask_fontawesome

Flask-FontAwesome adds FontAwesome to your Flask app.

Quick Start

from flask import Flask, render_template
from flask_fontawesome import FontAwesome

app = Flask(__name__)
fa = FontAwesome(app)

@app.route('/')
def index():
    return render_template('index.html')

app.run(host='127.0.0.1', port=8080)
<!DOCTYPE html>
<html>
  <head>
    {{ fontawesome_css() }}
    <title>FontAwesome Example</title>
  </head>
  <body>
    <h1>FontAwesome Example</h1>
    <p>This is an example of a <span class="fas fa-link"></span> link.</p>
    {{ fontawesome_js() }}
  </body>
</html>

API Docs

flask_fontawesome

FontAwesome

init_app

Jinja Functions

flask_fontawesome

fontawesome_html

fontawesome_css

fontawesome_js

Configuration

Flask-FontAwesome has a few configurations.

Option Default
FONTAWESOME_INCLUDE_V4_SHIMS False Whether or not to include the v4 shims.
FONTAWESOME_QUERYSTRING_REVVING True If True, serve FontAwesome resources with an appended query string to ensure cache busting on upgrade.
FONTAWESOME_SERVE_LOCAL True If True, serve from /static, else https://use.fontawesome.com.
FONTAWESOME_STYLES solid Type: list, options: all , regular, solid, brands. Which FontAwesome resources to load.
FONTAWESOME_TYPE webfont/css Options: webfont/css or svg/js.
FONTAWESOME_USE_MINIFIED True Whether or not to use the minified versions of the resources.

Full API

Full API Docs </api/modules> cover basic usage of this package.

api/modules