| 1 | <!doctype html> |
| 2 | <meta charset="utf-8"> |
| 3 | <link rel="stylesheet" href="{{ '/static/style.css'|asseturl }}"> |
| 4 | <link rel="stylesheet" href="{{ get_pygments_stylesheet()|url }}"> |
| 5 | <link rel="icon" href="{{ '/static/favicon.png'|asseturl }}"> |
| 6 | <title>{% block title %}Welcome{% endblock %} — Example</title> |
| 7 | <body> |
| 8 | <header> |
| 9 | <a href="{{ site.root|url }}" style="text-decoration: none;"> |
| 10 | <img class="logo" src="{{ site.root.attachments.images.get('logo.png').thumbnail(250)|url }}"> |
| 11 | <h1 class="logo">Example</h1> |
| 12 | </a> |
| 13 | <nav> |
| 14 | <ul class="nav navbar-nav"> |
| 15 | Basic Nav: |
| 16 | <li{% if this._path == '/' %} class="active"{% endif |
| 17 | %}><a href="{{ '/'|url }}">Welcome</a></li> |
| 18 | {% for href, title in [ |
| 19 | ['/blog', 'Blog'], |
| 20 | ['/projects', 'Projects'], |
| 21 | ['/about', 'About'] |
| 22 | ] %} |
| 23 | <li{% if this.is_child_of(href) %} class="active"{% endif |
| 24 | %}><a href="{{ href|url }}">{{ title }}</a></li> |
| 25 | {% endfor %} |
| 26 | </ul> |
| 27 | </nav> |
| 28 | </header> |
| 29 | |
| 30 | <div class="page"> |
| 31 | {% if this._path == '/' %} |
| 32 | <ul> |
| 33 | Available alts: |
| 34 | {% for alt in get_alts() %} |
| 35 | <li style="display: inline;"> |
| 36 | <a href="{{ '.'|url(alt=alt) }}">{{ alt }}</a> |
| 37 | </li> |
| 38 | {% endfor %} |
| 39 | </ul> |
| 40 | {{ this.alt_note }} |
| 41 | {% endif %} |
| 42 | |
| 43 | {% block body %}{% endblock %} |
| 44 | </div> |
| 45 | <footer> |
| 46 | Recursive tree navigation of this example site: |
| 47 | <button onclick="myFunction()">Toggle hide/show</button> |
| 48 | <ul id="footer-nav" class="tree-nav" style="display: none;"> |
| 49 | {% set root = site.get('/') %} |
| 50 | <li> |
| 51 | <a href="{{ root|url }}">{{ root.title }}</a> |
| 52 | </li> |
| 53 | {% for child in root.children recursive %} |
| 54 | <li> |
| 55 | <a href="{{ child|url }}">{{ child.path }}</a> |
| 56 | </li> |
| 57 | {% if child.children %} |
| 58 | <ul>{{ loop(child.children) }}</ul> |
| 59 | {% endif %} |
| 60 | {% endfor %} |
| 61 | </ul> |
| 62 | |
| 63 | <div> |
| 64 | © Copyright 2015 by Armin Ronacher. |
| 65 | </div> |
| 66 | </footer> |
| 67 | <script> |
| 68 | function myFunction() { |
| 69 | var x = document.getElementById("footer-nav"); |
| 70 | if (x.style.display === "none") { |
| 71 | x.style.display = "block"; |
| 72 | } else { |
| 73 | x.style.display = "none"; |
| 74 | } |
| 75 | } |
| 76 | </script> |
| 77 | </body> |