master
marieotsuka 2018-09-27 13:10:47 -04:00
rodzic b471ba656c
commit b2a3113c7e
25 zmienionych plików z 1637 dodań i 0 usunięć

2
.gitignore vendored 100644
Wyświetl plik

@ -0,0 +1,2 @@
.DS_Store

Wyświetl plik

@ -1,2 +1,3 @@
# solar
Theme for solar-powered low-tech magazine
More documentation to come soon.

Wyświetl plik

@ -0,0 +1,798 @@
/*
Name: Low-tech theme
Date: August 2018
Description: Custom theme for Low-Tech Magazine
Version: 3.0
*/
$color: black;
$color_sky: #f0f8ff;
$color_sub: #adadad;
$color_bg: #fff5d1;
$color_low: #162dab;
$color_hig: #d11305;
$color_obs: #006951;
// $font_family: Arial, sans-serif;
$pad: 0.5rem;
$font_s: 0.8rem;
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html {
font-size: 20px;
}
body {
// font-family: $font_family;
background: $color_sky;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: normal;
}
h1 {
font-size: 2.5rem;
line-height: 0.95;
text-indent: -.15rem;
}
p {
line-height: 1.4;
}
a {
color: $color;
text-decoration: none;
&:hover{
color: $color_sub !important;
text-decoration: none;
}
}
#content {
margin: auto;
padding-bottom: 2*$pad;
}
#content h1 {
margin-top: 2*$pad;
}
/*
BACKGROUND
*/
#battery {
position: fixed;
bottom: 0;
left: 0;
width: 100vw;
background: $color_bg;
}
#bat_data {
border-top: 1px solid $color_sub;
position: absolute;
top: 0;
right: 0;
z-index: 20;
color: $color_sub;
font-size: 0.75rem;
text-align: right;
padding-right: 1rem;
}
#spark{
display: inline-block;
width: 20px;
}
main {
position: absolute;
top: 0;
left: 0;
right: 0;
padding: 2*$pad;
}
/*
CATEGORY COLORS
*/
.description p {
display: none;
}
.low, li.low {
.featured-img,
p.img {
background-color: $color_low;
}
.category {
color: $color_low;
}
.category-low{
display: block;
}
}
.hig, li.hig {
.featured-img,
p.img {
background-color: $color_hig;
}
.category {
color: $color_hig;
}
.category-hig{
display: block;
}
}
.obs {
.featured-img,
p.img {
background-color: $color_obs;
}
.category {
color: $color_obs;
}
.category-obs{
display: block;
}
}
header.top {
padding-bottom: $pad;
border-bottom: 2px solid $color;
h1 {
text-transform: uppercase;
}
}
/*
NAVIGATION
*/
#menu-s {
display: none;
}
#menu {
ul {
display: inline-block;
}
.category {
margin: 0;
}
li {
display: inline-block;
}
li::after{
content: " | ";
}
li:last-child::after{
content: "";
}
}
nav .category {
display: inline-block;
}
.subtitle {
margin: 0.5*$pad 0;
color: $color_sub;
}
.gray {
color: $color_sub;
}
.social {
display: inline-block;
vertical-align: -3px;
a:last-child{
padding-left: 5px;
}
a:hover svg{
fill: $color_sub;
}
}
.icon {
width: 20px;
height: 20px;
}
.bar {
width: 100px;
background: black;
margin: 10px;
}
#burger{
position: fixed;
top: 0;
right: 0;
}
/*
INDEX LIST
*/
time {
display: block;
color: $color_sub;
font-size: $font_s;
}
.post-list {
list-style-type: none;
width: 100%;
display: flex;
flex-wrap: wrap;
li {
max-width: 25%;
padding: 2*$pad 2*$pad 2*$pad 0;
}
li:nth-child(4n){
padding-right: 0;
}
time {
margin-top: 0.5*$pad;
}
}
.cover {
li{
flex: 1;
}
li:nth-child(2) {
flex: 3;
max-width: none;
padding-right: 0;
}
.featured-img {
height: 500px;
background-size: 100%;
}
}
.featured-img {
margin: $pad 0;
width: 100%;
height: 200px;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
background-blend-mode: hard-light;
mix-blend-mode: multiply;
}
.category {
display: block;
margin: 0.5*$pad 0;
}
.popular{
display: none;
li {
max-width: 25%;
}
h2{
font-size: 1rem;
}
.category,.index-summary{
font-size: $font_s;
}
}
.index1 .popular{
display: flex;
}
.paginator{
margin: 2rem auto;
text-align: center;
font-size: 1rem;
a{
font-size: 1.5rem;
}
}
/*
ARCHIVES
*/
#archive {
list-style-type: none;
margin-bottom: 2rem;
li {
padding: 0.5*$pad 0;
overflow: auto;
border-bottom: 2px solid transparent;
&:hover {
border-color: $color;
}
}
.category,
.entry-title,
time {
float: left;
padding-right: $pad;
}
time{
color: black;
font-size: 1rem;
}
time, #date {
width: 20%;
}
#title,
.entry-title {
width: 60%;
}
#cat,
.category {
margin: 0;
width: 20%;
}
}
#filters {
padding: 0.5*$pad 0;
text-transform: uppercase;
letter-spacing: 1px;
overflow: auto;
color: $color;
> div {
float: left;
}
}
.filter {
&:hover {
cursor: pointer;
}
}
.filter.active.asc {
&::after {
content: "\2191";
}
}
.filter.active.desc {
&::after {
content: "\2193";
}
}
/*
ARTICLE TYPOGRAPHY
*/
.post-info {
overflow: auto;
margin-top: 0.5*$pad;
font-size: $font_s;
time {
float: left;
font-style: normal;
padding-right: 0.2rem;
}
address {
float: left;
font-style: normal;
padding-right: $pad;
}
.tags a {
text-decoration: underline;
&:hover {
text-decoration: none;
}
}
}
.entry-content {
h2,
h3,
ol,
p,
ul {
max-width: 33rem;
width: 80%;
}
h2 {
font-size: 2rem;
text-indent: -.15rem;
margin: 6*$pad auto 0;
}
h3 {
margin: 4*$pad auto 0;
}
p {
margin: 2*$pad auto;
}
a {
text-decoration: underline;
&:hover {
text-decoration: none;
}
}
ol,
ul {
margin: 2*$pad auto;
}
p.img {
font-size: $font_s;
font-style: normal;
width: 100%;
max-width: none;
mix-blend-mode: multiply;
}
img {
display: block;
mix-blend-mode: hard-light;
}
.caption{
display: block;
background: white;
padding: .5*$pad;
}
li {
margin-left: 2*$pad;
margin-bottom: $pad;
}
}
p.summary {
font-size: 1.5rem;
text-indent: 0;
margin-top: 2*$pad;
line-height: 1.2;
}
blockquote {
p {
font-size: 1.3rem;
line-height: 1.3;
text-indent: 0;
}
margin: 2*$pad 0;
border: 1px solid $color;
border-width: 2px 0;
}
.longquote {
margin: 2*$pad 2*$pad 0;
border-left: 1px solid $color;
padding-left: 2*$pad;
p {
font-size: 0.9rem;
}
}
img {
width: 100%;
display: block;
}
iframe{
margin: auto;
display: block;
}
/*
FOOTNOTES
*/
hr {
border: 0;
border-top: 2px solid black;
}
.footnote {
font-size: $font_s;
padding-top: $pad;
width: 80%;
max-width: 33rem;
margin: auto;
ol {
width: 100%;
}
p {
line-height: 1.2;
word-wrap: break-word;
margin: 0;
width: 100%;
}
}
sup {
vertical-align: baseline;
font-size: 0.75rem;
}
sub {
vertical-align: baseline;
font-size: 0.75rem;
}
.ref {
border: 1px solid $color;
padding: $pad;
background: #fff;
z-index: 10;
position: absolute;
right: 0;
width: 300px;
margin-top: -2rem;
max-width: 50%;
display: none;
p {
margin: 0;
word-wrap: break-word;
display: inline;
}
&:hover {
cursor: pointer;
}
.footnote-backref {
display: none;
}
}
a.footnote-ref {
text-decoration: none;
padding-right: 0.5*$pad;
&:hover {
cursor: pointer;
}
}
[id^=fn] {
.ref {
text-indent: 0;
}
}
.show {
.ref {
display: block;
}
}
.button {
display: block;
padding: $pad;
border: 2px solid $color;
border-width: 2px;
text-align: center;
margin: 1rem auto;
width: 400px;
&:hover{
cursor: pointer;
color: $color_sub;
border-color: $color_sub;
}
}
footer#content-info {
.support {
float: left;
margin-top: $pad;
width: auto;
}
h2 {
margin-bottom: 1rem;
}
border-top: 2px solid $color;
padding: $pad 0;
overflow: auto;
}
address {
p {
display: inline;
}
}
.related, #post-nav {
border-top: 2px solid black;
padding-top: $pad;
}
#post-nav {
width: 100%;
list-style-type: none;
overflow: auto;
margin-bottom: 2*$pad;
li {
display: block;
float: left;
width: 50%;
}
li.newer {
padding-right: $pad;
}
li.older {
float: right;
}
.gray {
font-size: $font_s;
}
}
// FOOTER
footer .dashboard{
margin-top: -0.3rem;
.weather_day::before{
content: ""
}
.weather_day:first-child::before{
content: "";
}
}
img.weather{
display: inline;
width: 1em;
position: relative;
top: 3px;
}
footer .weather_text {
display: none;
}
.entry-content .weather_text {
display: block;
}
.entry-content .weather_day{
margin-top: 1rem;
display: block;
text-transform: uppercase;
}
/*
MEDIA QUERIES
*/
@media screen and (max-width: 1100px) {
.post-list li {
max-width: 50%;
&:nth-child(2n){
padding-right: 0;
}
}
.cover li:nth-child(2){
flex: 1;
}
.cover li {
max-width: 50%;
.featured-img{
height: 300px;
background-size: auto 140%;
}
}
.featured-img{
background-size: 120%;
}
}
@media screen and (max-width: 800px) {
#menu-s{
display: block;
text-transform: uppercase;
letter-spacing: 1px;
margin-top: .25rem;
&:hover{
cursor: pointer;
color: $color_sub;
}
}
#menu {
ul {
display: none;
}
li {
display: block;
}
li::after, li:last-child::after{
content: "";
}
}
}
@media screen and (min-width: 800px) {
#menu {
ul {
display: inline-block;
}
}
}
@media screen and (max-width: 620px) {
.top h1{
font-size:2.3rem;
}
.post-list.cover{
flex-direction: column-reverse;
}
.cover li, .cover li:nth-child(2){
width: 100%;
padding: 0;
}
.post-list li {
max-width: 100%;
padding-right: 0;
}
.button{
width: 100%;
}
.entry-content {
h2 {
font-size: 1.5rem;
margin-left: 0;
}
p {
width: 100%;
}
ul {
width: 100%;
}
ol {
width: 100%;
}
}
.footnote {
width: 100%;
}
#archive {
li:hover{
border-color: transparent;
}
.dl, .dl-label {
display: none;
}
#date, #title, #cat {
width: 33%;
}
.category, .entry-title, time {
float: none;
width: 100%;
padding-right: 0;
}
.category {
font-size: 0.8rem;
}
}
}

