Primo commit - base sito funzionante?

This commit is contained in:
Emiliano Vavassori 2020-11-22 19:44:33 +01:00
parent 7abb0ade2e
commit 71f4b86bde
30 changed files with 1742 additions and 0 deletions

View file

@ -0,0 +1,11 @@
{% if GOOGLE_ANALYTICS %}
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("{{GOOGLE_ANALYTICS}}");
pageTracker._trackPageview();
} catch(err) {}</script>
{% endif %}

View file

@ -0,0 +1,22 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME }} | Archives{% endblock %}
{% block content %}
<h1>Archives</h1>
{# based on http://stackoverflow.com/questions/12764291/jinja2-group-by-month-year #}
{% for year, year_group in dates|groupby('date.year')|reverse %}
{% for month, month_group in year_group|groupby('date.month')|reverse %}
<h4 class="date">{{ (month_group|first).date|strftime('%b %Y') }}</h4>
<div class="post archives">
<ul>
{% for article in month_group %}
<li><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></li>
{% endfor %}
</ul>
</div>
{% endfor %}
{% endfor %}
{% endblock %}

View file

@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block head %}
{{ super() }}
{% if article.tags %}
<meta name="keywords" content="{{ article.tags|join(",") }}" />
{% endif %}
{% if article.description %}
<meta name="description" content="{{ article.description }}" />
{% endif %}
{% endblock %}
{% block title %}{{ SITENAME }} | {{ article.title|striptags }}{% endblock %}
{% block content %}
{% include "article_stub.html" %}
{% endblock %}

View file

@ -0,0 +1,37 @@
{% if not articles_page or first_article_of_day %}
<h4 class="date">{{ article.date.strftime("%b %d, %Y") }}</h4>
{% endif %}
<article class="post">
{% if article.title %}
<h2 class="title">
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permanent Link to &quot;{{ article.title|striptags }}&quot;">{{ article.title }}</a>
</h2>
{% endif %}
{% if not articles_page %}
{% include "translations.html" %}
{% endif %}
{{ article.content }}
<div class="clear"></div>
<div class="info">
<a href="{{ SITEURL }}/{{ article.url }}">posted at {{ article.date.strftime("%H:%M") }}</a>
{% if article.category.name != "misc" %}
&nbsp;&middot;&nbsp;<a href="{{ SITEURL }}/{{ article.category.url }}" rel="tag">{{ article.category }}</a>
{% endif %}
{% if article.tags %}
&nbsp;&middot;
{% for t in article.tags %}
&nbsp;<a href="{{ SITEURL }}/{{ t.url }}" class="tags{% if tag and tag.name == t.name %} selected{% endif %}">{{ t }}</a>
{% endfor %}
{% endif %}
</div>
{% if articles_page and DISQUS_SITENAME %}
<a href="{{ SITEURL }}/{{ article.url }}#disqus_thread">Click to read and post comments</a>
{% else %}
{% include "disqus.html" %}
{% endif %}
</article>

View file

@ -0,0 +1,7 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME }} | Articles by {{ author }}{% endblock %}
{% block ephemeral_nav %}
{{ ephemeral_nav_link(author, output_file, True) }}
{% endblock %}

View file

