I followed <https://kotlinlang.org/docs/dokka-html...
# dokka
v
I followed https://kotlinlang.org/docs/dokka-html.html#templates I'm trying to add my own javascript script to every html page but without success.
Copy code
tasks.withType<DokkaTask>().configureEach {
    pluginConfiguration<DokkaBase, DokkaBaseConfiguration> {
        templatesDir = file("dokka")
        customStyleSheets = listOf(file("dokka/dokka_custom_styles.css"))
    }
}
My file structure looks like this: module: - dokka - dokka_custom_styles.css - includes - page_metadata.ft The styles are picked up correctly but not the script:
Copy code
<#macro display>
    <title>${pageName}</title>
    <@template_cmd name="pathToRoot">
    <link href="${pathToRoot}images/logo-icon.svg" rel="icon" type="image/svg">
    <script>
        function myCustomFunction() {
            // Some code
        };

        window.addEventListener("DOMContentLoaded", function() {
            myCustomFunction();
        }, false);
    </script>
    </@template_cmd>
</#macro>
1
i
Hi! Let's have a look
- page_metadata.ft
is it
.ft
or
.ftl
?
v
i
oh, sorry, that's a slip up, it should be
.ftl
. Can you try it out?
Just tried it out with
.ftl
- seems to work
v
Yes, all fixed now.
.ftl
extension works.
Thank you @Ignat Beresnev.
i
Thanks for noticing and bringing this to our attention! I hope not that many people suffered from it 😞 I've pushed the fix just now, should automatically be deployed to the website some time later today
👍 1