Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into import_page
- Loading branch information
Showing
23 changed files
with
329 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Use tx3TagCloud to render our tags in a pretty web: | ||
|
||
* https://github.com/Tuxes3/tx3TagCloud | ||
|
||
**YOU HAVE TO COPY** the template | ||
`tx3_tag_cloud/templates/mako/tags.tmpl` in your THEME folder to make | ||
it work properly. This templates includes the JS and CSS files needed | ||
to render tx3TagCloud and also removes the tags rendered in the old | ||
way. | ||
|
||
Something like: `<your-nikola-site>/themes/<your-theme>/templates/` |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ul.tx3-tag-cloud | ||
{ | ||
|
||
} | ||
|
||
ul.tx3-tag-cloud li | ||
{ | ||
display: block; | ||
float: left; | ||
list-style: none; | ||
margin-right: 4px; | ||
} | ||
|
||
ul.tx3-tag-cloud li a | ||
{ | ||
display: block; | ||
text-decoration: none; | ||
color: #c9c9c9; | ||
padding: 3px 10px; | ||
} | ||
|
||
ul.tx3-tag-cloud li a:hover | ||
{ | ||
color: #000000; | ||
-webkit-transition: color 250ms linear; | ||
-moz-transition: color 250ms linear; | ||
-o-transition: color 250ms linear; | ||
-ms-transition: color 250ms linear; | ||
transition: color 250ms linear; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* ---------------------------------------------------------------------------- | ||
* "THE BEER-WARE LICENSE" (Revision 42): | ||
* Tuxes3 wrote this file. As long as you retain this notice you | ||
* can do whatever you want with this stuff. If we meet some day, and you think | ||
* this stuff is worth it, you can buy me a beer in return Tuxes3 | ||
* ---------------------------------------------------------------------------- | ||
*/ | ||
(function($) | ||
{ | ||
var settings; | ||
$.fn.tx3TagCloud = function(options) | ||
{ | ||
|
||
// | ||
// DEFAULT SETTINGS | ||
// | ||
settings = $.extend({ | ||
multiplier : 1 | ||
}, options); | ||
main(this); | ||
|
||
} | ||
|
||
function main(element) | ||
{ | ||
// adding style attr | ||
element.addClass("tx3-tag-cloud"); | ||
addListElementFontSize(element); | ||
} | ||
|
||
/** | ||
* calculates the font size on each li element | ||
* according to their data-weight attribut | ||
*/ | ||
function addListElementFontSize(element) | ||
{ | ||
var hDataWeight = -9007199254740992; | ||
var lDataWeight = 9007199254740992; | ||
$.each(element.find("li"), function(){ | ||
cDataWeight = getDataWeight(this); | ||
if (cDataWeight == undefined) | ||
{ | ||
logWarning("No \"data-weight\" attribut defined on <li> element"); | ||
} | ||
else | ||
{ | ||
hDataWeight = cDataWeight > hDataWeight ? cDataWeight : hDataWeight; | ||
lDataWeight = cDataWeight < lDataWeight ? cDataWeight : lDataWeight; | ||
} | ||
}); | ||
$.each(element.find("li"), function(){ | ||
var dataWeight = getDataWeight(this); | ||
var percent = Math.abs((dataWeight - lDataWeight)/(lDataWeight - hDataWeight)); | ||
$(this).css('font-size', (1 + (percent * settings['multiplier'])) + "em"); | ||
}); | ||
|
||
} | ||
|
||
function getDataWeight(element) | ||
{ | ||
return parseInt($(element).attr("data-weight")); | ||
} | ||
|
||
function logWarning(message) | ||
{ | ||
console.log("[WARNING] " + Date.now() + " : " + message); | ||
} | ||
|
||
}(jQuery)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function create_li_tags() { | ||
$.getJSON("/assets/js/tx3_tag_cloud.json", function(data){ | ||
var items = []; | ||
$.each(data, function(key, val){ | ||
var count = val[0] | ||
var url = val[1] | ||
var posts = val[2] | ||
items.push("<li data-weight='" + count + "'><a href='" + url + "'>" + key + "</a></li>"); | ||
}); | ||
|
||
$("<ul/>", { | ||
"id": "tagcloud", | ||
html: items.join("") | ||
}).appendTo("div.row"); | ||
|
||
$("#tagcloud").tx3TagCloud({ | ||
multiplier: 5 // default multiplier is "1" | ||
}); | ||
}); | ||
} | ||
create_li_tags(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
## -*- coding: utf-8 -*- | ||
<%inherit file="base.tmpl"/> | ||
|
||
<%block name="extra_head"> | ||
${parent.extra_head()} | ||
<link href="/assets/css/tx3-tag-cloud.css" rel="stylesheet" type="text/css"> | ||
<style> | ||
li { | ||
line-height: 70px !important; | ||
} | ||
</style> | ||
</%block> | ||
|
||
<%block name="content"> | ||
<h1>${title}</h1> | ||
% if cat_items: | ||
% if items: | ||
<h2>${messages("Categories")}</h2> | ||
% endif | ||
% for text, full_name, path, link, indent_levels, indent_change_before, indent_change_after in cat_hierarchy: | ||
% for i in range(indent_change_before): | ||
<ul class="unstyled"> | ||
% endfor | ||
<li><a class="reference badge" href="${link}">${text}</a> | ||
% if indent_change_after <= 0: | ||
</li> | ||
% endif | ||
% for i in range(-indent_change_after): | ||
</ul> | ||
% if i + 1 < len(indent_levels): | ||
</li> | ||
% endif | ||
% endfor | ||
% endfor | ||
% if items: | ||
<h2>${messages("Tags")}</h2> | ||
% endif | ||
%endif | ||
</%block> | ||
|
||
<%block name="extra_js"> | ||
<script type="text/javascript" src="/assets/js/jquery.tx3-tag-cloud.js"></script> | ||
<script type="text/javascript" src="/assets/js/tx3-tag-cloud.js"></script> | ||
</%block> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Core] | ||
Name = tx3TagCloud | ||
Module = tx3_tag_cloud | ||
|
||
[Nikola] | ||
MinVersion = 7.6.3 | ||
|
||
[Documentation] | ||
Author = Manuel Kaufmann | ||
Version = 0.1 | ||
Website = http://plugins.getnikola.com/#tx3_tag_cloud | ||
Description = Show tags in a pretty way using tx3TagCloud (https://github.com/Tuxes3/tx3TagCloud) |
Oops, something went wrong.