Wyświetl plik

@ -0,0 +1,182 @@
/* FileSaver.js
* A saveAs() FileSaver implementation.
* 1.3.8
* 2018-03-22 14:03:47
*
* By Eli Grey, https://eligrey.com
* License: MIT
* See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
*/
/*global self */
/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/src/FileSaver.js */
export var saveAs = saveAs || (function(view) {
"use strict";
// IE <10 is explicitly unsupported
if (typeof view === "undefined" || typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) {
return;
}
var
doc = view.document
// only get URL when necessary in case Blob.js hasn't overridden it yet
, get_URL = function() {
return view.URL || view.webkitURL || view;
}
, save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
, can_use_save_link = "download" in save_link
, click = function(node) {
var event = new MouseEvent("click");
node.dispatchEvent(event);
}
, is_safari = /constructor/i.test(view.HTMLElement) || view.safari
, is_chrome_ios =/CriOS\/[\d]+/.test(navigator.userAgent)
, setImmediate = view.setImmediate || view.setTimeout
, throw_outside = function(ex) {
setImmediate(function() {
throw ex;
}, 0);
}
, force_saveable_type = "application/octet-stream"
// the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to
, arbitrary_revoke_timeout = 1000 * 40 // in ms
, revoke = function(file) {
var revoker = function() {
if (typeof file === "string") { // file is an object URL
get_URL().revokeObjectURL(file);
} else { // file is a File
file.remove();
}
};
setTimeout(revoker, arbitrary_revoke_timeout);
}
, dispatch = function(filesaver, event_types, event) {
event_types = [].concat(event_types);
var i = event_types.length;
while (i--) {
var listener = filesaver["on" + event_types[i]];
if (typeof listener === "function") {
try {
listener.call(filesaver, event || filesaver);
} catch (ex) {
throw_outside(ex);
}
}
}
}
, auto_bom = function(blob) {
// prepend BOM for UTF-8 XML and text/* types (including HTML)
// note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF
if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
return new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type});
}
return blob;
}
, FileSaver = function(blob, name, no_auto_bom) {
if (!no_auto_bom) {
blob = auto_bom(blob);
}
// First try a.download, then web filesystem, then object URLs
var
filesaver = this
, type = blob.type
, force = type === force_saveable_type
, object_url
, dispatch_all = function() {
dispatch(filesaver, "writestart progress write writeend".split(" "));
}
// on any filesys errors revert to saving with object URLs
, fs_error = function() {
if ((is_chrome_ios || (force && is_safari)) && view.FileReader) {
// Safari doesn't allow downloading of blob urls
var reader = new FileReader();
reader.onloadend = function() {
var url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;');
var popup = view.open(url, '_blank');
if(!popup) view.location.href = url;
url=undefined; // release reference before dispatching
filesaver.readyState = filesaver.DONE;
dispatch_all();
};
reader.readAsDataURL(blob);
filesaver.readyState = filesaver.INIT;
return;
}
// don't create more object URLs than needed
if (!object_url) {
object_url = get_URL().createObjectURL(blob);
}
if (force) {
view.location.href = object_url;
} else {
var opened = view.open(object_url, "_blank");
if (!opened) {
// Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html
view.location.href = object_url;
}
}
filesaver.readyState = filesaver.DONE;
dispatch_all();
revoke(object_url);
}
;
filesaver.readyState = filesaver.INIT;
if (can_use_save_link) {
object_url = get_URL().createObjectURL(blob);
setImmediate(function() {
save_link.href = object_url;
save_link.download = name;
click(save_link);
dispatch_all();
revoke(object_url);
filesaver.readyState = filesaver.DONE;
}, 0);
return;
}
fs_error();
}
, FS_proto = FileSaver.prototype
, saveAs = function(blob, name, no_auto_bom) {
return new FileSaver(blob, name || blob.name || "download", no_auto_bom);
}
;
// IE 10+ (native saveAs)
if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) {
return function(blob, name, no_auto_bom) {
name = name || blob.name || "download";
if (!no_auto_bom) {
blob = auto_bom(blob);
}
return navigator.msSaveOrOpenBlob(blob, name);
};
}
// todo: detect chrome extensions & packaged apps
//save_link.target = "_blank";
FS_proto.abort = function(){};
FS_proto.readyState = FS_proto.INIT = 0;
FS_proto.WRITING = 1;
FS_proto.DONE = 2;
FS_proto.error =
FS_proto.onwritestart =
FS_proto.onprogress =
FS_proto.onwrite =
FS_proto.onabort =
FS_proto.onerror =
FS_proto.onwriteend =
null;
return saveAs;
}(
typeof self !== "undefined" && self
|| typeof window !== "undefined" && window
|| this
));

Wyświetl plik

@ -0,0 +1,2 @@
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs=saveAs||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},o=t.createElementNS("http://www.w3.org/1999/xhtml","a"),r="download"in o,i=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),c=e.webkitRequestFileSystem,d=e.requestFileSystem||c||e.mozRequestFileSystem,u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",f=0,l=4e4,v=function(e){var t=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};setTimeout(t,l)},p=function(e,t,n){t=[].concat(t);for(var o=t.length;o--;){var r=e["on"+t[o]];if("function"==typeof r)try{r.call(e,n||e)}catch(i){u(i)}}},w=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e},y=function(t,u,l){l||(t=w(t));var y,m,S,h=this,R=t.type,O=!1,g=function(){p(h,"writestart progress write writeend".split(" "))},b=function(){if(m&&a&&"undefined"!=typeof FileReader){var o=new FileReader;return o.onloadend=function(){var e=o.result;m.location.href="data:attachment/file"+e.slice(e.search(/[,;]/)),h.readyState=h.DONE,g()},o.readAsDataURL(t),void(h.readyState=h.INIT)}if((O||!y)&&(y=n().createObjectURL(t)),m)m.location.href=y;else{var r=e.open(y,"_blank");void 0===r&&a&&(e.location.href=y)}h.readyState=h.DONE,g(),v(y)},E=function(e){return function(){return h.readyState!==h.DONE?e.apply(this,arguments):void 0}},N={create:!0,exclusive:!1};return h.readyState=h.INIT,u||(u="download"),r?(y=n().createObjectURL(t),void setTimeout(function(){o.href=y,o.download=u,i(o),g(),v(y),h.readyState=h.DONE})):(e.chrome&&R&&R!==s&&(S=t.slice||t.webkitSlice,t=S.call(t,0,t.size,s),O=!0),c&&"download"!==u&&(u+=".download"),(R===s||c)&&(m=e),d?(f+=t.size,void d(e.TEMPORARY,f,E(function(e){e.root.getDirectory("saved",N,E(function(e){var n=function(){e.getFile(u,N,E(function(e){e.createWriter(E(function(n){n.onwriteend=function(t){m.location.href=e.toURL(),h.readyState=h.DONE,p(h,"writeend",t),v(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&b()},"writestart progress write abort".split(" ").forEach(function(e){n["on"+e]=h["on"+e]}),n.write(t),h.abort=function(){n.abort(),h.readyState=h.DONE},h.readyState=h.WRITING}),b)}),b)};e.getFile(u,{create:!1},E(function(e){e.remove(),n()}),E(function(e){e.code===e.NOT_FOUND_ERR?n():b()}))}),b)}),b)):void b())},m=y.prototype,S=function(e,t,n){return new y(e,t,n)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,n){return n||(e=w(e)),navigator.msSaveOrOpenBlob(e,t||"download")}:(m.abort=function(){var e=this;e.readyState=e.DONE,p(e,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,S)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof module&&module.exports?module.exports.saveAs=saveAs:"undefined"!=typeof define&&null!==define&&null!==define.amd&&define([],function(){return saveAs});

