{% import "Juice/macros/meta.html" as meta with context %} {#: HEADER() ----------------------------------------------------------- #} {%- macro head(title="%s", favicon="favicon.ico", charset="utf-8", add_social_graph=true, add_google_analytics=true, fontawesome_version="4.4.0") -%} {{ title | replace("%s", __.__META__["title"]) | safe }} {{ meta.meta("description", __.__META__["description"]) }} {{ set_favicon(favicon) }} {% if add_social_graph == true %} {{ meta.social_graph() }} {% endif %} {{ css('juice-all.css') }} {{ js('jquery.js') }} {{ js('juice-all.js') }} {% if add_google_analytics == true %} {{ google_analytics() }} {% endif %} {{ fontawesome(fontawesome_version) }} {%- endmacro -%} {#: CSS ------------------------------------------------------------- #} {%- macro css(file) %} {%- assets file %} {% endassets -%} {% endmacro -%} {#: JS--------------------------------------------------------------- #} {%- macro js(file) %} {%- assets file %} {% endassets -%} {% endmacro -%} {#:: static_file(url) ::#} {#:: Include static assets ::#} {%- macro static_file(url) -%} {%- if not url.startswith('http') and not url.startswith('//') -%} {%- set url = url_for('static', filename=url) -%} {%- endif -%} {{ url | safe }} {%- endmacro -%} {#: GOOGLE_ANALYTICS() ------------------------------------------------------ #} {% macro google_analytics(code=None) %} {% if not code %} {% set code = __.APPLICATION_GOOGLE_ANALYTICS_ID %} {% endif %} {% if code %} {% endif %} {% endmacro %} {# To create an image Has the option of making that image easyload params: - file: The image name - lazy: (bool) if True, it will be lazy loaded - static: (bool) it will be treated as static files if true - responsive: (bool) #} {% macro img(file, lazy=true, responsive=true, static=false) %} {% set _class = kwargs.pop('class', '') %} {% set _responsive = "responsive" if responsive else "" %} {% set blank_image_1x1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNgYAAAAAMAASsJTYQAAAAASUVORK5CYII=" %} {% set image_file = static_file(file) if static else file%} {% set lazy_class = "lazy" %} {% if lazy %} {% set img_src = blank_image_1x1 %} {% set data_src = image_file %} {% else %} {% set img_src = image_file %} {% set data_src = "" %} {% set lazy_class = "" %} {% endif %} {% endmacro %} {#: OEMBED ------------------------------------------------------------------ #} {# To #} {% macro oembed(url, title="") %} {{ title }} {% endmacro %} #------------------------------------------------------------------------------- {%- macro fontawesome(version="4.3.0") -%} {%- endmacro -%} {#: Favicon :#} {% macro set_favicon(path) %} {% endmacro %} {% macro bootswatch_theme(name) %} {{ css('Juice/bootswatch/%s.css' % name) }} {% endmacro %} {# IN EXPERIMENT #} {% macro oauth_providers(text="Signin with #provider", size="lg", btn_block=true) %} {% endmacro %} #-------------------------------------------------------------------------------