Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixing initial project files

  • Loading branch information...
commit 76ff81c58c1f9ec64050c9157c7520aff3e82c8b 1 parent bfe7478
@aconbere authored
View
14 DOCUMENT_README.mkd
@@ -1,6 +1,14 @@
Documents are defined with a simple scheme (fake BNF)
-header ::= <yaml> "\n\n" | <string> "\n\n"
-content ::= <string>
+ header ::= <yaml> "\n\n" | <string> "\n\n"
+ content ::= <string>
-document ::= <header> <content>
+ document ::= <header> <content>
+
+Headers can contain any data, but keys that are looked for in particular are
+
+* title
+* date
+* author
+* email
+* slug
View
10 igor.egg-info/PKG-INFO
@@ -0,0 +1,10 @@
+Metadata-Version: 1.0
+Name: igor
+Version: 1.0
+Summary: UNKNOWN
+Home-page: UNKNOWN
+Author: Anders Conbere
+Author-email: aconbere@conbere.org
+License: bsd
+Description: UNKNOWN
+Platform: UNKNOWN
View
33 igor.egg-info/SOURCES.txt
@@ -0,0 +1,33 @@
+MANIFEST.in
+igor/__init__.py
+igor/config.py
+igor/documents.py
+igor/markup.py
+igor/publisher.py
+igor/rfc3339.py
+igor/template_tools.py
+igor/tools.py
+igor/utils.py
+igor.egg-info/PKG-INFO
+igor.egg-info/SOURCES.txt
+igor.egg-info/dependency_links.txt
+igor.egg-info/top_level.txt
+igor/vcs/__init__.py
+igor/vcs/vcs.py
+igor/vcs/git/__init__.py
+igor/vcs/git/log.py
+igor/vcs/git/ls_tree.py
+igor/vcs/git/refs.py
+igor_extras/__init__.py
+scripts/igor
+scripts/igor-post-update
+test/test_config.py
+test/test_documents.py
+test/test_git.py
+test/test_git_log.py
+test/test_git_ls_tree.py
+test/test_markup.py
+test/test_publisher.py
+test/test_tools.py
+test/test_utils.py
+test/test_vcs.py
View
1  igor.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
View
2  igor.egg-info/top_level.txt
@@ -0,0 +1,2 @@
+igor_extras
+igor
View
22 igor/documents.py
@@ -66,10 +66,10 @@ def parse_headers(self, header):
headers = {"title": headers}
return headers
- published_date = headers.get("published_date")
+ date = headers.get("date")
- if published_date:
- headers['published_date'] = self.parse_time(published_date)
+ if date:
+ headers['date'] = self.parse_time(date)
return headers
@@ -140,9 +140,9 @@ def summary(self, length):
else:
return self._summary_cached
- def published_date(self):
- header_published_date = self.headers.get('published_date')
- return header_published_date or self.extra_data.get('published_date') or \
+ def date(self):
+ header_date = self.headers.get('date')
+ return header_date or self.extra_data.get('date') or \
datetime.now()
def author(self):
@@ -154,11 +154,11 @@ def author_email(self):
return header_email or self.extra_data.get('author_email') or ""
def publish_directory(self, date_format = "%Y/%m/%d"):
- return path.join(self.published_date().strftime(date_format),
+ return path.join(self.date().strftime(date_format),
self.slug)
def __cmp__(self, p2):
- return cmp(p2.published_date(), self.published_date())
+ return cmp(p2.date(), self.date())
class Collection(Document):
def __init__(self, posts):
@@ -194,9 +194,9 @@ def organize_by_date(self, posts):
org = {}
for post in posts:
- year = post.published_date().year
- month = post.published_date().month
- day = post.published_date().day
+ year = post.date().year
+ month = post.date().month
+ day = post.date().day
if org.has_key(year):
if org[year].has_key(month):
View
2  igor_extras/initial_project/_templates/archive.html
@@ -17,7 +17,7 @@
<li><ol>
{% for post in posts %}
<li>
- <span>{{ post.published_date() }}</span>
+ <span>{{ post.date() }}</span>
<a href="{{ link_to(post.slug) }}">{{ post.title }}</a>
</li>
{% endfor %}
View
4 igor_extras/initial_project/_templates/main.atom
@@ -18,8 +18,8 @@
<title><![CDATA[{{ post.title }}]]></title>
<link rel="alternate" href="{{ link_to(post.slug) }}"/>
<id>{{ tag_uri(post) }}</id>
- <updated>{{ post.published_date()|rfc_date }}</updated>
- <published>{{ post.published_date()|rfc_date }}</published>
+ <updated>{{ post.date()|rfc_date }}</updated>
+ <published>{{ post.date()|rfc_date }}</published>
<summary type="html"><![CDATA[{{ post.summary(summary_length) }}]]></summary>
<content type="html"><![CDATA[{{ post.body }}]]></content>
</entry>
View
2  igor_extras/initial_project/_templates/main.html
@@ -11,7 +11,7 @@
{% for post in posts %}
<div id="post">
<h2><a href="{{ link_to(post.slug) }}">{{ post.title }}</a></h2>
- <p>{{ post.published_date() }}</p>
+ <p>{{ post.date() }}</p>
{{ post.content }}
</div>
{% endfor %}
View
2  igor_extras/initial_project/_templates/post.html
@@ -9,7 +9,7 @@
<body>
<div id="content">
<h1>{{ doc.title }}</h1>
- <p>{{ doc.published_date() }}</p>
+ <p>{{ doc.date() }}</p>
{{ doc.body }}
</div>
</body>
View
2  test/test_documents.py
@@ -45,7 +45,7 @@ def test_post(file):
assert(p.ext)
assert(p.markup())
assert(p.summary(1))
- assert(p.published_date())
+ assert(p.date())
assert(p.author() == "")
assert(p.author_email() == "")
View
2  test/test_git.py
@@ -9,6 +9,6 @@ def test_git(project):
file = path.join(project, "_posts/welcome.txt")
g = Git(project, file)
assert(g.author_email())
- assert(g.published_date())
+ assert(g.date())
assert(g.author())
assert(g.data())
Please sign in to comment.
Something went wrong with that request. Please try again.