aboutsummaryrefslogtreecommitdiff
path: root/templates/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/index.html')
-rw-r--r--templates/index.html111
1 files changed, 64 insertions, 47 deletions
diff --git a/templates/index.html b/templates/index.html
index abc29c0..c17ee63 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -1,57 +1,74 @@
-{% import "macros/page.html" as page_macros %}
-{% import "macros/macros.html" as macros %}
-{% extends "base.html" %}
-{% block content %}
- <div>
- {% for page in paginator.pages %}
+{%- extends "base.html" %}
+
+{%- block seo %}
+ {{- super() }}
+
+ {%- if config.title %}
+ {%- set title = config.title %}
+ {%- else %}
+ {%- set title = "" %}
+ {%- endif %}
+
+ {%- if config.extra.title_addition and title %}
+ {%- set title_addition = title_separator ~ config.extra.title_addition %}
+ {%- elif config.extra.title_addition %}
+ {%- set title_addition = config.extra.title_addition %}
+ {%- else %}
+ {%- set title_addition = "" %}
+ {%- endif %}
+
+ {%- set description = config.description %}
+
+ {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }}
+{%- endblock seo %}
+
+{%- block content %}
+ <div>
+ {%- for page in paginator.pages %}
<article>
- {{ macros::title(page=page) }}
+ {{- macros::title(page=page) }}
<p>
- {% if page.summary -%}
- {{ page.summary | markdown(inline=true) | safe }}
- {% elif page.description %}
- {{ page.description | safe }}
- {% elif page.content %}
- {{ page.content | safe | striptags | truncate(length=150) }}
- {% elif page.extra.static_thumbnail %}
- {% endif -%}
+ {%- if page.summary %}
+ {{ page.summary | markdown(inline=true) | safe }}
+ {%- elif page.description %}
+ {{ page.description | safe }}
+ {%- elif page.content %}
+ {{ page.content | safe | striptags | truncate(length=150) }}
+ {%- elif page.extra.static_thumbnail %}
+ {%- endif %}
<a href="{{ page.permalink | safe }}">...more</a>
</p>
</article>
- {% endfor %}
- {% if paginator.previous or paginator.next %}
- <nav>
- <div>{% if paginator.previous %}<a href="{{ paginator.previous | safe }}">&#60; Previous</a> {% endif %} </div>
- <div>
- <ul>
- {% for pager in range(start=1, end=paginator.number_pagers+1) %}
- <li>
- {% if pager == 1 %}
- <a class="pag {% if paginator.current_index == pager %}cnav{% endif %}" href='{{ get_url(path="/", trailing_slash=true) }}'>
- {{pager}}
- </a>
- {% else %}
- <a class="pag {% if paginator.current_index == pager %}cnav{% endif %}" href='{{ paginator.base_url }}{{pager}}'>
- {{pager}}
- </a>
- {% endif -%}
- </li>
- {% endfor %}
- </ul>
- </div>
- <div>{% if paginator.next %}<a href="{{ paginator.next | safe }}">Next &#62;</a>{% endif %} </div>
- </nav>
- {% endif -%}
- </div>
- {% set section_item = get_section(path="_index.md") %}
- {% if config.extra.recent | default(value=true) %}
+ {%- endfor %}
+ {%- if paginator.previous or paginator.next %}
+ <nav>
+ <div>{%- if paginator.previous %}<a href="{{ paginator.previous | safe }}">&#60; Previous</a> {% endif %} </div>
+ <div>
+ <ul>
+ {%- for pager in range(start=1, end=paginator.number_pagers+1) %}
+ <li>
+ {%- if pager == 1 %}
+ <a class="pag {% if paginator.current_index == pager %}cnav{% endif %}" href='{{ get_url(path="/", trailing_slash=true) }}'>{{pager}}</a>
+ {%- else %}
+ <a class="pag {% if paginator.current_index == pager %}cnav{% endif %}" href='{{ paginator.base_url }}{{pager}}'>{{pager}}</a>
+ {%- endif %}
+ </li>
+ {%- endfor %}
+ </ul>
+ </div>
+ <div>{%- if paginator.next %}<a href="{{ paginator.next | safe }}">Next &#62;</a>{% endif %} </div>
+ </nav>
+ {%- endif %}
+ </div>
+ {%- set section_item = get_section(path="_index.md") %}
+ {%- if config.extra.recent | default(value=true) %}
<div class="toc">
<div class="toc-sticky">
<h3>Recent Posts</h3>
- {% for page in section_item.pages | slice(end=config.extra.recent_items) %}
- {{ page_macros::page_listing(page=page) }}
- {% endfor %}
+ {%- for page in section_item.pages | slice(end=config.extra.recent_items) %}
+ {{- page_macros::page_listing(page=page) }}
+ {%- endfor %}
</div>
</div>
- {% endif %}
-{% endblock content %}
+ {%- endif %}
+{%- endblock content %}