Skip to content

Commit

Permalink
Update all default templates with new layout/content
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdmyers committed Apr 29, 2019
1 parent fcae744 commit 472a21a
Show file tree
Hide file tree
Showing 9 changed files with 219 additions and 80 deletions.
13 changes: 13 additions & 0 deletions templates/footer.twig
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
<footer id="footer">
<div class="container">
<div class="row">
<div class="col-12">
<ul class="list-unstyled text-left footer-menu">
{% for item in footer_menu.get_items %}
<li class="{{ item.classes | join(' ') }} pr-3 d-inline-block">
<a href="{{ item.link }}" class="text-white">{{ item.title }}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
</footer>
29 changes: 19 additions & 10 deletions templates/html-header.twig
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
<!doctype html>
<!--[if lt IE 7]><html class="ie ie6 lt-ie9 lt-ie8 lt-ie7" {{site.language_attributes}}> <![endif]-->
<!--[if IE 7]><html class="ie ie7 lt-ie9 lt-ie8" {{site.language_attributes}}> <![endif]-->
<!--[if IE 8]><html class="ie ie8 lt-ie9" {{site.language_attributes}}> <![endif]-->
<!--[if gt IE 8]><!--><html {{site.language_attributes}}> <!--<![endif]-->
<!--[if lt IE 7]><html class="ie ie6 lt-ie9 lt-ie8 lt-ie7" {{ site.language_attributes }}> <![endif]-->
<!--[if IE 7]><html class="ie ie7 lt-ie9 lt-ie8" {{ site.language_attributes }}> <![endif]-->
<!--[if IE 8]><html class="ie ie8 lt-ie9" {{ site.language_attributes }}> <![endif]-->
<!--[if gt IE 8]><!--><html {{ site.language_attributes }}> <!--<![endif]-->
{% set page_title %}{% if wp_title %}{{ wp_title }} - {{ site.name }}{% else %}{{ site.name }}{% endif %}{% endset %}
<head>
<meta charset="{{site.charset}}">
<meta charset="{{ site.charset }}">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="{{site.description}}">
<link rel="pingback" href="{{site.pingback_url}}" />
<link rel="icon" href="{{site.theme.link}}/favicon.png">
<meta name="description" content="{{ site.description }}">

{% if options.google_site_verification %}
<meta name="google-site-verification" content="{{ options.google_site_verification }}">
{% endif %}

<link rel="pingback" href="{{ site.pingback_url }}">
<link rel="canonical" href="{{ site.link }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ site.theme.link }}/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="{{ site.theme.link }}/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="{{ site.theme.link }}/favicon-16x16.png">
<link rel="manifest" href="{{ site.theme.link }}/site.webmanifest">

<title>{{ page_title }}</title>

<link rel="stylesheet" href="{{site.theme.link}}/style.css" type="text/css" media="screen" />
<link rel="stylesheet" href="{{ site.theme.link }}/style.css" type="text/css" media="screen" />

{{function('wp_head')}}
{{ function('wp_head') }}
39 changes: 22 additions & 17 deletions templates/layouts/base.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,37 @@
{% endblock %}
</head>
{% endblock %}

<body class="{{body_class}}" data-template="base.twig">
<body class="{{ body_class }}" data-template="base.twig">
{% do action('body_top') %}
{% block nav %}
{% include 'nav.twig' %}
{% endblock nav %}
<div class="container">
<section id="content" role="main" class="content-wrapper">
{% if title %}<h1>{{title}}</h1>{% endif %}
<div class="wrapper {{sidebar_class}}">
{% block content %}
Sorry, no content
{% endblock %}
</div>
{% if sidebar %}
<aside class="layout-sidebar">
{{sidebar}}
</aside>
<section id="content" role="main" class="content-wrapper {{ wrapper_class }}">
<div class="wrapper {{sidebar_class}}">
{% if title %}
<div class="container">
<div class="row">
<div class="col-12">
<h1>{{ title }}</h1>
</div>
</div>
</div>
{% endif %}
</section>
</div><!-- /.container -->
{% block content %}
Sorry, no content
{% endblock %}
</div>
{% if sidebar %}
<aside class="layout-sidebar">
{{ sidebar }}
</aside>
{% endif %}
</section><!-- /.container -->
{% block footer %}
{% include 'footer.twig' %}
{{ function('wp_footer') }}
{% endblock %}
{% block javascripts %}
<script src="{{site.theme.link}}/assets/build/js/all.min.js"></script>
{% endblock %}
</body>
</html>
2 changes: 1 addition & 1 deletion templates/nav.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="{{ site.url }}">{{ site.name }}</a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ site.url }}">{{ site.name }}</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
Expand Down
12 changes: 11 additions & 1 deletion templates/pages/404.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{% extends "layouts/base.twig" %}

