Repository: gfidente/pelican-svbhack
Branch: master
Commit: 60a7f3fe0e1a
Files: 21
Total size: 27.2 KB
Directory structure:
gitextract_1ip4l591/
├── .gitignore
├── LICENSE
├── Makefile
├── README.md
├── static/
│ └── css/
│ ├── pygments.css
│ ├── style.css
│ └── style.less
└── templates/
├── archives.html
├── article.html
├── author.html
├── authors.html
├── base.html
├── categories.html
├── category.html
├── index.html
├── modules/
│ ├── analytics.html
│ ├── idl.html
│ └── pagination.html
├── page.html
├── tag.html
└── tags.html
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*~
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2012 William Ting
Copyright (c) 2013 Giulio Fidente
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: Makefile
================================================
# Install using:
#
# pip install pygments
#
# built in styles: ['monokai', 'manni', 'rrt', 'perldoc', 'borland', 'colorful',
# 'default', 'murphy', 'vs', 'trac', 'tango', 'fruity', 'autumn', 'bw', 'emacs',
# 'vim', 'pastie', 'friendly', 'native']
STYLE = default
pygments:
pygmentize -S ${STYLE} -f html > ./static/css/pygments.css
================================================
FILE: README.md
================================================
# SVBHACK
pelican-svbhack is a responsive theme for [Pelican](http://getpelican.com), it is my hack of a svbtle-like theme.
## DEMO
You can see the [theme in action](http://www.gfidente.com/).

## FEATURES
- responsive
- syntax highlighting for pre blocks
- supports google analytics and [matomo](https://matomo.org/)
- custom list of links
- supports the [readtime](https://github.com/getpelican/pelican-plugins/tree/master/readtime) plugin
## KNOWN ISSUES
- no IE testing
- no custom menu
## INSTALL
Clone the [repository](https://github.com/gfidente/pelican-svbhack), edit your `pelicanconf.py` and modify the `THEME` variable to make it point to the downloaded theme location.
## PELICANCONF.PY
Supports a number of common global variables but patches are welcomed if you need better support.
- `GOOGLE_ANALYTICS` to use Google Analytics, set this var to your UA-XYZ code
- `MATOMO_URL` to use Matomo, set this var to your server, e.g. "analytics.example.com" (no protocol prefix)
- `MATOMO_SITE_ID` to use Matomo, set this var to your site ID, e.g. "1"
- `USER_LOGO_URL` to replace the logo placeholder, put your logo in content/images/your_logo.png and make this var point to `SITEURL + '/static/images/your_logo.png'`
- `ROUND_USER_LOGO` set this to `True` to crop your logo to a circle and add a black border
- `HIDE_USER_LOGO` set this to `True` to hide the placeholder without adding your logo
- `USE_GENERIC_FONT_FAMILIES` set this to `True` to use generic font families and avoid using Google Fonts
- `DISQUS_SITENAME` set this to your Disqus sitename to enable disqus comments in articles
- `TAGLINE` some text rendered right below the logo
- `INTERNET_DEFENSE_LEAGUE` set this to `True` if you want to enable the [Internet Defense League](http://internetdefenseleague.org) code
When developing locally, you may want to set the following variable: `SITEURL = http://localhost:8000`
## MODIFICATIONS
- Accent color can be changed by editing `@accent` in `./static/css/style.less`.
- A different Pygmentize theme can be used by editing `./Makefile` and running `make pygments`.
## AUTHOR
pelican-svbhack is authored by Giulio Fidente.
## LICENSE
Released under MIT License, full details in `LICENSE` file.
================================================
FILE: static/css/pygments.css
================================================
.hll { background-color: #ffffcc }
.c { color: #408080; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { color: #008000; font-weight: bold } /* Keyword */
.o { color: #666666 } /* Operator */
.cm { color: #408080; font-style: italic } /* Comment.Multiline */
.cp { color: #BC7A00 } /* Comment.Preproc */
.c1 { color: #408080; font-style: italic } /* Comment.Single */
.cs { color: #408080; font-style: italic } /* Comment.Special */
.gd { color: #A00000 } /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.gr { color: #FF0000 } /* Generic.Error */
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
.gi { color: #00A000 } /* Generic.Inserted */
.go { color: #888888 } /* Generic.Output */
.gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.gs { font-weight: bold } /* Generic.Strong */
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.gt { color: #0044DD } /* Generic.Traceback */
.kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.kp { color: #008000 } /* Keyword.Pseudo */
.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.kt { color: #B00040 } /* Keyword.Type */
.m { color: #666666 } /* Literal.Number */
.s { color: #BA2121 } /* Literal.String */
.na { color: #7D9029 } /* Name.Attribute */
.nb { color: #008000 } /* Name.Builtin */
.nc { color: #0000FF; font-weight: bold } /* Name.Class */
.no { color: #880000 } /* Name.Constant */
.nd { color: #AA22FF } /* Name.Decorator */
.ni { color: #999999; font-weight: bold } /* Name.Entity */
.ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.nf { color: #0000FF } /* Name.Function */
.nl { color: #A0A000 } /* Name.Label */
.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.nt { color: #008000; font-weight: bold } /* Name.Tag */
.nv { color: #19177C } /* Name.Variable */
.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.w { color: #bbbbbb } /* Text.Whitespace */
.mf { color: #666666 } /* Literal.Number.Float */
.mh { color: #666666 } /* Literal.Number.Hex */
.mi { color: #666666 } /* Literal.Number.Integer */
.mo { color: #666666 } /* Literal.Number.Oct */
.sb { color: #BA2121 } /* Literal.String.Backtick */
.sc { color: #BA2121 } /* Literal.String.Char */
.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.s2 { color: #BA2121 } /* Literal.String.Double */
.se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.sh { color: #BA2121 } /* Literal.String.Heredoc */
.si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.sx { color: #008000 } /* Literal.String.Other */
.sr { color: #BB6688 } /* Literal.String.Regex */
.s1 { color: #BA2121 } /* Literal.String.Single */
.ss { color: #19177C } /* Literal.String.Symbol */
.bp { color: #008000 } /* Name.Builtin.Pseudo */
.vc { color: #19177C } /* Name.Variable.Class */
.vg { color: #19177C } /* Name.Variable.Global */
.vi { color: #19177C } /* Name.Variable.Instance */
.il { color: #666666 } /* Literal.Number.Integer.Long */
================================================
FILE: static/css/style.css
================================================
body {
margin: 0;
padding: 0;
background-color: #ffffff;
color: #4d4d4d;
font-family: 'PT Sans', sans-serif;
font-size: 18px;
}
a {
color: #000000;
text-decoration: none;
}
hr {
color: #eeeeee;
background-color: #eeeeee;
height: 1px;
border: none;
}
img {
max-width: 100%;
}
table {
border-collapse: collapse;
}
th,
td {
padding: 4px;
border-width: thin;
border-style: solid;
}
.round-img {
border-radius: 50%;
padding: 2px;
border: 10px solid;
}
aside div#user_meta {
padding: 40px;
text-align: center;
}
aside div#user_meta h2 {
margin: 15px 0 5px 0;
}
aside div#user_meta p {
margin: 0 0 15px 0;
font-size: .8rem;
}
aside div#user_meta ul {
margin: 40px 0 0 0;
padding-left: 0;
font-size: .9rem;
list-style-type: none;
}
aside div#user_meta ul li {
display: inline;
line-height: 3em;
}
aside div#user_meta ul li a {
padding: 5px 15px 5px 15px;
border: 3px solid #eeeeee;
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
color: #999999;
}
main header {
padding: 40px;
border-top: #eeeeee 1px solid;
border-bottom: #eeeeee 1px solid;
}
main header p {
font-weight: bold;
font-size: .6rem;
text-transform: uppercase;
}
main article {
max-width: 640px;
padding: 40px;
}
main article div.article_text {
line-height: 1.375em;
}
main article div.article_text a {
text-decoration: underline;
}
main article div.article_text code {
margin: 2px;
padding: 0;
color: #000000;
font-size: .8rem;
font-family: 'PT Mono', monospace;
background: #eeeeee;
}
main article div.article_text pre {
margin: 22px 2px 22px 2px;
padding: 2px;
color: #000000;
border-left: 3px solid #0e94ec;
font-size: .8rem;
font-family: 'PT Mono', monospace;
background: #eeeeee;
line-height: 1.125em;
overflow-x: auto;
}
main article div.article_text blockquote {
margin: 22px 2px 22px 2px;
padding-left: 40px;
color: #999999;
font-style: italic;
}
main article div.article_text div.quoteblock {
border-left: 5px solid #eeeeee;
color: #999999;
margin-bottom: 1.5em;
margin-left: 1em;
margin-right: 10%;
margin-top: 1em;
padding-left: 1em;
}
main article div.article_text div.quoteblock > div.attribution {
padding-top: 0.5em;
text-align: right;
}
main article div.article_text div.imageblock {
margin: 5px;
border: 1px solid #eeeeee;
padding: 5px;
}
main article div.article_text figure {
margin: 5px;
border: 1px solid #eeeeee;
padding: 5px;
}
main article div.article_text figcaption {
text-align: center;
}
main article div.article_text h1 a.headerlink,
main article div.article_text h2 a.headerlink,
main article div.article_text h3 a.headerlink,
main article div.article_text h4 a.headerlink {
visibility: hidden;
}
main article div.article_text h1:hover a.headerlink,
main article div.article_text h2:hover a.headerlink,
main article div.article_text h3:hover a.headerlink,
main article div.article_text h4:hover a.headerlink {
visibility: visible;
}
main article div.gist {
line-height: .875em;
}
main article div.article_meta, div.article_readtime {
font-size: .7rem;
color: #999999;
}
main footer {
border-top: #eeeeee 1px solid;
padding: 40px;
}
main footer a.button_accent {
padding: 10px;
border: 2px solid #0e94ec;
border-radius: 20px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
text-transform: uppercase;
color: #0e94ec;
font-size: 1rem;
}
main footer a.button_accent:hover {
color: #ffffff;
background-color: #0e94ec;
}
main footer a.button_accent:active {
color: #ffffff;
background-color: #0e94ec;
}
main div#ending_message {
border-top: #eeeeee 1px solid;
padding: 0 40px 0 40px;
color: #999999;
font-size: .6rem;
}
@media screen and (min-width: 1024px) {
aside {
width: 25%;
height: 100%;
position: fixed;
top: 0;
left: 0;
border-right: #eeeeee 1px solid;
}
aside h2 {
margin: 10px 0 0 0;
}
aside div#user_meta {
max-width: 192px;
text-align: right;
}
aside div#user_meta ul li {
display: block;
}
main {
width: 75%;
position: absolute;
top: 0;
left: 25%;
overflow-x: hidden;
overflow-y: hidden;
}
main article {
max-width: 640px;
}
main header {
border-top: 0;
}
}
================================================
FILE: static/css/style.less
================================================
@red: #ff0000;
@black: #000000;
@white: #ffffff;
@light-grey: #eeeeee;
@med-grey: #999999;
@dark-grey: #4d4d4d;
@blue: #0e94ec;
@accent: @blue;
@sans: 'PT Sans', sans-serif;
@serif: 'PT Serif', serif;
@mono: 'PT Mono', monospace;
body {
margin: 0;
padding: 0;
background-color: @white;
color: @dark-grey;
font-family: @sans;
font-size: 18px;
}
a {
color: @black;
text-decoration: none;
}
hr {
color: @light-grey;
background-color: @light-grey;
height: 1px;
border: none;
}
.border-radius (@radius: 5px) {
border-radius: @radius;
-moz-border-radius: @radius;
-webkit-border-radius: @radius;
}
img {
max-width: 100%;
}
table {
border-collapse: collapse;
}
th, td {
padding: 4px;
border-width: thin;
border-style: solid;
}
.round-img {
border-radius: 50%;
padding: 2px;
border: 10px solid;
}
aside {
div#user_meta {
padding: 40px;
text-align: center;
h2 {
margin: 15px 0 5px 0;
}
p {
margin: 0 0 15px 0;
font-size: .8rem;
}
ul {
margin: 40px 0 0 0;
padding-left: 0;
font-size: .9rem;
list-style-type: none;
li {
display: inline;
line-height: 3em;
a {
padding: 5px 15px 5px 15px;
border: 3px solid @light-grey;
.border-radius(15px);
color: @med-grey;
}
}
}
}
}
main {
header {
padding: 40px;
border-top: @light-grey 1px solid;
border-bottom: @light-grey 1px solid;
p {
font-weight: bold;
font-size: .6rem;
text-transform: uppercase;
}
}
article {
max-width: 640px;
padding: 40px;
div.article_title {
}
div.article_text {
line-height: 1.375em;
a {
text-decoration: underline;
}
code {
margin: 2px;
padding: 0;
color: @black;
font-size: .8rem;
font-family: @mono;
background: @light-grey;
}
pre {
margin: 22px 2px 22px 2px;
padding: 2px;
color: @black;
border-left: 3px solid @accent;
font-size: .8rem;
font-family: @mono;
background: @light-grey;
line-height: 1.125em;
overflow-x: auto;
}
blockquote {
margin: 22px 2px 22px 2px;
padding-left: 40px;
color: @med-grey;
font-style: italic;
}
// quoteblock and attribution are used by the asciidoc backend.
div.quoteblock {
border-left: 5px solid @light-grey;
color: @med-grey;
margin-bottom: 1.5em;
margin-left: 1.0em;
margin-right: 10%;
margin-top: 1.0em;
padding-left: 1.0em;
}
div.quoteblock > div.attribution {
padding-top: 0.5em;
text-align: right;
}
// imageblock is used by the asciidoc backend.
div.imageblock {
margin: 5px;
border: 1px solid @light-grey;
padding: 5px;
}
// figure and figcaption are used by the markdown_captions markdown extension.
figure {
margin: 5px;
border: 1px solid @light-grey;
padding: 5px;
}
figcaption {
text-align: center;
}
h1, h2, h3, h4 {
a.headerlink {
visibility:hidden;
}
}
h1:hover, h2:hover, h3:hover, h4:hover {
a.headerlink {
visibility:visible;
}
}
}
div.gist {
line-height: .875em;
}
div.article_meta, div.article_readtime {
font-size: .7rem;
color: @med-grey;
}
}
footer {
border-top: @light-grey 1px solid;
padding: 40px;
a.button_accent {
padding: 10px;
border: 2px solid @accent;
.border-radius(20px);
text-transform: uppercase;
color: @accent;
font-size: 1rem;
&:hover {
color: @white;
background-color: @accent;
}
&:active {
color: @white;
background-color: @accent;
}
}
div#paginator {
}
}
div#ending_message {
border-top: @light-grey 1px solid;
padding: 0 40px 0 40px;
color: @med-grey;
font-size: .6rem;
}
}
@media screen and (min-width: 1024px) {
aside {
width: 25%;
height: 100%;
position: fixed;
top: 0;
left: 0;
border-right: @light-grey 1px solid;
h2 {
margin: 10px 0 0 0;
}
div#user_meta {
max-width: 192px;
text-align: right;
ul {
li {
display: block;
}
}
}
}
main {
width: 75%;
position: absolute;
top: 0;
left: 25%;
overflow-x: hidden;
overflow-y: hidden;
article {
max-width: 640px;
}
header {
border-top: 0;
}
}
}
================================================
FILE: templates/archives.html
================================================
{% extends "base.html" %}
{% block title %}– Archives{% endblock %}
{% block content %}
{% for article in dates %}
{{ article.locale_date }}
{{ article.title }}
{% endfor %}
{% endblock %}
================================================
FILE: templates/article.html
================================================
{% extends "base.html" %}
{% block head %}
{% endblock %}
{% block title %}– {{ article.title }}{% endblock %}
{% block content %}
Posted on: {{ article.locale_date }}
{% if article.readtime %}
Estimated read time: {{article.readtime.minutes}} minutes
{% endif %}
{{ article.content }}
Category: {{ article.category }}
{% if article.tags %} – Tags:
{% for tag in article.tags %}
{{ tag }} {% if not loop.last %},{% endif %}
{% endfor %}
{% endif %}
{% if DISQUS_SITENAME %}
{% endif %}
{% endblock %}
================================================
FILE: templates/author.html
================================================
{% extends "index.html" %}
{% block title %}– Posts by: {{ author }}{% endblock %}
{% block header %}
> Author: {{ author }}
{% endblock %}
================================================
FILE: templates/authors.html
================================================
{% extends "base.html" %}
{% block title %}– Authors{% endblock %}
{% block content %}
{% for author, articles in authors|sort %}
{{ author }} ({{ articles|count }})
{% endfor %}
{% endblock %}
================================================
FILE: templates/base.html
================================================
{% if not USE_GENERIC_FONT_FAMILIES %}
{% endif %}
{% if FEED_ALL_ATOM %}
{% endif %}
{% if FEED_ALL_RSS %}
{% endif %}
{% block head %}
{% endblock %}
{{ SITENAME }}
{% block title %}{% endblock %}
{% include "modules/analytics.html" %}
{% block content %}
{% endblock %}
{% block footer %}
{% endblock %}
{% include "modules/idl.html" %}
================================================
FILE: templates/categories.html
================================================
{% extends "base.html" %}
{% block title %}– Categories{% endblock %}
{% block content %}
{% for category, articles in categories|sort %}
{{ category }} ({{ articles|count }})
{% endfor %}
{% endblock %}
================================================
FILE: templates/category.html
================================================
{% extends "index.html" %}
{% block title %}– Category: {{ category }}{% endblock %}
{% block head %}
{% if CATEGORY_FEED_ATOM %}
{% endif %}
{% if CATEGORY_FEED_RSS %}
{% endif %}
{% endblock %}
{% block header %}
> Category: {{ category }}
{% if CATEGORY_FEED_ATOM %}
¦ Atom
{% endif %}
{% if CATEGORY_FEED_RSS %}
¦ RSS
{% endif %}
{% endblock %}
================================================
FILE: templates/index.html
================================================
{% extends "base.html" %}
{% block content %}
{% for article in articles_page.object_list %}
Posted on: {{ article.locale_date }}
{% if article.readtime %}
Estimated read time: {{article.readtime.minutes}} minutes
{% endif %}
{{ article.summary }}
{% if not loop.last %}
{% endif %}
{% endfor %}
{% endblock %}
{% block footer %}
{% include "modules/pagination.html" %}
{% endblock %}
================================================
FILE: templates/modules/analytics.html
================================================
{% if GOOGLE_ANALYTICS %}
{% endif %}
{% if MATOMO_URL %}
{% endif %}
================================================
FILE: templates/modules/idl.html
================================================
{% if INTERNET_DEFENSE_LEAGUE %}
{% endif %}
================================================
FILE: templates/modules/pagination.html
================================================
{% if DEFAULT_PAGINATION %}
{% if articles_page.has_next() %}
← Older Posts
{% endif %}
{% if articles_page.has_previous() %}
{% if articles_page.previous_page_number() == 1 %}
Newer Posts →
{% else %}
Newer Posts →
{% endif %}
{% endif %}
{% endif %}
================================================
FILE: templates/page.html
================================================
{% extends "base.html" %}
{% block title %}– {{ page.title }}{% endblock %}
{% block content %}
{{ page.content }}
Updated on: {{ page.locale_date }}
{% endblock %}
================================================
FILE: templates/tag.html
================================================
{% extends "index.html" %}
{% block title %}– Tag: {{ tag }}{% endblock %}
{% block head %}
{% if TAG_FEED_ATOM %}
{% endif %}
{% if TAG_FEED_RSS %}
{% endif %}
{% endblock %}
{% block header %}
> Tag: {{ tag }}
{% if TAG_FEED_ATOM %}
¦ Atom
{% endif %}
{% if TAG_FEED_RSS %}
¦ RSS
{% endif %}
{% endblock %}
================================================
FILE: templates/tags.html
================================================
{% extends "base.html" %}
{% block title %}– Tags{% endblock %}
{% block content %}
{%- for tag, articles in tags|sort %}
{{ tag }} ({{ articles|count }})
{% endfor %}
{% endblock %}