diff options
-rw-r--r-- | mimetypes.csv | 2 | ||||
-rw-r--r-- | siteconfig.py | 4 | ||||
-rw-r--r-- | static/main.css | 11 | ||||
-rw-r--r-- | templates/base.html | 9 | ||||
-rw-r--r-- | templates/index.html | 2 | ||||
-rw-r--r-- | views.py | 13 |
6 files changed, 22 insertions, 19 deletions
diff --git a/mimetypes.csv b/mimetypes.csv index 7e867ea..4defb37 100644 --- a/mimetypes.csv +++ b/mimetypes.csv @@ -90,4 +90,4 @@ .R,text/plain .yml,text/plain .yaml,text/plain -.md,text/markdown +.md,text/plain diff --git a/siteconfig.py b/siteconfig.py index 8717a82..aa03597 100644 --- a/siteconfig.py +++ b/siteconfig.py @@ -25,7 +25,7 @@ class siteconfig(config): MAIN_SITE_DIRS = sorted( config.DEFAULT_SITE_DIRS ) # ["dir1", "dir2", "dir3"] - + MAIN_SITE_DIRS.remove("files") # Set a custom secret key. If not set, it will be generated # Most of the time, you don't need to set this! SECRET_KEY = config.GENERATED_SECRET_KEY # replace with random number. @@ -66,7 +66,7 @@ class siteconfig(config): # RSS Settings rss_channel_config = { 'TITLE': "mjfer.net RSS Feed", - 'LINK': "https://mjfer.net/", + 'LINK': "https://mjfer.net/feed.xml", 'DESCRIPTION': "feed organized by the latest updated files", 'LANGUAGE': "en-us", 'PUBDATE': "", diff --git a/static/main.css b/static/main.css index eeaeffc..08ca707 100644 --- a/static/main.css +++ b/static/main.css @@ -1,13 +1,16 @@ -h1,h2 { +h1 { text-align: center; margin: 1% auto; white-space: normal; } -h3,h4 { - text-align: justify; +h2,h3,h4 { + text-align: left; margin: 1% auto; white-space: normal; } +h2.center { + text-align: center; +} h3.center { text-align: center; } @@ -17,7 +20,7 @@ h1 { } h2 { font-size: 175%; - color: #404040; + color: #202020; } h3 { font-size: 150%; diff --git a/templates/base.html b/templates/base.html index 2515795..ec0a41a 100644 --- a/templates/base.html +++ b/templates/base.html @@ -9,7 +9,8 @@ hacking, forensics, tor, anonymity, internet, society, luddite, futurism, lulz, fun, poetry, games, vidya, thoughts, random, homepage, email server, web server, sound, fury, shakespeare, - nothing, writing, audio, classical music, video game music"/> + nothing, writing, audio, classical music, video game music, + mjfernez, mjfernet, mike, fernez, mikefernez, michael"/> <meta name="author" content="mjfernez"> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> {% block css%} @@ -23,19 +24,19 @@ <div class="navbar"> <b>|</b> <!-- This makes the bar symmetrical --> {% for dir in navbar %} - <b> <a href="/site/{{ dir }}">{{ dir }}/</a> |</b> + <b> <a href="/{{ dir }}">{{ dir }}/</a> |</b> {% endfor %} <!-- Add icons here --> <a href="/feed.xml" target="_blank" rel="noopener noreferrer"> <img class="icon" src="/static/rss.svg"></a> <a href="mailto:mjf@mjfer.net"><img class="icon" src="/static/email.svg"></a> </div> - <h2>{{ title }}</h2> + <h2 class="center">{{ title }}</h2> <div class="content"> {% block content %} {% endblock %} <h3 class="center">{{ errors }}</h3> - {% if parent_dir != '/site/' %} + {% if parent_dir %} <h3 class="center"><a href="{{ parent_dir }}">Go up to parent folder ({{ parent_dir }})</a></h3> {% endif %} </div> diff --git a/templates/index.html b/templates/index.html index c8356fe..b612c63 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2,7 +2,7 @@ {% block content %} <center> {% if description %} -{% include cur_path + '/.description' %} +{% include '/site/' + cur_path + '/.description' %} {% endif %} {% if dirs %} @@ -18,9 +18,8 @@ CONTENT_BLOCK = ( @app.route("/") -@app.route("/site") -@app.route("/site/home.html") -@app.route("/site/index.html") +@app.route("/home.html") +@app.route("/index.html") @cache.cached() def home(): """ @@ -31,13 +30,13 @@ def home(): """ context = default_context() context.update( - {'title': app.config['HOME_TITLE'], 'parent_dir': '/site/'} + {'title': app.config['HOME_TITLE'], 'parent_dir': None} ) return render_template("site/home.html", **context) # from: https://pythonise.com/series/learning-flask/sending-files-with-flask -@app.route("/site/<path:path>") +@app.route("/<path:path>") @cache.cached() def render_file(path): """ @@ -55,7 +54,7 @@ def render_file(path): context.update( { 'title': path.split('.')[0].upper(), - 'parent_dir': '/site/' + '/'.join(path.split('/')[:-1]), + 'parent_dir': '/' + '/'.join(path.split('/')[:-1]), 'last_update': file_last_modified(abs_path), } ) @@ -82,7 +81,7 @@ def render_file(path): dirs, files, links, description = index_dir(abs_path) context.update( { - 'cur_path': 'site/' + path, + 'cur_path': path, 'cur_dir': path.split('/')[-1] + '/', 'dirs': dirs, 'files': files, |