File diff suppressed because one or more lines are too long

15
solar/static/js/jszip.min.js vendored 100755

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -0,0 +1,17 @@
{
"ac_power": "1.75W",
"ac_current": ".31Ah",
"ac_voltage": "5.47V",
"ac_used": "yes",
"bat_power": "0W",
"bat_current": "0Ah",
"bat_voltage": "4.18V",
"bat_capacity": "100%",
"bat_charging": "no",
"temperature": "32.90",
"uptime": "up 2 weeks, 2 days, 3 hours, 3 minutes",
"load_1": "0.25",
"load_5": "0.21",
"load_15": "0.15"
}

10
solar/static/js/tinysort.min.js vendored 100644
Wyświetl plik

@ -0,0 +1,10 @@
/**
* TinySort is a small script that sorts HTML elements. It sorts by text- or attribute value, or by that of one of it's children.
* @summary A nodeElement sorting script.
* @version 2.3.6
* @license MIT
* @author Ron Valstar <ron@ronvalstar.nl>
* @copyright Ron Valstar <ron@ronvalstar.nl>
* @namespace tinysort
*/
!function(e,t){"use strict";function r(){return t}"function"==typeof define&&define.amd?define("tinysort",r):e.tinysort=t}(this,function(){"use strict";function e(e,n){function s(){0===arguments.length?v({}):t(arguments,function(e){v(x(e)?{selector:e}:e)}),d=$.length}function v(e){var t=!!e.selector,n=t&&":"===e.selector[0],o=r(e||{},m);$.push(r({hasSelector:t,hasAttr:!(o.attr===l||""===o.attr),hasData:o.data!==l,hasFilter:n,sortReturnNumber:"asc"===o.order?1:-1},o))}function S(){t(e,function(e,t){M?M!==e.parentNode&&(k=!1):M=e.parentNode;var r=$[0],n=r.hasFilter,o=r.selector,a=!o||n&&e.matchesSelector(o)||o&&e.querySelector(o),l=a?R:V,s={elm:e,pos:t,posn:l.length};B.push(s),l.push(s)}),D=R.slice(0)}function y(e,t,r){for(var n=r(e.toString()),o=r(t.toString()),a=0;n[a]&&o[a];a++)if(n[a]!==o[a]){var l=Number(n[a]),s=Number(o[a]);return l==n[a]&&s==o[a]?l-s:n[a]>o[a]?1:-1}return n.length-o.length}function N(e){for(var t,r,n=[],o=0,a=-1,l=0;t=(r=e.charAt(o++)).charCodeAt(0);){var s=46==t||t>=48&&57>=t;s!==l&&(n[++a]="",l=s),n[a]+=r}return n}function C(e,r){var n=0;for(0!==p&&(p=0);0===n&&d>p;){var l=$[p],s=l.ignoreDashes?f:u;if(t(h,function(e){var t=e.prepare;t&&t(l)}),l.sortFunction)n=l.sortFunction(e,r);else if("rand"==l.order)n=Math.random()<.5?1:-1;else{var c=a,g=w(e,l),m=w(r,l),v=""===g||g===o,S=""===m||m===o;if(g===m)n=0;else if(l.emptyEnd&&(v||S))n=v&&S?0:v?1:-1;else{if(!l.forceStrings){var C=x(g)?g&&g.match(s):a,b=x(m)?m&&m.match(s):a;if(C&&b){var A=g.substr(0,g.length-C[0].length),F=m.substr(0,m.length-b[0].length);A==F&&(c=!a,g=i(C[0]),m=i(b[0]))}}n=g===o||m===o?0:l.natural&&(isNaN(g)||isNaN(m))?y(g,m,N):m>g?-1:g>m?1:0}}t(h,function(e){var t=e.sort;t&&(n=t(l,c,g,m,n))}),n*=l.sortReturnNumber,0===n&&p++}return 0===n&&(n=e.pos>r.pos?1:-1),n}function b(){var e=R.length===B.length;if(k&&e)O?R.forEach(function(e,t){e.elm.style.order=t}):M?M.appendChild(A()):console.warn("parentNode has been removed");else{var t=$[0],r=t.place,n="org"===r,o="start"===r,a="end"===r,l="first"===r,s="last"===r;if(n)R.forEach(F),R.forEach(function(e,t){E(D[t],e.elm)});else if(o||a){var c=D[o?0:D.length-1],i=c&&c.elm.parentNode,u=i&&(o&&i.firstChild||i.lastChild);u&&(u!==c.elm&&(c={elm:u}),F(c),a&&i.appendChild(c.ghost),E(c,A()))}else if(l||s){var f=D[l?0:D.length-1];E(F(f),A())}}}function A(){return R.forEach(function(e){q.appendChild(e.elm)}),q}function F(e){var t=e.elm,r=c.createElement("div");return e.ghost=r,t.parentNode.insertBefore(r,t),e}function E(e,t){var r=e.ghost,n=r.parentNode;n.insertBefore(t,r),n.removeChild(r),delete e.ghost}function w(e,t){var r,n=e.elm;return t.selector&&(t.hasFilter?n.matchesSelector(t.selector)||(n=l):n=n.querySelector(t.selector)),t.hasAttr?r=n.getAttribute(t.attr):t.useVal?r=n.value||n.getAttribute("value"):t.hasData?r=n.getAttribute("data-"+t.data):n&&(r=n.textContent),x(r)&&(t.cases||(r=r.toLowerCase()),r=r.replace(/\s+/g," ")),null===r&&(r=g),r}function x(e){return"string"==typeof e}x(e)&&(e=c.querySelectorAll(e)),0===e.length&&console.warn("No elements to sort");var D,M,q=c.createDocumentFragment(),B=[],R=[],V=[],$=[],k=!0,z=e.length&&e[0].parentNode,L=z.rootNode!==document,O=e.length&&(n===o||n.useFlex!==!1)&&!L&&-1!==getComputedStyle(z,null).display.indexOf("flex");return s.apply(l,Array.prototype.slice.call(arguments,1)),S(),R.sort(C),b(),R.map(function(e){return e.elm})}function t(e,t){for(var r,n=e.length,o=n;o--;)r=n-o-1,t(e[r],r)}function r(e,t,r){for(var n in t)(r||e[n]===o)&&(e[n]=t[n]);return e}function n(e,t,r){h.push({prepare:e,sort:t,sortBy:r})}var o,a=!1,l=null,s=window,c=s.document,i=parseFloat,u=/(-?\d+\.?\d*)\s*$/g,f=/(\d+\.?\d*)\s*$/g,h=[],d=0,p=0,g=String.fromCharCode(4095),m={selector:l,order:"asc",attr:l,data:l,useVal:a,place:"org",returns:a,cases:a,natural:a,forceStrings:a,ignoreDashes:a,sortFunction:l,useFlex:a,emptyEnd:a};return s.Element&&function(e){e.matchesSelector=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=this,r=(t.parentNode||t.document).querySelectorAll(e),n=-1;r[++n]&&r[n]!=t;);return!!r[n]}}(Element.prototype),r(n,{loop:t}),r(e,{plugin:n,defaults:m})}());

