I would like to add a domain name for the location of the stylesheets and js of our website. In other words from this:

<link rel="stylesheet" href="/sites/default/files/css/css__wBfhyL83sORKzo__AgHv4HOGuOoSbIzIaa4clq9PXs.css?pclkf4" media="all" />

to this:

<link rel="stylesheet" href="//domain.name/sites/default/files/css/css__wBfhyL83sORKzo__AgHv4HOGuOoSbIzIaa4clq9PXs.css?pclkf4" media="all" />

I can see the following in html.html.twig:

 * Variables:
 * - $css: An array of CSS files for the current page.
...
  <css-placeholder token="{{ placeholder_token|raw }}">
  <js-placeholder token="{{ placeholder_token|raw }}">

I can also see the following in templete_preprocess_html: $variables["#attached"]["html_response_attachment_placeholders"]

Unfortunately, I do not know how to proceed from here. I'm using a bootstrap scss sub-theme and custom modules. I feel the implementation will be straight-forward. Please give me a push. Thanks!

Comments

Greg Sims created an issue. See original summary.

Greg Sims’s picture

Issue summary: View changes
markhalliwell’s picture

Status: Active » Closed (won't fix)

This isn't an issue related to this project specifically. The CSS/JS placeholders are generated dynamically and lazy loaded. Furthermore, they're run through an aggregation API that can alter and modify said list countless times.

There's not really any great documentation (that I know) of how this all works, but I'd recommend taking a look at https://www.drupal.org/project/advagg and seeing how/what they do. That might point you in the right direction.