{% block content %}
Sorry, we couldn't find what you're looking for.
<section class="404 py-5" style="min-height: 500px;">
<div class="container">
<div class="row">
<div class="col-12 col-lg-8 offset-lg-1">
<h3 class="h1">Oops! Nothing to see here.</h3>
<p>The link you clicked may be broken or the page might have moved. Please double check your URL or use one of the links below.</p>
<p><a href="{{ site.link }}" class="btn btn-lg btn-primary">Go Home</a><a href="{{ site.link }}/contact" class="btn btn-lg btn-info ml-3">Contact Us</a></p>
</div>
</div>
</div>
</section>
{% endblock %}
49 changes: 44 additions & 5 deletions templates/pages/author.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,47 @@
{% extends "layouts/base.twig" %}
{% block content %}

{% for post in posts %}
{% include ["tease-"~post.post_type~".twig", "tease.twig"] %}
{% endfor %}

{% block content %}
<section class="news pb-5">
<div class="container">
<div class="row">
<div class="col-12">
<hr>
<div class="mb-5">
<div class="row">
{% for news_post in posts %}
<a class="news-item col-12 col-md-6" href="{{ news_post.link }}">
<h3>{{ news_post.title }}</h3>
<h5>{{ news_post.date }}</h5>
<p>{{ news_post.preview() }}</p>
<div class="category {{ news_post.category.slug }}">
{{ news_post.category }}
</div>
</a>
{% endfor %}
</div>
</div>
<hr>
<div class="tool-pagination">
{% if posts.pagination.prev %}
<a href="{{posts.pagination.prev.link}}" class="prev {{posts.pagination.prev.link|length ? '' : 'invisible'}}">Prev</a>
{% endif %}
<ul class="pages">
{% for page in posts.pagination.pages %}
<li>
{% if page.link %}
<a href="{{page.link}}" class="{{page.class}}">{{page.title}}</a>
{% else %}
<span class="{{page.class}}">{{page.title}}</span>
{% endif %}
</li>
{% endfor %}
</ul>
{% if posts.pagination.next %}
<a href="{{posts.pagination.next.link}}" class="next {{posts.pagination.next.link|length ? '' : 'invisible'}}">Next</a>
{% endif %}
</div>
</div>
</div>
</div>
</section>
{% endblock %}
63 changes: 57 additions & 6 deletions templates/pages/index.twig
Original file line number Diff line number Diff line change
@@ -1,10 +1,61 @@
{% extends "layouts/base.twig" %}

{% block content %}
<h2>{{foo}}</h2>
<p>{{qux}}</p>
{% for post in posts %}
{% include ['tease-'~post.post_type~'.twig', 'tease.twig'] %}
{% endfor %}

