forked from github/pelican
Add a settings file.
This commit is contained in:
parent
3daaecda26
commit
3376cd5400
4 changed files with 8 additions and 12 deletions
1
TODO
1
TODO
|
|
@ -1,4 +1,3 @@
|
|||
* Add a settings.py file/option
|
||||
* Fall back to settings + date of files when no metadata available
|
||||
* Filter to generate only the files with .rst extension
|
||||
* Add a licence
|
||||
|
|
|
|||
|
|
@ -103,17 +103,14 @@ def update_dict(mapping, key, value):
|
|||
|
||||
|
||||
def read_settings(context, filename):
|
||||
"""Load a Python file into a dictionary.
|
||||
"""Load a Python file into a dictionary.
|
||||
"""
|
||||
if filename:
|
||||
from importlib import import_module
|
||||
d = import_module(filename)
|
||||
|
||||
for key in dir(d):
|
||||
tempdict = {}
|
||||
execfile(filename, tempdict)
|
||||
for key in tempdict:
|
||||
if key.isupper():
|
||||
context[key] = getattr(d, key)
|
||||
from ipdb import set_trace
|
||||
set_trace()
|
||||
context[key] = tempdict[key]
|
||||
return context
|
||||
|
||||
_METADATA = re.compile('.. ([a-z]+): (.*)', re.M)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<h1>Archives for {{ blogname }}</h1>
|
||||
<h1>Archives for {{ BLOGNAME }}</h2>
|
||||
|
||||
<dl>
|
||||
{% for date, articles in dates %}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{% block title %}{{ blogtitle }}{%endblock%}</title>
|
||||
<title>{% block title %}{{ BLOGNAME }}{%endblock%}</title>
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
|
||||
<body id="index" class="home">
|
||||
<header id="banner" class="body">
|
||||
<h1><a href="{{ blogurl }}">{{ blogtitle }} <strong>{{ blogsubtitle }}</strong></a></h1>
|
||||
<h1><a href="{{ BLOGURL }}">{{ BLOGNAME }} <strong>{{ BLOGSUBTITLE }}</strong></a></h1>
|
||||
</header><!-- /#banner -->
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue