SplashPublishPlugin
SplashPublishPlugin copied to clipboard
Update README.md
For some reason -> .installPlugin(.splash(withClassPrefix: "classPrefix")) was not working and colouring the code properly though if you use -> ,plugins: [ .splash(withClassPrefix: "") ] Splash colours work.
I tried the latter one while it still doesn't work. It seems that the CSS file is neither referenced in the head of html pages nor copied to the generated folder.
We can reference CSS from HTML by doing the following. ref: https://github.com/uhooi/website-sample/pull/3
extension Theme {
static var uhooi: Self {
Theme(
htmlFactory: UhooiHTMLFactory(),
resourcePaths: [
"Resources/UhooiTheme/styles.css",
+ "Resources/SplashPublishPlugin/sundellsColors.css",
]
)
}
}
private struct UhooiHTMLFactory<Site: Website>: HTMLFactory {
// ...
func makeItemHTML(for item: Item<Site>,
context: PublishingContext<Site>) throws -> HTML {
HTML(
.lang(context.site.language),
- .head(for: item, on: context.site),
+ .head(for: item, on: context.site, stylesheetPaths: [
+ "/styles.css",
+ "/sundellsColors.css",
+ ]),
// ...
}
// ...
}