From ec6feec81ebab89dc6779027649b1ce517042d22 Mon Sep 17 00:00:00 2001 From: mjfernez Date: Mon, 1 Nov 2021 23:56:07 -0400 Subject: 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 --- rss_generator.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'rss_generator.py') 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/" -- cgit v1.2.3