diff options
| author | 2015-07-08 07:35:06 -0300 | |
|---|---|---|
| committer | 2015-07-08 07:35:06 -0300 | |
| commit | 055d72d76b44b0e627c8a17c48dbecd62e44197b (patch) | |
| tree | e2c8d5475477c46115461fe9547c1ee797873635 /nikola/data/themes/bootstrap | |
| parent | 61f3aad02cd6492cb38e41b66f2ed8ec56e98981 (diff) | |
| parent | b0b24795b24ee6809397fbbadf42f31f310a219f (diff) | |
Merge tag 'upstream/7.6.0'
Upstream version 7.6.0
Diffstat (limited to 'nikola/data/themes/bootstrap')
12 files changed, 97 insertions, 47 deletions
diff --git a/nikola/data/themes/bootstrap/README.md b/nikola/data/themes/bootstrap/README.md index 5340fe2..637caf5 100644 --- a/nikola/data/themes/bootstrap/README.md +++ b/nikola/data/themes/bootstrap/README.md @@ -3,7 +3,7 @@ A "website-done-with-bootstrap" theme, so to speak. Has a fixed navigation bar at top that displays the NAVIGATION_LINKS setting and supports nested menus. -This theme is used in Nikola's website: http://getnikola.com +This theme is used in Nikola's website: https://getnikola.com Important: To fit in the bootstrap navigation bar, the search form needs the navbar-form and pull-left CSS classes applied. Here is an example with Nikola's diff --git a/nikola/data/themes/bootstrap/assets/css/theme.css b/nikola/data/themes/bootstrap/assets/css/theme.css index 761dbb6..4fc31a8 100644 --- a/nikola/data/themes/bootstrap/assets/css/theme.css +++ b/nikola/data/themes/bootstrap/assets/css/theme.css @@ -1,11 +1,3 @@ -body { - padding-top: 60px; -} -@media (max-width: 979px) { - body { - padding-top: 0px; - } -} #container { width: 960px; margin: 50 auto; @@ -91,17 +83,6 @@ article.post-micro { font-size: 1.5em; } -/* fix anchors for headers */ -h1, h2, h3 { - margin-top: -40px; - padding-top: 60px; -} - -h4, h5, h6 { - margin-top: -50px; - padding-top: 60px; -} - .image-block { display: inline-block; } @@ -193,3 +174,32 @@ h4, h5, h6 { overflow: visible; clip: auto; } + +/* hat tip bootstrap/html5 boilerplate */ +@media print { + *, *:before, *:after { + font-family: Garamond, Junicode, serif; + } + + body { + font-size: 12pt; + } + + article .entry-title a[href]:after, + article .metadata a[href]:after, + article .tags a[href]:after { + content: ""; + } + + article .metadata .sourceline { + display: none; + } + + article .metadata .linkline a[href]:after { + content: " (" attr(href) ")"; + } + + .navbar { + display: none; + } +} diff --git a/nikola/data/themes/bootstrap/assets/js/colorbox-i18n/jquery.colorbox-bn.js b/nikola/data/themes/bootstrap/assets/js/colorbox-i18n/jquery.colorbox-bn.js new file mode 120000 index 0000000..9b995d8 --- /dev/null +++ b/nikola/data/themes/bootstrap/assets/js/colorbox-i18n/jquery.colorbox-bn.js @@ -0,0 +1 @@ +../../../../../../../bower_components/jquery-colorbox/i18n/jquery.colorbox-bn.js
\ No newline at end of file diff --git a/nikola/data/themes/bootstrap/assets/js/colorbox-i18n/jquery.colorbox-pt-BR.js b/nikola/data/themes/bootstrap/assets/js/colorbox-i18n/jquery.colorbox-pt-BR.js new file mode 120000 index 0000000..e20bd38 --- /dev/null +++ b/nikola/data/themes/bootstrap/assets/js/colorbox-i18n/jquery.colorbox-pt-BR.js @@ -0,0 +1 @@ +../../../../../../../bower_components/jquery-colorbox/i18n/jquery.colorbox-pt-BR.js
\ No newline at end of file diff --git a/nikola/data/themes/bootstrap/assets/js/colorbox-i18n/jquery.colorbox-pt-br.js b/nikola/data/themes/bootstrap/assets/js/colorbox-i18n/jquery.colorbox-pt-br.js deleted file mode 120000 index 76f289e..0000000 --- a/nikola/data/themes/bootstrap/assets/js/colorbox-i18n/jquery.colorbox-pt-br.js +++ /dev/null @@ -1 +0,0 @@ -../../../../../../../bower_components/jquery-colorbox/i18n/jquery.colorbox-pt-br.js
\ No newline at end of file diff --git a/nikola/data/themes/bootstrap/assets/js/jquery.js b/nikola/data/themes/bootstrap/assets/js/jquery.js new file mode 120000 index 0000000..966173b --- /dev/null +++ b/nikola/data/themes/bootstrap/assets/js/jquery.js @@ -0,0 +1 @@ +../../../../../../bower_components/jquery/dist/jquery.js
\ No newline at end of file diff --git a/nikola/data/themes/bootstrap/bundles b/nikola/data/themes/bootstrap/bundles index 089b036..38257d2 100644 --- a/nikola/data/themes/bootstrap/bundles +++ b/nikola/data/themes/bootstrap/bundles @@ -1,4 +1,4 @@ assets/css/all-nocdn.css=bootstrap.css,bootstrap-responsive.css,rst.css,code.css,colorbox.css,theme.css,custom.css assets/css/all.css=rst.css,code.css,colorbox.css,theme.css,custom.css -assets/js/all-nocdn.js=jquery.min.js,bootstrap.min.js,jquery.colorbox-min.js -assets/js/all.js=jquery.colorbox-min.js +assets/js/all-nocdn.js=jquery.min.js,bootstrap.min.js,jquery.colorbox-min.js,moment-with-locales.min.js,fancydates.js +assets/js/all.js=jquery.colorbox-min.js,moment-with-locales.min.js,fancydates.js diff --git a/nikola/data/themes/bootstrap/templates/base.tmpl b/nikola/data/themes/bootstrap/templates/base.tmpl index 9f2bb61..e848673 100644 --- a/nikola/data/themes/bootstrap/templates/base.tmpl +++ b/nikola/data/themes/bootstrap/templates/base.tmpl @@ -13,7 +13,7 @@ ${template_hooks['extra_head']()} <!-- Menubar --> -<div class="navbar navbar-fixed-top" id="navbar"> +<div class="navbar navbar-static-top" id="navbar"> <div class="navbar-inner"> <div class="container"> @@ -24,7 +24,7 @@ ${template_hooks['extra_head']()} <span class="icon-bar"></span> </a> - <a class="brand" href="${abs_link('/')}"> + <a class="brand" href="${abs_link(_link("root", None, lang))}"> %if logo_url: <img src="${logo_url}" alt="${blog_title}" id="logo"> %endif @@ -58,7 +58,7 @@ ${template_hooks['extra_head']()} </div> </div> <!-- End of Menubar --> -<div class="container-fluid" id="content"> +<div class="container-fluid" id="content" role="main"> <!--Body content--> <div class="row-fluid"> <div class="span2"></div> @@ -74,7 +74,13 @@ ${template_hooks['extra_head']()} ${template_hooks['page_footer']()} </div> ${base.late_load_js()} - <script>jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script> + <script>$('a.image-reference:not(.islink) img:not(.islink)').parent().colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script> + <!-- fancy dates --> + <script> + moment.locale("${momentjs_locales[lang]}"); + fancydates(${date_fanciness}, ${js_date_format}); + </script> + <!-- end fancy dates --> <%block name="extra_js"></%block> % if annotations and post and not post.meta('noannotations'): ${notes.code()} diff --git a/nikola/data/themes/bootstrap/templates/base_helper.tmpl b/nikola/data/themes/bootstrap/templates/base_helper.tmpl index 40cce39..4c62f8d 100644 --- a/nikola/data/themes/bootstrap/templates/base_helper.tmpl +++ b/nikola/data/themes/bootstrap/templates/base_helper.tmpl @@ -1,5 +1,6 @@ ## -*- coding: utf-8 -*- +<%namespace name="notes" file="annotation_helper.tmpl" import="*" /> <%def name="html_headstart()"> <!DOCTYPE html> <html @@ -68,19 +69,21 @@ lang="${lang}"> <%def name="late_load_js()"> %if use_bundles: %if use_cdn: - <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> - <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> + <script src="//maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> <script src="/assets/js/all.js"></script> %else: <script src="/assets/js/all-nocdn.js"></script> %endif %else: %if use_cdn: - <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> - <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> + <script src="//maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> %else: <script src="/assets/js/jquery.min.js"></script> <script src="/assets/js/bootstrap.min.js"></script> + <script src="/assets/js/moment-with-locales.min.js"></script> + <script src="/assets/js/fancydates.js"></script> %endif <script src="/assets/js/jquery.colorbox-min.js"></script> %endif @@ -94,14 +97,14 @@ lang="${lang}"> <%def name="html_stylesheets()"> %if use_bundles: %if use_cdn: - <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> + <link href="//maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> <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: %if use_cdn: - <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> + <link href="//maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> %else: <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"> <link href="/assets/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"> @@ -114,6 +117,10 @@ lang="${lang}"> <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> %endif %endif + % if needs_ipython_css: + <link href="/assets/css/ipython.min.css" rel="stylesheet" type="text/css"> + <link href="/assets/css/nikola_ipython.css" rel="stylesheet" type="text/css"> + % endif % if annotations and post and not post.meta('noannotations'): ${notes.css()} % elif not annotations and post and post.meta('annotations'): @@ -129,7 +136,7 @@ lang="${lang}"> <ul class="dropdown-menu"> %for suburl, text in url: % if rel_link(permalink, suburl) == "#": - <li class="active"><a href="${permalink}">${text}</a> + <li class="active"><a href="${permalink}">${text} <span class="sr-only">${messages("(active)", lang)}</span></a> %else: <li><a href="${suburl}">${text}</a> %endif @@ -137,7 +144,7 @@ lang="${lang}"> </ul> % else: % if rel_link(permalink, url) == "#": - <li class="active"><a href="${permalink}">${text}</a> + <li class="active"><a href="${permalink}">${text} <span class="sr-only">${messages("(active)", lang)}</span></a> %else: <li><a href="${url}">${text}</a> %endif @@ -157,12 +164,21 @@ lang="${lang}"> <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 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 </%def> <%def name="html_translations()"> %for langname in translations.keys(): %if langname != lang: - <li><a href="${_link("index", None, langname)}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></li> + <li><a href="${abs_link(_link("root", None, langname))}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a></li> %endif %endfor </%def> diff --git a/nikola/data/themes/bootstrap/templates/gallery.tmpl b/nikola/data/themes/bootstrap/templates/gallery.tmpl index 8ad4eb4..ab15587 100644 --- a/nikola/data/themes/bootstrap/templates/gallery.tmpl +++ b/nikola/data/themes/bootstrap/templates/gallery.tmpl @@ -7,7 +7,7 @@ <%block name="content"> ${ui.bar(crumbs)} %if title: - <h1>${title}</h1> + <h1>${title|h}</h1> %endif %if post: <p> @@ -40,6 +40,7 @@ ${comments.comment_form(None, permalink, title)} <%block name="extra_head"> ${parent.extra_head()} +<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml"> <style type="text/css"> .image-block { display: inline-block; diff --git a/nikola/data/themes/bootstrap/templates/post.tmpl b/nikola/data/themes/bootstrap/templates/post.tmpl index e55fcd5..8d9f88a 100644 --- a/nikola/data/themes/bootstrap/templates/post.tmpl +++ b/nikola/data/themes/bootstrap/templates/post.tmpl @@ -14,11 +14,14 @@ %endif <meta name="author" content="${post.author()}"> %if post.prev_post: - <link rel="prev" href="${post.prev_post.permalink()}" title="${post.prev_post.title()}" type="text/html"> + <link rel="prev" href="${post.prev_post.permalink()}" title="${post.prev_post.title()|h}" type="text/html"> %endif %if post.next_post: - <link rel="next" href="${post.next_post.permalink()}" title="${post.next_post.title()}" type="text/html"> + <link rel="next" href="${post.next_post.permalink()}" title="${post.next_post.title()|h}" type="text/html"> %endif + % if post.is_draft: + <meta name="robots" content="noindex"> + % endif ${helper.open_graph_metadata(post)} ${helper.twitter_card_information(post)} ${helper.meta_translations(post)} @@ -37,7 +40,7 @@ </nav> </aside> % if not post.meta('nocomments') and site_has_comments: - <section class="comments"> + <section class="comments hidden-print"> <h2>${messages("Comments")}</h2> ${comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path)} </section> diff --git a/nikola/data/themes/bootstrap/templates/tags.tmpl b/nikola/data/themes/bootstrap/templates/tags.tmpl index 9afeca7..ead3b0a 100644 --- a/nikola/data/themes/bootstrap/templates/tags.tmpl +++ b/nikola/data/themes/bootstrap/templates/tags.tmpl @@ -4,14 +4,24 @@ <%block name="content"> <h1>${title}</h1> % if cat_items: - <h2>${messages("Categories")}</h2> - <ul class="unstyled"> - % for text, link in cat_items: - % if text: - <li><a class="reference badge" href="${link}">${text}</a></li> + % if items: + <h2>${messages("Categories")}</h2> + % endif + % for text, full_name, path, link, indent_levels, indent_change_before, indent_change_after in cat_hierarchy: + % for i in range(indent_change_before): + <ul class="unstyled"> + % endfor + <li><a class="reference badge" href="${link}">${text}</a> + % if indent_change_after <= 0: + </li> % endif + % for i in range(-indent_change_after): + </ul> + % if i + 1 < len(indent_levels): + </li> + % endif + % endfor % endfor - </ul> % if items: <h2>${messages("Tags")}</h2> % endif @@ -19,7 +29,9 @@ % if items: <ul class="list-inline"> % for text, link in items: - <li><a class="reference badge" href="${link}">${text}</a></li> + % if text not in hidden_tags: + <li><a class="reference badge" href="${link}">${text}</a></li> + % endif % endfor </ul> % endif |