Wyświetl plik

@ -0,0 +1,84 @@
{% extends "base.html" %}
{% block body_class %}
<body>
{% endblock body_class %}
{% block content %}
<section id="archive">
{% block content_title %}
{% endblock %}
<div id="filters">
<div class="filter active desc" id="date">
Date
</div>
<div class="filter asc" id="title">
Title
</div>
<div class="filter asc" id="cat">
Theme
</div>
</div>
<ul>
{% for article in dates %}
{% if article.display != "hidden" %}
<li class = "{{article.category|lower|truncate(3,True, '')}}"><article>
<time class="published" datetime="{{ article.date.isoformat() }}">{{ article.date|strftime('%B %Y')}}</time>
<div class="entry-title"><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></div>
<div class="{{ article.category}}"><a href="{{ SITEURL }}/{{ article.category.url }}" class="category">{{ article.category }}</a> </div>
</article></li>
{% endif %}
{% endfor %}
</ul><!-- /#archive-list -->
</section><!-- /#content -->
<!-- LIST SORTING-------------->
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script
src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/tinysort.min.js"></script>
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/FileSaver.min.js"></script>
<script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/jszip.min.js"></script>
<script>
var listElements = document.querySelectorAll('#archive ul li');
var filters = document.getElementsByClassName('filter');
for (var i = 0; i < filters.length; i++) {
filters[i].addEventListener('click', sort, false);
}
function sort() {
for (var j = 0; j < filters.length; j++) {
filters[j].classList.remove('active');
}
this.classList.add('active');
this.classList.toggle('desc');
this.classList.toggle('asc');
var type = (this).id;
switch (type) {
case "title":
tinysort(listElements,{selector:'.entry-title',order:(this.isAsc=!this.isAsc)?'asc':'desc'});
break;
case "date":
tinysort(listElements,{selector:'time',attr:'datetime',order:(this.isAsc=!this.isAsc)?'asc':'desc'});
break;
case "cat":
tinysort(listElements,{selector:'.category',order:(this.isAsc=!this.isAsc)?'asc':'desc'});
break;
}
}
</script>
{% endblock content %}

Wyświetl plik

@ -0,0 +1,110 @@
{% extends "base.html" %}
{% block head %}
{{ super() }}
{% if article.description %}
<meta name="description" content="{{ article.description }}" />
{% endif %}
{% for tag in article.tags %}
<meta name="tags" content="{{tag}}" />
{% endfor %}
{% endblock %}
{% block body_class %}
<body class = "{{article.category|lower|truncate(3,True, '')}}">
{% endblock body_class %}
{% block content %}
<section id="content" class="article">
<header>
<a href="{{ SITEURL }}/{{ article.category.url }}" class="category">{{ article.category }}</a>
<h1 class="entry-title">
{{ article.title }}</h1>
<div class="translations">
{% import 'translations.html' as translations with context %}
{{ translations.translations_for(article) }}
</div>
<p class="summary">
{{ article.summary }}
</p>
</header>
<div class="entry-content">
{{ article.content }}
</div><!-- /.entry-content -->
<!-- <div id="send-comment">
<a href="mailto:kris@lowtechmagazine.com?subject=comments on {{ article.title }}" class="button" title="Comment">Send a letter to the editor</a>
</div> -->
<div class="post-info gray">
<time class="published" datetime="{{ article.date.isoformat() }}">
{{ article.locale_date }}
</time>
{% if article.modified %}
<time class="modified" datetime="{{ article.modified.isoformat() }}">
{{ article.locale_modified }}
</time>
{% endif %}
{% if article.authors %}
<address>
by {% for author in article.authors %}
<a class="url fn" href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
{% endfor %}
{% if article.editor %}
(edited by {{ article.editor}})
{% endif %}
{% if article.translator %}
| translated by
{{ article.translator }}
{% endif %}
</address>
{% endif %}
</div><!-- /.post-info -->
</section>
{% if article.related_posts %}
<h3 class="related">Related Articles</h3>
<div class="post-info gray">
{% include 'taglist.html' %}
</div>
<ul class="post-list">
{% for related_post in article.related_posts %}
<li class="{{related_post.category|lower|truncate(3,True, '')}}">
<article>
<a href="{{ SITEURL }}/{{ related_post.url }}" rel="bookmark" title="Permalink to {{ related_post.title|striptags }}">
{% if related_post.featured_image %}
<div class="featured-img" style="background-image: url('{{ SITEURL }}/{{ related_post.featured_image }}')">
</div>
{% endif %}
<h2 class="entry-title">{{ related_post.title }}</h2></a>
<a href="{{ SITEURL }}/{{ related_post.category.url }}" class="category">{{ related_post.category }}</a>
{% if related_post.summary %}
<p class="index-summary">{{ related_post.summary }}</p>
{% endif %}
<time class="published" datetime="{{ related_post.date.isoformat() }}">{{ related_post.date|strftime('%B %Y')}}</time>
</article>
</li>
{% endfor %}
</ul>
{% endif %}
<ul id="post-nav">
{% if article.next_article %}
<li class="newer">
<p class="gray">&larr; newer article</p>
<a href="{{ SITEURL }}/{{ article.next_article.url}}">
{{ article.next_article.title }}
</a>
</li>
{% endif %}
{% if article.prev_article %}
<li class="older">
<p class="gray">older article &rarr;</p>
<a href="{{ SITEURL }}/{{ article.prev_article.url}}">
{{ article.prev_article.title }}
</a>
</li>
{% endif %}
</ul>
{% endblock %}

