Skip to content

Update README.md #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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