diff options
author | Oleg Yukhnevich <whyoleg@gmail.com> | 2023-11-07 15:27:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-07 15:27:34 +0200 |
commit | 64cce58f73f908909ba60da6005d7abb2572b2f0 (patch) | |
tree | b66897df0bb86e159d6d040c65e04552efd1ee68 /plugins/base/src/main/resources/dokka | |
parent | 84e48b516500433332e9279237cd139f7836ca94 (diff) | |
download | dokka-64cce58f73f908909ba60da6005d7abb2572b2f0.tar.gz dokka-64cce58f73f908909ba60da6005d7abb2572b2f0.tar.bz2 dokka-64cce58f73f908909ba60da6005d7abb2572b2f0.zip |
Add the link to GitHub repo to the header if there are source links defined (#3235)
* Use URL from base plugin configuration
* Add integration test for the multi-module project that the homepage link exists everywhere
Diffstat (limited to 'plugins/base/src/main/resources/dokka')
3 files changed, 39 insertions, 1 deletions
diff --git a/plugins/base/src/main/resources/dokka/images/homepage.svg b/plugins/base/src/main/resources/dokka/images/homepage.svg new file mode 100644 index 00000000..a3d7602b --- /dev/null +++ b/plugins/base/src/main/resources/dokka/images/homepage.svg @@ -0,0 +1,5 @@ +<!-- SOURCE: https://www.svgrepo.com/svg/416627/home-house-ui --> +<svg fill="#ffffff" width="64px" height="64px" viewBox="0 0 512.00 512.00" xmlns="http://www.w3.org/2000/svg"> + <path d="M256,0C114.615,0,0,114.615,0,256s114.615,256,256,256s256-114.615,256-256S397.385,0,256,0z M404.861,263.236 L404.861,263.236c-7.297,7.297-18.066,8.993-26.986,5.104v97.098c0,20.193-16.37,36.562-36.562,36.562H170.688 c-20.193,0-36.562-16.37-36.562-36.562v-97.098c-8.919,3.89-19.689,2.193-26.986-5.104c-9.519-9.519-9.519-24.952,0-34.471 L238.764,97.139h0c9.519-9.519,24.952-9.519,34.471,0l131.625,131.625C414.38,238.283,414.38,253.717,404.861,263.236z"/> + <path d="M286.469,267.938h-60.938c-6.731,0-12.188,5.457-12.188,12.188v73.125c0,6.731,5.457,12.188,12.188,12.188h60.938 c6.731,0,12.188-5.457,12.188-12.188v-73.125C298.656,273.394,293.2,267.938,286.469,267.938z"/> +</svg> diff --git a/plugins/base/src/main/resources/dokka/styles/style.css b/plugins/base/src/main/resources/dokka/styles/style.css index 67a899a5..62b0ddbd 100644 --- a/plugins/base/src/main/resources/dokka/styles/style.css +++ b/plugins/base/src/main/resources/dokka/styles/style.css @@ -342,6 +342,7 @@ td:first-child { /* --- Navigation controls --- */ .navigation-controls { display: flex; + margin-left: 4px; } @media (min-width: 760px) { @@ -365,7 +366,6 @@ td:first-child { display: block; border-radius: 50%; background-color: inherit; - margin-left: 4px; padding: 0; border: none; cursor: pointer; @@ -394,6 +394,36 @@ td:first-child { } /* /--- Navigation THEME --- */ +/* --- Navigation HOMEPAGE --- */ +.navigation-controls--homepage { + height: 40px; + width: 40px; + display: block; + border-radius: 50%; + cursor: pointer; +} + +.navigation-controls--homepage a::before { + height: 100%; + width: 20px; + margin-left: 10px; + display: block; + content: ""; + background: url("../images/homepage.svg"); + background-size: 100% 100%; +} + +.navigation-controls--homepage:hover { + background: var(--white-10); +} + +@media (max-width: 759px) { + .navigation-controls--homepage { + display: none; + } +} +/* /--- Navigation HOMEPAGE --- */ + .navigation .platform-selector:not([data-active]) { color: #fff; } diff --git a/plugins/base/src/main/resources/dokka/templates/includes/header.ftl b/plugins/base/src/main/resources/dokka/templates/includes/header.ftl index d5c7a613..d399e633 100644 --- a/plugins/base/src/main/resources/dokka/templates/includes/header.ftl +++ b/plugins/base/src/main/resources/dokka/templates/includes/header.ftl @@ -21,6 +21,9 @@ <@source_set_selector.display/> </div> <div class="navigation-controls"> + <#if homepageLink?has_content> + <div class="navigation-controls--btn navigation-controls--homepage" id="homepage-link" role="button"><a href="${homepageLink}"></a></div> + </#if> <button class="navigation-controls--btn navigation-controls--theme" id="theme-toggle-button" type="button">switch theme</button> <div class="navigation-controls--btn navigation-controls--search" id="searchBar" role="button">search in API</div> </div> |