diff options
Diffstat (limited to 'themes/erdgeist/templates/base_helper.tmpl')
| -rw-r--r-- | themes/erdgeist/templates/base_helper.tmpl | 66 |
1 files changed, 31 insertions, 35 deletions
diff --git a/themes/erdgeist/templates/base_helper.tmpl b/themes/erdgeist/templates/base_helper.tmpl index bec4b78..7b44a95 100644 --- a/themes/erdgeist/templates/base_helper.tmpl +++ b/themes/erdgeist/templates/base_helper.tmpl | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | ## -*- coding: utf-8 -*- | 1 | ## -*- coding: utf-8 -*- |
| 2 | 2 | ||
| 3 | <%namespace name="notes" file="annotation_helper.tmpl" import="*" /> | 3 | <%namespace name="notes" file="annotation_helper.tmpl" import="*" /> |
| 4 | <%namespace name="feeds_translations" file="feeds_translations_helper.tmpl" import="*"/> | ||
| 4 | <%def name="html_headstart()"> | 5 | <%def name="html_headstart()"> |
| 5 | <!DOCTYPE html> | 6 | <!DOCTYPE html> |
| 6 | <html | 7 | <html |
| @@ -26,17 +27,26 @@ dir="rtl" \ | |||
| 26 | lang="${lang}"> | 27 | lang="${lang}"> |
| 27 | <head> | 28 | <head> |
| 28 | <meta charset="utf-8"> | 29 | <meta charset="utf-8"> |
| 30 | % if use_base_tag: | ||
| 31 | <base href="${abs_link(permalink)}"> | ||
| 32 | % endif | ||
| 29 | %if description: | 33 | %if description: |
| 30 | <meta name="description" content="${description}"> | 34 | <meta name="description" content="${description|h}"> |
| 31 | %endif | 35 | %endif |
| 32 | <meta name="viewport" content="width=device-width, initial-scale=1"> | 36 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 33 | <title>${title|striphtml} | ${blog_title|striphtml}</title> | 37 | %if title == blog_title: |
| 38 | <title>${blog_title|h}</title> | ||
| 39 | %else: | ||
| 40 | <title>${title|h} | ${blog_title|h}</title> | ||
| 41 | %endif | ||
| 34 | 42 | ||
| 35 | ${html_stylesheets()} | 43 | ${html_stylesheets()} |
| 36 | ${html_feedlinks()} | 44 | <meta name="theme-color" content="${theme_color}"> |
| 37 | %if permalink: | 45 | % if meta_generator_tag: |
| 38 | <link rel="canonical" href="${abs_link(permalink)}"> | 46 | <meta name="generator" content="Nikola (getnikola.com)"> |
| 39 | %endif | 47 | % endif |
| 48 | ${feeds_translations.head(classification=None, kind='index', other=False)} | ||
| 49 | <link rel="canonical" href="${abs_link(permalink)}"> | ||
| 40 | 50 | ||
| 41 | %if favicons: | 51 | %if favicons: |
| 42 | %for name, file, size in favicons: | 52 | %for name, file, size in favicons: |
| @@ -55,11 +65,10 @@ lang="${lang}"> | |||
| 55 | <link rel="next" href="${nextlink}" type="text/html"> | 65 | <link rel="next" href="${nextlink}" type="text/html"> |
| 56 | %endif | 66 | %endif |
| 57 | 67 | ||
| 58 | ${mathjax_config} | ||
| 59 | %if use_cdn: | 68 | %if use_cdn: |
| 60 | <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> | 69 | <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> |
| 61 | %else: | 70 | %else: |
| 62 | <!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5.js', lang)}"></script><![endif]--> | 71 | <!--[if lt IE 9]><script src="${url_replacer(permalink, '/assets/js/html5.js', lang, url_type)}"></script><![endif]--> |
| 63 | %endif | 72 | %endif |
| 64 | 73 | ||
| 65 | ${extra_head_data} | 74 | ${extra_head_data} |
| @@ -81,13 +90,10 @@ lang="${lang}"> | |||
| 81 | %else: | 90 | %else: |
| 82 | <script src="/assets/js/jquery.min.js"></script> | 91 | <script src="/assets/js/jquery.min.js"></script> |
| 83 | <script src="/assets/js/bootstrap.min.js"></script> | 92 | <script src="/assets/js/bootstrap.min.js"></script> |
| 84 | <script src="/assets/js/moment-with-locales.min.js"></script> | 93 | <script src="/assets/js/baguetteBox.min.js"></script> |
| 85 | <script src="/assets/js/fancydates.js"></script> | ||
| 86 | %endif | 94 | %endif |
| 87 | <script src="/assets/js/jquery.colorbox-min.js"></script> | 95 | <script src="/assets/js/moment-with-locales.min.js"></script> |
| 88 | %endif | 96 | <script src="/assets/js/fancydates.min.js"></script> |
| 89 | %if colorbox_locales[lang]: | ||
| 90 | <script src="/assets/js/colorbox-i18n/jquery.colorbox-${colorbox_locales[lang]}.js"></script> | ||
| 91 | %endif | 97 | %endif |
| 92 | ${social_buttons_code} | 98 | ${social_buttons_code} |
| 93 | </%def> | 99 | </%def> |
| @@ -106,30 +112,30 @@ lang="${lang}"> | |||
| 106 | <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet"> | 112 | <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet"> |
| 107 | %else: | 113 | %else: |
| 108 | <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"> | 114 | <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"> |
| 115 | <link href="/assets/css/baguetteBox.min.css" rel="stylesheet" type="text/css"> | ||
| 109 | %endif | 116 | %endif |
| 110 | <link href="/assets/css/rst.css" rel="stylesheet" type="text/css"> | 117 | <link href="/assets/css/rst_base.css" rel="stylesheet" type="text/css"> |
| 118 | <link href="/assets/css/nikola_rst.css" rel="stylesheet" type="text/css"> | ||
| 111 | <link href="/assets/css/code.css" rel="stylesheet" type="text/css"> | 119 | <link href="/assets/css/code.css" rel="stylesheet" type="text/css"> |
| 112 | <link href="/assets/css/colorbox.css" rel="stylesheet" type="text/css"> | ||
| 113 | <link href="/assets/css/theme.css" rel="stylesheet" type="text/css"> | 120 | <link href="/assets/css/theme.css" rel="stylesheet" type="text/css"> |
| 114 | %if has_custom_css: | 121 | %if has_custom_css: |
| 115 | <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> | 122 | <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> |
| 116 | %endif | 123 | %endif |
| 117 | %endif | 124 | %endif |
| 118 | % if annotations and post and not post.meta('noannotations'): | 125 | %if needs_ipython_css: |
| 119 | ${notes.css()} | 126 | <link href="/assets/css/ipython.min.css" rel="stylesheet" type="text/css"> |
| 120 | % elif not annotations and post and post.meta('annotations'): | 127 | <link href="/assets/css/nikola_ipython.css" rel="stylesheet" type="text/css"> |
| 121 | ${notes.css()} | 128 | %endif |
| 122 | % endif | ||
| 123 | </%def> | 129 | </%def> |
| 124 | 130 | ||
| 125 | <%def name="html_navigation_links()"> | 131 | <%def name="html_navigation_links()"> |
| 126 | %for url, text, icon in navigation_links[lang]: | 132 | %for url, text, icon in navigation_links[lang]: |
| 127 | % if isinstance(url, tuple): | 133 | % if isinstance(url, tuple): |
| 128 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">${text}<b class="caret"></b></a> | 134 | <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">${text} <b class="caret"></b></a> |
| 129 | <ul class="dropdown-menu"> | 135 | <ul class="dropdown-menu"> |
| 130 | %for suburl, text in url: | 136 | %for suburl, text in url: |
| 131 | % if rel_link(permalink, suburl) == "#": | 137 | % if rel_link(permalink, suburl) == "#": |
| 132 | <li class="active"><a href="${permalink}" title="${text}"><i class="${icon}"></i></a> | 138 | <li class="active"><a href="${permalink}">${text} <i class="${icon}"></i></a> |
| 133 | %else: | 139 | %else: |
| 134 | <li><a href="${suburl}" title="${text}"><i class="${icon}"></i></a> | 140 | <li><a href="${suburl}" title="${text}"><i class="${icon}"></i></a> |
| 135 | %endif | 141 | %endif |
| @@ -146,21 +152,11 @@ lang="${lang}"> | |||
| 146 | </%def> | 152 | </%def> |
| 147 | 153 | ||
| 148 | <%def name="html_feedlinks()"> | 154 | <%def name="html_feedlinks()"> |
| 149 | %if rss_link: | 155 | ${feeds_translations.head(classification=None, kind='index', other=False)} |
| 150 | ${rss_link} | ||
| 151 | %elif generate_rss: | ||
| 152 | %if len(translations) > 1: | ||
| 153 | %for language in translations: | ||
| 154 | <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}"> | ||
| 155 | %endfor | ||
| 156 | %else: | ||
| 157 | <link rel="alternate" type="application/rss+xml" title="RSS" href="${_link('rss', None)}"> | ||
| 158 | %endif | ||
| 159 | %endif | ||
| 160 | </%def> | 156 | </%def> |
| 161 | 157 | ||
| 162 | <%def name="html_translations()"> | 158 | <%def name="html_translations()"> |
| 163 | %for langname in translations.keys(): | 159 | %for langname in sorted(translations): |
| 164 | %if langname != lang: | 160 | %if langname != lang: |
| 165 | <li><a href="${abs_link(_link("root", None, langname))}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></li> | 161 | <li><a href="${abs_link(_link("root", None, langname))}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></li> |
| 166 | %endif | 162 | %endif |
