ssg icon indicating copy to clipboard operation
ssg copied to clipboard

Broken links to css and js

Open andylarkum opened this issue 1 year ago • 1 comments

Followed all steps detailed in README.md

The generated static content references: build/assets/*

...for css and js files, but this folder does not exist.

css and js files do exist in: css/* js/*

...but have different names to those referenced in the html. Example: html ref: tailwind-891c0160.css filenames in css:

  • tailwind.css
  • tailwind.css.br
  • tailwind.css.gz

Any ideas?

andylarkum avatar Aug 08 '24 08:08 andylarkum

For now, to work around, I've done this (in case it helps others):

In layouts.antlers.html: Remove Antlers: {{ vite src=“resources/js/app.js|resources/css/app.css” }

Add HTML: <link rel="stylesheet" href="/css/tailwind.css"/> <script src="/js/site.js"></script> <script defer src="//unpkg.com/alpinejs" defer></script>

andylarkum avatar Aug 11 '24 15:08 andylarkum

You probably need to update the copy paths in your ssg.php config file:

    'copy' => [
        public_path('assets') => 'assets',
-       public_path('css') => 'css',
-       public_path('js') => 'js',
+       public_path('build') => 'build',
    ],

duncanmcclean avatar Oct 07 '25 14:10 duncanmcclean