Merge pull request #19 from alexex/master

added bootlex theme to the themes repo
This commit is contained in:
Alexis Metaireau
2012-03-27 15:38:13 -07:00
16 changed files with 4339 additions and 0 deletions

13
bootlex/LICENSE Normal file
View File

@@ -0,0 +1,13 @@
Copyright 2012 Alexander Jung-Loddenkemper.
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.

45
bootlex/README.md Normal file
View File

@@ -0,0 +1,45 @@
# What is bootlex?
Bootlex is a theme for the [pelican](https://github.com/ametaireau/pelican) static blog generator.
It is based on a modified bootstrap and works nicely with a lot of pelican features.
# Requirements
At some points I switched to the git version, so this theme might work with the stable version, but I recommend to use the latest version from git.
# Installation
Just pull the repo with `git clone git://github.com/alexex/bootlex.git` and include its location via the `THEME` option in your settings.py
There are some settings that will make it work flawlessly:
Your `SITEURL`must have a **trailing slash**. I would recommend the following url config, that I am using with my theme, and seems to work quite good:
ARTICLE_URL = ('{slug}/')
ARTICLE_SAVE_AS = ('{slug}.html')
PAGE_URL = ('{slug}/')
PAGE_SAVE_AS = ('{slug}.html')
AUTHOR_URL = ('author/{name}/')
TAG_URL = ('tag/{name}/')
You will probably need some RewriteRules for your Webserver aswell, my `.htaccess` looks like this:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)/$ $1.html [L]
# Features
You can make use of the following settings:
* `Pages` (will be included in the menu automatically)
* `MENUITEMS` (will be included aswell)
* `LINKS` (as the above)
* `GOOGLE_ANALYTICS` (will be included automatically, if set)
# Missing
I do not know whether it works, but as I never cared about it, I suppose that categorys will not work properly

BIN
bootlex/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

3992
bootlex/static/bootstrap.css vendored Executable file

File diff suppressed because it is too large Load Diff

69
bootlex/static/pastie.css Normal file
View File

