-@if(setting('app-custom-head') && \Route::currentRouteName() !== 'settings')
-<!-- Custom user content -->
-{!! \BookStack\Util\HtmlNonceApplicator::apply(setting('app-custom-head'), $cspNonce) !!}
-<!-- End custom user content -->
+@inject('headContent', 'BookStack\Theming\CustomHtmlHeadContentProvider')
+
+@if(setting('app-custom-head') && !request()->routeIs('settings.category'))
+<!-- Start: custom user content -->
+{!! $headContent->forWeb() !!}
+<!-- End: custom user content -->
@endif
\ No newline at end of file