summaryrefslogtreecommitdiffstats
path: root/nikola/data/themes/base/templates/base_helper.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'nikola/data/themes/base/templates/base_helper.tmpl')
-rw-r--r--nikola/data/themes/base/templates/base_helper.tmpl91
1 files changed, 51 insertions, 40 deletions
diff --git a/nikola/data/themes/base/templates/base_helper.tmpl b/nikola/data/themes/base/templates/base_helper.tmpl
index 948cfba..18801ed 100644
--- a/nikola/data/themes/base/templates/base_helper.tmpl
+++ b/nikola/data/themes/base/templates/base_helper.tmpl
@@ -1,29 +1,25 @@
## -*- coding: utf-8 -*-
+<%namespace name="feeds_translations" file="feeds_translations_helper.tmpl" import="*"/>
<%def name="html_headstart()">
<!DOCTYPE html>
<html \
-prefix='\
-%if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']):
-og: http://ogp.me/ns# article: http://ogp.me/ns/article# \
-%endif
-%if comment_system == 'facebook':
-fb: http://ogp.me/ns/fb#
-%endif
-' \
-%if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']):
-vocab="http://ogp.me/ns" \
-%endif
+ prefix='\
+ og: http://ogp.me/ns# article: http://ogp.me/ns/article# \
+ %if comment_system == 'facebook':
+ fb: http://ogp.me/ns/fb# \
+ %endif
+ ' \
+ vocab="http://ogp.me/ns" \
% if is_rtl:
-dir="rtl" \
+ dir="rtl" \
% endif
\
lang="${lang}">
<head>
<meta charset="utf-8">
- <base href="${abs_link(permalink)}">
%if description:
- <meta name="description" content="${description}">
+ <meta name="description" content="${description|h}">
%endif
<meta name="viewport" content="width=device-width">
%if title == blog_title:
@@ -33,7 +29,11 @@ lang="${lang}">
%endif
${html_stylesheets()}
- ${html_feedlinks()}
+ <meta name="theme-color" content="${theme_color}">
+ % if meta_generator_tag:
+ <meta name="generator" content="Nikola (getnikola.com)">
+ % endif
+ ${feeds_translations.head(classification=None, kind='index', other=False)}
<link rel="canonical" href="${abs_link(permalink)}">
%if favicons:
@@ -53,29 +53,58 @@ lang="${lang}">
<link rel="next" href="${nextlink}" type="text/html">
%endif
- ${mathjax_config}
%if use_cdn:
- <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
+ <!--[if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script><![endif]-->
%else:
- <!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5.js', lang)}"></script><![endif]-->
+ <!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5shiv-printshiv.min.js', lang, url_type)}"></script><![endif]-->
%endif
${extra_head_data}
</%def>
<%def name="late_load_js()">
+ % if use_bundles:
+ % if use_cdn:
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.11.1/baguetteBox.min.js" integrity="sha256-ULQV01VS9LCI2ePpLsmka+W0mawFpEA0rtxnezUj4A4=" crossorigin="anonymous"></script>
+ <script src="/assets/js/all.js"></script>
+ % else:
+ <script src="/assets/js/all-nocdn.js"></script>
+ % endif
+ % else:
+ % if use_cdn:
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.11.1/baguetteBox.min.js" integrity="sha256-ULQV01VS9LCI2ePpLsmka+W0mawFpEA0rtxnezUj4A4=" crossorigin="anonymous"></script>
+ % else:
+ <script src="/assets/js/baguetteBox.min.js"></script>
+ % endif
+ % endif
+ % if date_fanciness != 0:
+ % if date_fanciness == 2:
+ <script src="https://polyfill.io/v3/polyfill.js?features=Intl.RelativeTimeFormat.%7Elocale.${luxon_locales[lang]}"></script>
+ % endif
+ % if use_cdn:
+ <script src="https://cdn.jsdelivr.net/npm/luxon@1.25.0/build/global/luxon.min.js" integrity="sha256-OVk2fwTRcXYlVFxr/ECXsakqelJbOg5WCj1dXSIb+nU=" crossorigin="anonymous"></script>
+ % else:
+ <script src="/assets/js/luxon.min.js"></script>
+ % endif
+ % if not use_bundles:
+ <script src="/assets/js/fancydates.min.js"></script>
+ % endif
+ % endif
${social_buttons_code}
</%def>
<%def name="html_stylesheets()">
%if use_bundles:
%if use_cdn:
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.11.1/baguetteBox.min.css" integrity="sha256-cLMYWYYutHkt+KpNqjg7NVkYSQ+E2VbrXsEvOqU7mL0=" crossorigin="anonymous">
<link href="/assets/css/all.css" rel="stylesheet" type="text/css">
%else:
<link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
%endif
%else:
- <link href="/assets/css/rst.css" rel="stylesheet" type="text/css">
+ <link href="/assets/css/baguetteBox.min.css" rel="stylesheet" type="text/css">
+ <link href="/assets/css/rst_base.css" rel="stylesheet" type="text/css">
+ <link href="/assets/css/nikola_rst.css" rel="stylesheet" type="text/css">
<link href="/assets/css/code.css" rel="stylesheet" type="text/css">
<link href="/assets/css/theme.css" rel="stylesheet" type="text/css">
%if has_custom_css:
@@ -88,34 +117,16 @@ lang="${lang}">
% endif
</%def>
+### This function is deprecated; use feed_helper directly.
<%def name="html_feedlinks()">
- %if rss_link:
- ${rss_link}
- %elif generate_rss:
- %if len(translations) > 1:
- %for language in sorted(translations):
- <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}">
- %endfor
- %else:
- <link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}">
- %endif
- %endif
- %if generate_atom:
- %if len(translations) > 1:
- %for language in sorted(translations):
- <link rel="alternate" type="application/atom+xml" title="Atom (${language})" href="${_link('index_atom', None, language)}">
- %endfor
- %else:
- <link rel="alternate" type="application/atom+xml" title="Atom" href="${_link('index_atom', None)}">
- %endif
- %endif
+ ${feeds_translations.head(classification=None, kind='index', other=False)}
</%def>
<%def name="html_translations()">
<ul class="translations">
%for langname in sorted(translations):
%if langname != lang:
- <li><a href="${abs_link(_link("root", None, langname))}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></li>
+ <li><a href="${_link("root", None, langname)}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></li>
%endif
%endfor
</ul>