DRY up layouts by creating a default
This commit is contained in:
parent
97b4571370
commit
7c1792312f
5 changed files with 118 additions and 241 deletions
47
_layouts/default.html
Normal file
47
_layouts/default.html
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{% capture absurl %}{{ site.url }}{{ site.baseurl }}{% endcapture %}
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ site.locale | slice: 0,2 }}">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
{% include head.html %}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="{{ layout.class }}">
|
||||||
|
|
||||||
|
{% include browser-upgrade.html %}
|
||||||
|
|
||||||
|
{% include navigation.html %}
|
||||||
|
|
||||||
|
{% if page.image.feature %}
|
||||||
|
<div class="image-wrap">
|
||||||
|
<img src=
|
||||||
|
{% if page.image.feature contains 'http' %}
|
||||||
|
"{{ page.image.feature }}"
|
||||||
|
{% else %}
|
||||||
|
"{{ page.image.feature | prepend: "/images/" | prepend: absurl }}"
|
||||||
|
{% endif %}
|
||||||
|
alt="{{ page.title }} feature image">
|
||||||
|
{% if page.image.credit %}
|
||||||
|
<span class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></span>
|
||||||
|
{% endif %}
|
||||||
|
</div><!-- /.image-wrap -->
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div id="main" role="main">
|
||||||
|
<div class="article-author-side">
|
||||||
|
{% include author-bio.html %}
|
||||||
|
</div>
|
||||||
|
{{ content }}
|
||||||
|
</div><!-- /#main -->
|
||||||
|
|
||||||
|
<div class="footer-wrap">
|
||||||
|
<footer>
|
||||||
|
{% include footer.html %}
|
||||||
|
</footer>
|
||||||
|
</div><!-- /.footer-wrap -->
|
||||||
|
|
||||||
|
{% include scripts.html %}
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,61 +1,17 @@
|
||||||
{% capture absurl %}{{ site.url }}{{ site.baseurl }}{% endcapture %}
|
---
|
||||||
|
layout: default
|
||||||
|
---
|
||||||
|
|
||||||
<!doctype html>
|
<div id="index">
|
||||||
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
|
<h3><a href="{{ absurl }}/posts/">Recent Posts</a></h3>
|
||||||
<!--[if (IE 7)&!(IEMobile)]><html class="no-js lt-ie9 lt-ie8" lang="en"><![endif]-->
|
{% for post in site.posts limit:5 %}
|
||||||
<!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]-->
|
<article>
|
||||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"><!--<![endif]-->
|
{% if post.link %}
|
||||||
<head>
|
<h2 class="link-post"><a href="{{ absurl }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a> <a href="{{ post.link }}" target="_blank" title="{{ post.title }}"><i class="fa fa-link"></i></a></h2>
|
||||||
{% include head.html %}
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="home">
|
|
||||||
|
|
||||||
{% include browser-upgrade.html %}
|
|
||||||
|
|
||||||
{% include navigation.html %}
|
|
||||||
|
|
||||||
{% if page.image.feature %}
|
|
||||||
<div class="image-wrap">
|
|
||||||
<img src=
|
|
||||||
{% if page.image.feature contains 'http' %}
|
|
||||||
"{{ page.image.feature }}"
|
|
||||||
{% else %}
|
{% else %}
|
||||||
"{{ page.image.feature | prepend: "/images/" | prepend: absurl }}"
|
<h2><a href="{{ absurl }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></h2>
|
||||||
|
<p>{{ post.excerpt | strip_html | truncate: 160 }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
alt="{{ page.title }} feature image">
|
</article>
|
||||||
{% if page.image.credit %}
|
{% endfor %}
|
||||||
<span class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></span>
|
</div><!-- /#index -->
|
||||||
{% endif %}
|
|
||||||
</div><!-- /.image-wrap -->
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div id="main" role="main">
|
|
||||||
<div class="article-author-side">
|
|
||||||
{% include author-bio.html %}
|
|
||||||
</div>
|
|
||||||
<div id="index">
|
|
||||||
<h3><a href="{{ absurl }}/posts/">Recent Posts</a></h3>
|
|
||||||
{% for post in site.posts limit:5 %}
|
|
||||||
<article>
|
|
||||||
{% if post.link %}
|
|
||||||
<h2 class="link-post"><a href="{{ absurl }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a> <a href="{{ post.link }}" target="_blank" title="{{ post.title }}"><i class="fa fa-link"></i></a></h2>
|
|
||||||
{% else %}
|
|
||||||
<h2><a href="{{ absurl }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></h2>
|
|
||||||
<p>{{ post.excerpt | strip_html | truncate: 160 }}</p>
|
|
||||||
{% endif %}
|
|
||||||
</article>
|
|
||||||
{% endfor %}
|
|
||||||
</div><!-- /#index -->
|
|
||||||
</div><!-- /#main -->
|
|
||||||
|
|
||||||
<div class="footer-wrap">
|
|
||||||
<footer>
|
|
||||||
{% include footer.html %}
|
|
||||||
</footer>
|
|
||||||
</div><!-- /.footer-wrap -->
|
|
||||||
|
|
||||||
{% include scripts.html %}
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,61 +1,21 @@
|
||||||
{% capture absurl %}{{ site.url }}{{ site.baseurl }}{% endcapture %}
|
---
|
||||||
|
layout: default
|
||||||
|
---
|
||||||
|
|
||||||
<!doctype html>
|
<article class="page">
|
||||||
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
|
<h1>{{ page.title }}</h1>
|
||||||
<!--[if (IE 7)&!(IEMobile)]><html class="no-js lt-ie9 lt-ie8" lang="en"><![endif]-->
|
<div class="article-wrap">
|
||||||
<!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]-->
|
{{ content }}
|
||||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"><!--<![endif]-->
|
{% if page.share != false %}
|
||||||
<head>
|
<hr />
|
||||||
{% include head.html %}
|
{% include social-share.html %}
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="page">
|
|
||||||
|
|
||||||
{% include browser-upgrade.html %}
|
|
||||||
|
|
||||||
{% include navigation.html %}
|
|
||||||
|
|
||||||
{% if page.image.feature %}
|
|
||||||
<div class="image-wrap">
|
|
||||||
<img src=
|
|
||||||
{% if page.image.feature contains 'http' %}
|
|
||||||
"{{ page.image.feature }}"
|
|
||||||
{% else %}
|
|
||||||
"{{ page.image.feature | prepend: "/images/" | prepend: absurl }}"
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
alt="{{ page.title }} feature image">
|
</div><!-- /.article-wrap -->
|
||||||
{% if page.image.credit %}
|
{% if site.owner.disqus-shortname and page.comments == true %}
|
||||||
<span class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></span>
|
<section id="disqus_thread"></section><!-- /#disqus_thread -->
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div><!-- /.image-wrap -->
|
</article>
|
||||||
|
|
||||||
|
{% if site.owner.disqus-shortname and page.comments == true %}
|
||||||
|
<section id="disqus_thread"></section><!-- /#disqus_thread -->
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div id="main" role="main">
|
|
||||||
<div class="article-author-side">
|
|
||||||
{% include author-bio.html %}
|
|
||||||
</div>
|
|
||||||
<article class="page">
|
|
||||||
<h1>{{ page.title }}</h1>
|
|
||||||
<div class="article-wrap">
|
|
||||||
{{ content }}
|
|
||||||
{% if page.share != false %}
|
|
||||||
<hr />
|
|
||||||
{% include social-share.html %}
|
|
||||||
{% endif %}
|
|
||||||
</div><!-- /.article-wrap -->
|
|
||||||
{% if site.owner.disqus-shortname and page.comments == true %}
|
|
||||||
<section id="disqus_thread"></section><!-- /#disqus_thread -->
|
|
||||||
{% endif %}
|
|
||||||
</article>
|
|
||||||
</div><!-- /#index -->
|
|
||||||
|
|
||||||
<div class="footer-wrap">
|
|
||||||
<footer>
|
|
||||||
{% include footer.html %}
|
|
||||||
</footer>
|
|
||||||
</div><!-- /.footer-wrap -->
|
|
||||||
|
|
||||||
{% include scripts.html %}
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
|
@ -1,67 +1,23 @@
|
||||||
{% capture absurl %}{{ site.url }}{{ site.baseurl }}{% endcapture %}
|
---
|
||||||
|
layout: default
|
||||||
|
---
|
||||||
|
|
||||||
<!doctype html>
|
<div id="index">
|
||||||
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
|
<h1>{{ page.title }}</h1>
|
||||||
<!--[if (IE 7)&!(IEMobile)]><html class="no-js lt-ie9 lt-ie8" lang="en"><![endif]-->
|
{% capture written_year %}'None'{% endcapture %}
|
||||||
<!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]-->
|
{% for post in site.posts %}
|
||||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"><!--<![endif]-->
|
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
|
||||||
<head>
|
{% if year != written_year %}
|
||||||
{% include head.html %}
|
<h3>{{ year }}</h3>
|
||||||
</head>
|
{% capture written_year %}{{ year }}{% endcapture %}
|
||||||
|
|
||||||
<body class="post-index">
|
|
||||||
|
|
||||||
{% include browser-upgrade.html %}
|
|
||||||
|
|
||||||
{% include navigation.html %}
|
|
||||||
|
|
||||||
{% if page.image.feature %}
|
|
||||||
<div class="image-wrap">
|
|
||||||
<img src=
|
|
||||||
{% if page.image.feature contains 'http' %}
|
|
||||||
"{{ page.image.feature }}"
|
|
||||||
{% else %}
|
|
||||||
"{{ page.image.feature | prepend: "/images/" | prepend: absurl }}"
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
alt="{{ page.title }} feature image">
|
<article>
|
||||||
{% if page.image.credit %}
|
{% if post.link %}
|
||||||
<span class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></span>
|
<h2 class="link-post"><a href="{{ absurl }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a> <a href="{{ post.link }}" target="_blank" title="{{ post.title }}"><i class="fa fa-link"></i></a></h2>
|
||||||
{% endif %}
|
{% else %}
|
||||||
</div><!-- /.image-wrap -->
|
<h2><a href="{{ absurl }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></h2>
|
||||||
{% endif %}
|
<p>{{ post.excerpt | strip_html | truncate: 160 }}</p>
|
||||||
|
|
||||||
<div id="main" role="main">
|
|
||||||
<div class="article-author-side">
|
|
||||||
{% include author-bio.html %}
|
|
||||||
</div>
|
|
||||||
<div id="index">
|
|
||||||
<h1>{{ page.title }}</h1>
|
|
||||||
{% capture written_year %}'None'{% endcapture %}
|
|
||||||
{% for post in site.posts %}
|
|
||||||
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
|
|
||||||
{% if year != written_year %}
|
|
||||||
<h3>{{ year }}</h3>
|
|
||||||
{% capture written_year %}{{ year }}{% endcapture %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<article>
|
</article>
|
||||||
{% if post.link %}
|
{% endfor %}
|
||||||
<h2 class="link-post"><a href="{{ absurl }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a> <a href="{{ post.link }}" target="_blank" title="{{ post.title }}"><i class="fa fa-link"></i></a></h2>
|
</div><!-- /#index -->
|
||||||
{% else %}
|
|
||||||
<h2><a href="{{ absurl }}{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></h2>
|
|
||||||
<p>{{ post.excerpt | strip_html | truncate: 160 }}</p>
|
|
||||||
{% endif %}
|
|
||||||
</article>
|
|
||||||
{% endfor %}
|
|
||||||
</div><!-- /#index -->
|
|
||||||
</div><!-- /#main -->
|
|
||||||
|
|
||||||
<div class="footer-wrap">
|
|
||||||
<footer>
|
|
||||||
{% include footer.html %}
|
|
||||||
</footer>
|
|
||||||
</div><!-- /.footer-wrap -->
|
|
||||||
|
|
||||||
{% include scripts.html %}
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,63 +1,30 @@
|
||||||
{% capture absurl %}{{ site.url }}{{ site.baseurl }}{% endcapture %}
|
---
|
||||||
|
layout: default
|
||||||
|
---
|
||||||
|
|
||||||
<!doctype html>
|
<article class="post">
|
||||||
<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
|
<div class="headline-wrap">
|
||||||
<!--[if (IE 7)&!(IEMobile)]><html class="no-js lt-ie9 lt-ie8" lang="en"><![endif]-->
|
{% if page.link %}
|
||||||
<!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]-->
|
<h1><a href="{{ page.link }}">{{ page.title }}</a></h1>
|
||||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"><!--<![endif]-->
|
|
||||||
<head>
|
|
||||||
{% include head.html %}
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="post">
|
|
||||||
|
|
||||||
{% include browser-upgrade.html %}
|
|
||||||
|
|
||||||
{% include navigation.html %}
|
|
||||||
|
|
||||||
{% if page.image.feature %}
|
|
||||||
<div class="image-wrap">
|
|
||||||
<img src=
|
|
||||||
{% if page.image.feature contains 'http' %}
|
|
||||||
"{{ page.image.feature }}"
|
|
||||||
{% else %}
|
{% else %}
|
||||||
"{{ page.image.feature | prepend: "/images/" | prepend: absurl }}"
|
<h1><a href="{{ absurl }}{{ page.url }}" rel="bookmark" title="{{ page.title }}">{{ page.title }}</a></h1>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
alt="{{ page.title }} feature image">
|
</div><!--/ .headline-wrap -->
|
||||||
{% if page.image.credit %}
|
<div class="article-wrap">
|
||||||
<span class="image-credit">Photo Credit: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></span>
|
{{ content }}
|
||||||
{% endif %}
|
<hr />
|
||||||
</div><!-- /.image-wrap -->
|
<footer role="contentinfo">
|
||||||
{% endif %}
|
{% if page.share != false %}{% include social-share.html %}{% endif %}
|
||||||
|
<p class="byline"><strong>{{ page.title }}</strong> was published on <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %d, %Y" }}</time>{% if page.modified %} and last modified on <time datetime="{{ page.modified | date: "%Y-%m-%d" }}">{{ page.modified | date: "%B %d, %Y" }}</time>{% endif %}.</p>
|
||||||
|
</footer>
|
||||||
|
</div><!-- /.article-wrap -->
|
||||||
|
|
||||||
<div id="main" role="main">
|
|
||||||
<div class="article-author-side">
|
|
||||||
{% include author-bio.html %}
|
|
||||||
</div>
|
|
||||||
<article class="post">
|
|
||||||
<div class="headline-wrap">
|
|
||||||
{% if page.link %}
|
|
||||||
<h1><a href="{{ page.link }}">{{ page.title }}</a></h1>
|
|
||||||
{% else %}
|
|
||||||
<h1><a href="{{ absurl }}{{ page.url }}" rel="bookmark" title="{{ page.title }}">{{ page.title }}</a></h1>
|
|
||||||
{% endif %}
|
|
||||||
</div><!--/ .headline-wrap -->
|
|
||||||
<div class="article-wrap">
|
|
||||||
{{ content }}
|
|
||||||
<hr />
|
|
||||||
<footer role="contentinfo">
|
|
||||||
{% if page.share != false %}{% include social-share.html %}{% endif %}
|
|
||||||
<p class="byline"><strong>{{ page.title }}</strong> was published on <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %d, %Y" }}</time>{% if page.modified %} and last modified on <time datetime="{{ page.modified | date: "%Y-%m-%d" }}">{{ page.modified | date: "%B %d, %Y" }}</time>{% endif %}.</p>
|
|
||||||
</footer>
|
|
||||||
</div><!-- /.article-wrap -->
|
|
||||||
{% if site.owner.disqus-shortname and page.comments == true %}
|
{% if site.owner.disqus-shortname and page.comments == true %}
|
||||||
<section id="disqus_thread"></section><!-- /#disqus_thread -->
|
<section id="disqus_thread"></section><!-- /#disqus_thread -->
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</article>
|
</article>
|
||||||
</div><!-- /#main -->
|
|
||||||
|
|
||||||
<div class="footer-wrap">
|
{% if site.related_posts.size > 0 %}
|
||||||
{% if site.related_posts.size > 0 %}
|
|
||||||
<div class="related-articles">
|
<div class="related-articles">
|
||||||
<h4>You might also enjoy <small class="pull-right">(<a href="{{ absurl }}/posts/">View all posts</a>)</small></h4>
|
<h4>You might also enjoy <small class="pull-right">(<a href="{{ absurl }}/posts/">View all posts</a>)</small></h4>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -67,13 +34,4 @@
|
||||||
</ul>
|
</ul>
|
||||||
<hr />
|
<hr />
|
||||||
</div><!-- /.related-articles -->
|
</div><!-- /.related-articles -->
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<footer>
|
|
||||||
{% include footer.html %}
|
|
||||||
</footer>
|
|
||||||
</div><!-- /.footer-wrap -->
|
|
||||||
|
|
||||||
{% include scripts.html %}
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Loading…
Reference in a new issue