diff options
| author | alex <alex@pdp7.net> | 2021-03-13 17:36:09 +0100 |
|---|---|---|
| committer | alex <alex@pdp7.net> | 2021-03-13 17:36:09 +0100 |
| commit | 5c74711c33d9c75a31e01c161e645797ee669a15 (patch) | |
| tree | 0bf9ae30f1cd25c45db247e4ac7c4c5482c2227f | |
| parent | e352b66af593fd9d76677015ac5aeb6121f70f7b (diff) | |
Adapt better to subscription spec
| -rwxr-xr-x | build.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -16,7 +16,7 @@ class Post: @property def posted(self): - return datetime.datetime.strptime(self.content.splitlines()[1], "%Y-%m-%d") + return datetime.datetime.strptime(self.content.splitlines()[1], "%Y-%m-%d").date() @property def uri(self): @@ -49,18 +49,18 @@ def create_index(posts): index.write(textwrap.dedent(""" # El blog es mío - Hay otros como él, pero este es el mío - """)) + ## Hay otros como él, pero este es el mío + """).lstrip()) for post in posts[0:10]: index.write(textwrap.dedent(f""" - => {post.uri} {post.title} + => {post.uri} {post.posted} {post.title} """)) post_lines = post.content.splitlines() - index.write("\n".join(post_lines[1:])) + index.write("\n".join(post_lines[2:])) index.write("\n\n") index.write(textwrap.dedent(""" @@ -79,7 +79,7 @@ def create_index(posts): for post in posts[10:]: index.write(textwrap.dedent(f""" - => {post.uri} {post.title} + => {post.uri} {post.posted} {post.title} """)[:-1]) def create_individual_posts(posts): |
