Skip to content
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

Provide ability to specify a custom favicon for the HTML output #2517

Open
mahozad opened this issue May 31, 2022 · 2 comments
Open

Provide ability to specify a custom favicon for the HTML output #2517

mahozad opened this issue May 31, 2022 · 2 comments
Labels
enhancement An issue for a feature or an overall improvement format: html An issue/PR related to Dokka's default HTML output format

Comments

@mahozad
Copy link
Contributor

mahozad commented May 31, 2022

Created this issue because it was suggested in #2513.

A custom favicon (which may be different from the header logo) cannot be provided for the output HTML format.

A workaround is to name the favicon logo-icon.svg and specify it as a custom asset in the configurations:

tasks.dokkaHtml.configure {
    dokkaSourceSets {
        pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
            customAssets = listOf(
                file("docs/logo-icon.svg"),
                // ...
            )
        }
    }
}

Some problems with this is that I may want to name my favicon something other than logo-icon.svg and may want to use a format other than SVG (for example, PNG).

Are you willing to provide a PR?
Maybe (depends on if the maintainers want it and if I can).

@mahozad mahozad added the enhancement An issue for a feature or an overall improvement label May 31, 2022
@IgnatBeresnev IgnatBeresnev added the format: html An issue/PR related to Dokka's default HTML output format label Mar 8, 2023
@solrudev
Copy link

Use case: prefers-color-scheme CSS media query for monochrome white/black logo. If browser highlights a tab with white background (prefers-color-scheme: light), favicon should turn black, but header logo should be white.

@solrudev
Copy link

There's a workaround to customize favicon and header logo separately.

If you need to provide custom header logo different from favicon, logo-styles.css should be configured which links to a different logo image. Favicon won't be replaced with the logo you provide in the CSS and will still be taken from logo-icon.svg in customAssets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An issue for a feature or an overall improvement format: html An issue/PR related to Dokka's default HTML output format
Projects
None yet
Development

No branches or pull requests

3 participants