From e96ea7f073c9843f7aa6b842ee373aafb698ebeb Mon Sep 17 00:00:00 2001
From: Stefan Ritter
Date: Tue, 3 Mar 2009 17:56:22 +0100
Subject: [PATCH 1/3] Comments:
* Check if entries/title.comments exists and switch from 'no comments' to
'comments (count)
* Changed font of commentlink to Helvetica 10
---
blogthon.cgi | 13 +++++++++----
styles/blogthon.css | 4 ++--
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/blogthon.cgi b/blogthon.cgi
index dc34572..1962d77 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -140,10 +140,15 @@ else: # Show regular entry
for line in content:
print ' ' + line.strip() + '
'
if comments == "True":
- print '
'
-
+ if not glob.glob(entries_dir + title + '.comments'):
+ print '
'
+ else:
+ print '
'
+
print '
'
print '
'
content.close()
diff --git a/styles/blogthon.css b/styles/blogthon.css
index 3808f1a..280536a 100644
--- a/styles/blogthon.css
+++ b/styles/blogthon.css
@@ -73,8 +73,8 @@ a.entrytitle:link, a.entrytitle:hover, a.entrytitle:visited, a.entrytitle:active
}
a.comment:link, a.comment:hover, a.comment:active, a.comment:visited {
- font-family: Arial;
- font-size: 8px;
+ font-family: Helvetica;
+ font-size: 10px;
}
# vim: set tw=0 ts=4:
From 728ee7d2772f457d726a6b4d1dcfde9242187de4 Mon Sep 17 00:00:00 2001
From: Stefan Ritter
Date: Tue, 3 Mar 2009 18:43:37 +0100
Subject: [PATCH 2/3] Comments:
* Commentcounter added for commentlinks:
-. at the start of a line means "here is the header"
(better for splitting)
. at the start of a line means "i am a text"
---
blogthon.cgi | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/blogthon.cgi b/blogthon.cgi
index 1962d77..bc02a02 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -140,14 +140,21 @@ else: # Show regular entry
for line in content:
print ' ' + line.strip() + '
'
if comments == "True":
- if not glob.glob(entries_dir + title + '.comments'):
+ comments_file = glob.glob(entries_dir + title + '.comments')
+ print str(comments_file)
+ if not comments_file:
print '
'
else:
+ comments_content = open(comments_file[0], "r")
+ comments_counter = 0
+ for line in comments_content:
+ if line.split(".", 1)[0] == "-": comments_counter += 1
print '
'
+ comments_content.close()
print ' '
print '
'
From e862ea3c45dfdaf59ace5272d1ae6e7b4bbc64ca Mon Sep 17 00:00:00 2001
From: Stefan Ritter
Date: Tue, 3 Mar 2009 18:47:33 +0100
Subject: [PATCH 3/3] Comments:
Added a Demo.comments
---
entries/Demo.comments | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 entries/Demo.comments
diff --git a/entries/Demo.comments b/entries/Demo.comments
new file mode 100644
index 0000000..b6d9d98
--- /dev/null
+++ b/entries/Demo.comments
@@ -0,0 +1,8 @@
+-. xeno Sun Mar 1 12:00:00 2009
+.Hi,
+.
+.I hope you like my software. To delete this entry, just delete the file
+.entries/Demo.comments.
+.
+.Best regards,
+.xeno
- comments
' - print '