Improvements to Icons for the Website service (#21)
Reviewed-on: rock-n-code/loud-amsterdam#21 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:
@@ -10,8 +10,12 @@ enum StaticFile: CaseIterable, Sendable {
|
||||
case error
|
||||
/// The `favicon.ico` icon.
|
||||
case favicon
|
||||
/// The `icon.png` and `icon.svg` icons.
|
||||
/// The `icon.svg` icon.
|
||||
case icon
|
||||
/// The `icon-192.png` icon for the web manifest.
|
||||
case icon192
|
||||
/// The `icon-512.png` icon for the web manifest.
|
||||
case icon512
|
||||
/// The `css/index.css` stylesheet and `js/index.js` script for the landing page.
|
||||
case index
|
||||
/// The `robots.txt` crawler directives.
|
||||
@@ -57,12 +61,14 @@ extension StaticFile {
|
||||
/// The file extensions the file is available with.
|
||||
var fileExtensions: [Extension] {
|
||||
switch self {
|
||||
case .appleTouchIcon: [.png]
|
||||
case .appleTouchIcon,
|
||||
.icon192,
|
||||
.icon512: [.png]
|
||||
case .error,
|
||||
.index,
|
||||
.shared: [.css, .js]
|
||||
case .favicon: [.ico]
|
||||
case .icon: [.png, .svg]
|
||||
case .icon: [.svg]
|
||||
case .robots: [.txt]
|
||||
case .site: [.webmanifest]
|
||||
case .sitemap: [.xml]
|
||||
@@ -76,6 +82,8 @@ extension StaticFile {
|
||||
case .error: "error"
|
||||
case .favicon: "favicon"
|
||||
case .icon: "icon"
|
||||
case .icon192: "icon-192"
|
||||
case .icon512: "icon-512"
|
||||
case .index: "index"
|
||||
case .robots: "robots"
|
||||
case .shared: "shared"
|
||||
|
||||
@@ -74,6 +74,14 @@ struct IndexPage: HTMLDocument, Sendable {
|
||||
.rel("manifest"),
|
||||
.href(StaticFile.site.urlPath(for: .webmanifest))
|
||||
)
|
||||
meta(
|
||||
.name("theme-color"),
|
||||
.content("#0c0710"),
|
||||
.custom(
|
||||
name: "media",
|
||||
value: "(prefers-color-scheme: dark)"
|
||||
)
|
||||
)
|
||||
meta(
|
||||
.name("theme-color"),
|
||||
.content("#fafafa")
|
||||
|
||||
Reference in New Issue
Block a user