Assets.html not overwriting the default theme's assets.html

Hey all,
I’m trying to add bootstrap-grid and masonry to the LoveIt theme
I’ve added the Bootstrap and Masonry assets to the assets/lib/ folder and declared them in the jsdelivr.yml file. I’ve also updated the config.toml to add bootstrap as a parameter that can be enabled. This part seems to be working fine when I edit the assets.html file in the /themes/LoveIt/_default /partials/ directory. However if I try adding an assets.html the root folder system to override the theme version it doesn’t seem to override it.

The directories I have tried putting the file in are the following:

  1. /layouts/_default/partials/
  2. /layouts/portfolio/partials/
  3. /layouts/_default/
  4. /layouts/
  5. /partials/

Below is the code I am trying to add and the variables which are already in the top of the file to help with context.

{{- $params := .Scratch.Get "params" -}}
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
{{- $config := (.Scratch.Get "this").config -}}


{{- /* The code I have added */ -}}
{{- /* bootstrapMasonryJS.js */ -}}
{{- if .Site.Params.bootstrapmasonry | and .Site.Params.bootstrapmasonry.enable -}}
{{- $source := $cdn.bootstrapMasonryCSS | default "lib/bootstrap/dist/css/bootstrap-grid.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.bootstrapMasonryJS | default "lib/masonry-layout/dist/masonry.pkgd.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "bootstrapMasonry" true | merge $config -}}
{{- end -}}

If you need any more information, please ask.

Many Thanks

See https://github.com/dillonzq/LoveIt/blob/master/layouts/partials/assets.html

The path to the assets.html file is:

themes/LoveIt/layouts/partials/assets.html

You can override the file with:

layouts/partials/assets.html

After moving the assets.html into the override directory that you’ve suggested it works.

Thank you very much for you help

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.