diff options
author | mjfernez <mjf@mjfer.net> | 2021-11-01 23:56:07 -0400 |
---|---|---|
committer | mjfernez <mjf@mjfer.net> | 2021-11-01 23:56:07 -0400 |
commit | ec6feec81ebab89dc6779027649b1ce517042d22 (patch) | |
tree | 629e14f3a77032ea955533c553137812768c39fa /rss_generator.py | |
parent | 7c16beb6538ccf024b552d475a26b9345bf550ec (diff) | |
download | ezcms-ec6feec81ebab89dc6779027649b1ce517042d22.tar.gz |
Optimize mobile CSS. Add last update time default
This commit optimizes the mobile and web css to be responsive on zoom
(in supported browsers) and responsive on mobile screens. This is a
minimal optimization and lot can be done to improve it, particularly
for wider screen devices like tablets
This also adds the last update time to all views (except home).
Function logic was moved to view functions to support this and
rss_generator was changed to depend on it
Diffstat (limited to 'rss_generator.py')
-rw-r--r-- | rss_generator.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/rss_generator.py b/rss_generator.py index f248003..eb4ca82 100644 --- a/rss_generator.py +++ b/rss_generator.py @@ -1,7 +1,7 @@ import os from time import strftime, strptime, ctime from siteconfig import siteconfig -from view_functions import is_hidden_path +from view_functions import is_hidden_path, file_last_modified class RSS_Item: @@ -32,7 +32,7 @@ class RSS_Item: self.TITLE = path.rsplit('.', 1)[0].split('/')[-1] self.FILE_TYPE = path.rsplit('.', 1)[1] self.DESCRIPTION = self.parse_file() - self.LAST_UPDATE = self.file_last_modified() + self.LAST_UPDATE = self.last_updated() self.URI = self.get_uri() self.LINK = siteconfig.rss_channel_config['LINK'] + self.URI @@ -42,7 +42,7 @@ class RSS_Item: ) def short_timestamp(self): - return strftime("%Y-%m-%d %H:%M %z", strptime(self.LAST_UPDATE)) + return strftime("%Y-%m-%d %H:%M", strptime(self.LAST_UPDATE)) def parse_file(self): """ @@ -75,8 +75,8 @@ class RSS_Item: return ''.join(description) - def file_last_modified(self): - return ctime(os.stat(self.FULL_PATH).st_ctime) + def last_updated(self): + return file_last_modified(self.FULL_PATH) def get_uri(self): # return everything after "./templates/" |