@@ -0,0 +1,69 @@
.codehilite { background-color: #ffffcc }
.codehilite .c { color: #586E75 } /* Comment */
.codehilite .err { color: #93A1A1 } /* Error */
.codehilite .g { color: #93A1A1 } /* Generic */
.codehilite .k { color: #859900 } /* Keyword */
.codehilite .l { color: #93A1A1 } /* Literal */
.codehilite .n { color: #93A1A1 } /* Name */
.codehilite .o { color: #859900 } /* Operator */
.codehilite .x { color: #CB4B16 } /* Other */
.codehilite .p { color: #93A1A1 } /* Punctuation */
.codehilite .cm { color: #586E75 } /* Comment.Multiline */
.codehilite .cp { color: #859900 } /* Comment.Preproc */
.codehilite .c1 { color: #586E75 } /* Comment.Single */
.codehilite .cs { color: #859900 } /* Comment.Special */
.codehilite .gd { color: #2AA198 } /* Generic.Deleted */
.codehilite .ge { color: #93A1A1; font-style: italic } /* Generic.Emph */
.codehilite .gr { color: #DC322F } /* Generic.Error */
.codehilite .gh { color: #CB4B16 } /* Generic.Heading */
.codehilite .gi { color: #859900 } /* Generic.Inserted */
.codehilite .go { color: #93A1A1 } /* Generic.Output */
.codehilite .gp { color: #93A1A1 } /* Generic.Prompt */
.codehilite .gs { color: #93A1A1; font-weight: bold } /* Generic.Strong */
.codehilite .gu { color: #CB4B16 } /* Generic.Subheading */
.codehilite .gt { color: #93A1A1 } /* Generic.Traceback */
.codehilite .kc { color: #CB4B16 } /* Keyword.Constant */
.codehilite .kd { color: #268BD2 } /* Keyword.Declaration */
.codehilite .kn { color: #859900 } /* Keyword.Namespace */
.codehilite .kp { color: #859900 } /* Keyword.Pseudo */
.codehilite .kr { color: #268BD2 } /* Keyword.Reserved */
.codehilite .kt { color: #DC322F } /* Keyword.Type */
.codehilite .ld { color: #93A1A1 } /* Literal.Date */
.codehilite .m { color: #2AA198 } /* Literal.Number */
.codehilite .s { color: #2AA198 } /* Literal.String */
.codehilite .na { color: #93A1A1 } /* Name.Attribute */
.codehilite .nb { color: #B58900 } /* Name.Builtin */
.codehilite .nc { color: #268BD2 } /* Name.Class */
.codehilite .no { color: #CB4B16 } /* Name.Constant */
.codehilite .nd { color: #268BD2 } /* Name.Decorator */
.codehilite .ni { color: #CB4B16 } /* Name.Entity */
.codehilite .ne { color: #CB4B16 } /* Name.Exception */
.codehilite .nf { color: #268BD2 } /* Name.Function */
.codehilite .nl { color: #93A1A1 } /* Name.Label */
.codehilite .nn { color: #93A1A1 } /* Name.Namespace */
.codehilite .nx { color: #93A1A1 } /* Name.Other */
.codehilite .py { color: #93A1A1 } /* Name.Property */
.codehilite .nt { color: #268BD2 } /* Name.Tag */
.codehilite .nv { color: #268BD2 } /* Name.Variable */
.codehilite .ow { color: #859900 } /* Operator.Word */
.codehilite .w { color: #93A1A1 } /* Text.Whitespace */
.codehilite .mf { color: #2AA198 } /* Literal.Number.Float */
.codehilite .mh { color: #2AA198 } /* Literal.Number.Hex */
.codehilite .mi { color: #2AA198 } /* Literal.Number.Integer */
.codehilite .mo { color: #2AA198 } /* Literal.Number.Oct */
.codehilite .sb { color: #586E75 } /* Literal.String.Backtick */
.codehilite .sc { color: #2AA198 } /* Literal.String.Char */
.codehilite .sd { color: #93A1A1 } /* Literal.String.Doc */
.codehilite .s2 { color: #2AA198 } /* Literal.String.Double */
.codehilite .se { color: #CB4B16 } /* Literal.String.Escape */
.codehilite .sh { color: #93A1A1 } /* Literal.String.Heredoc */
.codehilite .si { color: #2AA198 } /* Literal.String.Interpol */
.codehilite .sx { color: #2AA198 } /* Literal.String.Other */
.codehilite .sr { color: #DC322F } /* Literal.String.Regex */
.codehilite .s1 { color: #2AA198 } /* Literal.String.Single */
.codehilite .ss { color: #2AA198 } /* Literal.String.Symbol */
.codehilite .bp { color: #268BD2 } /* Name.Builtin.Pseudo */
.codehilite .vc { color: #268BD2 } /* Name.Variable.Class */
.codehilite .vg { color: #268BD2 } /* Name.Variable.Global */
.codehilite .vi { color: #268BD2 } /* Name.Variable.Instance */
.codehilite .il { color: #2AA198 } /* Literal.Number.Integer.Long */

View File

@@ -0,0 +1,15 @@
{% if GOOGLE_ANALYTICS %}
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ GOOGLE_ANALYTICS }}']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
{% endif %}

View File

@@ -0,0 +1,15 @@
{% extends "base.html" %}
{% block title %}Archiv{%endblock%}
{% block menu_entry_archive %}
class="active"
{% endblock %}
{% block content %}
<h1>Archiv {{ pagename }}</h1>
<dl>
{% for article in dates %}
<dt>{{ article.locale_date }}</dt>
<dd><a href='{{ SITEURL }}{{ article.url }}'>{{ article.title }}</a></dd>
{% endfor %}
</dl>
{% endblock %}

View File

@@ -0,0 +1,13 @@
{% extends "base.html" %}
{% block title %}{{ article.title }}{%endblock%}
{% block content %}
<div id="content">
<div class="header">
<h1>{{ article.title }}</h1>
</div>
<p class="meta"><small><span>{% if article.author %}<a href="{{ SITEURL }}author/{{ article.author.slug }}/">{{ article.author }}</a> - {% endif %}</span><span>{{ article.locale_date }}</span> - <span class="tags">{% if article.tags %}{% for tag in article.tags %}<a href="/tag/{{ tag }}/">{{ tag }}</a>{% if not loop.last %}, {% endif %}{% endfor %}{% endif %}</span></small></p>
<div class="entry-content">
{{ article.content }}
</div><!-- /.entry-content -->
</div>
{% endblock %}

View File

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

View File

@@ -0,0 +1,71 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ DEFAULT_LANG }}">
<head>
{% block head %}
<title>{% block title %}{% endblock title %} - {{ SITENAME }}</title>
<link href="http://fonts.googleapis.com/css?family=Arimo:400,700|Inika" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}theme/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}theme/pastie.css" />
{% endblock head %}
{% include 'analytics.html' %}
</head>
<body>
<div class="container">
<div class="row">
<div class="span8">
{% block content %}
{% endblock %}
</div>
<div class="span3 offset1">
<div class="well">
<ul class="nav nav-list">
<li class="nav-header">Blog</li>
<li {% if page_name == 'index' %}class="active"{% endif %}><a href="{{ SITEURL }}">Index</a></li>
<li {% block menu_entry_tag %}{% endblock %}><a href="{{ SITEURL }}tags/">Tags</a></li>
<li {% block menu_entry_archive %}{% endblock %}><a href="{{ SITEURL }}archives/">Archiv</a></li>
{% if DISPLAY_PAGES_ON_MENU %}
{% if PAGES %}
<li class="nav-header">Seiten</li>
{% for p in PAGES %}
<li{% if p == page %} class="active"{% endif %}><a href="{{ SITEURL }}{{ p.url }}">{{ p.title }}</a></li>
{% endfor %}
{% endif %}
{% else %}
{# {% for cat, null in categories %}
<li{% if cat == category %} class="active"{% endif %}><a href="{{ SITEURL }}category/{{ cat }}/">{{ cat }}</a></li>
{% endfor %}
#}
{% endif %}
{% if MENUITEMS %}
<li class="nav-header">Anderes</li>
{% for title, link in MENUITEMS %}
<li><a href="{{ link }}">{{ title }}</a></li>
{% endfor %}
{% endif %}
{% if LINKS %}
<li class="nav-header">Links</li>
{% for title, link in LINKS %}
<li><a href="{{ link }}">{{ title }}</a></li>
{% endfor %}
{% endif %}
</ul>
</div><!-- /#menu -->
</div>
</div>
<hr />
<div class="row">
<div class="span12">
<div id="about">
<p>Proudly powered by <a href="http://twitter.github.com/bootstrap/">bootstrap</a>, <a href="http://docs.notmyidea.org/alexis/pelican/">pelican</a>, <a href="http://python.org">python</a> and <a href="http://www.julo.ch/about/">Alex</a>!</p>
</div><!-- /#about -->
</div><!-- /#contentinfo -->
</div>
</div>
</body>
</html>

View File

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

View File

@@ -0,0 +1,5 @@
{% extends "index.html" %}
{% block content_title %}
<h2>Articles in the {{ category }} category</h2>
{% endblock %}

View File

@@ -0,0 +1,61 @@
{% extends "base.html" %}
{% block title %}Blog{%endblock%}
{% block content %}
<div id="content">
{% block content_title %}
<h1>Blog</h1>
{% endblock %}
<ul class="unstyled">
{% for article in articles_page.object_list %}
<li>
<div>
<div class="header">
<h2>{{ article.title }}</h2>
</div>
<p class="meta"><small><span>{% if article.author %}<a href="{{ SITEURL }}author/{{ article.author.slug }}/">{{ article.author }}</a> - {% endif %}</span><span>{{ article.locale_date }}</span> - <span class="tags">{% if article.tags %}{% for tag in article.tags %}<a href="/tag/{{ tag }}/">{{ tag }}</a>{% if not loop.last %}, {% endif %}{% endfor %}{% endif %}</span></small></p>
<div class="entry-content">
{{ article.summary }}
</div><!-- /.entry-content -->
<div class="row">
<div class="span1 offset7">
<a class="btn btn-small" href="{{ SITEURL }}{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title}}">Mehr</a>
</div>
</div>
</div>
</li>
<li><hr /></li>
{% endfor %}
</ul><!-- /#posts-list -->
<div class="pagination pagination-centered">
<ul>
{% if articles_page.has_previous() and (articles_page.previous_page_number() != 1) %}
<li><a href="{{ SITEURL }}">1</a></li>
{% endif %}
{% if articles_page.previous_page_number() - 1 == 2 %}
<li><a href="{{ articles_page.previous_page_number() - 1}}">{{ articles_page.previous_page_number() - 1}}</a></li>
{% elif articles_page.previous_page_number() - 1 > 1 %}
<li class="disabled"><a href="#">...</a></li>
{% endif %}
{% if articles_page.has_previous() %}
<li><a href="{{ SITEURL }}{% if articles_page.previous_page_number() != 1 %}{{ page_name }}{{ articles_page.previous_page_number() }}/{% endif %}">{{ articles_page.previous_page_number() }}</a></li>
{% endif %}
<li class="active"><a href="#">{{ articles_page.number }}</a></li>
{% if articles_page.has_next() %}
<li><a href="{{ SITEURL }}{{ page_name }}{{ articles_page.next_page_number() }}/">{{ articles_page.next_page_number() }}</a></li>
{% endif %}
{% if articles_paginator.num_pages - articles_page.next_page_number() == 2 %}
<li><a href="{{ articles_page.next_page_number() + 1}}">{{ articles_page.next_page_number() + 1}}</a></li>
{% elif articles_paginator.num_pages - articles_page.next_page_number() > 2 %}
<li class="disabled"><a href="#">...</a></li>
{% endif %}
{% if articles_page.has_next() and (articles_page.next_page_number() != articles_paginator.num_pages) %}
<li><a href="{{ SITEURL }}{{ page_name }}{{ articles_paginator.num_pages }}/">{{ articles_paginator.num_pages }}</a></li>
{% endif %}
</ul>
</div>
</div><!-- /#content -->
{% endblock content %}

View File

@@ -0,0 +1,6 @@
{% extends "base.html" %}
{% block title %}{{ page.title }}{%endblock%}
{% block content %}
<h1>{{ page.title }}</h1>
{{ page.content }}
{% endblock %}

View File

@@ -0,0 +1,2 @@
{% extends "index.html" %}
{% block title %}Tag {{ tag }}{% endblock %}

View File

@@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block title %}Tags{%endblock%}
{% block menu_entry_tag %}
class="active"
{% endblock %}
{% block content %}
<h1>Tags</h1>
{% if tags %}
<ul>
{% for tag, articles in tags %}
<li><a href="{{ SITEURL }}tag/{{ tag }}/">{{ tag }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>Sorry, bisher gibt es keine Tags.</p>
{% endif %}
{% endblock %}