<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="/style.css" type="text/css" media='all' />
    <!--<link rel="stylesheet" href="/styles.css">-->
    <link rel="stylesheet" href="/font-awesome/font-awesome.css"
    type="text/css" media='all'/>

    <style type="text/css" media="screen">
        html { margin-top: 32px !important; }
        * html body { margin-top: 32px !important; }
        @media screen and ( max-width: 782px ) {
            html { margin-top: 46px !important; }
            * html body { margin-top: 46px !important; }
        }
    </style>

    <title>{% if page.title %}{{ page.title }} - {% endif %}{{ config.site_name }}</title>
  </head>
  <body {% if page and page.meta.homepage %}
    class="home blog"
    {% else %}
    class="post-template-default single single-post single-format-standard"
    {% endif %}>
<div id="page" class="site">
	<header id="masthead" class="site-header">
		<div class="col-width header-wrap">
			<div class="site-heading">
				<h1 class="site-title"><a href="{{ config.site_url }}" rel="home">
					{{ config.site_name }}
				</a></h1>
				<nav class="social-navigation" role="navigation">
					<div class="social-menu-wrap">
			<ul id="menu-social-media" class="social-menu"><li id="menu-item-10" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-10"><a href="http://www.facebook.com"><span>Facebook</span></a></li>
			<li id="menu-item-11" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-11"><a href="http://www.linkedin.com"><span>LinkedIn</span></a></li>
			<li id="menu-item-12" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-12"><a href="http://www.twitter.com"><span>Twitter</span></a></li>
			<li id="menu-item-13" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-13"><a href="http://www.instagram.com"><span>Instagram</span></a></li>
					</div>
				</nav>
			</div>
		</div>
		<div class="col-width sub-header-wrap">
			<p class="site-description">{{ config.site_description }}</p>
		</div>
	</header>
	<div id="content" class="site-content clear">
        <div class="col-width">
		<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">
    {% if page and page.meta.homepage %}
            <div id="infinite-wrap">
        {% for nav_item in nav %}
            <!--<div class="section">
            <a href="{{ nav_item.url|url }}">
            {{ nav_item.content }}
            </a></div>-->
	
            {% if nav_item.children %}
            {% for nav_item in ((nav_item.children)|sort(attribute="meta.index",reverse=True))|paginate(page=page) %}
            {# % for nav_item in ((nav_item.children)|sort(attribute="meta.index",reverse=True))[page.start_idx:page.end_idx] % #}
			  {% if nav_item.is_page %}
                <article class="card post type-post status-publish format-standard hentry" >
                <div class="entry-image-section">
                <a href="{{ nav_item.url|url }}" class="entry-image-link">
                    <figure class="entry-image">
                        <img width="288" max-height="342" 
                        src="{{ nav_item.meta.featured_image }}">
                    </figure>
                </a>
                </div>
                <a href="{{ nav_item.url|url }}">
				<header id="masthead" class="entry-header">
				<h1 class="entry-title">{{ nav_item.title }}</h1>
				</header>
                </a>
                <div class="entry-content">
                {{ nav_item.content|truncate }}
                </div>
                <footer class="entry-meta">
                    <span class="entry-tags">
                    {% for tag in nav_item.meta.tags %}
                    <a href="{{ config.site_url|url}}tag/{{ tag }}/" rel="tag">{{ tag }}</a>
                    {% endfor %}
                    </span>
                </footer>
                </article>
			  {% else %}
					<a href="{{ nav_item.url|url }}">
					{{ nav_item.title }}
					</a>
			  {% endif %}
            {% endfor %}
            {% endif %}
        {% endfor %}
            </div>
            <nav class="navigation posts-navigation" role="navigation">
                <h2 class="screen-reader-text">Posts navigation</h2>
                <div class="nav-links">
                  {% if not page.last_page %}
                    <div class="nav-previous">
                        <a href="{{ config.site_url|url }}page/{{ page.page_num + 1 }}/">
                            "Older posts"
                        </a>
                    </div>
                  {% endif %}
                  {% if page.page_num == 2 %}
                    <div class="nav-next">
                        <a href="{{ config.site_url|url }}">
                            "Newer posts"
                        </a>
                    </div>
                  {% elif page.page_num > 2 %}
                    <div class="nav-next">
                        <a href="{{ config.site_url|url }}page/{{ page.page_num - 1 }}/">
                            "Newer posts"
                        </a>
                    </div>
                  {% endif %}
                </div>
            </nav>

    {% else %}
			<article class="post type-post status-publish format-standard
                has-post-thumbnail hentry clear-fix" style="height: auto
                !important;" >
			<header class="entry-header">
			<h1 class="entry-title">{{ page.title }}</h1>
            <div class="entry-meta">
                {% if page.meta.author %}<span class="author vcard">
                    <a href="{{ config.site_url|url }}author/{{ page.meta.author|url}}">
                        {{ page.meta.author }}</a></span>{% endif %}
                {% if page.meta.date %}<span class="entry-tags-date">
                    <a href="{{ page.url|url }}">
                    {{ page.meta.date }}
                    </a></span>{% endif %}
                {% if page.meta.category %}<span class="entry-categories">
                    <a href="{{ config.site_url|url }}/category/{{ page.meta.category|url }}">
                    {{ page.meta.category }}
                    </a></span>{% endif %}
                {% if page.edit_url %}<span class="edit-link">
                    <a href="{{ page.edit_url }}">
                        {{ page.edit_url }}</a></span>{% endif %}
            </div>
            <nav class="navigation post-navigation" role="navigation">
                <h2 class="screen-reader-text">Post navigation</h2>
                <div class="nav-links">
                    <div class="nav-previous">
                        <a href="{{ page.previous_page.url|url }}" rel="prev">
                            <span class="meta-nav" aria-hidden="true">
                                "Previous"
                            </span>
                        </a>
                    </div>
                    <div class="nav-next">
                        <a href="{{ page.next_page.url|url }}" rel="prev">
                            <span class="meta-nav" aria-hidden="true">
                                "Next"
                            </span>
                        </a>
                    </div>
                </div>
            </nav>
			</header>
            <div class="post-hero-image clear-fix">
                <figure class="entry-image">
                    <img width="100%"  
                    src="{{ page.meta.featured_image }}">
                </figure>
            </div>
			<div class="entry-content">
			{{ page.content }}
			</div>
			</article>
    {% endif %}
		</main>
        </div></div>
	</div>
</div>
		<hr>
		{% if 'search' in config['plugins'] %}
		Search stuff:
		{% endif %}
  </body>
</html>
