first commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{% extends "base.twig" %}
|
||||
|
||||
{% block content %}
|
||||
Sorry, we couldn't find what you're looking for.
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,9 @@
|
||||
{# This file demonstrates using most of the index.twig template and modifying
|
||||
just a small part. See `search.twig` for an example of another approach #}
|
||||
|
||||
{% extends "index.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<h3>This is my archive</h3>
|
||||
{{ parent() }}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends "base.twig" %}
|
||||
|
||||
{% block content %}
|
||||
{% for post in posts %}
|
||||
{% include ["tease-"~post.post_type~".twig", "tease.twig"] %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,45 @@
|
||||
{% block html_head_container %}
|
||||
|
||||
{% include 'html-header.twig' %}
|
||||
{% block head %}
|
||||
{% endblock %}
|
||||
</head>
|
||||
{% endblock %}
|
||||
|
||||
<body class="{{body_class}}" data-template="base.twig">
|
||||
<a class="skip-link screen-reader-text" href="#content">{{ _e( 'Skip to content') }}</a>
|
||||
<header class="header" >
|
||||
{% block header %}
|
||||
<div class="wrapper">
|
||||
<h1 class="hdr-logo" role="banner">
|
||||
<a class="hdr-logo-link" href="{{site.url}}" rel="home">{{site.name}}</a>
|
||||
</h1>
|
||||
<nav id="nav-main" class="nav-main" role="navigation">
|
||||
{% include "menu.twig" with {'items': menu.get_items} %}
|
||||
</nav><!-- #nav -->
|
||||
</div>
|
||||
{% endblock %}
|
||||
</header>
|
||||
|
||||
<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>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
{% block footer %}
|
||||
<footer id="footer">
|
||||
{% include 'footer.twig' %}
|
||||
</footer>
|
||||
{{ function('wp_footer') }}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,28 @@
|
||||
<div class="comment-form">
|
||||
<h3>Add comment</h3>
|
||||
<form class="comment-form" method="post" action="{{ site.site_url~'/wp-comments-post.php' }}">
|
||||
{% if user %}
|
||||
<input type="hidden" name="email" value="{{ user.email }}">
|
||||
<input type="hidden" name="author" value="{{ user.name }}">
|
||||
<input type="hidden" name="url" value="{{ user.link }}">
|
||||
{% else %}
|
||||
<label>Email<br>
|
||||
<input required name="email" type="email" id="email">
|
||||
</label>
|
||||
<label>Name<br>
|
||||
<input required name="author" type="text">
|
||||
</label>
|
||||
<label>Website<br>
|
||||
<input name="url" type="url">
|
||||
</label>
|
||||
{% endif %}
|
||||
<label>Comment<br>
|
||||
<textarea placeholder="Leave a comment..." name="comment" cols="60" rows="3"></textarea>
|
||||
</label>
|
||||
<input name="comment_post_ID" value="{{ post.id }}" type="hidden">
|
||||
<input name="comment_parent" value="{{ comment.ID|default('0') }}" type="hidden">
|
||||
<button type="submit" name="Submit" class="btn">Send</button>
|
||||
<button type="reset">Cancel</button>
|
||||
<p>Your comment will be revised by the site if needed.</p>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,21 @@
|
||||
<div class="blog-comment {{comment.comment_type}}" id="blog-comment-{{comment.ID}}">
|
||||
<h5 class="comment-author">{{comment.author.name}} says</h5>
|
||||
<div class="comment-content">{{comment.comment_content|wpautop}}</div>
|
||||
|
||||
<section class="comment-box">
|
||||
|
||||
<!-- comment form -->
|
||||
{% include "comment-form.twig" %}
|
||||
|
||||
<!-- child comments -->
|
||||
{% if post.comments %}
|
||||
<h4> replies </h4>
|
||||
<div class="comments">
|
||||
{% for cmt in comment.children %}
|
||||
{% include "comment.twig" with {comment:cmt} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</section>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
Copyright {{"now"|date('Y')}}
|
||||
@@ -0,0 +1,15 @@
|
||||
<!doctype html>
|
||||
<!--[if lt IE 9]><html class="no-js no-svg ie lt-ie9 lt-ie8 lt-ie7" {{ site.language_attributes }}> <![endif]-->
|
||||
<!--[if IE 9]><html class="no-js no-svg ie ie9 lt-ie9 lt-ie8" {{ site.language_attributes }}> <![endif]-->
|
||||
<!--[if gt IE 9]><!--><html class="no-js no-svg" {{ site.language_attributes }}> <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="{{ site.charset }}" />
|
||||
<meta name="description" content="{{ site.description }}">
|
||||
<link rel="stylesheet" href="{{ site.theme.link }}/style.css" type="text/css" media="screen" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="author" href="{{ site.theme.link }}/humans.txt" />
|
||||
<link rel="pingback" href="{{ site.pingback_url }}" />
|
||||
<link rel="profile" href="http://gmpg.org/xfn/11">
|
||||
{{function('wp_head')}}
|
||||
@@ -0,0 +1,11 @@
|
||||
{% extends "base.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<h2>{{ foo }}</h2>
|
||||
<p>{{ qux }}</p>
|
||||
{% for post in posts %}
|
||||
{% include ['tease-'~post.post_type~'.twig', 'tease.twig'] %}
|
||||
{% endfor %}
|
||||
|
||||
{% include 'partial/pagination.twig' with { pagination: posts.pagination({show_all: false, mid_size: 3, end_size: 2}) } %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,10 @@
|
||||
{% if menu %}
|
||||
<ul>
|
||||
{% for item in items %}
|
||||
<li class="{{ item.classes | join(' ') }}">
|
||||
<a target="{{ item.target }}" href="{{ item.link }}">{{ item.title }}</a>
|
||||
{% include "menu.twig" with {'items': item.children} %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends "base.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container content-wrapper">
|
||||
{{content}}
|
||||
</div><!-- /content-wrapper -->
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,14 @@
|
||||
{% extends "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>
|
||||
<div class="article-body">
|
||||
{{post.content}}
|
||||
</div>
|
||||
</section>
|
||||
</article>
|
||||
</div><!-- /content-wrapper -->
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,64 @@
|
||||
{% if posts.pagination.pages is not empty %}
|
||||
<nav class="pagination-block">
|
||||
<ul class="pagination">
|
||||
|
||||
{# First #}
|
||||
{% if posts.pagination.pages|first and posts.pagination.pages|first.current != true %}
|
||||
<li class="first btn">
|
||||
<a href="{{ posts.pagination.pages|first.link }}">First</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="first btn disabled">
|
||||
<button disabled>First</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{# Previous #}
|
||||
{% if posts.pagination.prev %}
|
||||
<li class="prev btn">
|
||||
<a href="{{ posts.pagination.prev.link }}">Previous</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="prev btn disabled">
|
||||
<button disabled>Previous</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{# Pages #}
|
||||
{% for page in posts.pagination.pages %}
|
||||
{% if page.link %}
|
||||
<li>
|
||||
<a href="{{ page.link }}" class="{{ page.class }}">{{ page.title }}</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="current">
|
||||
<span class="{{ page.class }}">{{ page.title }}</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{# Next #}
|
||||
{% if posts.pagination.next %}
|
||||
<li class="next btn">
|
||||
<a href="{{ posts.pagination.next.link }}">Next</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="next btn disabled">
|
||||
<button disabled>Next</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{# Last #}
|
||||
{% if posts.pagination.pages|last and posts.pagination.pages|last.current != true %}
|
||||
<li class="last btn">
|
||||
<a href="{{ posts.pagination.pages|last.link }}">Last</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="last btn disabled">
|
||||
<button disabled>Last</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,13 @@
|
||||
{# see `archive.twig` for an alternative strategy of extending templates #}
|
||||
{% extends "base.twig" %}
|
||||
|
||||
{% block content %}
|
||||
{# see `base.twig:27` for where this block's content will be inserted #}
|
||||
<div class="content-wrapper">
|
||||
{% for post in posts %}
|
||||
{% include ['tease-'~post.post_type~'.twig', 'tease.twig'] %}
|
||||
{% endfor %}
|
||||
|
||||
{% include 'partial/pagination.twig' with { pagination: posts.pagination({show_all: false, mid_size: 3, end_size: 2}) } %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1 @@
|
||||
Sidebar in Timber. Add HTML to your hearts content.
|
||||
@@ -0,0 +1,9 @@
|
||||
{% extends "base.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<form class="password-form" action="{{site.site_url}}/wp-login.php?action=postpass" method="post">
|
||||
<label for="pwbox-{{post.ID}}">Password:</label>
|
||||
<input class="password-box" name="post_password" id="pwbox-{{post.ID}}" type="password" placeholder="Password" size="20" maxlength="20" />
|
||||
<input class="password-btn" type="submit" name="Submit" value="Submit" />
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,39 @@
|
||||
{% extends "base.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="content-wrapper">
|
||||
<article class="post-type-{{ post.post_type }}" id="post-{{ post.ID }}">
|
||||
<img src="{{ post.thumbnail.src|resize(1200, 300) }}">
|
||||
<section class="article-content">
|
||||
<h1 class="article-h1">{{ post.title }}</h1>
|
||||
<a href="{{ post.link }}">{{ _e('edit') }}</a>
|
||||
<p class="blog-author">
|
||||
<span>By</span><a href="{{post.author.path}}"> {{ post.author.name }} </a><span>•</span> <time datetime="{{ post.date|date('Y-m-d H:i:s') }}">{{ post.date }}</time>
|
||||
</p>
|
||||
<div class="article-body">
|
||||
{{post.content}}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- comment box -->
|
||||
<section class="comment-box">
|
||||
<!-- comments -->
|
||||
<div class="comments">
|
||||
{% if post.comments %}
|
||||
<h3> comments </h3>
|
||||
{% for cmt in post.comments %}
|
||||
{% include "comment.twig" with {comment:cmt} %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if post.comment_status == "closed" %}
|
||||
<p> comments for this post are closed </p>
|
||||
{% else %}
|
||||
<!-- comment form -->
|
||||
{% include "comment-form.twig" %}
|
||||
{% endif %}
|
||||
</section>
|
||||
</article>
|
||||
</div><!-- /content-wrapper -->
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,9 @@
|
||||
{% extends "tease.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<h2 class="h2"><a href="{{post.link}}">{{post.title}}</a></h2>
|
||||
<p>{{post.preview.length(25)}}</p>
|
||||
{% if post.thumbnail.src %}
|
||||
<img src="{{post.thumbnail.src}}" />
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,9 @@
|
||||
<article class="tease tease-{{post.post_type}}" id="tease-{{post.ID}}">
|
||||
{% block content %}
|
||||
<h2 class="h2"><a href="{{post.link}}">{{post.title}}</a></h2>
|
||||
<p>{{post.preview}}</p>
|
||||
{% if post.get_thumbnail %}
|
||||
<img src="{{post.thumbnail.src}}" />
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
</article>
|
||||
Reference in New Issue
Block a user