Skip to content

Instantly share code, notes, and snippets.

@bobrocke
Created November 29, 2015 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobrocke/d830b53977348068292e to your computer and use it in GitHub Desktop.
Save bobrocke/d830b53977348068292e to your computer and use it in GitHub Desktop.
Base Partial
<!-- /templates/partials/base.html.twig -->
<!DOCTYPE html>
<html lang="en">
<head>
{% block head %}
<meta charset="utf-8" />
<title>{{ site.title }}{% if header.title %} - {{ header.title }}{% endif %}</title>
{% include 'partials/metadata.html.twig' %}
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="icon" type="image/png" href="{{ url('theme://images/favicon.png', true) }}" />
<!-- Gather up the fonts -->
<link href="http://fonts.googleapis.com/css?family=Merriweather+Sans:700, 400, 300" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Merriweather:400,400italic,700,700italic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
<!-- Gather up the CSS -->
{% block the_stylesheets %}
{% do assets.add('theme://css/font-awesome.min.css', 109) %}
{% do assets.add('theme://css-compiled/bobmess.css', 108) %}
{% if page.header.validate %}
{% do assets.add('theme://css/parsley.css', 106) %}
{% endif %}
{% endblock %}
{{ assets.css() }}
<!-- Gather up the JavaScript -->
{% block the_javascripts %}
{% do assets.add('jquery', 110) %}
{% do assets.add('theme://js/captionate.js', 108) %}
{% do assets.add('theme://js/doubletaptogo.js', 106) %}
{% if page.header.validate %}
{% do assets.add('theme://js/parsley.js', 103) %}
{% endif %}
{% endblock %}
{{ assets.js() }}
{% if site.production %}
<!-- Start of Google Analytics Code -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-18982801-6', 'auto');
ga('send', 'pageview');
</script>
<!-- End of Google Analytics Code -->
{% endif %}
{% endblock head %}
</head>
<body>
<div class="page-block">
{% block header %}
<header>
<a href="{{ base_url_absolute }}"><img class="avatar" src="{{ theme_url }}/images/avatar.png" alt="Bob Rockefeller Photography" /></a>
<nav>
{% block header_extra %}{% endblock %}
{% block header_navigation %}
{% include 'partials/navigation.html.twig' %}
{% endblock %}
</nav>
</header>
{% endblock %}
{% block top %}
<div class="category-block" role="navigation">
<ul>
<li>
Topics:
</li>
<li>
<a href="{{ base_url }}/topic:admin">Admin</a>
<ul>
{% for item in topics_tags['admin'] %}
<li>
<a href="{{ base_url }}/topic:admin/tag:{{ item }}">{{ item|title }}</a>
</li>
{% endfor %}
</ul>
</li>
<li>
<a href="{{ base_url }}/topic:photography">Photography</a>
<ul>
{% for item in topics_tags['photography'] %}
<li>
<a href="{{ base_url }}/topic:photography/tag:{{ item }}">{{ item|title }}</a>
</li>
{% endfor %}
</ul>
</li>
<li>
<a href="{{ base_url }}/topic:web development">Web Development</a>
<ul>
{% for item in topics_tags['web development'] %}
<li>
<a href="{{ base_url }}/topic:web development/tag:{{ item }}">{{ item|title }}</a>
</li>
{% endfor %}
</ul>
</li>
</ul>
</div>
{% endblock %}
{% block showcase %}{% endblock %}
{% block main %}
<div class="content-block">
{% block content %}{% endblock %}
{% block pagination %}{% endblock %}
{% block comments %}{% endblock %}
</div>
{% endblock %}
{% block footer %}
<footer>
<span>Copyright &copy; 2015 &middot; Bob Rockefeller</span>
</footer>
{% endblock %}
</div>
{% block bottom %}
<!-- Start the image captionator -->
<script>
$(window).load(function () {
$('img.caption').captionate();
});
</script>
<!-- Start the mobile menu focus handler -->
<script>
$(function () {
$('.category-block li:has(ul)').doubleTapToGo();
});
</script>
<!-- Start the Disqus comment count code -->
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus_shortname }}';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
{% endblock %}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment