Index: openacs-4/packages/bootstrap-icons/tcl/resource-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bootstrap-icons/tcl/Attic/resource-init.tcl,v diff -u -N -r1.1.2.8 -r1.1.2.9 --- openacs-4/packages/bootstrap-icons/tcl/resource-init.tcl 1 Dec 2023 08:57:17 -0000 1.1.2.8 +++ openacs-4/packages/bootstrap-icons/tcl/resource-init.tcl 1 Dec 2023 09:57:36 -0000 1.1.2.9 @@ -16,25 +16,26 @@ lappend ::security::csp::default_directives \ style-src [dict get $resource_info cdnHost] \ font-src [dict get $resource_info cdnHost] - - ns_log notice "ADDING CDN" - + } else { - set fn bootstrap-icons.css # - # Unfortunately, the structure of the distributed .zip file is - # version dependent: Versions greater or equal to 1.10.4 and less - # than 1.11.0 require a "font" in the path. Also 1.11.2 requires this. + # Unfortunately, the structure of the distributed .zip file is a + # moving target. Sometimes, a sub folder "fonts" is used, + # sometimes, minifiled versions are included. Check in the + # filesystem, what we have actually got. # - if {([apm_version_names_compare $::bootstrap_icons::version 1.10.4] >= 0 - && [apm_version_names_compare $::bootstrap_icons::version 1.11.0 ] < 0) - || [apm_version_names_compare $::bootstrap_icons::version 1.11.2 ] >= 0 - } { - # - # Adding "font" to the path. - # - set fn font/$fn - } + set fspath [dict get $resource_info resourceDir]/bootstrap-icons-$::bootstrap_icons::version + + # + # Do we have the subdirectory "font"? If yes, use it. + # + set subdir [expr {[file isdirectory $fspath/font] ? "font/" : ""}] + # + # Do we have a minified version? If yes, use it. + # + set fn [expr {[file exists $fspath/${subdir}bootstrap-icons.min.css] + ? "${subdir}bootstrap-icons.min.css" + : "${subdir}bootstrap-icons.css"}] } set URN urn:ad:css:bootstrap-icons