From 47a4c04d96215d7374ab8d4c639e8d905eb5862c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Sat, 31 May 2025 00:05:05 +0200 Subject: [PATCH] refactor: Standardize theme structure and update configs - Restructured 'minimal' theme to use 'static/css' and 'static/js' subdirectories for assets, aligning with qsgen3's expected theme structure. - Moved 'minimaltemplate-v1.css' to 'themes/minimal/static/css/'. - Moved JS files from 'themes/minimal/css/' to 'themes/minimal/static/js/'. - Updated 'site.conf.example' to reflect 'minimal' theme usage and correct 'site_theme_css_file' path relative to the theme's static directory. - Cleaned up redundant CSS variable definitions in 'bin/qsgen3' (_generate_index_page function). --- bin/qsgen3 | 8 +------- site.conf.example | 3 ++- themes/minimal/{ => static}/css/minimaltemplate-v1.css | 0 themes/minimal/{css => static/js}/jquery-3.5.1.js | 0 themes/minimal/{css => static/js}/webflow.js | 0 themes/minimal/{css => static/js}/webfont.js | 0 6 files changed, 3 insertions(+), 8 deletions(-) rename themes/minimal/{ => static}/css/minimaltemplate-v1.css (100%) rename themes/minimal/{css => static/js}/jquery-3.5.1.js (100%) rename themes/minimal/{css => static/js}/webflow.js (100%) rename themes/minimal/{css => static/js}/webfont.js (100%) diff --git a/bin/qsgen3 b/bin/qsgen3 index 837a790..73efa1c 100755 --- a/bin/qsgen3 +++ b/bin/qsgen3 @@ -519,12 +519,6 @@ _generate_index_page() { _log DEBUG "Successfully wrote comprehensive YAML to $temp_yaml_file" - # Theme CSS handling for index page - local source_theme_css_file="${QSG_CONFIG[paths_layouts_dir]}/css/${QSG_CONFIG[site_theme]}.css" - local target_theme_css_dir="${QSG_CONFIG[paths_output_dir]}/css" - local target_theme_css_file="$target_theme_css_dir/theme.css" - local pandoc_css_path_for_index="/css/theme.css" - _log DEBUG "In _generate_index_page: PROJECT_ROOT='$PROJECT_ROOT'" local pandoc_cmd_index=( pandoc @@ -550,7 +544,7 @@ _generate_index_page() { _log DEBUG "Pandoc command for index page will be constructed as follows:" _log DEBUG "Base command: pandoc" - _log DEBUG "CSS arg if theme applies: --css ${pandoc_css_path_for_index}" + _log DEBUG "CSS arg if theme applies: --css ${QSG_CONFIG[pandoc_css_path_arg]:-(not set or expected CSS file not found in output)}" _log DEBUG "Metadata file arg: --metadata-file ${temp_yaml_file}" _log DEBUG "Template arg: --template=${layout_index_file}" _log DEBUG "Output arg: --output=${output_index_file}" diff --git a/site.conf.example b/site.conf.example index 320afbc..b459529 100644 --- a/site.conf.example +++ b/site.conf.example @@ -5,7 +5,8 @@ site_name="My Example Site" site_tagline="An example site generated by qsgen3" site_url="http://localhost:8000" # Or your actual production URL -site_theme="default" # Specifies the theme to use (e.g., default, dark) +site_theme="minimal" # Specifies the theme to use (e.g., minimal, default) +site_theme_css_file="css/minimaltemplate-v1.css" # Path to main CSS file, relative to THEME'S static/ directory # --- Paths (relative to project root) --- paths_content_dir="content" diff --git a/themes/minimal/css/minimaltemplate-v1.css b/themes/minimal/static/css/minimaltemplate-v1.css similarity index 100% rename from themes/minimal/css/minimaltemplate-v1.css rename to themes/minimal/static/css/minimaltemplate-v1.css diff --git a/themes/minimal/css/jquery-3.5.1.js b/themes/minimal/static/js/jquery-3.5.1.js similarity index 100% rename from themes/minimal/css/jquery-3.5.1.js rename to themes/minimal/static/js/jquery-3.5.1.js diff --git a/themes/minimal/css/webflow.js b/themes/minimal/static/js/webflow.js similarity index 100% rename from themes/minimal/css/webflow.js rename to themes/minimal/static/js/webflow.js diff --git a/themes/minimal/css/webfont.js b/themes/minimal/static/js/webfont.js similarity index 100% rename from themes/minimal/css/webfont.js rename to themes/minimal/static/js/webfont.js