<section class="news pb-5">
<div class="container">
<div class="row">
<div class="col-12 col-lg-8 offset-lg-1">
<div class="mb-4 mt-5 text-left d-inline-block">News Archive</div>
<hr>
<div class="mb-5">
<div class="row">
{% for news_post in posts %}
<div class="col-12" data-location="{{ news_post.link }}">
<h3>{{ news_post.title }}</h3>
<h5>{{ news_post.date }}</h5>
<p>{{ news_post.preview() }}</p>
<div class="category {{ news_post.category.slug }}">
{{ news_post.category }}
</div>
</div>
{% endfor %}
</div>
</div>
<hr>
{% if pagination is not empty %}
<div class="tool-pagination">
{% if pagination.prev %}
<a href="{{ pagination.prev.link }}" class="prev btn d-inline-block mr-3 {{ pagination.prev.link|length ? '' : 'invisible' }}">Prev</a>
{% endif %}
<ul class="pages list-unstyled d-inline-block">
{% for page in pagination.pages %}
<li class="d-inline-block mx-1">
{% if page.link %}
<a href="{{ page.link }}" class="{{ page.class }}">{{ page.title }}</a>
{% else %}
<span class="{{ page.class }}">{{ page.title }}</span>
{% endif %}
</li>
{% endfor %}
</ul>
{% if pagination.next %}
<a href="{{ pagination.next.link }}" class="next btn d-inline-block ml-3 {{ pagination.next.link|length ? '' : 'invisible' }}">Next</a>
{% endif %}
</div>
{% endif %}
</div>
<div class="col-lg-3" style="margin-top: 150px;">
<h4>Archives</h4>
<ul class="list-unstyled">
{% for item in archives.items %}
<li><a href="{{item.link}}">{{item.name}}</a></li>
{% for child in item.children %}
<li class="child pl-3"><a href="{{child.link}}">{{child.name}}</a></li>
{% endfor %}
{% endfor %}
</ul>
</div>
</div>
</div>
</section>
{% endblock %}
23 changes: 12 additions & 11 deletions templates/pages/page.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

{% block content %}

<div class="content-wrapper">
<article class="post-type-{{post.post_type}}" id="post-{{post.ID}}">
<section class="article-content">
<h1 class="article-h1">{{post.title}}</h1>
<div class="container py-5">
<div class="col-12 col-lg-10 offset-lg-1">
<article class="post-type-{{post.post_type}}" id="post-{{post.ID}}">
<section class="article-content">
<h1 class="article-h1">{{post.title}}</h1>

<div class="article-body">
{{post.content}}
</div>
</section>

</article>
</div> <!-- /content-wrapper -->
<div class="article-body">
{{post.content}}
</div>
</section>
</article>
</div>
</div>

{% endblock %}
69 changes: 40 additions & 29 deletions templates/pages/single.twig
Original file line number Diff line number Diff line change
@@ -1,35 +1,46 @@
{% extends "layouts/base.twig" %}

{% block content %}

<div class="content-wrapper">
<article class="post-type-{{post.post_type}}" id="post-{{post.ID}}">
<section class="article-content">
<h1 class="article-h1">{{post.title}}</h1>

<p class="blog-author">
<span>By</span><a href="{{post.author.path}}"> {{ post.author.name }} </a><span>&bull;</span> {{ post.post_date|date}}
</p>

<div class="article-body">
{{post.content}}
<article class="post-type-{{post.post_type}}" id="post-{{post.ID}}">
<section class="article-content py-5">
<div class="container">
<div class="row">
<div class="col-12 col-lg-8 offset-lg-1">
{% if post.thumbnail.src %}
<img src="{{ post.thumbnail.src }}" alt="" class="mb-4 w-100">
{% endif %}
<h1 class="article-h1">{{ post.title }}</h1>
<h5 class="category {{ post.category.slug }}">{{ post.category }}</h5>
<p class="blog-author">
<span>By</span><a href="{{post.author.path}}"> {{ post.author.name }} </a><span>&bull;</span> {{ post.post_date | date }}
</p>
<div class="article-body">
{{ post.content }}
</div>
</div>
</div>
</section>
</div>
</section>
{% if post.comment_status != 'closed' %}
<section class="comments">
<div class="respond">
<h3 class="h2">Comments</h3>
{{ comment_form }}
</div>
<div class="responses">
{% for cmt in post.get_comments() %}
{% include "comment.twig" with {comment:cmt} %}
{% endfor %}
</div>

<section class="comments pb-5">
<section class="article-content">
<div class="container">
<div class="row">
<div class="col-12 col-lg-10 offset-lg-1">
<hr>
<div class="respond">
<h3 class="h2 text-lightblue">Comments</h3>
{{ comment_form }}
</div>
<div class="responses">
{% for cmt in post.get_comments() %}
{% include "comment.twig" with {comment:cmt} %}
{% endfor %}
</div>
</div>
</div>
</div>
</section>
</section>
{% endif %}
</article>
</div> <!-- /content-wrapper -->

{% endif %}
</article>
{% endblock %}

0 comments on commit 472a21a

Please sign in to comment.