diff options
| author | 2013-05-30 17:41:06 -0300 | |
|---|---|---|
| committer | 2013-05-30 17:41:06 -0300 | |
| commit | 0c4dfdec5b55b6064dccc38bbfb0a7c0699c895a (patch) | |
| tree | a6707225ccc559f7edf50ddd3fdc7fc85145c921 /nikola/data | |
| parent | 8b14a1e5b2ca574fdd4fd2377567ec98a110d4b6 (diff) | |
Imported Upstream version 5.4.4
Diffstat (limited to 'nikola/data')
66 files changed, 583 insertions, 988 deletions
diff --git a/nikola/data/themes/default/assets/css/code.css b/nikola/data/themes/default/assets/css/code.css deleted file mode 100644 index b1d7ace..0000000 --- a/nikola/data/themes/default/assets/css/code.css +++ /dev/null @@ -1,62 +0,0 @@ -pre { word-break: pre; white-space: pre; word-wrap: pre; overflow: auto; max-width: 100%;} -td.linenos { vertical-align: top; width: 4em;} -div.code > pre, .code -{ background: #f8f8f8; white-space: pre;} -.code .c { color: #008800; font-style: italic } /* Comment */ -.code .err { border: 1px solid #FF0000 } /* Error */ -.code .k { color: #AA22FF; font-weight: bold } /* Keyword */ -.code .o { color: #666666 } /* Operator */ -.code .cm { color: #008800; font-style: italic } /* Comment.Multiline */ -.code .cp { color: #008800 } /* Comment.Preproc */ -.code .c1 { color: #008800; font-style: italic } /* Comment.Single */ -.code .cs { color: #008800; font-weight: bold } /* Comment.Special */ -.code .gd { color: #A00000 } /* Generic.Deleted */ -.code .ge { font-style: italic } /* Generic.Emph */ -.code .gr { color: #FF0000 } /* Generic.Error */ -.code .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.code .gi { color: #00A000 } /* Generic.Inserted */ -.code .go { color: #808080 } /* Generic.Output */ -.code .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ -.code .gs { font-weight: bold } /* Generic.Strong */ -.code .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.code .gt { color: #0040D0 } /* Generic.Traceback */ -.code .kc { color: #AA22FF; font-weight: bold } /* Keyword.Constant */ -.code .kd { color: #AA22FF; font-weight: bold } /* Keyword.Declaration */ -.code .kp { color: #AA22FF } /* Keyword.Pseudo */ -.code .kr { color: #AA22FF; font-weight: bold } /* Keyword.Reserved */ -.code .kt { color: #AA22FF; font-weight: bold } /* Keyword.Type */ -.code .m { color: #666666 } /* Literal.Number */ -.code .s { color: #BB4444 } /* Literal.String */ -.code .na { color: #BB4444 } /* Name.Attribute */ -.code .nb { color: #AA22FF } /* Name.Builtin */ -.code .nc { color: #0000FF } /* Name.Class */ -.code .no { color: #880000 } /* Name.Constant */ -.code .nd { color: #AA22FF } /* Name.Decorator */ -.code .ni { color: #999999; font-weight: bold } /* Name.Entity */ -.code .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ -.code .nf { color: #00A000 } /* Name.Function */ -.code .nl { color: #A0A000 } /* Name.Label */ -.code .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ -.code .nt { color: #008000; font-weight: bold } /* Name.Tag */ -.code .nv { color: #B8860B } /* Name.Variable */ -.code .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ -.code .mf { color: #666666 } /* Literal.Number.Float */ -.code .mh { color: #666666 } /* Literal.Number.Hex */ -.code .mi { color: #666666 } /* Literal.Number.Integer */ -.code .mo { color: #666666 } /* Literal.Number.Oct */ -.code .sb { color: #BB4444 } /* Literal.String.Backtick */ -.code .sc { color: #BB4444 } /* Literal.String.Char */ -.code .sd { color: #BB4444; font-style: italic } /* Literal.String.Doc */ -.code .s2 { color: #BB4444 } /* Literal.String.Double */ -.code .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ -.code .sh { color: #BB4444 } /* Literal.String.Heredoc */ -.code .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ -.code .sx { color: #008000 } /* Literal.String.Other */ -.code .sr { color: #BB6688 } /* Literal.String.Regex */ -.code .s1 { color: #BB4444 } /* Literal.String.Single */ -.code .ss { color: #B8860B } /* Literal.String.Symbol */ -.code .bp { color: #AA22FF } /* Name.Builtin.Pseudo */ -.code .vc { color: #B8860B } /* Name.Variable.Class */ -.code .vg { color: #B8860B } /* Name.Variable.Global */ -.code .vi { color: #B8860B } /* Name.Variable.Instance */ -.code .il { color: #666666 } /* Literal.Number.Integer.Long */ diff --git a/nikola/data/themes/default/assets/css/slides.css b/nikola/data/themes/default/assets/css/slides.css deleted file mode 100644 index 272c83e..0000000 --- a/nikola/data/themes/default/assets/css/slides.css +++ /dev/null @@ -1,11 +0,0 @@ -.slides_container { - display: block; - margin-left: auto; - margin-right: auto; - max-width: 80%; - width: 400px; - height: 300px; -} -.slide-current { - font-weight: bold; -} diff --git a/nikola/data/themes/default/assets/css/theme.css b/nikola/data/themes/default/assets/css/theme.css index 0523ce9..08a71f3 100644 --- a/nikola/data/themes/default/assets/css/theme.css +++ b/nikola/data/themes/default/assets/css/theme.css @@ -60,3 +60,14 @@ blockquote p, blockquote { font-weight: 300; line-height: 1.25; } + +ul.bricks > li { + display: inline; + background-color: lightblue; + padding: 8px; + border-radius: 5px; + line-height: 3; + white-space:nowrap; + margin: 3px; +} + diff --git a/nikola/data/themes/default/assets/js/slides.jquery.js b/nikola/data/themes/default/assets/js/slides.jquery.js deleted file mode 100755 index f2e09c8..0000000 --- a/nikola/data/themes/default/assets/js/slides.jquery.js +++ /dev/null @@ -1,555 +0,0 @@ -/* -* Slides, A Slideshow Plugin for jQuery -* Intructions: http://slidesjs.com -* By: Nathan Searles, http://nathansearles.com -* Version: 1.1.9 -* Updated: September 5th, 2011 -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -(function($){ - $.fn.slides = function( option ) { - // override defaults with specified option - option = $.extend( {}, $.fn.slides.option, option ); - - return this.each(function(){ - // wrap slides in control container, make sure slides are block level - $('.' + option.container, $(this)).children().wrapAll('<div class="slides_control"/>'); - - var elem = $(this), - control = $('.slides_control',elem), - total = control.children().size(), - width = control.children().outerWidth(), - height = control.children().outerHeight(), - start = option.start - 1, - effect = option.effect.indexOf(',') < 0 ? option.effect : option.effect.replace(' ', '').split(',')[0], - paginationEffect = option.effect.indexOf(',') < 0 ? effect : option.effect.replace(' ', '').split(',')[1], - next = 0, prev = 0, number = 0, current = 0, loaded, active, clicked, position, direction, imageParent, pauseTimeout, playInterval; - - // is there only one slide? - if (total < 2) { - // Fade in .slides_container - $('.' + option.container, $(this)).fadeIn(option.fadeSpeed, option.fadeEasing, function(){ - // let the script know everything is loaded - loaded = true; - // call the loaded funciton - option.slidesLoaded(); - }); - // Hide the next/previous buttons - $('.' + option.next + ', .' + option.prev).fadeOut(0); - return false; - } - - // animate slides - function animate(direction, effect, clicked) { - if (!active && loaded) { - active = true; - // start of animation - option.animationStart(current + 1); - switch(direction) { - case 'next': - // change current slide to previous - prev = current; - // get next from current + 1 - next = current + 1; - // if last slide, set next to first slide - next = total === next ? 0 : next; - // set position of next slide to right of previous - position = width*2; - // distance to slide based on width of slides - direction = -width*2; - // store new current slide - current = next; - break; - case 'prev': - // change current slide to previous - prev = current; - // get next from current - 1 - next = current - 1; - // if first slide, set next to last slide - next = next === -1 ? total-1 : next; - // set position of next slide to left of previous - position = 0; - // distance to slide based on width of slides - direction = 0; - // store new current slide - current = next; - break; - case 'pagination': - // get next from pagination item clicked, convert to number - next = parseInt(clicked,10); - // get previous from pagination item with class of current - prev = $('.' + option.paginationClass + ' li.'+ option.currentClass +' a', elem).attr('href').match('[^#/]+$'); - // if next is greater then previous set position of next slide to right of previous - if (next > prev) { - position = width*2; - direction = -width*2; - } else { - // if next is less then previous set position of next slide to left of previous - position = 0; - direction = 0; - } - // store new current slide - current = next; - break; - } - - // fade animation - if (effect === 'fade') { - // fade animation with crossfade - if (option.crossfade) { - // put hidden next above current - control.children(':eq('+ next +')', elem).css({ - zIndex: 10 - // fade in next - }).fadeIn(option.fadeSpeed, option.fadeEasing, function(){ - if (option.autoHeight) { - // animate container to height of next - control.animate({ - height: control.children(':eq('+ next +')', elem).outerHeight() - }, option.autoHeightSpeed, function(){ - // hide previous - control.children(':eq('+ prev +')', elem).css({ - display: 'none', - zIndex: 0 - }); - // reset z index - control.children(':eq('+ next +')', elem).css({ - zIndex: 0 - }); - // end of animation - option.animationComplete(next + 1); - active = false; - }); - } else { - // hide previous - control.children(':eq('+ prev +')', elem).css({ - display: 'none', - zIndex: 0 - }); - // reset zindex - control.children(':eq('+ next +')', elem).css({ - zIndex: 0 - }); - // end of animation - option.animationComplete(next + 1); - active = false; - } - }); - } else { - // fade animation with no crossfade - control.children(':eq('+ prev +')', elem).fadeOut(option.fadeSpeed, option.fadeEasing, function(){ - // animate to new height - if (option.autoHeight) { - control.animate({ - // animate container to height of next - height: control.children(':eq('+ next +')', elem).outerHeight() - }, option.autoHeightSpeed, - // fade in next slide - function(){ - control.children(':eq('+ next +')', elem).fadeIn(option.fadeSpeed, option.fadeEasing); - }); - } else { - // if fixed height - control.children(':eq('+ next +')', elem).fadeIn(option.fadeSpeed, option.fadeEasing, function(){ - // fix font rendering in ie, lame - if($.browser.msie) { - $(this).get(0).style.removeAttribute('filter'); - } - }); - } - // end of animation - option.animationComplete(next + 1); - active = false; - }); - } - // slide animation - } else { - // move next slide to right of previous - control.children(':eq('+ next +')').css({ - left: position, - display: 'block' - }); - // animate to new height - if (option.autoHeight) { - control.animate({ - left: direction, - height: control.children(':eq('+ next +')').outerHeight() - },option.slideSpeed, option.slideEasing, function(){ - control.css({ - left: -width - }); - control.children(':eq('+ next +')').css({ - left: width, - zIndex: 5 - }); - // reset previous slide - control.children(':eq('+ prev +')').css({ - left: width, - display: 'none', - zIndex: 0 - }); - // end of animation - option.animationComplete(next + 1); - active = false; - }); - // if fixed height - } else { - // animate control - control.animate({ - left: direction - },option.slideSpeed, option.slideEasing, function(){ - // after animation reset control position - control.css({ - left: -width - }); - // reset and show next - control.children(':eq('+ next +')').css({ - left: width, - zIndex: 5 - }); - // reset previous slide - control.children(':eq('+ prev +')').css({ - left: width, - display: 'none', - zIndex: 0 - }); - // end of animation - option.animationComplete(next + 1); - active = false; - }); - } - } - // set current state for pagination - if (option.pagination) { - // remove current class from all - $('.'+ option.paginationClass +' li.' + option.currentClass, elem).removeClass(option.currentClass); - // add current class to next - $('.' + option.paginationClass + ' li:eq('+ next +')', elem).addClass(option.currentClass); - } - } - } // end animate function - - function stop() { - // clear interval from stored id - clearInterval(elem.data('interval')); - } - - function pause() { - if (option.pause) { - // clear timeout and interval - clearTimeout(elem.data('pause')); - clearInterval(elem.data('interval')); - // pause slide show for option.pause amount - pauseTimeout = setTimeout(function() { - // clear pause timeout - clearTimeout(elem.data('pause')); - // start play interval after pause - playInterval = setInterval( function(){ - animate("next", effect); - },option.play); - // store play interval - elem.data('interval',playInterval); - },option.pause); - // store pause interval - elem.data('pause',pauseTimeout); - } else { - // if no pause, just stop - stop(); - } - } - - // 2 or more slides required - if (total < 2) { - return; - } - - // error corection for start slide - if (start < 0) { - start = 0; - } - - if (start > total) { - start = total - 1; - } - - // change current based on start option number - if (option.start) { - current = start; - } - - // randomizes slide order - if (option.randomize) { - control.randomize(); - } - - // make sure overflow is hidden, width is set - $('.' + option.container, elem).css({ - overflow: 'hidden', - // fix for ie - position: 'relative' - }); - - // set css for slides - control.children().css({ - position: 'absolute', - top: 0, - left: control.children().outerWidth(), - zIndex: 0, - display: 'none' - }); - - // set css for control div - control.css({ - position: 'relative', - // size of control 3 x slide width - width: (width * 3), - // set height to slide height - height: height, - // center control to slide - left: -width - }); - - // show slides - $('.' + option.container, elem).css({ - display: 'block' - }); - - // if autoHeight true, get and set height of first slide - if (option.autoHeight) { - control.children().css({ - height: 'auto' - }); - control.animate({ - height: control.children(':eq('+ start +')').outerHeight() - },option.autoHeightSpeed); - } - - // checks if image is loaded - if (option.preload && control.find('img:eq(' + start + ')').length) { - // adds preload image - $('.' + option.container, elem).css({ - background: 'url(' + option.preloadImage + ') no-repeat 50% 50%' - }); - - // gets image src, with cache buster - var img = control.find('img:eq(' + start + ')').attr('src') + '?' + (new Date()).getTime(); - - // check if the image has a parent - if ($('img', elem).parent().attr('class') != 'slides_control') { - // If image has parent, get tag name - imageParent = control.children(':eq(0)')[0].tagName.toLowerCase(); - } else { - // Image doesn't have parent, use image tag name - imageParent = control.find('img:eq(' + start + ')'); - } - - // checks if image is loaded - control.find('img:eq(' + start + ')').attr('src', img).load(function() { - // once image is fully loaded, fade in - control.find(imageParent + ':eq(' + start + ')').fadeIn(option.fadeSpeed, option.fadeEasing, function(){ - $(this).css({ - zIndex: 5 - }); - // removes preload image - $('.' + option.container, elem).css({ - background: '' - }); - // let the script know everything is loaded - loaded = true; - // call the loaded funciton - option.slidesLoaded(); - }); - }); - } else { - // if no preloader fade in start slide - control.children(':eq(' + start + ')').fadeIn(option.fadeSpeed, option.fadeEasing, function(){ - // let the script know everything is loaded - loaded = true; - // call the loaded funciton - option.slidesLoaded(); - }); - } - - // click slide for next - if (option.bigTarget) { - // set cursor to pointer - control.children().css({ - cursor: 'pointer' - }); - // click handler - control.children().click(function(){ - // animate to next on slide click - animate('next', effect); - return false; - }); - } - - // pause on mouseover - if (option.hoverPause && option.play) { - control.bind('mouseover',function(){ - // on mouse over stop - stop(); - }); - control.bind('mouseleave',function(){ - // on mouse leave start pause timeout - pause(); - }); - } - - // generate next/prev buttons - if (option.generateNextPrev) { - $('.' + option.container, elem).after('<a href="#" class="'+ option.prev +'">Prev</a>'); - $('.' + option.prev, elem).after('<a href="#" class="'+ option.next +'">Next</a>'); - } - - // next button - $('.' + option.next ,elem).click(function(e){ - e.preventDefault(); - if (option.play) { - pause(); - } - animate('next', effect); - }); - - // previous button - $('.' + option.prev, elem).click(function(e){ - e.preventDefault(); - if (option.play) { - pause(); - } - animate('prev', effect); - }); - - // generate pagination - if (option.generatePagination) { - // create unordered list - if (option.prependPagination) { - elem.prepend('<ul class='+ option.paginationClass +'></ul>'); - } else { - elem.append('<ul class='+ option.paginationClass +'></ul>'); - } - // for each slide create a list item and link - control.children().each(function(){ - $('.' + option.paginationClass, elem).append('<li><a href="#'+ number +'">'+ (number+1) +'</a></li>'); - number++; - }); - } else { - // if pagination exists, add href w/ value of item number to links - $('.' + option.paginationClass + ' li a', elem).each(function(){ - $(this).attr('href', '#' + number); - number++; - }); - } - - // add current class to start slide pagination - $('.' + option.paginationClass + ' li:eq('+ start +')', elem).addClass(option.currentClass); - - // click handling - $('.' + option.paginationClass + ' li a', elem ).click(function(){ - // pause slideshow - if (option.play) { - pause(); - } - // get clicked, pass to animate function - clicked = $(this).attr('href').match('[^#/]+$'); - // if current slide equals clicked, don't do anything - if (current != clicked) { - animate('pagination', paginationEffect, clicked); - } - return false; - }); - - // click handling - $('a.link', elem).click(function(){ - // pause slideshow - if (option.play) { - pause(); - } - // get clicked, pass to animate function - clicked = $(this).attr('href').match('[^#/]+$') - 1; - // if current slide equals clicked, don't do anything - if (current != clicked) { - animate('pagination', paginationEffect, clicked); - } - return false; - }); - - if (option.play) { - // set interval - playInterval = setInterval(function() { - animate('next', effect); - }, option.play); - // store interval id - elem.data('interval',playInterval); - } - }); - }; - - // default options - $.fn.slides.option = { - preload: false, // boolean, Set true to preload images in an image based slideshow - preloadImage: '/img/loading.gif', // string, Name and location of loading image for preloader. Default is "/img/loading.gif" - container: 'slides_container', // string, Class name for slides container. Default is "slides_container" - generateNextPrev: false, // boolean, Auto generate next/prev buttons - next: 'next', // string, Class name for next button - prev: 'prev', // string, Class name for previous button - pagination: true, // boolean, If you're not using pagination you can set to false, but don't have to - generatePagination: true, // boolean, Auto generate pagination - prependPagination: false, // boolean, prepend pagination - paginationClass: 'pagination', // string, Class name for pagination - currentClass: 'current', // string, Class name for current class - fadeSpeed: 350, // number, Set the speed of the fading animation in milliseconds - fadeEasing: '', // string, must load jQuery's easing plugin before http://gsgd.co.uk/sandbox/jquery/easing/ - slideSpeed: 350, // number, Set the speed of the sliding animation in milliseconds - slideEasing: '', // string, must load jQuery's easing plugin before http://gsgd.co.uk/sandbox/jquery/easing/ - start: 1, // number, Set the speed of the sliding animation in milliseconds - effect: 'slide', // string, '[next/prev], [pagination]', e.g. 'slide, fade' or simply 'fade' for both - crossfade: false, // boolean, Crossfade images in a image based slideshow - randomize: false, // boolean, Set to true to randomize slides - play: 0, // number, Autoplay slideshow, a positive number will set to true and be the time between slide animation in milliseconds - pause: 0, // number, Pause slideshow on click of next/prev or pagination. A positive number will set to true and be the time of pause in milliseconds - hoverPause: false, // boolean, Set to true and hovering over slideshow will pause it - autoHeight: false, // boolean, Set to true to auto adjust height - autoHeightSpeed: 350, // number, Set auto height animation time in milliseconds - bigTarget: false, // boolean, Set to true and the whole slide will link to next slide on click - animationStart: function(){}, // Function called at the start of animation - animationComplete: function(){}, // Function called at the completion of animation - slidesLoaded: function() {} // Function is called when slides is fully loaded - }; - - // Randomize slide order on load - $.fn.randomize = function(callback) { - function randomizeOrder() { return(Math.round(Math.random())-0.5); } - return($(this).each(function() { - var $this = $(this); - var $children = $this.children(); - var childCount = $children.length; - if (childCount > 1) { - $children.hide(); - var indices = []; - for (i=0;i<childCount;i++) { indices[indices.length] = i; } - indices = indices.sort(randomizeOrder); - $.each(indices,function(j,k) { - var $child = $children.eq(k); - var $clone = $child.clone(true); - $clone.show().appendTo($this); - if (callback !== undefined) { - callback($child, $clone); - } - $child.remove(); - }); - } - })); - }; -})(jQuery);
\ No newline at end of file diff --git a/nikola/data/themes/default/bundles b/nikola/data/themes/default/bundles index 35af9c0..2b81ea8 100644 --- a/nikola/data/themes/default/bundles +++ b/nikola/data/themes/default/bundles @@ -1,4 +1,4 @@ -assets/css/all-nocdn.css=bootstrap.css,bootstrap-responsive.css,rst.css,code.css,colorbox.css,slides.css,theme.css,custom.css -assets/css/all.css=rst.css,code.css,colorbox.css,slides.css,theme.css,custom.css -assets/js/all-nocdn.js=jquery-1.7.2.min.js,bootstrap.min.js,jquery.colorbox-min.js,slides.min.jquery.js -assets/js/all.js=jquery.colorbox-min.js,slides.min.jquery.js +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-1.7.2.min.js,bootstrap.min.js,jquery.colorbox-min.js +assets/js/all.js=jquery.colorbox-min.js diff --git a/nikola/data/themes/default/messages/messages_ca.py b/nikola/data/themes/default/messages/messages_ca.py index 8e7186f..a709f1b 100644 --- a/nikola/data/themes/default/messages/messages_ca.py +++ b/nikola/data/themes/default/messages/messages_ca.py @@ -2,21 +2,22 @@ from __future__ import unicode_literals MESSAGES = { - "LANGUAGE": "Català", - "Posts for year %s": "Entrades de l'any %s", - "Archive": "Arxiu", - "Posts about %s": "Entrades sobre %s", - "Tags": "Etiquetes", "Also available in": "També disponibles en", + "Archive": "Arxiu", + "LANGUAGE": "Català", "More posts about": "Més entrades sobre", - "Posted": "Publicat", - "Original site": "Lloc original", - "Read in English": "Llegeix-ho en català", - "Older posts": "Entrades anteriors", "Newer posts": "Entrades posteriors", - "Previous post": "Entrada anterior", "Next post": "Entrada següent", - "old posts page %d": "entrades antigues pàgina %d", + "Older posts": "Entrades anteriors", + "Original site": "Lloc original", + "Posted": "Publicat", + "Posts about %s": "Entrades sobre %s", + "Posts for year %s": "Entrades de l'any %s", + "Posts for {month} {year}": "", + "Previous post": "Entrada anterior", + "Read in English": "Llegeix-ho en català", "Read more": "Llegeix-ne més", "Source": "Codi", + "Tags": "Etiquetes", + "old posts page %d": "entrades antigues pàgina %d", } diff --git a/nikola/data/themes/default/messages/messages_de.py b/nikola/data/themes/default/messages/messages_de.py index 5da3b2b..57c784f 100644 --- a/nikola/data/themes/default/messages/messages_de.py +++ b/nikola/data/themes/default/messages/messages_de.py @@ -2,21 +2,22 @@ from __future__ import unicode_literals MESSAGES = { - "LANGUAGE": "Deutsch", - "Posts for year %s": "Einträge aus dem Jahr %s", - "Archive": "Archiv", - "Posts about %s": "Einträge über %s", - "Tags": "Tags", "Also available in": "Auch verfügbar in", + "Archive": "Archiv", + "LANGUAGE": "Deutsch", "More posts about": "Weitere Einträge über", - "Posted": "Veröffentlicht", - "Original site": "Original-Seite", - "Read in English": "Auf Deutsch lesen", - "Older posts": "Ältere Einträge", "Newer posts": "Neuere Einträge", - "Previous post": "Vorheriger Eintrag", "Next post": "Nächster Eintrag", - "Source": "Source", + "Older posts": "Ältere Einträge", + "Original site": "Original-Seite", + "Posted": "Veröffentlicht", + "Posts about %s": "Einträge über %s", + "Posts for year %s": "Einträge aus dem Jahr %s", + "Posts for {month} {year}": "Einträge für {month} {year}", + "Previous post": "Vorheriger Eintrag", + "Read in English": "Auf Deutsch lesen", "Read more": "Weiterlesen", - "old posts page %d": "Vorherige Einträge %d" + "Source": "Source", + "Tags": "Tags", + "old posts page %d": "Vorherige Einträge %d", } diff --git a/nikola/data/themes/default/messages/messages_el.py b/nikola/data/themes/default/messages/messages_el.py new file mode 100644 index 0000000..a00f88f --- /dev/null +++ b/nikola/data/themes/default/messages/messages_el.py @@ -0,0 +1,23 @@ +# -*- encoding:utf-8 -*- +from __future__ import unicode_literals + +MESSAGES = { + "Also available in": "Διαθέσιμο και στα", + "Archive": "Αρχείο", + "LANGUAGE": "Ελληνικά", + "More posts about": "Περισσότερες αναρτήσεις για", + "Newer posts": "Νεότερες αναρτήσεις", + "Next post": "Επόμενη ανάρτηση", + "Older posts": "Παλαιότερες αναρτήσεις", + "Original site": "Ιστοσελίδα αρχικής ανάρτησης", + "Posted": "Αναρτήθηκε", + "Posts about %s": "Αναρτήσεις για %s", + "Posts for year %s": "Αναρτήσεις για το έτος %s", + "Posts for {month} {year}": "", + "Previous post": "Προηγούμενη ανάρτηση", + "Read in English": "Διαβάστε στα Ελληνικά", + "Read more": "Διαβάστε περισσότερα", + "Source": "Πηγαίος κώδικας", + "Tags": "Ετικέτες", + "old posts page %d": "σελίδα παλαιότερων αναρτήσεων %d", +} diff --git a/nikola/data/themes/default/messages/messages_en.py b/nikola/data/themes/default/messages/messages_en.py index 9fc77ef..982b654 100644 --- a/nikola/data/themes/default/messages/messages_en.py +++ b/nikola/data/themes/default/messages/messages_en.py @@ -2,21 +2,22 @@ from __future__ import unicode_literals MESSAGES = { - "LANGUAGE": "English", - "Posts for year %s": "Posts for year %s", - "Archive": "Archive", - "Posts about %s": "Posts about %s", - "Tags": "Tags", "Also available in": "Also available in", + "Archive": "Archive", + "LANGUAGE": "English", "More posts about": "More posts about", - "Posted": "Posted", - "Original site": "Original site", - "Read in English": "Read in English", "Newer posts": "Newer posts", + "Next post": "Next post", "Older posts": "Older posts", + "Original site": "Original site", + "Posted": "Posted", + "Posts about %s": "Posts about %s", + "Posts for year %s": "Posts for year %s", + "Posts for {month} {year}": "Posts for {month} {year}", "Previous post": "Previous post", - "Next post": "Next post", - "old posts page %d": "old posts page %d", + "Read in English": "Read in English", "Read more": "Read more", "Source": "Source", + "Tags": "Tags", + "old posts page %d": "old posts page %d", } diff --git a/nikola/data/themes/default/messages/messages_es.py b/nikola/data/themes/default/messages/messages_es.py index f17f058..4b73d47 100644 --- a/nikola/data/themes/default/messages/messages_es.py +++ b/nikola/data/themes/default/messages/messages_es.py @@ -2,21 +2,22 @@ from __future__ import unicode_literals MESSAGES = { - "LANGUAGE": "Español", - "Posts for year %s": "Posts del año %s", - "Archive": "Archivo", - "Posts about %s": "Posts sobre %s", - "Tags": "Tags", "Also available in": "También disponible en", + "Archive": "Archivo", + "LANGUAGE": "Español", "More posts about": "Más posts sobre", - "Posted": "Publicado", - "Original site": "Sitio original", - "Read in English": "Leer en español", - "Older posts": "Posts anteriores", "Newer posts": "Posts posteriores", - "Previous post": "Post anterior", "Next post": "Siguiente post", - "old posts page %d": "posts antiguos página %d", + "Older posts": "Posts anteriores", + "Original site": "Sitio original", + "Posted": "Publicado", + "Posts about %s": "Posts sobre %s", + "Posts for year %s": "Posts del año %s", + "Posts for {month} {year}": "Posts de {month} {year}", + "Previous post": "Post anterior", + "Read in English": "Leer en español", "Read more": "Leer más", "Source": "Código", + "Tags": "Tags", + "old posts page %d": "posts antiguos página %d", } diff --git a/nikola/data/themes/default/messages/messages_fr.py b/nikola/data/themes/default/messages/messages_fr.py index 74eecb8..94e9f46 100644 --- a/nikola/data/themes/default/messages/messages_fr.py +++ b/nikola/data/themes/default/messages/messages_fr.py @@ -2,20 +2,22 @@ from __future__ import unicode_literals MESSAGES = { - "LANGUAGE": "Français", - "Posts for year %s": "Billets de l'année %s", - "Archive": "Archives", - "Posts about %s": "Billets sur %s", - "Tags": "Étiquettes", "Also available in": "Disponible aussi en", + "Archive": "Archives", + "LANGUAGE": "Français", "More posts about": "Plus de billets sur", - "Posted": "Publié", - "Original site": "Site d'origine", - "Read in English": "Lire en français", "Newer posts": "Billets récents", + "Next post": "Billet suivant", "Older posts": "Anciens billets", - "Previous post": "Previous post", - "Next post": "Next post", - "Read more": "Read more", + "Original site": "Site d'origine", + "Posted": "Publié", + "Posts about %s": "Billets sur %s", + "Posts for year %s": "Billets de l'année %s", + "Posts for {month} {year}": "Billets de {month} {year}", + "Previous post": "Billet précédent", + "Read in English": "Lire en français", + "Read more": "Lire la suite", "Source": "Source", + "Tags": "Étiquettes", + "old posts page %d": "anciens billets page %d", } diff --git a/nikola/data/themes/default/messages/messages_it.py b/nikola/data/themes/default/messages/messages_it.py index 42f4709..c41a20c 100644 --- a/nikola/data/themes/default/messages/messages_it.py +++ b/nikola/data/themes/default/messages/messages_it.py @@ -1,23 +1,23 @@ -# vim: set fileencoding=utf-8 : +# -*- encoding:utf-8 -*- from __future__ import unicode_literals MESSAGES = { - "LANGUAGE": "Italiano", - "Posts for year %s": "Articoli per l'anno %s", - "Archive": "Archivio", - "Posts about %s": "Articoli su %s", - "Tags": "Tags", "Also available in": "Anche disponibile in", + "Archive": "Archivio", + "LANGUAGE": "Italiano", "More posts about": "Altri articoli s", - "Posted": "Pubblicato", - "Original site": "Sito originale", - "Read in English": "Leggi in italiano", "Newer posts": "Articoli recenti", - "Older posts": "Articoli più vecchi", + "Next post": "Articolo successivo", "Older posts": "Articoli vecchi", + "Original site": "Sito originale", + "Posted": "Pubblicato", + "Posts about %s": "Articoli su %s", + "Posts for year %s": "Articoli per l'anno %s", + "Posts for {month} {year}": "", "Previous post": "Articolo precedente", - "Next post": "Articolo successivo", - "old posts page %d": "pagina dei vecchi articoli %d", + "Read in English": "Leggi in italiano", "Read more": "Espandi", "Source": "Source", + "Tags": "Tags", + "old posts page %d": "pagina dei vecchi articoli %d", } diff --git a/nikola/data/themes/default/messages/messages_ja.py b/nikola/data/themes/default/messages/messages_ja.py new file mode 100644 index 0000000..8dd1521 --- /dev/null +++ b/nikola/data/themes/default/messages/messages_ja.py @@ -0,0 +1,23 @@ +# -*- encoding:utf-8 -*- +from __future__ import unicode_literals + +MESSAGES = { + "Also available in": "他の言語で読む", + "Archive": "過去の記事", + "LANGUAGE": "日本語", + "More posts about": "タグ", + "Newer posts": "新しい記事", + "Next post": "次の記事", + "Older posts": "過去の記事", + "Original site": "元のサイト", + "Posted": "投稿日時", + "Posts about %s": "%sについての記事", + "Posts for year %s": "%s年の記事", + "Posts for {month} {year}": "{year}年{month}月の記事", + "Previous post": "前の記事", + "Read in English": "日本語で読む", + "Read more": "続きを読む", + "Source": "ソース", + "Tags": "タグ", + "old posts page %d": "前の記事 %dページ目", +} diff --git a/nikola/data/themes/default/messages/messages_pl.py b/nikola/data/themes/default/messages/messages_pl.py index 7172ebc..876b5f2 100644 --- a/nikola/data/themes/default/messages/messages_pl.py +++ b/nikola/data/themes/default/messages/messages_pl.py @@ -2,21 +2,22 @@ from __future__ import unicode_literals MESSAGES = { - "LANGUAGE": "polski", - "Posts for year %s": "Posty z roku %s", - "Archive": "Archiwum", - "Posts about %s": "Posty o %s", - "Tags": "Tags", "Also available in": "Również dostępny w", + "Archive": "Archiwum", + "LANGUAGE": "polski", "More posts about": "Więcej postów o", - "Posted": "Opublikowany", - "Original site": "Oryginalna strona", - "Read in English": "Czytaj po polsku", - "Older posts": "Starsze posty", "Newer posts": "Nowsze posty", - "Previous post": "Poprzedni post", "Next post": "Następny post", - "Source": "Źródło", + "Older posts": "Starsze posty", + "Original site": "Oryginalna strona", + "Posted": "Opublikowany", + "Posts about %s": "Posty o %s", + "Posts for year %s": "Posty z roku %s", + "Posts for {month} {year}": "Posty z {month} {year}", + "Previous post": "Poprzedni post", + "Read in English": "Czytaj po polsku", "Read more": "Czytaj więcej", - "old posts page %d": "stare posty, strona %d" + "Source": "Źródło", + "Tags": "Tags", + "old posts page %d": "stare posty, strona %d", } diff --git a/nikola/data/themes/default/messages/messages_pt-br.py b/nikola/data/themes/default/messages/messages_pt_br.py index 183c577..12dafb5 100644 --- a/nikola/data/themes/default/messages/messages_pt-br.py +++ b/nikola/data/themes/default/messages/messages_pt_br.py @@ -2,21 +2,22 @@ from __future__ import unicode_literals MESSAGES = { - "LANGUAGE": "Português", - "Posts for year %s": "Posts do ano %s", - "Archive": "Arquivo", - "Posts about %s": "Posts sobre %s", - "Tags": "Tags", "Also available in": "Também disponível em", + "Archive": "Arquivo", + "LANGUAGE": "Português", "More posts about": "Mais posts sobre", - "Posted": "Publicado", - "Original site": "Site original", - "Read in English": "Ler em português", "Newer posts": "Posts mais recentes", + "Next post": "Próximo post", "Older posts": "Posts mais antigos", + "Original site": "Site original", + "Posted": "Publicado", + "Posts about %s": "Posts sobre %s", + "Posts for year %s": "Posts do ano %s", + "Posts for {month} {year}": "Posts de {month} {year}", "Previous post": "Post anterior", - "Next post": "Próximo post", - "old posts page %d": "Posts antigos página %d", + "Read in English": "Ler em português", "Read more": "Leia mais", "Source": "Código", + "Tags": "Tags", + "old posts page %d": "Posts antigos página %d", } diff --git a/nikola/data/themes/default/messages/messages_ru.py b/nikola/data/themes/default/messages/messages_ru.py index 8a209ec..1d7e41c 100644 --- a/nikola/data/themes/default/messages/messages_ru.py +++ b/nikola/data/themes/default/messages/messages_ru.py @@ -2,21 +2,22 @@ from __future__ import unicode_literals MESSAGES = { - "LANGUAGE": "Русский", - "Posts for year %s": "Записи за %s год", - "Archive": "Архив", - "Posts about %s": "Записи с тэгом %s:", - "Tags": "Тэги", "Also available in": "Также доступно в", + "Archive": "Архив", + "LANGUAGE": "Русский", "More posts about": "Больше записей о", - "Posted": "Опубликовано", - "Original site": "Оригинальный сайт", - "Read in English": "Прочесть по-русски", - "Older posts": "Старые записи", "Newer posts": "Новые записи", - "Previous post": "Предыдущая запись", "Next post": "Следующая запись", - "old posts page %d": "страница со старыми записями %d", + "Older posts": "Старые записи", + "Original site": "Оригинальный сайт", + "Posted": "Опубликовано", + "Posts about %s": "Записи с тэгом %s:", + "Posts for year %s": "Записи за %s год", + "Posts for {month} {year}": "", + "Previous post": "Предыдущая запись", + "Read in English": "Прочесть по-русски", "Read more": "Продолжить чтение", "Source": "Source", + "Tags": "Тэги", + "old posts page %d": "страница со старыми записями %d", } diff --git a/nikola/data/themes/default/messages/messages_zh-cn.py b/nikola/data/themes/default/messages/messages_zh_cn.py index 2f4b64e..aa69a96 100644 --- a/nikola/data/themes/default/messages/messages_zh-cn.py +++ b/nikola/data/themes/default/messages/messages_zh_cn.py @@ -1,22 +1,23 @@ -# -*- encoding:utf-8 -*-
-from __future__ import unicode_literals
-
-MESSAGES = {
- "LANGUAGE": "简体中文",
- "Posts for year %s": "%s年文章",
- "Archive": "文章存档",
- "Posts about %s": "文章分类:%s",
- "Tags": "标签",
- "Also available in": "其他语言版本",
- "More posts about": "更多相关文章:",
- "Posted": "发表于",
- "Original site": "原文地址",
- "Read in English": "中文版",
- "Older posts": "旧一篇",
- "Newer posts": "新一篇",
- "Previous post": "前一篇",
- "Next post": "后一篇",
- "old posts page %d": "旧文章页 %d",
- "Read more": "更多",
- "Source": "源代码",
-}
+# -*- encoding:utf-8 -*- +from __future__ import unicode_literals + +MESSAGES = { + "Also available in": "其他语言版本", + "Archive": "文章存档", + "LANGUAGE": "简体中文", + "More posts about": "更多相关文章:", + "Newer posts": "新一篇", + "Next post": "后一篇", + "Older posts": "旧一篇", + "Original site": "原文地址", + "Posted": "发表于", + "Posts about %s": "文章分类:%s", + "Posts for year %s": "%s年文章", + "Posts for {month} {year}": "{year}年{month}月文章", + "Previous post": "前一篇", + "Read in English": "中文版", + "Read more": "更多", + "Source": "源代码", + "Tags": "标签", + "old posts page %d": "旧文章页 %d", +} diff --git a/nikola/data/themes/default/templates/base.tmpl b/nikola/data/themes/default/templates/base.tmpl index c0935a2..72a4077 100644 --- a/nikola/data/themes/default/templates/base.tmpl +++ b/nikola/data/themes/default/templates/base.tmpl @@ -1,11 +1,13 @@ ## -*- coding: utf-8 -*- <%namespace file="base_helper.tmpl" import="*"/> +${set_locale(lang)} <!DOCTYPE html> <html lang="${lang}"> <head> ${html_head()} <%block name="extra_head"> </%block> + ${extra_head_data} </head> <body> %if add_this_buttons: @@ -22,7 +24,7 @@ <%block name="belowtitle"> %if len(translations) > 1: <small> - ${(messages[lang][u"Also available in"])}: + ${(messages("Also available in"))}: ${html_translations()} </small> %endif @@ -52,7 +54,7 @@ </div> </div> </div> - ${analytics} ${late_load_js()} + ${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/default/templates/base_helper.tmpl b/nikola/data/themes/default/templates/base_helper.tmpl index eb22905..a833c51 100644 --- a/nikola/data/themes/default/templates/base_helper.tmpl +++ b/nikola/data/themes/default/templates/base_helper.tmpl @@ -22,7 +22,6 @@ <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/slides.css" rel="stylesheet" type="text/css"/> <link href="/assets/css/theme.css" rel="stylesheet" type="text/css"/> %if has_custom_css: <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> @@ -34,9 +33,13 @@ %if rss_link: ${rss_link} %else: - %for language in translations: - <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}"> - %endfor + %if len(translations) > 1: + %for language in 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 favicons: %for name, file, size in favicons: @@ -63,7 +66,6 @@ <script src="/assets/js/bootstrap.min.js" type="text/javascript"></script> %endif <script src="/assets/js/jquery.colorbox-min.js" type="text/javascript"></script> - <script src="/assets/js/slides.min.jquery.js" type="text/javascript"></script> %endif </%def> @@ -98,7 +100,7 @@ <%def name="html_translations()"> %for langname in translations.keys(): %if langname != lang: - <a href="${_link("index", None, langname)}">${messages[langname]["LANGUAGE"]}</a> + <a href="${_link("index", None, langname)}">${messages("LANGUAGE", langname)}</a> %endif %endfor </%def> diff --git a/nikola/data/themes/default/templates/disqus_helper.tmpl b/nikola/data/themes/default/templates/disqus_helper.tmpl index 674e20e..4c60f85 100644 --- a/nikola/data/themes/default/templates/disqus_helper.tmpl +++ b/nikola/data/themes/default/templates/disqus_helper.tmpl @@ -1,6 +1,9 @@ ## -*- coding: utf-8 -*- <%! import json + translations = { + 'es': 'es_ES', + } %> <%def name="html_disqus(url, title, identifier)"> %if disqus_forum: @@ -12,8 +15,8 @@ %endif var disqus_title=${json.dumps(title)}; var disqus_identifier="${identifier}"; - var disqus_config = function () { - this.language = "${lang}"; + var disqus_config = function () { + this.language = "${translations.get(lang, lang)}"; }; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; diff --git a/nikola/data/themes/default/templates/index.tmpl b/nikola/data/themes/default/templates/index.tmpl index 4f66867..b49e764 100644 --- a/nikola/data/themes/default/templates/index.tmpl +++ b/nikola/data/themes/default/templates/index.tmpl @@ -5,13 +5,15 @@ <%block name="content"> % for post in posts: <div class="postbox"> - <h1><a href="${post.permalink(lang)}">${post.title(lang)}</a> + <h1><a href="${post.permalink()}">${post.title()}</a> <small> - ${messages[lang]["Posted"]}: <time class="published" datetime="${post.date.isoformat()}">${post.date.strftime(date_format)}</time> + ${messages("Posted")}: <time class="published" datetime="${post.date.isoformat()}">${post.formatted_date(date_format)}</time> </small></h1> <hr> - ${post.text(lang, index_teasers)} - ${disqus.html_disqus_link(post.permalink()+"#disqus_thread", post.base_path)} + ${post.text(teaser_only=index_teasers)} + % if not post.meta('nocomments'): + ${disqus.html_disqus_link(post.permalink()+"#disqus_thread", post.base_path)} + % endif </div> % endfor ${helper.html_pager()} diff --git a/nikola/data/themes/default/templates/index_helper.tmpl b/nikola/data/themes/default/templates/index_helper.tmpl index 151b4d2..7859972 100644 --- a/nikola/data/themes/default/templates/index_helper.tmpl +++ b/nikola/data/themes/default/templates/index_helper.tmpl @@ -4,11 +4,11 @@ <ul class="pager"> %if prevlink: <li class="previous"> - <a href="${prevlink}">← ${messages[lang]["Newer posts"]}</a> + <a href="${prevlink}">← ${messages("Newer posts")}</a> %endif %if nextlink: <li class="next"> - <a href="${nextlink}">${messages[lang]["Older posts"]} →</a> + <a href="${nextlink}">${messages("Older posts")} →</a> %endif </ul> </div> diff --git a/nikola/data/themes/default/templates/list_post.tmpl b/nikola/data/themes/default/templates/list_post.tmpl index 1a1cdee..f0e159d 100644 --- a/nikola/data/themes/default/templates/list_post.tmpl +++ b/nikola/data/themes/default/templates/list_post.tmpl @@ -6,7 +6,7 @@ <h1>${title}</h1> <ul class="unstyled"> % for post in posts: - <li><a href="${post.permalink(lang)}">[${post.date.strftime(date_format)}] ${post.title(lang)}</a> + <li><a href="${post.permalink()}">[${post.formatted_date(date_format)}] ${post.title()}</a> % endfor </ul> </div> diff --git a/nikola/data/themes/default/templates/post.tmpl b/nikola/data/themes/default/templates/post.tmpl index 22d8a58..f9e24d2 100644 --- a/nikola/data/themes/default/templates/post.tmpl +++ b/nikola/data/themes/default/templates/post.tmpl @@ -10,20 +10,24 @@ ${helper.twitter_card_information(post)} ${helper.html_title()} <hr> <small> - ${messages[lang]["Posted"]}: <time class="published" datetime="${post.date.isoformat()}">${post.date.strftime(date_format)}</time> + ${messages("Posted")}: <time class="published" datetime="${post.date.isoformat()}">${post.formatted_date(date_format)}</time> ${helper.html_translations(post)} ${helper.html_tags(post)} </small> <hr> - ${post.text(lang)} + ${post.text()} ${helper.html_pager(post)} - ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} + % if not post.meta('nocomments'): + ${disqus.html_disqus(post.permalink(absolute=True), post.title(), post.base_path)} + % endif ${helper.mathjax_script(post)} </div> </%block> <%block name="sourcelink"> +% if not post.meta('password'): <li> - <a href="${post.pagenames[lang]+post.source_ext()}" id="sourcelink">${messages[lang]["Source"]}</a> + <a href="${post.meta('slug')+post.source_ext()}" id="sourcelink">${messages("Source")}</a> </li> +% endif </%block> diff --git a/nikola/data/themes/default/templates/post_helper.tmpl b/nikola/data/themes/default/templates/post_helper.tmpl index 911a831..cce0ecf 100644 --- a/nikola/data/themes/default/templates/post_helper.tmpl +++ b/nikola/data/themes/default/templates/post_helper.tmpl @@ -2,7 +2,7 @@ <%def name="html_title()"> <h1>${title}</h1> % if link: - <p><a href='${link}'>${messages[lang]["Original site"]}</a></p> + <p><a href='${link}'>${messages("Original site")}</a></p> % endif </%def> @@ -12,7 +12,7 @@ %for langname in translations.keys(): %if langname != lang and post.is_translation_available(langname): | - <a href="${post.permalink(langname)}">${messages[langname]["Read in English"]}</a> + <a href="${post.permalink(langname)}">${messages("Read in English", langname)}</a> %endif %endfor %endif @@ -21,9 +21,9 @@ <%def name="html_tags(post)"> %if post.tags: - | ${messages[lang]["More posts about"]} + | ${messages("More posts about")} %for tag in post.tags: - <a class="tag" href="${_link('tag', tag, lang)}"><span class="badge badge-info">${tag}</span></a> + <a class="tag" href="${_link('tag', tag)}"><span class="badge badge-info">${tag}</span></a> %endfor %endif </%def> @@ -32,19 +32,21 @@ <ul class="pager"> %if post.prev_post: <li class="previous"> - <a href="${post.prev_post.permalink(lang)}">← ${messages[lang]["Previous post"]}</a> + <a href="${post.prev_post.permalink()}">← ${messages("Previous post")}</a> + </li> %endif %if post.next_post: <li class="next"> - <a href="${post.next_post.permalink(lang)}">${messages[lang]["Next post"]} →</a> + <a href="${post.next_post.permalink()}">${messages("Next post")} →</a> + </li> %endif </ul> </%def> <%def name="twitter_card_information(post)"> %if twitter_card and twitter_card['use_twitter_cards']: - <meta name="twitter:card" content="${twitter_card.get('card', 'summary')}"> - <meta name="og:url" content="${post.permalink(lang, absolute=True)}"> + <meta name="twitter:card" content="${twitter_card.get('card', 'summary')|h}"> + <meta name="og:url" content="${post.permalink(absolute=True)}"> %if 'site:id' in twitter_card: <meta name="twitter:site:id" content="${twitter_card['site:id']}"> %elif 'site' in twitter_card: @@ -55,11 +57,11 @@ %elif 'creator' in twitter_card: <meta name="twitter:creator" content="${twitter_card['creator']}"> %endif - <meta name="og:title" content="${post.title(lang)[:70]}"> - %if post.description(lang): - <meta name="og:description" content="${post.description(lang)[:200]}"> + <meta name="og:title" content="${post.title()[:70]|h}"> + %if post.description(): + <meta name="og:description" content="${post.description()[:200]|h}"> %else: - <meta name="og:description" content="${post.text(lang, strip_html=True)[:200]}"> + <meta name="og:description" content="${post.text(strip_html=True)[:200]|h}"> %endif %endif </%def> diff --git a/nikola/data/themes/default/templates/story.tmpl b/nikola/data/themes/default/templates/story.tmpl index d5c2f44..c1c06d8 100644 --- a/nikola/data/themes/default/templates/story.tmpl +++ b/nikola/data/themes/default/templates/story.tmpl @@ -1,12 +1,16 @@ ## -*- coding: utf-8 -*- <%inherit file="post.tmpl"/> +<%namespace name="helper" file="post_helper.tmpl"/> <%namespace name="disqus" file="disqus_helper.tmpl"/> +<%block name="extra_head"> +${helper.twitter_card_information(post)} +</%block> <%block name="content"> %if title: <h1>${title}</h1> %endif - ${post.text(lang)} -%if enable_comments: - ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} + ${post.text()} +%if enable_comments and not post.meta('nocomments'): + ${disqus.html_disqus(post.permalink(absolute=True), post.title(), post.base_path)} %endif </%block> diff --git a/nikola/data/themes/default/templates/tag.tmpl b/nikola/data/themes/default/templates/tag.tmpl index 7c89ad1..7fb43c0 100644 --- a/nikola/data/themes/default/templates/tag.tmpl +++ b/nikola/data/themes/default/templates/tag.tmpl @@ -1,7 +1,32 @@ ## -*- coding: utf-8 -*- <%inherit file="list_post.tmpl"/> <%block name="extra_head"> + %if len(translations) > 1: %for language in translations: - <link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for tag ${tag} (${language})" href="${_link("tag_rss", tag, lang)}"> + <link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for tag ${tag} (${language})" href="${_link("tag_rss", tag, language)}"> %endfor + %else: + <link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for tag ${tag}" href="${_link("tag_rss", tag)}"> + %endif +</%block> + +<%block name="content"> + <!--Body content--> + <div class="postbox"> + <h1>${title}</h1> + %if len(translations) > 1: + %for language in translations: + <a href="${_link("tag_rss", tag, language)}">RSS (${language})</a> + %endfor + %else: + <a href="${_link("tag_rss", tag)}">RSS</a> + %endif + <br> + <ul class="unstyled"> + % for post in posts: + <li><a href="${post.permalink()}">[${post.formatted_date(date_format)}] ${post.title()}</a> + % endfor + </ul> + </div> + <!--End of body content--> </%block> diff --git a/nikola/data/themes/default/templates/tags.tmpl b/nikola/data/themes/default/templates/tags.tmpl index 369a3d5..5727dc5 100644 --- a/nikola/data/themes/default/templates/tags.tmpl +++ b/nikola/data/themes/default/templates/tags.tmpl @@ -1,14 +1,12 @@ ## -*- coding: utf-8 -*- <%inherit file="base.tmpl"/> <%block name="content"> - <div class="postbox"> - <!--Body content--> - <h1>${title}</h1> - <ul class="unstyled"> - % for text, link in items: - <li><a class="tag" href="${link}"><span class="badge badge-info">${text}</span></a> - % endfor - </ul> - <!--End of body content--> - </div> + <!--Body content--> + <h1>${title}</h1> + <ul class="unstyled bricks"> + % for text, link in items: + <li><a class="reference" href="${link}">${text}</a></li> + % endfor + </ul> + <!--End of body content--> </%block> diff --git a/nikola/data/themes/jinja-default/templates/base.tmpl b/nikola/data/themes/jinja-default/templates/base.tmpl index 97cddff..c104b20 100644 --- a/nikola/data/themes/jinja-default/templates/base.tmpl +++ b/nikola/data/themes/jinja-default/templates/base.tmpl @@ -1,4 +1,5 @@ <!DOCTYPE html> +{{set_locale(lang)}} <html lang="{{lang}}"> <head> <meta charset="utf-8"> @@ -23,7 +24,6 @@ <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/slides.css" rel="stylesheet" type="text/css"/> <link href="/assets/css/theme.css" rel="stylesheet" type="text/css"/> {% if has_custom_css %} <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> @@ -42,6 +42,7 @@ {% endif %} {% block extra_head %} {% endblock %} + {{extra_head_data}} </head> <body> {% if add_this_buttons %} @@ -58,10 +59,10 @@ {% block belowtitle%} {% if translations|length > 1 %} <small> - {{ messages[lang]["Also available in"] }}: + {{ messages("Also available in") }}: {% for langname in translations.keys() %} {% if langname != lang %} - <a href="{{_link("index", None, langname)}}">{{messages[langname]["LANGUAGE"]}}</a> + <a href="{{_link("index", None, langname)}}">{{messages("LANGUAGE", langname)}}</a> {% endif %} {% endfor %} </small> @@ -106,7 +107,6 @@ </div> </div> </div> - {{analytics}} <!-- late load javascript --> {% if use_bundles %} {% if use_cdn %} @@ -125,7 +125,7 @@ <script src="/assets/js/bootstrap.min.js" type="text/javascript"></script> {% endif %} <script src="/assets/js/jquery.colorbox-min.js" type="text/javascript"></script> - <script src="/assets/js/slides.min.jquery.js" type="text/javascript"></script> {% 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/jinja-default/templates/index.tmpl b/nikola/data/themes/jinja-default/templates/index.tmpl index ab0392c..7d1aa00 100644 --- a/nikola/data/themes/jinja-default/templates/index.tmpl +++ b/nikola/data/themes/jinja-default/templates/index.tmpl @@ -2,14 +2,14 @@ {% block content %} {% for post in posts %} <div class="postbox"> - <h1><a href="{{post.permalink(lang)}}">{{post.title(lang)}}</a> + <h1><a href="{{post.permalink()}}">{{post.title()}}</a> <small> - {{messages[lang]["Posted"]}}: {{post.date.strftime(date_format)}} + {{messages("Posted")}}: {{post.formatted_date(date_format)}} </small></h1> <hr> - {{post.text(lang, index_teasers)}} + {{post.text(teaser_only=index_teasers)}} <p> - {% if disqus_forum %} + {% if disqus_forum and not post.meta('nocomments')%} <a href="{{post.permalink()}}#disqus_thread" data-disqus-identifier="{{post.base_path}}">Comments</a> {% endif %} </div> @@ -18,11 +18,11 @@ <ul class="pager"> {%if prevlink %} <li class="previous"> - <a href="{{prevlink}}">← {{messages[lang]["Newer posts"]}}</a> + <a href="{{prevlink}}">← {{messages("Newer posts")}}</a> {% endif %} {% if nextlink %} <li class="next"> - <a href="{{nextlink}}">{{messages[lang]["Older posts"]}} →</a> + <a href="{{nextlink}}">{{messages("Older posts")}} →</a> {% endif %} </ul> diff --git a/nikola/data/themes/jinja-default/templates/list_post.tmpl b/nikola/data/themes/jinja-default/templates/list_post.tmpl index 7723214..b4ac59e 100644 --- a/nikola/data/themes/jinja-default/templates/list_post.tmpl +++ b/nikola/data/themes/jinja-default/templates/list_post.tmpl @@ -5,7 +5,7 @@ <h1>{{title}}</h1> <ul class="unstyled"> {% for post in posts %} - <li><a href="{{post.permalink(lang)}}">[{{post.date.strftime(date_format)}}] {{post.title(lang)}}</a> + <li><a href="{{post.permalink()}}">[{{post.formatted_date(date_format)}}] {{post.title()}}</a> {% endfor %} </ul> </div> diff --git a/nikola/data/themes/jinja-default/templates/post.tmpl b/nikola/data/themes/jinja-default/templates/post.tmpl index d14e973..ab96682 100644 --- a/nikola/data/themes/jinja-default/templates/post.tmpl +++ b/nikola/data/themes/jinja-default/templates/post.tmpl @@ -3,49 +3,50 @@ <div class="postbox"> <h1><a href='{{permalink}}'>{{title}}</a></h1> {% if link %} - <p><a href='{{link}}'>{{messages[lang]["Original site"]}}</a></p> + <p><a href='{{link}}'>{{messages("Original site")}}</a></p> {% endif %} <hr> <small> - {{messages[lang]["Posted"]}}: {{post.date.strftime(date_format)}} | + {{messages("Posted")}}: {{post.formatted_date(date_format)}} | {% if translations|length > 1 %} {% for langname in translations.keys() %} {% if langname != lang and post.is_translation_available(langname) %} - <a href="{{post.permalink(langname)}}">{{messages[langname]["Read in English"]}}</a> + <a href="{{post.permalink(langname)}}">{{messages("Read in English", langname)}}</a> | {% endif %} {% endfor %} {% endif %} - - <a href="{{post.pagenames[lang]+".txt"}}" id="sourcelink">{{messages[lang]["Source"]}}</a> + {% if not post.meta('password') + <a href="{{post.meta('slug')+".txt"}}" id="sourcelink">{{messages("Source")}}</a> + {% endif %} {% if post.tags %} - | {{messages[lang]["More posts about"]}} + | {{messages("More posts about")}} {% for tag in post.tags %} - <a href="{{_link("tag", tag, lang)}}"><span class="badge badge-info">{{tag}}</span></a> + <a href="{{_link("tag", tag)}}"><span class="badge badge-info">{{tag}}</span></a> {% endfor %} {% endif %} </small> <hr> - {{post.text(lang)}} + {{post.text()}} <ul class="pager"> {%if post.prev_post %} <li class="previous"> - <a href="{{rel_link(permalink, post.prev_post.permalink(lang))}}">← {{messages[lang]["Previous post"]}}</a> + <a href="{{rel_link(permalink, post.prev_post.permalink())}}">← {{messages("Previous post")}}</a> {% endif %} {%if post.next_post %} <li class="next"> - <a href="{{rel_link(permalink, post.next_post.permalink(lang))}}">{{messages[lang]["Next post"]}} →</a> + <a href="{{rel_link(permalink, post.next_post.permalink())}}">{{messages("Next post")}} →</a> {% endif %} </ul> - {% if disqus_forum %} + {% if disqus_forum and not post.meta('nocomments')%} <div id="disqus_thread"></div> <script type="text/javascript"> var disqus_shortname ="{{disqus_forum}}"; var disqus_url="{{post.permalink(absolute=True)}}"; - var disqus_title={{post.title(lang)|tojson }}; + var disqus_title={{post.title()|tojson }}; var disqus_identifier="{{post.base_path}}"; - var disqus_config = function () { + var disqus_config = function () { this.language = "{{lang}}"; }; (function() { diff --git a/nikola/data/themes/jinja-default/templates/story.tmpl b/nikola/data/themes/jinja-default/templates/story.tmpl index ccaac91..a4ad375 100644 --- a/nikola/data/themes/jinja-default/templates/story.tmpl +++ b/nikola/data/themes/jinja-default/templates/story.tmpl @@ -3,8 +3,23 @@ {% if title %} <h1>{{title}}</h1> {% endif %} - {{post.text(lang)}} -{%if enable_comments %} - {{disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)}} + {{post.text()}} +{%if enable_comments and disqus_forum and not post.meta('nocomments')%} + <div id="disqus_thread"></div> + <script type="text/javascript"> + var disqus_shortname ="{{disqus_forum}}"; + var disqus_url="{{post.permalink(absolute=True)}}"; + var disqus_title={{post.title()|tojson }}; + var disqus_identifier="{{post.base_path}}"; + var disqus_config = function () { + this.language = "{{lang}}"; + }; + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + })(); +</script> +<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> {%endif%} {% endblock %} diff --git a/nikola/data/themes/jinja-default/templates/tag.tmpl b/nikola/data/themes/jinja-default/templates/tag.tmpl index 42720fd..77db27d 100644 --- a/nikola/data/themes/jinja-default/templates/tag.tmpl +++ b/nikola/data/themes/jinja-default/templates/tag.tmpl @@ -1,6 +1,6 @@ {% extends "list_post.tmpl"%} {%block extra_head %} {% for language in translations %} - <link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for tag {{tag}} ({{language}})" href="{{_link("tag_rss", tag, lang)}}"> + <link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for tag {{tag}} ({{language}})" href="{{_link("tag_rss", tag, language)}}"> {% endfor %} {% endblock %} diff --git a/nikola/data/themes/jinja-default/templates/tags.tmpl b/nikola/data/themes/jinja-default/templates/tags.tmpl index 3eae88d..0fa9d0f 100644 --- a/nikola/data/themes/jinja-default/templates/tags.tmpl +++ b/nikola/data/themes/jinja-default/templates/tags.tmpl @@ -3,9 +3,9 @@ <div class="postbox"> <!--Body content--> <h1>{{title}}</h1> - <ul class="unstyled"> + <ul class="unstyled bricks"> {% for text, link in items %} - <li><a href="{{link}}"><span class="badge badge-info">{{text}}</span></a> + <li><a href="{{link}}">{{text}}</a></li> {% endfor %} </ul> <!--End of body content--> diff --git a/nikola/data/themes/monospace/assets/css/code.css b/nikola/data/themes/monospace/assets/css/code.css deleted file mode 100644 index b1d7ace..0000000 --- a/nikola/data/themes/monospace/assets/css/code.css +++ /dev/null @@ -1,62 +0,0 @@ -pre { word-break: pre; white-space: pre; word-wrap: pre; overflow: auto; max-width: 100%;} -td.linenos { vertical-align: top; width: 4em;} -div.code > pre, .code -{ background: #f8f8f8; white-space: pre;} -.code .c { color: #008800; font-style: italic } /* Comment */ -.code .err { border: 1px solid #FF0000 } /* Error */ -.code .k { color: #AA22FF; font-weight: bold } /* Keyword */ -.code .o { color: #666666 } /* Operator */ -.code .cm { color: #008800; font-style: italic } /* Comment.Multiline */ -.code .cp { color: #008800 } /* Comment.Preproc */ -.code .c1 { color: #008800; font-style: italic } /* Comment.Single */ -.code .cs { color: #008800; font-weight: bold } /* Comment.Special */ -.code .gd { color: #A00000 } /* Generic.Deleted */ -.code .ge { font-style: italic } /* Generic.Emph */ -.code .gr { color: #FF0000 } /* Generic.Error */ -.code .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.code .gi { color: #00A000 } /* Generic.Inserted */ -.code .go { color: #808080 } /* Generic.Output */ -.code .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ -.code .gs { font-weight: bold } /* Generic.Strong */ -.code .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.code .gt { color: #0040D0 } /* Generic.Traceback */ -.code .kc { color: #AA22FF; font-weight: bold } /* Keyword.Constant */ -.code .kd { color: #AA22FF; font-weight: bold } /* Keyword.Declaration */ -.code .kp { color: #AA22FF } /* Keyword.Pseudo */ -.code .kr { color: #AA22FF; font-weight: bold } /* Keyword.Reserved */ -.code .kt { color: #AA22FF; font-weight: bold } /* Keyword.Type */ -.code .m { color: #666666 } /* Literal.Number */ -.code .s { color: #BB4444 } /* Literal.String */ -.code .na { color: #BB4444 } /* Name.Attribute */ -.code .nb { color: #AA22FF } /* Name.Builtin */ -.code .nc { color: #0000FF } /* Name.Class */ -.code .no { color: #880000 } /* Name.Constant */ -.code .nd { color: #AA22FF } /* Name.Decorator */ -.code .ni { color: #999999; font-weight: bold } /* Name.Entity */ -.code .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ -.code .nf { color: #00A000 } /* Name.Function */ -.code .nl { color: #A0A000 } /* Name.Label */ -.code .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ -.code .nt { color: #008000; font-weight: bold } /* Name.Tag */ -.code .nv { color: #B8860B } /* Name.Variable */ -.code .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ -.code .mf { color: #666666 } /* Literal.Number.Float */ -.code .mh { color: #666666 } /* Literal.Number.Hex */ -.code .mi { color: #666666 } /* Literal.Number.Integer */ -.code .mo { color: #666666 } /* Literal.Number.Oct */ -.code .sb { color: #BB4444 } /* Literal.String.Backtick */ -.code .sc { color: #BB4444 } /* Literal.String.Char */ -.code .sd { color: #BB4444; font-style: italic } /* Literal.String.Doc */ -.code .s2 { color: #BB4444 } /* Literal.String.Double */ -.code .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ -.code .sh { color: #BB4444 } /* Literal.String.Heredoc */ -.code .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ -.code .sx { color: #008000 } /* Literal.String.Other */ -.code .sr { color: #BB6688 } /* Literal.String.Regex */ -.code .s1 { color: #BB4444 } /* Literal.String.Single */ -.code .ss { color: #B8860B } /* Literal.String.Symbol */ -.code .bp { color: #AA22FF } /* Name.Builtin.Pseudo */ -.code .vc { color: #B8860B } /* Name.Variable.Class */ -.code .vg { color: #B8860B } /* Name.Variable.Global */ -.code .vi { color: #B8860B } /* Name.Variable.Instance */ -.code .il { color: #666666 } /* Literal.Number.Integer.Long */ diff --git a/nikola/data/themes/monospace/bundles b/nikola/data/themes/monospace/bundles index aa35d9c..4760181 100644 --- a/nikola/data/themes/monospace/bundles +++ b/nikola/data/themes/monospace/bundles @@ -1 +1,2 @@ assets/css/all.css=rst.css,code.css,theme.css +assets/css/all-nocdn.css=rst.css,code.css,theme.css diff --git a/nikola/data/themes/monospace/templates/base.tmpl b/nikola/data/themes/monospace/templates/base.tmpl index 9eecbd4..806795d 100644 --- a/nikola/data/themes/monospace/templates/base.tmpl +++ b/nikola/data/themes/monospace/templates/base.tmpl @@ -1,11 +1,13 @@ ## -*- coding: utf-8 -*- <%namespace file="base_helper.tmpl" import="*"/> +${set_locale(lang)} <!DOCTYPE html> <html lang="${lang}"> <head> ${html_head()} <%block name="extra_head"> </%block> + ${extra_head_data} </head> <body class="home blog"> %if add_this_buttons: @@ -23,7 +25,7 @@ <%block name="belowtitle"> %if len(translations) > 1: <small> - ${(messages[lang][u"Also available in"])}: + ${(messages("Also available in"))}: ${html_translations()} </small> %endif @@ -38,6 +40,6 @@ <div id="footer"> ${content_footer} </div> - </div> + </div> ${analytics} </body> diff --git a/nikola/data/themes/monospace/templates/base_helper.tmpl b/nikola/data/themes/monospace/templates/base_helper.tmpl index aba8dff..4f3e45b 100644 --- a/nikola/data/themes/monospace/templates/base_helper.tmpl +++ b/nikola/data/themes/monospace/templates/base_helper.tmpl @@ -4,27 +4,29 @@ <meta name="description" content="${description}" > <meta name="author" content="${blog_author}"> <title>${title} | ${blog_title}</title> - <!-- Le styles --> + ${mathjax_config} %if use_bundles: - <link href="/assets/css/all.css" rel="stylesheet" type="text/css"> - <script src="/assets/js/all.js" type="text/javascript"></script> + %if use_cdn: + <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/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: - <link href="/assets/css/bootstrap.css" rel="stylesheet" type="text/css"> + %if use_cdn: + <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/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"> + %endif <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/slides.css" rel="stylesheet" type="text/css"/> <link href="/assets/css/theme.css" rel="stylesheet" type="text/css"/> %if has_custom_css: <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> %endif - <link href="/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css"> - <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> - <script src="/assets/js/slides.min.jquery.js" type="text/javascript"></script> - <script src="/assets/js/bootstrap.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" type="text/javascript"></script> <![endif]--> @@ -32,7 +34,7 @@ ${rss_link} %else: %for language in translations: - <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, lang)}"> + <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}"> %endfor %endif %if favicons: @@ -48,10 +50,10 @@ <!-- Social buttons --> <div id="addthisbox" class="addthis_toolbox addthis_peekaboo_style addthis_default_style addthis_label_style addthis_32x32_style"> <a class="addthis_button_more">Share</a> - <ul><li><a class="addthis_button_facebook"></a></li> - <li><a class="addthis_button_google_plusone_share"></a></li> - <li><a class="addthis_button_linkedin"></a></li> - <li><a class="addthis_button_twitter"></a></li> + <ul><li><a class="addthis_button_facebook"></a> + <li><a class="addthis_button_google_plusone_share"></a> + <li><a class="addthis_button_linkedin"></a> + <li><a class="addthis_button_twitter"></a> </ul> </div> <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4f7088a56bb93798"></script> @@ -74,7 +76,7 @@ <%def name="html_translations()"> %for langname in translations.keys(): %if langname != lang: - <a href="${_link("index", None, langname)}">${messages[langname]["LANGUAGE"]}</a> + <a href="${_link("index", None, langname)}">${messages("LANGUAGE", langname)}</a> %endif %endfor </%def> diff --git a/nikola/data/themes/monospace/templates/disqus_helper.tmpl b/nikola/data/themes/monospace/templates/disqus_helper.tmpl index 674e20e..4c60f85 100644 --- a/nikola/data/themes/monospace/templates/disqus_helper.tmpl +++ b/nikola/data/themes/monospace/templates/disqus_helper.tmpl @@ -1,6 +1,9 @@ ## -*- coding: utf-8 -*- <%! import json + translations = { + 'es': 'es_ES', + } %> <%def name="html_disqus(url, title, identifier)"> %if disqus_forum: @@ -12,8 +15,8 @@ %endif var disqus_title=${json.dumps(title)}; var disqus_identifier="${identifier}"; - var disqus_config = function () { - this.language = "${lang}"; + var disqus_config = function () { + this.language = "${translations.get(lang, lang)}"; }; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; diff --git a/nikola/data/themes/monospace/templates/index.tmpl b/nikola/data/themes/monospace/templates/index.tmpl index ee57d26..4a0c630 100644 --- a/nikola/data/themes/monospace/templates/index.tmpl +++ b/nikola/data/themes/monospace/templates/index.tmpl @@ -5,22 +5,24 @@ <%block name="content"> % for post in posts: <div class="postbox"> - <h1><a href="${post.permalink(lang)}">${post.title(lang)}</a></h1> + <h1><a href="${post.permalink()}">${post.title()}</a></h1> <div class="meta" style="background-color: rgb(234, 234, 234); "> <span class="authordate"> - ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)} + ${messages("Posted")}: ${post.formatted_date(date_format)} </span> <br> <span class="tags">Tags: %if post.tags: %for tag in post.tags: - <a class="tag" href="${_link('tag', tag, lang)}"><span class="badge badge-info">${tag}</span></a> + <a class="tag" href="${_link('tag', tag)}"><span class="badge badge-info">${tag}</span></a> %endfor %endif </span> </div> - ${post.text(lang, index_teasers)} - ${disqus.html_disqus_link(post.permalink()+"#disqus_thread", post.base_path)} + ${post.text(teaser_only=index_teasers)} + % if not post.meta('nocomments'): + ${disqus.html_disqus_link(post.permalink()+"#disqus_thread", post.base_path)} + % endif </div> % endfor ${helper.html_pager()} diff --git a/nikola/data/themes/monospace/templates/index_helper.tmpl b/nikola/data/themes/monospace/templates/index_helper.tmpl index 114a730..1bb700c 100644 --- a/nikola/data/themes/monospace/templates/index_helper.tmpl +++ b/nikola/data/themes/monospace/templates/index_helper.tmpl @@ -4,12 +4,12 @@ <ul class="pager"> %if prevlink: <li class="previous"> - <a href="${prevlink}">← ${messages[lang]["Newer posts"]}</a> + <a href="${prevlink}">← ${messages("Newer posts")}</a> </li> %endif %if nextlink: <li class="next"> - <a href="${nextlink}">${messages[lang]["Older posts"]} →</a> + <a href="${nextlink}">${messages("Older posts")} →</a> </li> %endif </ul> diff --git a/nikola/data/themes/monospace/templates/list_post.tmpl b/nikola/data/themes/monospace/templates/list_post.tmpl index 1a1cdee..f0e159d 100644 --- a/nikola/data/themes/monospace/templates/list_post.tmpl +++ b/nikola/data/themes/monospace/templates/list_post.tmpl @@ -6,7 +6,7 @@ <h1>${title}</h1> <ul class="unstyled"> % for post in posts: - <li><a href="${post.permalink(lang)}">[${post.date.strftime(date_format)}] ${post.title(lang)}</a> + <li><a href="${post.permalink()}">[${post.formatted_date(date_format)}] ${post.title()}</a> % endfor </ul> </div> diff --git a/nikola/data/themes/monospace/templates/post.tmpl b/nikola/data/themes/monospace/templates/post.tmpl index 2ba27f1..0ec360d 100644 --- a/nikola/data/themes/monospace/templates/post.tmpl +++ b/nikola/data/themes/monospace/templates/post.tmpl @@ -7,13 +7,16 @@ ${helper.html_title()} <div class="meta" style="background-color: rgb(234, 234, 234); "> <span class="authordate"> - ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)} [<a href="${post.pagenames[lang]+'.txt'}" id="sourcelink">${messages[lang]["Source"]}</a>] + ${messages("Posted")}: ${post.formatted_date(date_format)} + % if not post.meta('password'): + [<a href="${post.meta('slug')+'.txt'}" id="sourcelink">${messages("Source")}</a>] + % endif </span> <br> %if post.tags: - <span class="tags">${messages[lang]["Tags"]}: + <span class="tags">${messages("Tags")}: %for tag in post.tags: - <a class="tag" href="${_link('tag', tag, lang)}"><span class="badge badge-info">${tag}</span></a> + <a class="tag" href="${_link('tag', tag)}"><span class="badge badge-info">${tag}</span></a> %endfor </span> <br> @@ -22,8 +25,10 @@ ${helper.html_translations(post)} </span> </div> - ${post.text(lang)} + ${post.text()} ${helper.html_pager(post)} - ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} + % if not post.meta('nocomments'): + ${disqus.html_disqus(post.permalink(absolute=True), post.title(), post.base_path)} + % endif </div> </%block> diff --git a/nikola/data/themes/monospace/templates/post_helper.tmpl b/nikola/data/themes/monospace/templates/post_helper.tmpl index 8651c65..cce0ecf 100644 --- a/nikola/data/themes/monospace/templates/post_helper.tmpl +++ b/nikola/data/themes/monospace/templates/post_helper.tmpl @@ -2,7 +2,7 @@ <%def name="html_title()"> <h1>${title}</h1> % if link: - <p><a href='${link}'>${messages[lang]["Original site"]}</a></p> + <p><a href='${link}'>${messages("Original site")}</a></p> % endif </%def> @@ -12,7 +12,7 @@ %for langname in translations.keys(): %if langname != lang and post.is_translation_available(langname): | - <a href="${post.permalink(langname)}">${messages[langname]["Read in English"]}</a> + <a href="${post.permalink(langname)}">${messages("Read in English", langname)}</a> %endif %endfor %endif @@ -21,25 +21,53 @@ <%def name="html_tags(post)"> %if post.tags: - | ${messages[lang]["More posts about"]} + | ${messages("More posts about")} %for tag in post.tags: - <a class="tag" href="${_link('tag', tag, lang)}"><span class="badge badge-info">${tag}</span></a> + <a class="tag" href="${_link('tag', tag)}"><span class="badge badge-info">${tag}</span></a> %endfor %endif </%def> - <%def name="html_pager(post)"> <ul class="pager"> %if post.prev_post: <li class="previous"> - <a href="${post.prev_post.permalink(lang)}">← ${messages[lang]["Previous post"]}</a> + <a href="${post.prev_post.permalink()}">← ${messages("Previous post")}</a> </li> %endif %if post.next_post: <li class="next"> - <a href="${post.next_post.permalink(lang)}">${messages[lang]["Next post"]} →</a> + <a href="${post.next_post.permalink()}">${messages("Next post")} →</a> </li> %endif </ul> </%def> + +<%def name="twitter_card_information(post)"> + %if twitter_card and twitter_card['use_twitter_cards']: + <meta name="twitter:card" content="${twitter_card.get('card', 'summary')|h}"> + <meta name="og:url" content="${post.permalink(absolute=True)}"> + %if 'site:id' in twitter_card: + <meta name="twitter:site:id" content="${twitter_card['site:id']}"> + %elif 'site' in twitter_card: + <meta name="twitter:site" content="${twitter_card['site']}"> + %endif + %if 'creator:id' in twitter_card: + <meta name="twitter:creator:id" content="${twitter_card['creator:id']}"> + %elif 'creator' in twitter_card: + <meta name="twitter:creator" content="${twitter_card['creator']}"> + %endif + <meta name="og:title" content="${post.title()[:70]|h}"> + %if post.description(): + <meta name="og:description" content="${post.description()[:200]|h}"> + %else: + <meta name="og:description" content="${post.text(strip_html=True)[:200]|h}"> + %endif + %endif +</%def> + +<%def name="mathjax_script(post)"> + %if post.is_mathjax: + <script src="/assets/js/mathjax.js" type="text/javascript"></script> + %endif +</%def> diff --git a/nikola/data/themes/monospace/templates/story.tmpl b/nikola/data/themes/monospace/templates/story.tmpl index 30d263b..21d0e2f 100644 --- a/nikola/data/themes/monospace/templates/story.tmpl +++ b/nikola/data/themes/monospace/templates/story.tmpl @@ -1,11 +1,15 @@ ## -*- coding: utf-8 -*- <%inherit file="post.tmpl"/> +<%namespace name="helper" file="post_helper.tmpl"/> +<%block name="extra_head"> +${helper.twitter_card_information(post)} +</%block> <%block name="content"> %if title: <h1>${title}</h1> %endif - ${post.text(lang)} -%if enable_comments: - ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} + ${post.text()} +%if enable_comments and not post.meta('nocomments'): + ${disqus.html_disqus(post.permalink(absolute=True), post.title(), post.base_path)} %endif </%block> diff --git a/nikola/data/themes/monospace/templates/tag.tmpl b/nikola/data/themes/monospace/templates/tag.tmpl index 7c89ad1..97aafeb 100644 --- a/nikola/data/themes/monospace/templates/tag.tmpl +++ b/nikola/data/themes/monospace/templates/tag.tmpl @@ -2,6 +2,6 @@ <%inherit file="list_post.tmpl"/> <%block name="extra_head"> %for language in translations: - <link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for tag ${tag} (${language})" href="${_link("tag_rss", tag, lang)}"> + <link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for tag ${tag} (${language})" href="${_link("tag_rss", tag, language)}"> %endfor </%block> diff --git a/nikola/data/themes/orphan/assets/css/code.css b/nikola/data/themes/orphan/assets/css/code.css deleted file mode 120000 index 6b2b872..0000000 --- a/nikola/data/themes/orphan/assets/css/code.css +++ /dev/null @@ -1 +0,0 @@ -../../../default/assets/css/code.css
\ No newline at end of file diff --git a/nikola/data/themes/orphan/templates/base.tmpl b/nikola/data/themes/orphan/templates/base.tmpl index 39e2b9d..2a62b58 100644 --- a/nikola/data/themes/orphan/templates/base.tmpl +++ b/nikola/data/themes/orphan/templates/base.tmpl @@ -1,11 +1,13 @@ ## -*- coding: utf-8 -*- <%namespace file="base_helper.tmpl" import="*"/> +${set_locale(lang)} <!DOCTYPE html> <html lang="${lang}"> <head> ${html_head()} <%block name="extra_head"> </%block> + ${extra_head_data} </head> <body> %if add_this_buttons: @@ -17,7 +19,7 @@ <%block name="belowtitle"> %if len(translations) > 1: <small> - ${(messages[lang][u"Also available in"])}: + ${(messages("Also available in"))}: ${html_translations()} </small> %endif diff --git a/nikola/data/themes/orphan/templates/base_helper.tmpl b/nikola/data/themes/orphan/templates/base_helper.tmpl index aba8dff..4f3e45b 100644 --- a/nikola/data/themes/orphan/templates/base_helper.tmpl +++ b/nikola/data/themes/orphan/templates/base_helper.tmpl @@ -4,27 +4,29 @@ <meta name="description" content="${description}" > <meta name="author" content="${blog_author}"> <title>${title} | ${blog_title}</title> - <!-- Le styles --> + ${mathjax_config} %if use_bundles: - <link href="/assets/css/all.css" rel="stylesheet" type="text/css"> - <script src="/assets/js/all.js" type="text/javascript"></script> + %if use_cdn: + <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/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: - <link href="/assets/css/bootstrap.css" rel="stylesheet" type="text/css"> + %if use_cdn: + <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/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"> + %endif <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/slides.css" rel="stylesheet" type="text/css"/> <link href="/assets/css/theme.css" rel="stylesheet" type="text/css"/> %if has_custom_css: <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> %endif - <link href="/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css"> - <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> - <script src="/assets/js/slides.min.jquery.js" type="text/javascript"></script> - <script src="/assets/js/bootstrap.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" type="text/javascript"></script> <![endif]--> @@ -32,7 +34,7 @@ ${rss_link} %else: %for language in translations: - <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, lang)}"> + <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}"> %endfor %endif %if favicons: @@ -48,10 +50,10 @@ <!-- Social buttons --> <div id="addthisbox" class="addthis_toolbox addthis_peekaboo_style addthis_default_style addthis_label_style addthis_32x32_style"> <a class="addthis_button_more">Share</a> - <ul><li><a class="addthis_button_facebook"></a></li> - <li><a class="addthis_button_google_plusone_share"></a></li> - <li><a class="addthis_button_linkedin"></a></li> - <li><a class="addthis_button_twitter"></a></li> + <ul><li><a class="addthis_button_facebook"></a> + <li><a class="addthis_button_google_plusone_share"></a> + <li><a class="addthis_button_linkedin"></a> + <li><a class="addthis_button_twitter"></a> </ul> </div> <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4f7088a56bb93798"></script> @@ -74,7 +76,7 @@ <%def name="html_translations()"> %for langname in translations.keys(): %if langname != lang: - <a href="${_link("index", None, langname)}">${messages[langname]["LANGUAGE"]}</a> + <a href="${_link("index", None, langname)}">${messages("LANGUAGE", langname)}</a> %endif %endfor </%def> diff --git a/nikola/data/themes/orphan/templates/disqus_helper.tmpl b/nikola/data/themes/orphan/templates/disqus_helper.tmpl index 674e20e..4c60f85 100644 --- a/nikola/data/themes/orphan/templates/disqus_helper.tmpl +++ b/nikola/data/themes/orphan/templates/disqus_helper.tmpl @@ -1,6 +1,9 @@ ## -*- coding: utf-8 -*- <%! import json + translations = { + 'es': 'es_ES', + } %> <%def name="html_disqus(url, title, identifier)"> %if disqus_forum: @@ -12,8 +15,8 @@ %endif var disqus_title=${json.dumps(title)}; var disqus_identifier="${identifier}"; - var disqus_config = function () { - this.language = "${lang}"; + var disqus_config = function () { + this.language = "${translations.get(lang, lang)}"; }; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; diff --git a/nikola/data/themes/orphan/templates/index.tmpl b/nikola/data/themes/orphan/templates/index.tmpl index 1a436e2..59d391a 100644 --- a/nikola/data/themes/orphan/templates/index.tmpl +++ b/nikola/data/themes/orphan/templates/index.tmpl @@ -5,13 +5,15 @@ <%block name="content"> % for post in posts: <div class="postbox"> - <h1><a href="${post.permalink(lang)}">${post.title(lang)}</a> + <h1><a href="${post.permalink()}">${post.title()}</a> <small> - ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)} + ${messages("Posted")}: ${post.formatted_date(date_format)} </small></h1> <hr> - ${post.text(lang, index_teasers)} - ${disqus.html_disqus_link(post.permalink()+"#disqus_thread", post.base_path)} + ${post.text(teaser_only=index_teasers)} + % if not post.meta('nocomments'): + ${disqus.html_disqus_link(post.permalink()+"#disqus_thread", post.base_path)} + % endif </div> % endfor ${helper.html_pager()} diff --git a/nikola/data/themes/orphan/templates/index_helper.tmpl b/nikola/data/themes/orphan/templates/index_helper.tmpl index 114a730..1bb700c 100644 --- a/nikola/data/themes/orphan/templates/index_helper.tmpl +++ b/nikola/data/themes/orphan/templates/index_helper.tmpl @@ -4,12 +4,12 @@ <ul class="pager"> %if prevlink: <li class="previous"> - <a href="${prevlink}">← ${messages[lang]["Newer posts"]}</a> + <a href="${prevlink}">← ${messages("Newer posts")}</a> </li> %endif %if nextlink: <li class="next"> - <a href="${nextlink}">${messages[lang]["Older posts"]} →</a> + <a href="${nextlink}">${messages("Older posts")} →</a> </li> %endif </ul> diff --git a/nikola/data/themes/orphan/templates/list_post.tmpl b/nikola/data/themes/orphan/templates/list_post.tmpl index 1a1cdee..f0e159d 100644 --- a/nikola/data/themes/orphan/templates/list_post.tmpl +++ b/nikola/data/themes/orphan/templates/list_post.tmpl @@ -6,7 +6,7 @@ <h1>${title}</h1> <ul class="unstyled"> % for post in posts: - <li><a href="${post.permalink(lang)}">[${post.date.strftime(date_format)}] ${post.title(lang)}</a> + <li><a href="${post.permalink()}">[${post.formatted_date(date_format)}] ${post.title()}</a> % endfor </ul> </div> diff --git a/nikola/data/themes/orphan/templates/post.tmpl b/nikola/data/themes/orphan/templates/post.tmpl index 672d4f6..6f6529d 100644 --- a/nikola/data/themes/orphan/templates/post.tmpl +++ b/nikola/data/themes/orphan/templates/post.tmpl @@ -7,15 +7,19 @@ ${helper.html_title()} <hr> <small> - ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)} + ${messages("Posted")}: ${post.formatted_date(date_format)} ${helper.html_translations(post)} | - <a href="${post.pagenames[lang]+'.txt'}" id="sourcelink">${messages[lang]["Source"]}</a> + % if not post.meta('password'): + <a href="${post.meta('slug')+'.txt'}" id="sourcelink">${messages("Source")}</a> + % endif ${helper.html_tags(post)} </small> <hr> - ${post.text(lang)} + ${post.text()} ${helper.html_pager(post)} - ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} + % if not post.meta('nocomments'): + ${disqus.html_disqus(post.permalink(absolute=True), post.title(), post.base_path)} + % endif </div> </%block> diff --git a/nikola/data/themes/orphan/templates/post_helper.tmpl b/nikola/data/themes/orphan/templates/post_helper.tmpl index a3dc75f..cce0ecf 100644 --- a/nikola/data/themes/orphan/templates/post_helper.tmpl +++ b/nikola/data/themes/orphan/templates/post_helper.tmpl @@ -2,7 +2,7 @@ <%def name="html_title()"> <h1>${title}</h1> % if link: - <p><a href='${link}'>${messages[lang]["Original site"]}</a></p> + <p><a href='${link}'>${messages("Original site")}</a></p> % endif </%def> @@ -10,9 +10,9 @@ <%def name="html_translations(post)"> %if len(translations) > 1: %for langname in translations.keys(): - %if langname != lang and post.is_translation_available(langname): + %if langname != lang and post.is_translation_available(langname): | - <a href="${post.permalink(langname)}">${messages[langname]["Read in English"]}</a> + <a href="${post.permalink(langname)}">${messages("Read in English", langname)}</a> %endif %endfor %endif @@ -21,25 +21,53 @@ <%def name="html_tags(post)"> %if post.tags: - | ${messages[lang]["More posts about"]} + | ${messages("More posts about")} %for tag in post.tags: - <a class="tag" href="${_link('tag', tag, lang)}"><span class="badge badge-info">${tag}</span></a> + <a class="tag" href="${_link('tag', tag)}"><span class="badge badge-info">${tag}</span></a> %endfor %endif </%def> - <%def name="html_pager(post)"> <ul class="pager"> %if post.prev_post: <li class="previous"> - <a href="${post.prev_post.permalink(lang)}">← ${messages[lang]["Previous post"]}</a> + <a href="${post.prev_post.permalink()}">← ${messages("Previous post")}</a> </li> %endif %if post.next_post: <li class="next"> - <a href="${post.next_post.permalink(lang)}">${messages[lang]["Next post"]} →</a> + <a href="${post.next_post.permalink()}">${messages("Next post")} →</a> </li> %endif </ul> </%def> + +<%def name="twitter_card_information(post)"> + %if twitter_card and twitter_card['use_twitter_cards']: + <meta name="twitter:card" content="${twitter_card.get('card', 'summary')|h}"> + <meta name="og:url" content="${post.permalink(absolute=True)}"> + %if 'site:id' in twitter_card: + <meta name="twitter:site:id" content="${twitter_card['site:id']}"> + %elif 'site' in twitter_card: + <meta name="twitter:site" content="${twitter_card['site']}"> + %endif + %if 'creator:id' in twitter_card: + <meta name="twitter:creator:id" content="${twitter_card['creator:id']}"> + %elif 'creator' in twitter_card: + <meta name="twitter:creator" content="${twitter_card['creator']}"> + %endif + <meta name="og:title" content="${post.title()[:70]|h}"> + %if post.description(): + <meta name="og:description" content="${post.description()[:200]|h}"> + %else: + <meta name="og:description" content="${post.text(strip_html=True)[:200]|h}"> + %endif + %endif +</%def> + +<%def name="mathjax_script(post)"> + %if post.is_mathjax: + <script src="/assets/js/mathjax.js" type="text/javascript"></script> + %endif +</%def> diff --git a/nikola/data/themes/orphan/templates/story.tmpl b/nikola/data/themes/orphan/templates/story.tmpl index 30d263b..21d0e2f 100644 --- a/nikola/data/themes/orphan/templates/story.tmpl +++ b/nikola/data/themes/orphan/templates/story.tmpl @@ -1,11 +1,15 @@ ## -*- coding: utf-8 -*- <%inherit file="post.tmpl"/> +<%namespace name="helper" file="post_helper.tmpl"/> +<%block name="extra_head"> +${helper.twitter_card_information(post)} +</%block> <%block name="content"> %if title: <h1>${title}</h1> %endif - ${post.text(lang)} -%if enable_comments: - ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} + ${post.text()} +%if enable_comments and not post.meta('nocomments'): + ${disqus.html_disqus(post.permalink(absolute=True), post.title(), post.base_path)} %endif </%block> diff --git a/nikola/data/themes/orphan/templates/tag.tmpl b/nikola/data/themes/orphan/templates/tag.tmpl index 7c89ad1..97aafeb 100644 --- a/nikola/data/themes/orphan/templates/tag.tmpl +++ b/nikola/data/themes/orphan/templates/tag.tmpl @@ -2,6 +2,6 @@ <%inherit file="list_post.tmpl"/> <%block name="extra_head"> %for language in translations: - <link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for tag ${tag} (${language})" href="${_link("tag_rss", tag, lang)}"> + <link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for tag ${tag} (${language})" href="${_link("tag_rss", tag, language)}"> %endfor </%block> diff --git a/nikola/data/themes/site-planetoid/README b/nikola/data/themes/site-planetoid/README new file mode 100644 index 0000000..c148591 --- /dev/null +++ b/nikola/data/themes/site-planetoid/README @@ -0,0 +1 @@ +A version of the site theme for the use with the "planetoid" plugin. diff --git a/nikola/data/themes/site-planetoid/engine b/nikola/data/themes/site-planetoid/engine new file mode 100644 index 0000000..2951cdd --- /dev/null +++ b/nikola/data/themes/site-planetoid/engine @@ -0,0 +1 @@ +mako diff --git a/nikola/data/themes/site-planetoid/parent b/nikola/data/themes/site-planetoid/parent new file mode 100644 index 0000000..1320f90 --- /dev/null +++ b/nikola/data/themes/site-planetoid/parent @@ -0,0 +1 @@ +site diff --git a/nikola/data/themes/site-planetoid/templates/index.tmpl b/nikola/data/themes/site-planetoid/templates/index.tmpl new file mode 100644 index 0000000..29243e0 --- /dev/null +++ b/nikola/data/themes/site-planetoid/templates/index.tmpl @@ -0,0 +1,16 @@ +## -*- coding: utf-8 -*- +<%namespace name="helper" file="index_helper.tmpl"/> +<%inherit file="base.tmpl"/> +<%block name="content"> + % for post in posts: + <div style="border: 2px solid darkgrey; margin-bottom: 12px; border-radius: 4px; padding:12px; overflow: auto;"> + <a href="${post.meta('link')}"><h1>${post.title(lang)}</a> + <small> + ${messages("Posted")}: <time class="published" datetime="${post.date.isoformat()}">${post.formatted_date(date_format)}</time> + </small></h1> + ${post.text(lang)} + </div> + % endfor + ${helper.html_pager()} +</ul> +</%block> diff --git a/nikola/data/themes/site-planetoid/templates/post.tmpl b/nikola/data/themes/site-planetoid/templates/post.tmpl new file mode 100644 index 0000000..d60de78 --- /dev/null +++ b/nikola/data/themes/site-planetoid/templates/post.tmpl @@ -0,0 +1,9 @@ +## -*- coding: utf-8 -*- +<html> +<head> +<meta http-equiv="Refresh" content="0;url=${post.meta('link')}"> +</head> +<body> +Redirecting you to <a href="${post.meta('link')}">the original location.</a> +</body> +</html> diff --git a/nikola/data/themes/site-planetoid/templates/story.tmpl b/nikola/data/themes/site-planetoid/templates/story.tmpl new file mode 100644 index 0000000..7712e71 --- /dev/null +++ b/nikola/data/themes/site-planetoid/templates/story.tmpl @@ -0,0 +1,25 @@ +## -*- coding: utf-8 -*- +<%namespace name="helper" file="post_helper.tmpl"/> +<%namespace name="disqus" file="disqus_helper.tmpl"/> +<%inherit file="base.tmpl"/> +<%block name="extra_head"> +${helper.twitter_card_information(post)} +</%block> + +<%block name="content"> +%if title: + <h1>${title}</h1> +%endif + ${post.text()} +%if enable_comments and not post.meta('nocomments'): + ${disqus.html_disqus(post.permalink(absolute=True), post.title(), post.base_path)} +%endif +</%block> + +<%block name="sourcelink"> +% if not post.meta('password'): + <li> + <a href="${post.meta('slug')+post.source_ext()}" id="sourcelink">${messages("Source")}</a> + </li> +% endif +</%block> diff --git a/nikola/data/themes/site/assets/css/theme.css b/nikola/data/themes/site/assets/css/theme.css index aa0ee4a..24072ac 100644 --- a/nikola/data/themes/site/assets/css/theme.css +++ b/nikola/data/themes/site/assets/css/theme.css @@ -64,3 +64,17 @@ blockquote p, blockquote { line-height: 1.25; } +ul.bricks > li { + display: inline; + background-color: lightblue; + padding: 8px; + border-radius: 5px; + line-height: 3; + white-space:nowrap; + margin: 3px; +} + +h1, h2, h3, h4, h5, h6, h7 { + margin-top: -40px; + padding-top: 40px; +} diff --git a/nikola/data/themes/site/templates/base.tmpl b/nikola/data/themes/site/templates/base.tmpl index 416d04b..4efd0ad 100644 --- a/nikola/data/themes/site/templates/base.tmpl +++ b/nikola/data/themes/site/templates/base.tmpl @@ -1,5 +1,6 @@ ## -*- coding: utf-8 -*- <%namespace file="base_helper.tmpl" import="*"/> +${set_locale(lang)} <!DOCTYPE html> <html lang="${lang}"> <head> @@ -7,20 +8,21 @@ ${html_head()} <%block name="extra_head"> </%block> + ${extra_head_data} </head> <body> <!-- Menubar --> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> - + <!-- .btn-navbar is used as the toggle for collapsed navbar content --> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> - </a> - + </a> + <a class="brand" href="${abs_link('/')}"> ${blog_title} </a> @@ -52,14 +54,14 @@ <div class="span8"> <%block name="content"></%block> </div> - </div> + </div> <!--End of body content--> </div> <div class="footerbox"> ${content_footer} </div> ${html_social()} -${analytics} ${late_load_js()} +${analytics} <script type="text/javascript">jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"80%",maxHeight:"80%",scalePhotos:true});</script> </body> |