@ -0,0 +1,105 @@
{% macro ephemeral_nav_link(what, where, selected=False) -%}
<li class="ephemeral{% if selected %} selected{% endif %}"><a href="{{ SITEURL }}/{{ where }}">{{what}}</a></li>
{%- endmacro -%}
<!DOCTYPE html>
<html lang="{{ DEFAULT_LANG }}">
<head>
{% block head %}
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
{# favicon #}
<link rel="shortcut icon" type="image/png" href="{{ SITEURL }}/favicon.png">
<link rel="shortcut icon" type="image/x-icon" href="{{ SITEURL }}/favicon.ico">
{% 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(slug=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(slug=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(slug=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(slug=tag.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
{% endif %}
<link rel="stylesheet" href="{{ SITEURL }}/theme/css/main.css" type="text/css" />
<link rel="stylesheet" href="{{ SITEURL }}/theme/css/pygments.css" type="text/css" />
<meta name="generator" content="Pelican" />
<meta name="description" content="{{ SITEDESCRIPTION }}" />
<meta name="author" content="{{ AUTHOR }}" />
{% endblock head %}
<script src="https://kit.fontawesome.com/0a2f7dbe4a.js" crossorigin="anonymous"></script>
</head>
<body>
{% if DISPLAY_HEADER or DISPLAY_HEADER is not defined %}
<header>
{% if DISPLAY_MENU or DISPLAY_MENU is not defined %}
<nav>
<ul>
{% block ephemeral_nav %}{% endblock %}
{% if DISPLAY_HOME or DISPLAY_HOME is not defined %}
<li{% if output_file == "index.html" %} class="selected"{% endif %}><a href="{{ SITEURL }}/">Home</a></li>
{% endif %}
{% if DISPLAY_PAGES_ON_MENU %}
{% for p in pages %}
<li{% if p == page %} class="selected"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
{% endfor %}
{% endif %}
{% for title, link in MENUITEMS %}
<li><a href="{{ link }}">{{ title }}</a></li>
{% endfor %}
{% for name, link, file in MENU_INTERNAL_PAGES %}
<li{% if output_file == file %} class="selected"{% endif %}><a href="{{ SITEURL }}/{{ link }}">{{ name }}</a></li>
{% endfor %}
</ul>
</nav>
{% endif %}
<div class="header_box">
<h1><a href="{{ SITEURL }}/">{{ SITENAME }}</a></h1>
{% if SITESUBTITLE %}
<h2>{{ SITESUBTITLE }}</h2>
{% endif %}
</div>
</header>
{% endif %}
<div id="wrapper">
<div id="content">
{%- block content -%}{%- endblock %}
{% if DISPLAY_FOOTER or DISPLAY_FOOTER is not defined %}
<div class="clear"></div>
<footer>
<p>
<a href="https://github.com/jody-frankowski/blue-penguin">Blue Penguin</a> Theme
&middot;
Powered by <a href="http://getpelican.com">Pelican</a>
{% if FEED_ALL_ATOM %}
&middot;
<a href="{{ SITEURL }}/{{ FEED_ALL_ATOM }}" rel="alternate">Atom Feed</a>
{% endif %}
{% if FEED_ALL_RSS %}
&middot;
<a href="{{ SITEURL }}/{{ FEED_ALL_RSS }}" rel="alternate">Rss Feed</a>
{% endif %}
</footer>
{% endif %}
</div>
<div class="clear"></div>
</div>
{% include 'analytics.html' %}
</body>
</html>

View file

@ -0,0 +1,6 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME }} | articles in the "{{ category }}" category{% if articles_page.number != 1 %} | Page {{ articles_page.number }}{% endif %}{% endblock %}
{% block ephemeral_nav %}
{{ ephemeral_nav_link(category, output_file, True) }}
{% endblock %}

View file

@ -0,0 +1,12 @@
{% if DISQUS_SITENAME %}
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = '{{ DISQUS_SITENAME }}';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + 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="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
{% endif %}

View file

@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME }}{% if articles_page.number != 1 %} | Page {{ articles_page.number }}{% endif %}{% endblock %}
{% block content %}
{% set date = None %}
{% for article in articles_page.object_list %}
{% if date != article.date.date() %}
{% set first_article_of_day = True %}
{% else %}
{% set first_article_of_day = False %}
{% endif %}
{% set date = article.date.date() %}
{% include "article_stub.html" %}
{% endfor %}
{% include "pagination.html" %}
{% endblock %}

View file

@ -0,0 +1,105 @@
{% macro ephemeral_nav_link(what, where, selected=False) -%}
<li class="ephemeral{% if selected %} selected{% endif %}"><a href="{{ SITEURL }}/{{ where }}">{{what}}</a></li>
{%- endmacro -%}
<!DOCTYPE html>
<html lang="{{ DEFAULT_LANG }}">
<head>
{% block head %}
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
{# favicon #}
<link rel="shortcut icon" type="image/png" href="{{ SITEURL }}/favicon.png">
<link rel="shortcut icon" type="image/x-icon" href="{{ SITEURL }}/favicon.ico">
{% 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(slug=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(slug=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(slug=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(slug=tag.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
{% endif %}
<link rel="stylesheet" href="{{ SITEURL }}/theme/css/large.css" type="text/css" />
<link rel="stylesheet" href="{{ SITEURL }}/theme/css/pygments.css" type="text/css" />
<meta name="generator" content="Pelican" />
<meta name="description" content="{{ SITEDESCRIPTION }}" />
<meta name="author" content="{{ AUTHOR }}" />
{% endblock head %}
<script src="https://kit.fontawesome.com/0a2f7dbe4a.js" crossorigin="anonymous"></script>
</head>
<body>
{% if DISPLAY_HEADER or DISPLAY_HEADER is not defined %}
<header>
{% if DISPLAY_MENU or DISPLAY_MENU is not defined %}
<nav>
<ul>
{% block ephemeral_nav %}{% endblock %}
{% if DISPLAY_HOME or DISPLAY_HOME is not defined %}
<li{% if output_file == "index.html" %} class="selected"{% endif %}><a href="{{ SITEURL }}/">Home</a></li>
{% endif %}
{% if DISPLAY_PAGES_ON_MENU %}
{% for p in pages %}
<li{% if p == page %} class="selected"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
{% endfor %}
{% endif %}
{% for title, link in MENUITEMS %}
<li><a href="{{ link }}">{{ title }}</a></li>
{% endfor %}
{% for name, link, file in MENU_INTERNAL_PAGES %}
<li{% if output_file == file %} class="selected"{% endif %}><a href="{{ SITEURL }}/{{ link }}">{{ name }}</a></li>
{% endfor %}
</ul>
</nav>
{% endif %}
<div class="header_box">
<h1><a href="{{ SITEURL }}/">{{ SITENAME }}</a></h1>
{% if SITESUBTITLE %}
<h2>{{ SITESUBTITLE }}</h2>
{% endif %}
</div>
</header>
{% endif %}
<div id="wrapper">
<div id="content">
{%- block content -%}{%- endblock %}
{% if DISPLAY_FOOTER or DISPLAY_FOOTER is not defined %}
<div class="clear"></div>
<footer>
<p>
<a href="https://github.com/jody-frankowski/blue-penguin">Blue Penguin</a> Theme
&middot;
Powered by <a href="http://getpelican.com">Pelican</a>
{% if FEED_ALL_ATOM %}
&middot;
<a href="{{ SITEURL }}/{{ FEED_ALL_ATOM }}" rel="alternate">Atom Feed</a>
{% endif %}
{% if FEED_ALL_RSS %}
&middot;
<a href="{{ SITEURL }}/{{ FEED_ALL_RSS }}" rel="alternate">Rss Feed</a>
{% endif %}
</footer>
{% endif %}
</div>
<div class="clear"></div>
</div>
{% include 'analytics.html' %}
</body>
</html>

View file

@ -0,0 +1,11 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME }} | {{ page.title }}{% endblock %}
{% block content %}
<div class="page">
<h1>{{ page.title }}</h1>
{{ page.content }}
</div>
{% endblock %}

View file

@ -0,0 +1,17 @@
{# Use PAGINATION_PATTERNS or pagination may break #}
{% if DEFAULT_PAGINATION and (articles_page.has_previous() or articles_page.has_next()) %}
<div class="clear"></div>
<div class="pages">
{% if articles_page.has_previous() %}
<a href="{{ SITEURL }}/{{ articles_previous_page.url }}" class="prev_page">&larr;&nbsp;Previous</a>
{% endif %}
{% if articles_page.has_next() %}
<a href="{{ SITEURL }}/{{ articles_next_page.url }}" class="next_page">Next&nbsp;&rarr;</a>
{% endif %}
<span>Page {{ articles_page.number }} of {{ articles_paginator.num_pages }}</span>
</div>
{% endif %}

View file

@ -0,0 +1,5 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME }} | articles tagged "{{ tag }}"{% if articles_page.number != 1 %} | Page {{ articles_page.number }}{% endif %}{% endblock %}
{% block ephemeral_nav %}
{{ ephemeral_nav_link(tag, output_file, True) }}
{% endblock %}

View file

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

View file

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