aboutsummaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'app.py')
-rw-r--r--app.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/app.py b/app.py
index 868af3c..9c558b8 100644
--- a/app.py
+++ b/app.py
@@ -13,12 +13,13 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+import glob
+import os
from flask import Flask
from flask import render_template
from flask import abort
from flask.wrappers import Response
from markupsafe import Markup
-import glob
import markdown
import configparser
app = Flask(__name__)
@@ -39,7 +40,9 @@ def index():
except KeyError:
return "<code>Missing configuration! Please configure the config.ini!</code>"
# Get a list of all articles.
- for file in glob.glob("articles/*.md"):
+ files = glob.glob("articles/*.md")
+ files.sort(key=os.path.getctime)
+ for file in files[::-1]:
try:
articles += "\n<li><a href=\"" + file.replace(".md", "") + "\">" + \
config[file.replace(".md", "").replace("articles/", "")]['Title'] + "</a>" \
@@ -106,7 +109,7 @@ def rss_feeds():
rss_feed += "<title>" + \
config[file.replace("articles/", "").replace(".md", "")]['Title'] + \
"</title>"
- rss_feed += "<description><![CDATA[" + markdown.markdown(article.read()) + "]]></description>"
+ rss_feed += "<description><![CDATA[" + escape(article.read()) + "]]></description>"
rss_feed += "</item>"
article.close()
rss_feed += "</channel>" + "</rss>"