From 3a3edd6122d3a0ba5e92a270fb3f887b1fd180ce Mon Sep 17 00:00:00 2001 From: nomike Date: Sun, 11 May 2025 04:03:52 +0200 Subject: [PATCH 1/2] Fix detection and rendering of plain 'index' files Squashed commit of the following: commit 012eb17877a3d11df036ff15ec5bc182e47fb3fd Author: nomike Date: Sun May 11 03:57:35 2025 +0200 Add: Detect files named "index.html" as index files too commit 32f3cd0679688d1f90043057a25a489832964d60 Author: nomike Date: Sun May 11 03:54:16 2025 +0200 Fx: Re-add support for plain index files --- templatehelper.py | 4 ++-- templates/nomike.com/directory.html | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/templatehelper.py b/templatehelper.py index 49860b3..5a94e51 100644 --- a/templatehelper.py +++ b/templatehelper.py @@ -82,7 +82,7 @@ def listdir(path): If a file named "index" is present, it is supposed to be rendered as the main content of the page and thus it will be ommited from the list as well. """ - ignorelist = ['index', 'index.md', 'index.org', '*.scmsfasicon', '*.scmstarget'] + ignorelist = ['index', 'index.html', 'index.md', 'index.org', '*.scmsfasicon', '*.scmstarget'] if os.path.exists(os.path.join(pathprefix, path, '.scmsignore')): with open( os.path.join(pathprefix, path, '.scmsignore'), @@ -115,7 +115,7 @@ def listchildren(path): If a file named "index" is present, it is supposed to be rendered as the main content of the page and thus it will be ommited from the list as well. """ - ignorelist = ['index', 'index.md', 'index.org', '*.scmsfasicon', '*.scmstarget'] + ignorelist = ['index', 'index.html', 'index.md', 'index.org', '*.scmsfasicon', '*.scmstarget'] if os.path.exists(os.path.join(pathprefix, path, '.scmsignore')): with open( os.path.join(pathprefix, path, '.scmsignore'), diff --git a/templates/nomike.com/directory.html b/templates/nomike.com/directory.html index fc513e5..c9c26a4 100644 --- a/templates/nomike.com/directory.html +++ b/templates/nomike.com/directory.html @@ -14,6 +14,8 @@ {% endif -%} {% endblock -%} {% block content -%} {% if templatehelper.os.path.isfile(templatehelper.os.path.join(pathprefix, path,'index.org')) -%} {{ templatehelper.orgpython.to_html(templatehelper.readfile(templatehelper.os.path.join(pathprefix,path,'index.org'))) | safe }} {% elif templatehelper.os.path.isfile(templatehelper.os.path.join(pathprefix, path,'index.md')) -%} {{ templatehelper.markdown.markdown(templatehelper.readfile(templatehelper.os.path.join(pathprefix,path,'index.md')),extensions=['fenced_code','toc','tables']) - | safe }} {% else -%} + | safe }} {% elif templatehelper.os.path.isfile(templatehelper.os.path.join(pathprefix, path, 'index.html')) -%} {{ templatehelper.readfile(templatehelper.os.path.join(pathprefix, path, 'index.html')) + | safe -}} {% elif templatehelper.os.path.isfile(templatehelper.os.path.join(pathprefix, path, 'index')) -%} {{ templatehelper.readfile(templatehelper.os.path.join(pathprefix, path, 'index')) + | safe -}} {% else -%}

/{{ path }}

{% endif -%} {% if templatehelper.os.path.isdir(templatehelper.os.path.join(pathprefix, path, 'image')) %} {% include templatehelper.os.path.join(templatehelper.config['template'], 'gallery.html') %} {% endif %} {% endblock %} From 994e4054d8da7e4132627c7c88d7d418a58f919b Mon Sep 17 00:00:00 2001 From: nomike Date: Sun, 11 May 2025 04:06:41 +0200 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a33b4b..9f3ffc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.1.1](https://github.com/nomike/scms/releases/tag/1.1.1) - 2025-05-11 + +[Compare with v1.1.0](https://github.com/nomike/scms/compare/v1.1.0...1.1.1) + +### Fixed + +- Fix detection and rendering of plain 'index' files ([3a3edd6](https://github.com/nomike/scms/commit/3a3edd6122d3a0ba5e92a270fb3f887b1fd180ce) by nomike). + ## [1.1.0](https://github.com/nomike/scms/releases/tag/1.1.0) - 2025-05-11 [Compare with 1.0.0](https://github.com/nomike/scms/compare/1.0.0...1.1.0)