mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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
|
* Fall back to settings + date of files when no metadata available
|
||||||
* Filter to generate only the files with .rst extension
|
* Filter to generate only the files with .rst extension
|
||||||
* Add a licence
|
* Add a licence
|
||||||
|
|
|
||||||
|
|
@ -103,17 +103,14 @@ def update_dict(mapping, key, value):
|
||||||
|
|
||||||
|
|
||||||
def read_settings(context, filename):
|
def read_settings(context, filename):
|
||||||
"""Load a Python file into a dictionary.
|
"""Load a Python file into a dictionary.
|
||||||
"""
|
"""
|
||||||
if filename:
|
if filename:
|
||||||
from importlib import import_module
|
tempdict = {}
|
||||||
d = import_module(filename)
|
execfile(filename, tempdict)
|
||||||
|
for key in tempdict:
|
||||||
for key in dir(d):
|
|
||||||
if key.isupper():
|
if key.isupper():
|
||||||
context[key] = getattr(d, key)
|
context[key] = tempdict[key]
|
||||||
from ipdb import set_trace
|
|
||||||
set_trace()
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
_METADATA = re.compile('.. ([a-z]+): (.*)', re.M)
|
_METADATA = re.compile('.. ([a-z]+): (.*)', re.M)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Archives for {{ blogname }}</h1>
|
<h1>Archives for {{ BLOGNAME }}</h2>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
{% for date, articles in dates %}
|
{% for date, articles in dates %}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{% block title %}{{ blogtitle }}{%endblock%}</title>
|
<title>{% block title %}{{ BLOGNAME }}{%endblock%}</title>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="index" class="home">
|
<body id="index" class="home">
|
||||||
<header id="banner" class="body">
|
<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 -->
|
</header><!-- /#banner -->
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue