From 180a3505b4f588a7b6d7361074cb936a4f3a6c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Thu, 10 Aug 2023 17:02:36 +0200 Subject: [PATCH] ref: figured out how to properly register a theme --- ckanext/dcor_theme/css/make_dcor_main_css.py | 2 +- ckanext/dcor_theme/plugin.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ckanext/dcor_theme/css/make_dcor_main_css.py b/ckanext/dcor_theme/css/make_dcor_main_css.py index 9115f2c..9c05a38 100644 --- a/ckanext/dcor_theme/css/make_dcor_main_css.py +++ b/ckanext/dcor_theme/css/make_dcor_main_css.py @@ -44,7 +44,7 @@ def main(): dcor_css_path.write_text(main_css_data) - print("Make sure to set 'ckan.theme=dcor_theme_main' " + print("Make sure to set 'ckan.theme=dcor_theme_main/dcor_theme_main' " + "in the CKAN ini config!") diff --git a/ckanext/dcor_theme/plugin.py b/ckanext/dcor_theme/plugin.py index 3e266a5..e32a0aa 100644 --- a/ckanext/dcor_theme/plugin.py +++ b/ckanext/dcor_theme/plugin.py @@ -37,3 +37,6 @@ def update_config(self, config_): toolkit.add_public_directory(config_, 'public') toolkit.add_resource('assets', 'dcor_theme') toolkit.add_resource('assets_theme', 'dcor_theme_main') + # Add the custom theme directory to the public directories, + # so CKAN can find the css file. + toolkit.add_public_directory(config_, "assets_theme")