init bootstrap2

This commit is contained in:
Jiachen Yang
2012-03-11 00:59:53 +09:00
parent aa7f0e939c
commit 19755337b1
29 changed files with 6845 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,15 @@
{% extends "base.html" %}
{% block content %}
<div class="span12">
<section id="content">
<h1>Archives for {{ SITENAME }}</h1>
<dl>
{% for article in dates %}
<dt>{{ article.locale_date }}</dt>
<dd><a href='{{ article.url }}'>{{ article.title }}</a></dd>
{% endfor %}
</dl>
</section>
</div>
{% endblock %}

View File

@@ -0,0 +1,40 @@
{% extends "base.html" %}
{% block title %}{{ article.title }}{% endblock %}
{% block content %}
<div class="span12">
<section id="content">
<article>
<header>
<h1>
<a href="{{ pagename }}"
rel="bookmark"
title="Permalink to {{ article.title }}">
{{ article.title}}
</a>
</h1> {% include 'twitter.html' %}
</header>
<div class="entry-content">
{% include 'article_infos.html' %}
{{ article.content }}
</div><!-- /.entry-content -->
{% if DISQUS_SITENAME %}
<div class="comments">
<h2>Comments !</h2>
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_identifier = "{{ article.url }}";
(function() {
var dsq = document.createElement('script');
dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://{{ DISQUS_SITENAME }}.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
</div>
{% endif %}
</article>
</section>
</div>
{% endblock %}

View File

@@ -0,0 +1,14 @@
<footer class="post-info">
<abbr class="published" title="{{ article.date.isoformat() }}">
{{ article.locale_date }}
</abbr>
{% if article.author %}
<address class="vcard author">
By <a class="url fn" href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a>
</address>
{% endif %}
<p>In <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>. {% if PDF_PROCESSOR %}<a href="{{ SITEURL }}/pdf/{{ article.slug }}.pdf">get the pdf</a>{% endif %}</p>
{% include 'taglist.html' %}
{% include 'translations.html' %}
</footer><!-- /.post-info -->

View File

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

View File

View File

@@ -0,0 +1,147 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{% block title %}{{ SITENAME }}{%endblock%}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link rel="stylesheet" href="{{ SITEURL }}/theme/css/bootstrap.css" type="text/css" />
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="{{ SITEURL }}/theme/css/bootstrap-responsive.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="{{ SITEURL }}/theme/images/favicon.ico">
<link rel="apple-touch-icon" href="{{ SITEURL }}/theme/images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="{{ SITEURL }}/theme/images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="{{ SITEURL }}/theme/images/apple-touch-icon-114x114.png">
<link href="{{ SITEURL }}/{{ FEED }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} ATOM Feed" />
{% if FEED_RSS %}
<link href="{{ SITEURL }}/{{ FEED_RSS }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
{% endif %}
</head>
<body>
{% include 'github.html' %}
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="{{ SITEURL }}">{{ SITENAME }} {% if SITESUBTITLE %} <strong>{{ SITESUBTITLE }}</strong>{% endif %}</a>
<div class="nav-collapse">
<ul class="nav">
{% for title, link in MENUITEMS %}
<li><a href="{{ link }}">{{ title }}</a></li>
{% endfor %}
{% if DISPLAY_PAGES_ON_MENU %}
{% for page in PAGES %}
<li><a href="{{ SITEURL }}/{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}
{% endif %}
{% for cat, null in categories %}
<li {% if cat == category %}class="active"{% endif %}>
<a href="{{ SITEURL }}/category/{{ cat }}.html">{{ cat }}</a>
</li>
{% endfor %}
</ul>
<!--<p class="navbar-text pull-right">Logged in as <a href="#">username</a></p>-->
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span9">
{% block content %}
{% endblock %}
</div><!--/span-->
<div class="span3">
<div class="well sidebar-nav">
<ul class="nav nav-list">
{% if LINKS %}
<li class="nav-header">blogroll</li>
{% for name, link in LINKS %}
<li><a href="{{ link }}">{{ name }}</a></li>
{% endfor %}
{% endif %}
{% if SOCIAL %}
<li class="nav-header">social</li>
<li><a href="{{ SITEURL }}/{{ FEED }}" rel="alternate">atom feed</a></li>
{% if FEED_RSS %}
<li><a href="{{ SITEURL }}/{{ FEED_RSS }}" rel="alternate">rss feed</a></li>
{% endif %}
{% for name, link in SOCIAL %}
<li><a href="{{ link }}">{{ name }}</a></li>
{% endfor %}
{% endif %}
</ul>
</div><!--/.well -->
</div><!--/span-->
</div><!--/row-->
<hr>
<footer>
<address id="about">
Proudly powered by <a href="http://pelican.notmyidea.org/">Pelican</a>, which takes great advantage of <a href="http://python.org">Python</a>.
</address><!-- /#about -->
<p>The theme is by <a href="http://twitter.github.com/bootstrap/">Bootstrap from Twitter</a>, thanks!</p>
</footer>
</div><!--/.fluid-container-->
{% include 'analytics.html' %}
{% include 'piwik.html' %}
{% include 'disqus_script.html' %}
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="{{ SITEURL }}/theme/js/jquery.js"></script>
<script src="{{ SITEURL }}/theme/js/bootstrap-transition.js"></script>
<script src="{{ SITEURL }}/theme/js/bootstrap-alert.js"></script>
<script src="{{ SITEURL }}/theme/js/bootstrap-modal.js"></script>
<script src="{{ SITEURL }}/theme/js/bootstrap-dropdown.js"></script>
<script src="{{ SITEURL }}/theme/js/bootstrap-scrollspy.js"></script>
<script src="{{ SITEURL }}/theme/js/bootstrap-tab.js"></script>
<script src="{{ SITEURL }}/theme/js/bootstrap-tooltip.js"></script>
<script src="{{ SITEURL }}/theme/js/bootstrap-popover.js"></script>
<script src="{{ SITEURL }}/theme/js/bootstrap-button.js"></script>
<script src="{{ SITEURL }}/theme/js/bootstrap-collapse.js"></script>
<script src="{{ SITEURL }}/theme/js/bootstrap-carousel.js"></script>
<script src="{{ SITEURL }}/theme/js/bootstrap-typeahead.js"></script>
</body>
</html>

View File

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

View File

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

View File

@@ -0,0 +1,7 @@
{% if DISQUS_SITENAME %}
<p>There are
<a href="{{ SITEURL }}/{{ article.url }}#disqus_thread">
comments
</a>.
</p>
{% endif %}

View File

@@ -0,0 +1,11 @@
{% if DISQUS_SITENAME %}
<script type="text/javascript">
var disqus_shortname = '{{ DISQUS_SITENAME }}';
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
{% endif %}

View File

@@ -0,0 +1,9 @@
{% if GITHUB_URL %}
<a href="{{ GITHUB_URL }}">
{% if GITHUB_POSITION != "left" %}
<img style="position: absolute; top: 0; right: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub" />
{% else %}
<img style="position: absolute; top: 0; left: 0; border: 0;" src="http://s3.amazonaws.com/github/ribbons/forkme_left_white_ffffff.png" alt="Fork me on GitHub" />
{% endif %}
</a>
{% endif %}

View File

@@ -0,0 +1,71 @@
{% extends "base.html" %}
{% block content_title %}{% endblock %}
{% block content %}
{% if articles %}
{% for article in articles_page.object_list %}
{# First item #}
{% if loop.first and not articles_page.has_previous() %}
<div class="hero-unit">
<aside id="featured">
<article>
<h1><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></h1>
{% include 'article_infos.html' %}{{ article.content }}{% include 'comments.html' %}
</article>
{% if loop.length == 1 %}
{% include 'pagination.html' %}
{% endif %}
</aside><!-- /#featured -->
</div>
{% if loop.length > 1 %}
<div class="row-fluid">
<section id="content">
<h1>Other articles</h1>
<hr />
<ol id="posts-list">
{% endif %}
{# other items #}
{% else %}
{% if loop.first and articles_page.has_previous %}
<div class="row-fluid">
<section id="content">
<ol id="posts-list" start="{{ articles_paginator.per_page -1 }}">
{% endif %}
<li>
<div class="span6">
<article>
<header>
<h1><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title}}">{{ article.title }}</a></h1>
</header>
<div class="entry-content">
{% include 'article_infos.html' %}
{{ article.summary }}
<a class="btn primary" href="{{ SITEURL }}/{{ article.url }}">read more</a>
{% include 'comments.html' %}
</div><!-- /.entry-content -->
</article>
</div>
</li>
{% endif %}
{% if loop.last and (articles_page.has_previous()
or not articles_page.has_previous() and loop.length > 1) %}
{% include 'pagination.html' %}
{% endif %}
{% endfor %}
{% if loop.length > 1 or articles_page.has_previous() %}
</ol><!-- /#posts-list -->
</section><!-- /#content -->
</div>
{% endif %}
{% else %}
<div class="hero-unit">
<section id="content" class="body">
<h2>Pages</h2>
{% for page in PAGES %}
<li><a href="{{ SITEURL }}/{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}
</section>
</div>
{% endif %}
{% endblock content %}

View File

@@ -0,0 +1,15 @@
{% extends "base.html" %}
{% block title %}{{ page.title }}{% endblock %}
{% block content %}
<div class="span12">
<section id="content" class="body">
<h1 class="entry-title">{{ page.title }}</h1>
{% if PDF_PROCESSOR %}
<a href="{{ SITEURL }}/pdf/{{ page.slug }}.pdf">
get the pdf
</a>
{% endif %}
{{ page.content }}
</section>
</div>
{% endblock %}

View File

@@ -0,0 +1,15 @@
{% if DEFAULT_PAGINATION %}
<p class="paginator">
{% if articles_page.has_previous() %}
{% if articles_page.previous_page_number() == 1 %}
<a href="{{ SITEURL }}/{{ page_name }}.html">&laquo;</a>
{% else %}
<a href="{{ SITEURL }}/{{ page_name }}{{ articles_page.previous_page_number() }}.html">&laquo;</a>
{% endif %}
{% endif %}
Page {{ articles_page.number }} / {{ articles_paginator.num_pages }}
{% if articles_page.has_next() %}
<a href="{{ SITEURL }}/{{ page_name }}{{ articles_page.next_page_number() }}.html">&raquo;</a>
{% endif %}
</p>
{% endif %}

View File

@@ -0,0 +1,16 @@
{% if PIWIK_URL and PIWIK_SITE_ID %}
<script type="text/javascript">
{% if PIWIK_SSL_URL %}
var pkBaseURL = (("https:" == document.location.protocol) ? "https://{{ PIWIK_SSL_URL }}/" : "http://{{ PIWIK_URL }}/");
{% else %}
var pkBaseURL = (("https:" == document.location.protocol) ? "https://{{ PIWIK_URL }}/" : "http://{{ PIWIK_URL }}/");
{% endif %}
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", {{ PIWIK_SITE_ID }});
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://{{ PIWIK_URL }}/piwik.php?idsite={{ PIWIK_SITE_ID }}" style="border:0" alt="" /></p></noscript>
{% endif %}

View File

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

View File

@@ -0,0 +1,12 @@
{% if article.tags %}
<p>tags:
{% for tag in article.tags %}
<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>
{% endfor %}
</p>
{% endif %}
{% if PDF_PROCESSOR %}
<p><a href="{{ SITEURL }}/pdf/{{ article.slug }}.pdf">
get the pdf
</a></p>
{% endif %}

View File

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 %}

View File

@@ -0,0 +1,6 @@
{% if TWITTER_USERNAME %}
<a href="http://twitter.com/share" class="twitter-share-button"
data-count="horizontal" data-via="{{TWITTER_USERNAME}}">Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js">
</script>
{% endif %}