Problem
The deploy job in deploy.yml has been disabled (if: false) for a while. While adding some custom css and js to system--head.html to conditionally hide the side menu on the DocuServe page, I discovered that the once combined CustomJS/CSS field was now two separate fields in the CMS. If deploy were re-enabled, the head/system branch of deploy.py would fail immediately:
elif target == "head":
variant = item.name.split(".")[0].split("-")[-1]
if variant == "system":
page.goto("/libguides/lookfeel.php?action=1")
page.fill("#jscss_code", html)
page.click("#s-lg-btn-save-jscss")
This targets a single field, #jscss_code. That field does not exist on the current LibGuides admin "Custom JS/CSS" page anymore. The live page now has three separate fields instead: css_code, js_code_header, and js_code_footer. This is presumably left over from before the Bootstrap 5 migration, when LibGuides (or our template) used a single combined field.
Solution
I am splitting the single head--system.html source file into head--system-css.html and head--system-js.html so the repo content matches how the CMS is actually structured, and so manual copy/paste into the CMS (while deploy is disabled) is less error-prone.
compile.py does not need changes for this split. It is written so that it will produce two independent artifacts without adjusting it's workflow.
What still needs to change in deploy.py
The Playwrite script will need to be adjusted to the new css classes so that head--system-css.html goes to the css_code field and the head--system-js.html will go to the js_code_header field.
Problem
The
deployjob indeploy.ymlhas been disabled (if: false) for a while. While adding some custom css and js tosystem--head.htmlto conditionally hide the side menu on the DocuServe page, I discovered that the once combined CustomJS/CSS field was now two separate fields in the CMS. If deploy were re-enabled, thehead/systembranch ofdeploy.pywould fail immediately:This targets a single field,
#jscss_code. That field does not exist on the current LibGuides admin "Custom JS/CSS" page anymore. The live page now has three separate fields instead:css_code,js_code_header, andjs_code_footer. This is presumably left over from before the Bootstrap 5 migration, when LibGuides (or our template) used a single combined field.Solution
I am splitting the single
head--system.htmlsource file intohead--system-css.htmlandhead--system-js.htmlso the repo content matches how the CMS is actually structured, and so manual copy/paste into the CMS (while deploy is disabled) is less error-prone.compile.pydoes not need changes for this split. It is written so that it will produce two independent artifacts without adjusting it's workflow.What still needs to change in deploy.py
The Playwrite script will need to be adjusted to the new css classes so that
head--system-css.htmlgoes to thecss_codefield and thehead--system-js.htmlwill go to thejs_code_headerfield.