Commit b0e072e25f75dd6437172bd8482386529ef6c5c0

Authored by Paulo Costa
1 parent 84209caaac
Exists in master

added social media twig macros

templates/social_media.html.twig
... ... @@ -0,0 +1,36 @@
  1 +{# Social Media Utilities #}
  2 +
  3 +{% macro twitter_head(app_name,title,description,domain) %}
  4 +
  5 + <!-- Twitter card integration -->
  6 + <meta name="twitter:card" content="summary">
  7 + <meta name="twitter:site" content="@{{site}}">
  8 + <meta name="twitter:title" content="{{title}}">
  9 + <meta name="twitter:description" content="{{description }}">
  10 + <meta name="twitter:domain" content="{{domain}}">
  11 +{% endmacro %}
  12 +
  13 +{% macro facebook_head(title,url,logo,description) %}
  14 +
  15 + <meta property="og:title" content="{{title}}" />
  16 + <meta property="og:url" content="{{url}}" />
  17 + <meta property="og:image" content="{{logo}}">
  18 + <meta property="og:description" content="{{description}}" />
  19 + <meta property="og:type" content="website" />
  20 +
  21 +{% endmacro %}
  22 +
  23 +{% macro google_analytics_script(analytics_id) %}
  24 +
  25 + {% if analytics_id is defined %}
  26 + <script>
  27 + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  28 + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  29 + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  30 + })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  31 + ga('create', '{{ analytics_id }}', 'auto');
  32 + ga('send', 'pageview');
  33 + </script>
  34 + {% endif %}
  35 +
  36 +{% endmacro %}
... ...
templates/widgets.html.twig
  1 +{# Widgets and utilities for web applications #}
1 2  
2 3 {% macro language_dropdown(locales,curr_lang) %}
3 4 <li class="dropdown navbar-right">
... ...