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¶
-
class
flask_fontawesome.
FontAwesome
(app: flask.app.Flask = None)[source] -
init_app
(app: flask.app.Flask) → None[source]
-
Jinja Functions¶
-
flask_fontawesome.
fontawesome_html
() → markupsafe.Markup[source] Returns
Markup
of all the requested FontAwesome resources. This can be embedded in your Jinja templates to add FontAwesome to your site.
-
flask_fontawesome.
fontawesome_css
() → markupsafe.Markup[source] Returns :class`~flask.Markup` of the CSS FontAwesome resources.
Configuration¶
Flask-FontAwesome
has a few configurations.
Option |
Default |
|
---|---|---|
|
|
Whether or not to include the v4 shims. |
|
|
If |
|
|
If |
|
|
Type: |
|
|
Options: |
|
|
Whether or not to use the minified versions of the resources. |