aboutsummaryrefslogtreecommitdiffstats
path: root/views.py
Commit message (Collapse)AuthorAgeFilesLines
* Add caching fix from mjfer.net branchmjfernez2022-02-201-4/+3
|
* Fix 500 internal error (merge from mjfer.net)mjfernez2022-02-031-8/+11
|
* Remove site as the parent directory, manual mergemjfernez2021-12-221-7/+6
| | | | merges needed changes (and CSS) from mjfer.net branch
* Optimize mobile CSS. Add last update time defaultmjfernez2021-11-011-1/+2
| | | | | | | | | | | 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
* Adds RSS auto-generation for files in 'site'mjfernez2021-10-141-4/+19
| | | | | | | | | | | This commit adds rss_generator.py which contains the main logic for indexing the site directory and generating a feed on startup. It serves as a sort of ad-hoc database which is accessed when /feed.xml is requested. Also corrects various typos, README nonsense, and expands the config options for RSS. Instances of './templates/site' have been replaced with the general BASE_DIR variable in the siteconfig.
* Caching support. Separate views.py in 2 filesmjfernez2021-10-101-73/+21
| | | | | | | | | | | This commit adds the Flask-Caching module to the software stack and enables the caching of views in a wide variety of ways, but implemented here to be simple to understand to someone new to the concept of caching (aka me). Various documentation and formatting was applied to all files. views.py internal functions (mostly related to filesystem operations of the server). have been moved into view_functions.py
* Clarify siteconfigmjfernez2021-08-251-28/+24
| | | | | | | | | This clarifies what the MAIN_SITE_DIRS option means since one might read it to mean you can put your directories anywhere. Not so, you can only pick which dirs are displayed with that option. Also recommends to not use the secret key unless needed (for what reason, I don't know).
* .description is now rendered as htmlmjfernez2021-06-171-4/+4
| | | | | | | | .description was previously read as a text file, but this is cumbersome and limits the user. This allows the user to embed html in their .description files by adding the "cur_path" variable to context. 'index.html' has been updated to render the template located in cur_path if a description file exists
* Changed / to /site, added views.py, README amendedmjfernez2021-06-161-0/+180
Previously this program served files in the 'templates/site' dir on '/', but this caused problems when accessing raw files using '/raw/' which is useful for embedding or quickly downloading content. It's also an inconvenience to the user, since they have to add a word rather than double-clicking an replacing it. The main server file and the base and index templates have been changed to reflect this. The codebase has been reorganized to separate views from the main flask app. Blueprints were avoided since only one blueprint would be needed so thus unnecessary. README and docstrings were also expanded for clarity and edited for errors. Some comments