aboutsummaryrefslogtreecommitdiff
path: root/templates/macros
diff options
context:
space:
mode:
Diffstat (limited to 'templates/macros')
-rw-r--r--templates/macros/head.html8
-rw-r--r--templates/macros/macros.html25
-rw-r--r--templates/macros/social.html2
3 files changed, 32 insertions, 3 deletions
diff --git a/templates/macros/head.html b/templates/macros/head.html
index 6216830..0107b83 100644
--- a/templates/macros/head.html
+++ b/templates/macros/head.html
@@ -6,9 +6,9 @@
{%- macro resource() %}
{%- if config.extra.fonts_load and config.extra.fonts %}{%- for i in config.extra.fonts %}
{%- if i.url is matching("^http[s]?://") %}
- <link rel="preload" as="style" href="{{ i.url | safe }}">
+ <link rel="preload" href="{{ i.url | safe }}" as="style" onload="this.onload=null;this.rel='stylesheet'" crossorigin="anonymous">
{%- else %}
- <link rel="preload" as="font" href="{{ get_url(path=i.url, trailing_slash=false, cachebust=true) }}">
+ <link rel="preload" href="{{ get_url(path=i.url, trailing_slash=false) }}" as="style" onload="this.onload=null;this.rel='stylesheet'" crossorigin="anonymous">
{%- endif %}
{%- endfor %}{%- endif %}
@@ -17,8 +17,12 @@
{%- endif %}
{%- if config.build_search_index %}
+ {%- if config.extra.js_search_index %}
<script defer type="text/javascript" src="{{ get_url(path=config.extra.js_search_index, trailing_slash=false, cachebust=true) | safe }}"></script>
+ {%- endif %}
+ {%- if config.extra.js_search %}
<script defer type="text/javascript" src="{{ get_url(path=config.extra.js_search, trailing_slash=false, cachebust=true) | safe }}"></script>
+ {%- endif %}
{%- endif %}
{%- if config.generate_feed %}
diff --git a/templates/macros/macros.html b/templates/macros/macros.html
index 82e856a..a639a73 100644
--- a/templates/macros/macros.html
+++ b/templates/macros/macros.html
@@ -19,3 +19,28 @@
{%- macro footer(page) %}
<h3><a href="#">Back to top</a></h3>
{%- endmacro footer %}
+
+
+{%- macro pagination(paginator)%}
+ {%- if paginator.number_pagers > 1 %}
+ <nav>
+ <div>{%- if paginator.previous %}<a href="{{ paginator.previous | safe }}">&#60; Previous</a> {% endif %} </div>
+ <div>
+ <ul>
+ {%- for i in range(start=1, end=paginator.number_pagers+1) %}
+ <li>
+ {%- if i == paginator.current_index %}
+ <a class="cnav" href="#">{{i}}</a>
+ {%- elif i > 1 %}
+ <a href="{{paginator.base_url | safe }}{{i ~ '/'}}">{{i}}</a>
+ {%- else %}
+ <a href="{{paginator.first | safe }}">{{i}}</a>
+ {%- endif %}
+ </li>
+ {%- endfor %}
+ </ul>
+ </div>
+ <div>{%- if paginator.next %}<a href="{{ paginator.next | safe }}">Next &#62;</a>{% endif %} </div>
+ </nav>
+ {%- endif %}
+{%- endmacro %}
diff --git a/templates/macros/social.html b/templates/macros/social.html
index 05eeb82..37c66af 100644
--- a/templates/macros/social.html
+++ b/templates/macros/social.html
@@ -40,7 +40,7 @@
{%- if social_config.youtube %}
<a href="https://www.youtube.com/channel/{{ social_config.youtube }}/" target="_blank"><span class="svg youtube" title="YouTube"></span></a>{% endif %}
{%- if social_config.buymeacoffee %}
- <a href="https://www.buymeacoffee.com/{{ social_config.buymeacoffee }}" target="_blank"><span class="svg buymeacoffee" title="Buy Me A Coffee"></span></a>{% endif %}
+ <a href="https://www.buymeacoffee.com/{{ social_config.buymeacoffee }}/" target="_blank"><span class="svg buymeacoffee" title="Buy Me A Coffee"></span></a>{% endif %}
{%- if social_config.github_sponsor %}
<a href="https://github.com/sponsors/{{ social_config.github_sponsor }}/" target="_blank"><span class="svg github-sponsor" title="GitHub Sponsor"></span></a>{% endif %}
</span>