|
|
@@ -1,6 +1,6 @@ |
|
|
|
""" |
|
|
|
Module contains helper functions to be used inside the project's Jinja |
|
|
|
templates. |
|
|
|
.. module:: assets |
|
|
|
:synopsis: Helper functions for use inside the project's Jinja templates. |
|
|
|
""" |
|
|
|
|
|
|
|
from flask import Markup |
|
|
@@ -12,10 +12,12 @@ ASSET_HTML_TEMPLATES = { |
|
|
|
|
|
|
|
def tag(filename): |
|
|
|
""" |
|
|
|
Return HTML tag for asset named filename. |
|
|
|
Generate an HTML tag for a CSS/JS asset, based on its file extension. |
|
|
|
|
|
|
|
Return either a <script> or <link> tag to the file named filename, |
|
|
|
based on its extension. |
|
|
|
:param filename: The filename of the asset to create a tag for. |
|
|
|
|
|
|
|
:return: A string containing a `<source>` tag for JS files, and a `<link>` |
|
|
|
for CSS files. |
|
|
|
""" |
|
|
|
|
|
|
|
file_ext = filename.split(".")[-1] |
|
|
|