Skip to content

Conversation

@Ged2323
Copy link
Contributor

@Ged2323 Ged2323 commented Jul 26, 2020

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.

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.
@uetcis
Copy link

uetcis commented Oct 11, 2020

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.

@uhooi
Copy link

uhooi commented Mar 31, 2022

We can reference CSS from HTML by doing the following.
ref: uhooi/website-sample#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",
+           ]),
        // ...
    }
    // ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants