Improved the static assets definitions in the Website service (#18)

This PR contains the work done to overhaul the static asset definitions for the Website service.

To provide further details about the work:

* Website library
  * Overhauled the `StateFile` enumeration to reduce the number of cases to one case per logical file name, each exposing a `fileExtensions` list.
  * Wired everything into the pages with a consistent ordering convention: stylesheets load shared-first so the page sheet wins the CSS cascade; scripts load page-first with shared.js last. The error page also gained the shared stylesheet and its scripts; the index page gained its page CSS/JS and the new touch icon link.
  * Used the `StaticFile` enumeration as a single source of truth for every _href_/_src_ in the `IndexPage` and the `ErrorPage` pages, eliminating hardcoded asset paths.

* Website service
  * Added new assets to the Resources folder:
    * `apple-touch-icon.png`
    * `css/index.css`
    * `js/index.js`
    * `js/error.js`
    * `sitemap.xml`
  * Renamed existing assets within the Resources folder:
    * `css/style.css` → `css/shared.css`
    * `js/app.js` → `js/shared.js`
  * Fixed the working-directory location for the scheme in the Xcode project.

Reviewed-on: rock-n-code/loud-amsterdam#18
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit is contained in:
2026-07-19 02:08:59 +00:00
committed by javier
parent a045a23519
commit daf275b121
16 changed files with 279 additions and 172 deletions
@@ -19,7 +19,10 @@ struct ErrorPageTests {
#expect(html.contains(#"lang="en""#))
#expect(html.contains("Page Not Found"))
#expect(html.contains("Sorry, but the page you were trying to view does not exist."))
#expect(html.contains("/css/shared.css"))
#expect(html.contains("/css/error.css"))
#expect(html.contains("/js/error.js"))
#expect(html.contains("/js/shared.js"))
}
}
@@ -17,13 +17,15 @@ struct IndexPageTests {
#expect(html.contains("<!DOCTYPE html>"))
#expect(html.contains(#"lang="en""#))
#expect(html.contains("/css/style.css"))
#expect(html.contains("/css/shared.css"))
#expect(html.contains("/css/index.css"))
#expect(html.contains("/favicon.ico"))
#expect(html.contains("/icon.svg"))
#expect(html.contains("/icon.png"))
#expect(html.contains("/apple-touch-icon.png"))
#expect(html.contains("/site.webmanifest"))
#expect(html.contains("Hello world!"))
#expect(html.contains("/js/app.js"))
#expect(html.contains("/js/shared.js"))
#expect(html.contains("/js/index.js"))
}
}