diff options
Diffstat (limited to 'nikola/data/themes/site')
| -rw-r--r-- | nikola/data/themes/site/README | 32 | ||||
| -rw-r--r-- | nikola/data/themes/site/assets/css/theme.css | 27 | ||||
| -rw-r--r-- | nikola/data/themes/site/engine | 1 | ||||
| -rw-r--r-- | nikola/data/themes/site/parent | 1 | ||||
| -rw-r--r-- | nikola/data/themes/site/templates/base.tmpl | 104 | ||||
| -rw-r--r-- | nikola/data/themes/site/templates/post.tmpl | 55 |
6 files changed, 220 insertions, 0 deletions
diff --git a/nikola/data/themes/site/README b/nikola/data/themes/site/README new file mode 100644 index 0000000..6cbc7dd --- /dev/null +++ b/nikola/data/themes/site/README @@ -0,0 +1,32 @@ +A more "website-done-with-bootstrap" theme, so to speak. This theme should +be completely compatible with the default theme and need no configuration +changes, except for the search form, as explained below. + + +Has a fixed navigation bar at top that displays: + +* Site name +* navigation links (taken from sidebar_links in dodo.py) +* search form (taken from SEARCH_FORM in dodo.py) +* Link to page's source code (if available) +* Floating social bar on the left margin +* The below-title block is displayed flush right + +This theme is used in Nikola's website: http://nikola.ralsina.com.ar + +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 +default duckduckgo search form: + + SEARCH_FORM = """ + <!-- Custom search --> + <form method="get" id="search" action="http://duckduckgo.com/" class="navbar-form pull-left"> + <input type="hidden" name="sites" value="%s"/> + <input type="hidden" name="k8" value="#444444"/> + <input type="hidden" name="k9" value="#D51920"/> + <input type="hidden" name="kt" value="h"/> + <input type="text" name="q" maxlength="255" placeholder="Search…" class="span2" style="margin-top: 4px;"/> + <input type="submit" value="DuckDuckGo Search" style="visibility: hidden;" /> + </form> + <!-- End of custom search --> + """ % BLOG_URL diff --git a/nikola/data/themes/site/assets/css/theme.css b/nikola/data/themes/site/assets/css/theme.css new file mode 100644 index 0000000..6b21e2e --- /dev/null +++ b/nikola/data/themes/site/assets/css/theme.css @@ -0,0 +1,27 @@ +body { margin-top: 50px;} + +#container { + width: 960px; + margin: 50 auto; +} + +#contentcolumn { + max-width: 760px; +} +#q { + width: 150px; +} + +img { + max-width: 90%; +} + +.postbox { + border-bottom: 2px solid darkgrey; + margin-bottom: 12px; +} + +.footerbox {padding: 15px; text-align: center; margin-bottom: 15px;} + +#addthisbox {top: 180px; left:10px;} + diff --git a/nikola/data/themes/site/engine b/nikola/data/themes/site/engine new file mode 100644 index 0000000..2951cdd --- /dev/null +++ b/nikola/data/themes/site/engine @@ -0,0 +1 @@ +mako diff --git a/nikola/data/themes/site/parent b/nikola/data/themes/site/parent new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/nikola/data/themes/site/parent @@ -0,0 +1 @@ +default diff --git a/nikola/data/themes/site/templates/base.tmpl b/nikola/data/themes/site/templates/base.tmpl new file mode 100644 index 0000000..46e9b39 --- /dev/null +++ b/nikola/data/themes/site/templates/base.tmpl @@ -0,0 +1,104 @@ +## -*- coding: utf-8 -*- +<!DOCTYPE html> +<html lang="${lang}"> +<head> + <meta charset="utf-8"> + <meta name="title" content="${title} | ${blog_title}" > + <meta name="description" content="${description}" > + <meta name="author" content="${blog_author}"> + <title>${title} | ${blog_title}</title> + <!-- Le styles --> + %if use_bundles: + <link href="/assets/css/all.css" rel="stylesheet" type="text/css"> + <script src="/assets/js/all.js" type="text/javascript"></script> + %else: + <link href="/assets/css/bootstrap.css" rel="stylesheet" type="text/css"> + <link href="/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css"> + <link href="/assets/css/rst.css" rel="stylesheet" type="text/css"> + <link href="/assets/css/code.css" rel="stylesheet" type="text/css"> + <link href="/assets/css/colorbox.css" rel="stylesheet" type="text/css"/> + <link href="/assets/css/theme.css" rel="stylesheet" type="text/css"/> + %if exists("files/assets/css/custom.css", not_empty=True): + <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> + %endif + <script src="/assets/js/jquery-1.7.2.min.js" type="text/javascript"></script> + <script src="/assets/js/jquery.colorbox-min.js" type="text/javascript"></script> + %endif + <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> + <!--[if lt IE 9]> + <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> + <![endif]--> + %if rss_link: + ${rss_link} + %else: + %for language in translations: + <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link("rss", None, lang)}"> + %endfor + %endif + <%block name="extra_head"> + </%block> +</head> +<body> +<!-- Menubar --> +<div class="navbar navbar-fixed-top"> + <div class="navbar-inner"> + <div class="container"> + <a class="brand" href="${abs_link('/')}"> + ${blog_title} + </a> + <ul class="nav"> + %for url, text in sidebar_links[lang]: + % if rel_link(permalink, url) == "#": + <li class="active"><a href="${url}">${text}</a> + %else: + <li><a href="${url}">${text}</a> + %endif + %endfor + </ul> + %if search_form: + ${search_form} + %endif + <ul class="nav pull-right"> + <%block name="belowtitle"> + %if len(translations) > 1: + <li> + %for langname in translations.keys(): + %if langname != lang: + <a href="${_link("index", None, langname)}">${messages[langname]["LANGUAGE"]}</a> + %endif + %endfor + </li> + %endif + </%block> + <%block name="sourcelink"> </%block> + </ul> + </div> + </div> +</div> +<!-- End of Menubar --> + +<div class="container" id="container"> + <!--Body content--> + <%block name="content"></%block> + <!--End of body content--> + <div class="footerbox"> + ${content_footer} + </div> +</div> + %if add_this_buttons: + <!-- addthis --> + <div id="addthisbox" class="addthis_bar addthis_bar_vertical addthis_bar_small"> + <div class="addthis_toolbox addthis_default_style"> + <span><a class="addthis_button_preferred_1"></a></span> + <span><a class="addthis_button_preferred_2"></a></span> + <span><a class="addthis_button_preferred_3"></a></span> + <span><a class="addthis_button_preferred_4"></a></span> + <span><a class="addthis_button_compact"></a></span> + </div> + </div> + <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4f7088a56bb93798"></script> + <!-- End of addthis --> + %endif +${analytics} + <script type="text/javascript">jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"80%",maxHeight:"80%",scalePhotos:true});</script> +</body> diff --git a/nikola/data/themes/site/templates/post.tmpl b/nikola/data/themes/site/templates/post.tmpl new file mode 100644 index 0000000..99c0f1f --- /dev/null +++ b/nikola/data/themes/site/templates/post.tmpl @@ -0,0 +1,55 @@ +## -*- coding: utf-8 -*- +<%inherit file="base.tmpl"/> +<%block name="content"> + <div class="postbox"> + <h1>${title}</h1> + % if link: + <p><a href='${link}'>${messages[lang]["Original site"]}</a></p> + % endif + <hr> + <small> + ${messages[lang]["Posted:"]} ${post.date} + + %if len(translations) > 1: + %for langname in translations.keys(): + %if langname != lang: + | + <a href="${post.permalink(langname)}">${messages[langname][u"Read in English"]}</a> + %endif + %endfor + %endif + %if post.tags: + | ${messages[lang]["More posts about"]} + %for tag in post.tags: + <a href="${_link("tag", tag, lang)}"><span class="badge badge-info">${tag}</span></a> + %endfor + %endif + </small> + <hr> + ${post.text(lang)} + <ul class="pager"> + %if post.prev_post: + <li class="previous"> + <a href="${post.prev_post.permalink(lang)}">${messages[lang]["← Previous post"]}</a> + </li> + %endif + %if post.next_post: + <li class="next"> + <a href="${post.next_post.permalink(lang)}">${messages[lang]["Next post →"]}</a> + </li> + %endif + </ul> + %if disqus_forum: + <div id="disqus_thread"></div> + <script type="text/javascript">var disqus_shortname="${disqus_forum}";var disqus_url="${post.permalink(absolute=True)}";(function(){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src="http://"+disqus_shortname+".disqus.com/embed.js";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)})();</script> + <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> + <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> + %endif +</%block> + +<%block name="sourcelink"> + <li> + <a href="${post.pagenames[lang]+post.source_ext()}">${messages[lang]["Source"]}</a> + </li> + </div> +</%block> |