Wyświetl plik

@ -0,0 +1,7 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME }} - Articles by {{ author }}{% endblock %}
{% block content_title %}
<h2>Articles by {{ author }}</h2>
{% endblock %}

Wyświetl plik

@ -0,0 +1,13 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME }} - Authors{% endblock %}
{% block content %}
<h1>Authors on {{ SITENAME }}</h1>
<ul>
{%- for author, articles in authors|sort %}
<li><a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
{% endblock %}

Wyświetl plik

@ -0,0 +1,161 @@
<!DOCTYPE html>
<html lang="{{ DEFAULT_LANG }}">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
{% block head %}
<title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
{% assets filters="libsass,cssmin", output="css/style.min.css", "css/style.scss" %}
<link rel="stylesheet" href="{{ SITEURL }}/{{ ASSET_URL }}">
{% endassets %}
{% from 'syndication.html' import syndication with context %}
{{ syndication(article) }}
{% if FEED_ALL_ATOM %}
<link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
{% endif %}
{% if FEED_ALL_RSS %}
<link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Full RSS Feed" />
{% endif %}
{% if FEED_ATOM %}
<link href="{{ FEED_DOMAIN }}/{{ FEED_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
{% endif %}
{% if FEED_RSS %}
<link href="{{ FEED_DOMAIN }}/{{ FEED_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
{% endif %}
{% if CATEGORY_FEED_ATOM and category %}
<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(category.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
{% endif %}
{% if CATEGORY_FEED_RSS and category %}
<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(category.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" />
{% endif %}
{% if TAG_FEED_ATOM and tag %}
<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(tag.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" />
{% endif %}
{% if TAG_FEED_RSS and tag %}
<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
{% endif %}
{% endblock head %}
</head>
{% block body_class %}
{% endblock body_class %}
<div id="battery">
<div id="bat_data">
<a href="{{ SITEURL }}/weather/"><span id="sky"></span><span id="level">100%</span></a></div>
</div>
<main>
<header class="top">
<h1><a href="{{ SITEURL }}/">{{ SITENAME }}</a></h1>
<div class="subtitle">
{{ SITESUBTITLE }}
</div>
<nav id="menu">
<div id="menu-s">
menu
</div>
<ul>
<li><a href="{{ SITEURL }}/about/">About</a></li>
<li class="low"><a class="category" href="{{ SITEURL }}/category/low-tech-solutions.html">Low-tech Solutions</a></li>
<li class="hig"><a class="category" href="{{ SITEURL }}/category/high-tech-problems.html">High-tech Problems</a></li>
<li class="obs"><a class="category" href="{{ SITEURL }}/category/obsolete-technology.html">Obsolete Technology</a></li>
<li><a href="{{ SITEURL }}/archives.html">Archive</a></li>
<li><a href="{{ SITEURL }}/weather/">Weather</a></li>
<li><a href="{{ SITEURL }}/donate/">Donate</a></li>
<li class="social"><a href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}" type="application/rss+xml" rel="alternate" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" class="icon"><title>rss</title><circle cx="19.91" cy="58.23" r="6.86"/><path d="M67.89,65.72H55.7A41.86,41.86,0,0,0,13.89,23.91V11.73A54.06,54.06,0,0,1,67.89,65.72Z"/><path d="M48.93,65.72H36.75A22.88,22.88,0,0,0,13.89,42.87V30.68A35.08,35.08,0,0,1,48.93,65.72Z"/></svg></a></li>
</ul>
</nav><!-- /#menu -->
</header><!-- /#banner -->
{% block content %}
{% endblock %}
<footer id="content-info" class="body">
<h2>
<a href="{{ SITEURL }}/">{{ SITENAME }}</a>
</h2>
<a href="{{ SITEURL }}/weather/">
<div class="dashboard">
Location: Barcelona / Time: <span id="time"></span> / Battery Level: <span id="dashboard_level">100%</span> / Charging: <span id="charge"></span> / Power Consumption: <span id="power"> power</span> / Server: <span id="uptime">uptime</span>
<div class="forecast">Forecast: </div>
</div></a>
<p>&copy; Kris De Decker | kris [at] lowtechmagazine [dot] com |
<a href="{{ SITEURL }}/privacy/">Privacy Policy</a> |
{% if SOCIAL or FEED_ALL_ATOM or FEED_ALL_RSS %}
<span class="social">
<a href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}" type="application/rss+xml" rel="alternate"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" class="icon"><title>rss</title><circle cx="19.91" cy="58.23" r="6.86"/><path d="M67.89,65.72H55.7A41.86,41.86,0,0,0,13.89,23.91V11.73A54.06,54.06,0,0,1,67.89,65.72Z"/><path d="M48.93,65.72H36.75A22.88,22.88,0,0,0,13.89,42.87V30.68A35.08,35.08,0,0,1,48.93,65.72Z"/></svg></a>
<a href="https://www.facebook.com/Lowtechmagazine/"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" class="icon"><title>facebook</title><path d="M57.16,16.42H50.87c-4.93,0-5.85,2.36-5.85,5.77v7.57H56.76L55.2,41.61H45V72H32.77V41.61H22.56V29.76H32.77V21C32.77,10.9,39,5.37,48,5.37a78.35,78.35,0,0,1,9.13.48Z"/></svg></a>
<a href="https://twitter.com/lowtechmagazine"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" class="icon"><title>twitter</title><path d="M65.05,29.23c0,.56,0,1.12,0,1.68,0,17.1-13,36.8-36.8,36.8A36.54,36.54,0,0,1,8.44,61.91a26.68,26.68,0,0,0,3.12.16,25.9,25.9,0,0,0,16.06-5.53,13,13,0,0,1-12.09-9,16.28,16.28,0,0,0,2.44.2,13.67,13.67,0,0,0,3.4-.44A12.93,12.93,0,0,1,11,34.64v-.16a13,13,0,0,0,5.85,1.64,13,13,0,0,1-4-17.3A36.76,36.76,0,0,0,39.51,32.36a14.58,14.58,0,0,1-.32-3,12.95,12.95,0,0,1,22.38-8.85,25.45,25.45,0,0,0,8.21-3.12,12.9,12.9,0,0,1-5.69,7.13,25.93,25.93,0,0,0,7.45-2A27.79,27.79,0,0,1,65.05,29.23Z"/></svg></a>
<a href="mailto:kris@lowtechmagazine.com"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" class="icon"><title>email</title><path d="M4.95,13.14v55H74.33v-55Zm54.34,8.12L39.64,39.74,20,21.26ZM13.07,60V25.91l26.56,25,26.57-25V60Z"/></svg></a>
</span><!-- /.social -->
{% endif %}
</p>
</footer><!-- /#contentinfo -->
</main>
<script
src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">
var url = "{{ SITEURL }}/api/stats.json";
var weather_ignore = ["snow", "sleet", "wind", "fog"];
var weather_data = ["today", "tomorrow", "day_after_t"];
var weather_days = ["today", "tomorrow", "day after tomorrow"];
var forecast = "";
function getServerData(url,target){
$.getJSON(url, function(data) {
var stats=[];
$.each(data, function(key, val) {
stats.push( "<li id='" + key + "'>" + key + ": " + val + "</li>" );
});
$( "<ul/>", {
"class": "stats",
html: stats.join( "" )
}).appendTo( ".data" );
var level = data.bat_capacity;
$('#battery').css('height',level);
$('#level, #dashboard_level').html(level);
var power = "";
if(data.ac_power=="0W"){
power = data.bat_power;
}else{
power = data.ac_power;
}
$('#power').html(power);
$('#charge').html(data.ac_used);
for(i=0; i<weather_data.length; i++){
var key = weather_data[i];
var icon_name = key+"_icon";
var icon = data[icon_name];
var text = data[key];
var img;
if (weather_ignore.includes(icon)){
img = "cloudy";
}else {
img = icon;
}
forecast += '<span class="weather_day" id="' + key +'">'+ weather_days[i] +' <img class="weather" src="/extra/'+ img +'.png" alt="'+ text +'" title="'+ text +'"></span><span class="weather_text"> '+text+'</span>';
}
$(target).append(forecast);
$('#uptime').html(data.uptime);
$('#time').html(data.local_time);
});
}
getServerData(url,'.forecast');
$('#menu-s').click(function(){
$(this).next('ul').slideToggle();
});
</script>
</body>
</html>

Wyświetl plik

@ -0,0 +1,8 @@
{% extends "base.html" %}
{% block content %}
<ul>
{% for category, articles in categories %}
<li><a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a></li>
{% endfor %}
</ul>
{% endblock %}

Wyświetl plik

@ -0,0 +1,38 @@
{% extends "index.html" %}
{% block body_class %}
<body class = "category-page {{category|lower|truncate(3,True, '')}}">
{% endblock body_class %}
{% block content %}
<section id="content">
{% block content_title %}
<h1>{{ category }}</h1>
{% endblock %}
<div class="description">
<p class="summary category-low">
Interesting possibilities arise when you combine old technology with new knowledge and new materials, or when you apply old concepts and traditional knowledge to modern technology.</p>
<p class="summary category-hig">
High-tech has become the idol of our society, but technological progress is&mdash;more often than not&mdash;aimed at solving problems caused by earlier technical inventions.
</p>
<p class="summary category-obs">There is a lot of potential in past and often forgotten knowledge and technologies when it comes to designing a sustainable society.</p>
</div>
<ul class="post-list">
{% for article in articles_page.object_list %}
<li class = "{{article.category|lower|truncate(3,True, '')}}"><article>
{% if article.featured_image %}
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">
<div class="featured-img" style="background-image: url('{{ SITEURL }}{{ article.featured_image }}')">
</div>
{% endif %}
<h2 class="entry-title">{{ article.title }}</h2></a>
{% if article.summary %}
<p class="index-summary">{{ article.summary }}</p>
{% endif %}
<time class="published" datetime="{{ article.date.isoformat() }}">{{ article.date|strftime('%B %Y')}}</time>
</article></li>
{% endfor %}
</ul>
</section><!-- /#content -->
{% if articles_page.has_other_pages() %} {% include 'pagination.html' %} {% endif %}
{% endblock content %}

Wyświetl plik

@ -0,0 +1,61 @@
{% extends "base.html" %} {% block body_class %}
<body class="index{{ articles_page.number }}">
{% endblock body_class %} {% block content %}
<section id="content">
{% block content_title %}{% endblock %}
<ul class="post-list cover {{articles_page.object_list[0].category|lower|truncate(3,True, '')}}">
<li>
<a href="{{ SITEURL }}/{{ articles_page.object_list[0].url }}" rel="bookmark" title="Permalink to {{ articles_page.object_list[0].title|striptags }}"><h2 class="entry-title">{{ articles_page.object_list[0].title }}</h2></a>
<a href="{{ SITEURL }}/{{ articles_page.object_list[0].category.url }}" class="category">{{ articles_page.object_list[0].category }}</a>
{% if articles_page.object_list[0].summary %}
<p class="index-summary">{{ articles_page.object_list[0].summary }}</p>
{% endif %}
<time class="published" datetime="{{ articles_page.object_list[0].date.isoformat() }}">{{ articles_page.object_list[0].date|strftime('%B %Y')}}</time>
</li>
<li>
{% if articles_page.object_list[0].featured_image %}
<a href="{{ SITEURL }}/{{ articles_page.object_list[0].url }}" rel="bookmark" title="Permalink to {{ articles_page.object_list[0].title|striptags }}"><div class="featured-img" style="background-image: url('{{ SITEURL }}/{{ articles_page.object_list[0].featured_image }}')">
</div></a>
{% endif %}
</li>
</ul>
<ul class="post-list recent">
{% for article in articles_page.object_list[1 : 9] %}
<li class="{{article.category|lower|truncate(3,True, '')}}">
<article>
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">
{% if article.featured_image %}
<div class="featured-img" style="background-image: url('{{ SITEURL }}/{{ article.featured_image }}')"></div>
{% endif %}
<h2 class="entry-title">{{ article.title }}</h2></a>
<a href="{{ SITEURL }}/{{ article.category.url }}" class="category">{{ article.category }}</a>
{% if article.summary %}
<p class="index-summary">{{ article.summary }}</p>
{% endif %}
<time class="published" datetime="{{ article.date.isoformat() }}">{{ article.date|strftime('%B %Y')}}</time>
</article>
</li>
{% endfor %}
</ul>
<!-- /posts-list -->
<ul class="post-list popular">
{% for article in articles[9:] %} {% if article.display == "cover" %}
<li class="{{article.category|lower|truncate(3,True, '')}}">
<article>
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="{{ article.title|striptags }}"><h2 class="entry-title">{{ article.title }}</h2></a>
<a href="{{ SITEURL }}/{{ article.category.url }}" class="category">{{ article.category }}</a>
{% if article.summary %}
<p class="index-summary">{{ article.summary }}</p>
{% endif %}
<time class="published" datetime="{{ article.date.isoformat() }}">{{ article.date|strftime('%B %Y')}}</time>
</article>
</li>
{% endif %} {% endfor %}
</ul>
</section>
<!-- /#content -->
{% if articles_page.has_other_pages() %} {% include 'pagination.html' %} {% endif %}
{% endblock content %}

Wyświetl plik

@ -0,0 +1,21 @@
{% extends "base.html" %}
{% block title %}{{ page.title }}{%endblock%}
{% block content %}
<section id="content" class="page">
<header>
<h1>{{ page.title }}</h1>
<p class="summary">
{{ page.summary }}
</p>
</header>
<div class="entry-content">
{{ page.content }}
</div>
{% if page.modified %}
<p>
Last updated: {{ page.locale_modified }}
</p>
{% endif %}
</section>
{% endblock %}

Wyświetl plik

@ -0,0 +1,11 @@
{% if DEFAULT_PAGINATION %}
<div class="paginator">
{% if articles_page.has_previous() %}
<a href="{{ SITEURL }}/{{ articles_previous_page.url }}">&laquo;</a>
{% endif %}
page {{ articles_page.number }} / {{ articles_paginator.num_pages }}
{% if articles_page.has_next() %}
<a href="{{ SITEURL }}/{{ articles_next_page.url }}">&raquo;</a>
{% endif %}
</div>
{% endif %}

Wyświetl plik

@ -0,0 +1,11 @@
{% extends "base.html" %}
{% block content %}
<h1>Archives for {{ period | reverse | join(' ') }}</h1>
<dl>
{% for article in dates %}
<dt>{{ article.locale_date }}</dt>
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
{% endfor %}
</dl>
{% endblock %}

Wyświetl plik

@ -0,0 +1,57 @@
{#This template is for syndicating across the corporate part of the web. It implements Open Graph and Twitter Card metadata to display links nicely on social media.
# This code is mostly taken from Talha Mansoor's Elegant pelican theme https://github.com/talha131/pelican-elegant
#}
{# Thumbnail image to show when homepage is shared on social media. It also
serves as the default image for posts whose featured_image is not set. #}
{% if not FEATURED_IMAGE %}
{% set FEATURED_IMAGE = 'https://solar.lowtechmagazine.com/extra/clear-day.png' %}
{% else %}
{% set FEATURED_IMAGE = FEATURED_IMAGE %}
{% endif %}
{% macro syndication(article) %}
{% if article %}
<meta property="og:title" content="{{ article.title|striptags|e }} {%if article.subtitle %} - {{ article.subtitle|striptags|e }} {% endif %}"/>
<meta property="og:url" content="{{ SITEURL }}/{{ article.url }}" />
<meta property="og:description" content="{% if article.summary %}{{article.summary|striptags}}{% endif %}" />
<meta property="og:site_name" content="{{ SITENAME|striptags|e }}" />
<meta property="og:article:author" content="{{ article.author }}" />
{% if article.date %}
<meta property="og:article:published_time" content="{{ article.date.isoformat() }}" />
{% endif %}
{% if article.locale_modified and article.modified %}
<meta property="" content="{{ article.modified.isoformat() }}" />
{% endif %}
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ article.title|striptags|e }} {%if article.subtitle %} - {{ article.subtitle|striptags|e }} {% endif %}">
<meta name="twitter:description" content="{% if article.summary %}{{article.summary|striptags}}{% endif %}">
{% if article.featured_image %}
<meta property="og:image" content="{{ SITEURL }}{{ article.featured_image }}" />
<meta property="og:image:secure_url" content="{{ SITEURL }}{{ article.featured_image }}" />
<meta name="twitter:image" content="{{ SITEURL }}{{ article.featured_image }}" >
{% else %}
{% if FEATURED_IMAGE %}
<meta property="og:image" content="{{FEATURED_IMAGE}}" />
<meta name="twitter:image" content="{{FEATURED_IMAGE}}" >
{% endif %}
{% endif %}
{% endif %}
{% if not article %}
<meta property="og:title" content="{{ SITENAME|striptags|e }}"/>
<meta name="twitter:title" content="{{ SITENAME|striptags|e }}">
<meta name="twitter:card" content="summary" />
<meta property="og:url" content="{{ SITEURL }}" />
<meta property="og:description" content="Low-tech Magazine refuses to assume that every problem has a high-tech solution. A simple, sensible, but nevertheless controversial message; high-tech has become the idol of our society.">
<meta property="twitter:description" content="Low-tech Magazine refuses to assume that every problem has a high-tech solution. A simple, sensible, but nevertheless controversial message; high-tech has become the idol of our society.">
<meta property="og:site_name" content="{{ SITENAME|striptags|e }}" />
<meta property="og:article:author" content="{{ AUTHOR }}" />
{% if FEATURED_IMAGE %}
<meta property="og:image" content="{{FEATURED_IMAGE}}" />
<meta name="twitter:image" content="{{FEATURED_IMAGE}}" >
{% endif %}
{% endif %}
{% endmacro %}

Wyświetl plik

@ -0,0 +1,6 @@
{% extends "category.html" %}
{% block title %}{{ SITENAME }} - {{ tag }}{% endblock %}
{% block content_title %}
<h1>{{ tag }}</h1>
{% endblock %}

Wyświetl plik

@ -0,0 +1 @@
{% if article.tags %}<p class="tags">themes: {% for tag in article.tags %}<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag | escape }}</a> {% endfor %}</p>{% endif %}

Wyświetl plik

@ -0,0 +1,10 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME }} - Tags{% endblock %}
{% block content %}
<h1>Tags for {{ SITENAME }}</h1>
{%- for tag, articles in tags|sort %}
<li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a> ({{ articles|count }})</li>
{% endfor %}
{% endblock %}

Wyświetl plik

@ -0,0 +1,9 @@
{% macro translations_for(article) %}
{% if article.translations %}
Translations:
{% for translation in article.translations %}
<a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a>
{% endfor %}
{% endif %}
{% endmacro %}