diff --git a/plugin/src/main/scala/org/apache/pekko/PekkoParadoxPlugin.scala b/plugin/src/main/scala/org/apache/pekko/PekkoParadoxPlugin.scala index 0b57984..f249a86 100644 --- a/plugin/src/main/scala/org/apache/pekko/PekkoParadoxPlugin.scala +++ b/plugin/src/main/scala/org/apache/pekko/PekkoParadoxPlugin.scala @@ -45,6 +45,8 @@ object PekkoParadoxPlugin extends AutoPlugin { def pekkoParadoxGlobalSettings: Seq[Setting[_]] = Seq( paradoxTheme := Some("org.apache.pekko" % "pekko-theme-paradox" % version), + // Target hostname for static assets (CSS, JS, Icons, Font) + paradoxProperties ++= Map("assets.hostname" -> "https://pekko.apache.org/"), paradoxNavigationIncludeHeaders := true, pekkoParadoxCopyright in Global := """Copyright © 2011-2022 Lightbend, Inc. diff --git a/theme/src/main/assets/assets/images/apache-incubator.svg b/theme/src/main/assets/assets/images/apache-incubator.svg deleted file mode 100644 index aed990f..0000000 --- a/theme/src/main/assets/assets/images/apache-incubator.svg +++ /dev/null @@ -1,155 +0,0 @@ - - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/theme/src/main/assets/assets/images/pekko_favicon.png b/theme/src/main/assets/assets/images/pekko_favicon.png deleted file mode 100644 index 2d26c10..0000000 Binary files a/theme/src/main/assets/assets/images/pekko_favicon.png and /dev/null differ diff --git a/theme/src/main/assets/assets/images/pekko_logo.png b/theme/src/main/assets/assets/images/pekko_logo.png deleted file mode 100644 index 6691539..0000000 Binary files a/theme/src/main/assets/assets/images/pekko_logo.png and /dev/null differ diff --git a/theme/src/main/assets/assets/javascripts/groups.js b/theme/src/main/assets/assets/javascripts/groups.js deleted file mode 100644 index cf812be..0000000 --- a/theme/src/main/assets/assets/javascripts/groups.js +++ /dev/null @@ -1,171 +0,0 @@ -/*! - Adapted from original paradox generic theme to work with paradox-material-theme - https://github.com/lightbend/paradox/blob/8e30c341f1f8351a19b71599219d2f636ba68eb4/themes/generic/src/main/assets/js/groups.js - licensed under Apache License 2.0. -*/ - -groupChangeListeners = []; - -window.groupChanged = function(callback) { - groupChangeListeners.push(callback); -} - -$(function() { - - // Groups (like 'java' and 'scala') represent groups of 'switchable' content, either in tabs or in regular text. - // The catalog of groups can be defined in the sbt parameters to initialize the group. - - var groupCookie = "paradoxGroups"; - var cookieTg = getCookie(groupCookie); - var currentGroups = {}; - - var catalog = {} - var supergroupByGroup = {}; - - if(cookieTg != "") - currentGroups = JSON.parse(cookieTg); - - // See https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie for more information - function setCookie(cookieName, cookieValue, daysToExpire) { - if (!daysToExpire) daysToExpire = 365; - const now = new Date(); - now.setDate(now.getDate() + daysToExpire); - // The lax value will send the cookie for all same-site - // requests and top-level navigation GET requests. This - // is sufficient for user tracking, but it will prevent - // many CSRF attacks. This is the default value in modern browsers. - document.cookie = `${cookieName}=${encodeURIComponent(cookieValue)};expires=${now.toUTCString()};path=/;samesite=lax`; - } - - // See https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie#Example_2_Get_a_sample_cookie_named_test2 for - // more information - function getCookie(cookieName) { - const cookieAttr = decodeURIComponent(document.cookie) - .split(";") - .find(row => row.trimStart().startsWith(cookieName)) - return cookieAttr ? cookieAttr.split("=")[1] : ""; - } - - $("dl").has("dt.mdc-tab").each(function() { - var dl = $(this); - dl.addClass("tabbed"); - var dts = dl.find("dt"); - dts.each(function(i) { - var dt = $(this); - dt.html("" + dt.text() + ""); - }); - var dds = dl.find("dd"); - dds.each(function(i) { - var dd = $(this); - dd.hide(); - if (dd.find("blockquote").length) { - dd.addClass("has-note"); - } - }); - - // Default to the first tab, for grouped tabs switch again later - switchToTab(dts.first()); - - dts.first().addClass("first"); - dts.last().addClass("last"); - }); - - // Determine all supergroups, populate 'catalog' and 'supergroupByGroup' accordingly. - $(".supergroup").each(function() { - var supergroup = $(this).attr('name').toLowerCase(); - var groups = $(this).find(".group"); - - catalog[supergroup] = []; - - groups.each(function() { - var group = "group-" + $(this).text().toLowerCase(); - catalog[supergroup].push(group); - supergroupByGroup[group] = supergroup; - }); - - $(this).on("change", function() { - switchToGroup(supergroup, this.value); - }); - }); - - // Switch to the right initial groups - for (var supergroup in catalog) { - var current = queryParamGroup(supergroup) || currentGroups[supergroup] || catalog[supergroup][0]; - - switchToGroup(supergroup, current); - } - - $("dl dt.mdc-tab").click(function(e){ - e.preventDefault(); - var currentDt = $(this);//.parent("dt"); - var currentDl = currentDt.parent("dl"); - - var currentGroup = groupOf(currentDt); - - var supergroup = supergroupByGroup[currentGroup] - if (supergroup) { - switchToGroup(supergroup, currentGroup); - } else { - switchToTab(currentDt); - } - }); - - function queryParamGroup(supergroup) { - var value = new URLSearchParams(window.location.search).get(supergroup) - if (value) { - return "group-" + value.toLowerCase(); - } else { - return ""; - } - } - - function switchToGroup(supergroup, group) { - currentGroups[supergroup] = group; - setCookie(groupCookie, JSON.stringify(currentGroups)); - - // Dropdown switcher: - $("select") - .has("option[value=" + group +"]") - .val(group); - - // Inline snippets: - catalog[supergroup].forEach(peer => { - if (peer === group) { - $("." + group).show(); - } else { - $("." + peer).hide(); - } - }) - - // Tabbed snippets: - $("dl.tabbed").each(function() { - var dl = $(this); - dl.find("dt").each(function() { - var dt = $(this); - if(groupOf(dt) == group) { - switchToTab(dt); - } - }); - }); - - groupChangeListeners.forEach(listener => listener(group, supergroup, catalog)); - } - - function switchToTab(dt) { - // interplay with paradox-material-theme.js adding an activate function to tabs - if (dt[0].activate) dt[0].activate(); - } - - function groupOf(elem) { - const classAttribute = elem.next("dd").find("pre").attr("class"); - if (classAttribute) { - const currentClasses = classAttribute.split(' '); - const regex = new RegExp("^group-.*"); - const matchingClass = currentClasses.find(cc => regex.test(cc)); - if (matchingClass) return matchingClass; - } - - // No class found? Then use the tab title - return "group-" + elem.find('a').text().toLowerCase(); - } -}); diff --git a/theme/src/main/assets/assets/javascripts/paradox-material-theme.js b/theme/src/main/assets/assets/javascripts/paradox-material-theme.js deleted file mode 100644 index a21561a..0000000 --- a/theme/src/main/assets/assets/javascripts/paradox-material-theme.js +++ /dev/null @@ -1,222 +0,0 @@ -/*! - Paradox Material Theme - Copyright (c) 2017 Jonas Fonseca - License: MIT -*/ - -// Adapted from paradox-material-theme 0.6.0 to simplify switching to a tab. -// https://github.com/jonas/paradox-material-theme/blob/2d57fe0567ea9fe7e8de14faef4fa777841d505a/theme/src/main/assets/assets/javascripts/paradox-material-theme.js - -function initParadoxMaterialTheme() { - // callout -> ammonition - document.querySelectorAll('.callout').forEach(callout => { - callout.classList.add('admonition') - callout.querySelectorAll('.callout-title').forEach(title => { - title.classList.add('admonition-title') - }) - callout.style.visibility = 'visible'; - }) - - var headers = ['h2', 'h3', 'h4', 'h5', 'h6'] - headers.forEach(headerName => { - document.querySelectorAll(headerName).forEach(header => { - var link = header.querySelector('a') - if (link) { - header.id = link.name - link.name = '' - header.removeChild(link) - link.text = '¶' - link.title = 'Permanent link' - link.className = 'headerlink' - header.appendChild(link) - } - }) - }) - - document.querySelectorAll('nav.md-nav--primary > ul').forEach((root, rootIndex) => { - function createNavToggle(path, active) { - var input = document.createElement('input') - input.classList.add('md-toggle') - input.classList.add('md-nav__toggle') - input.type = 'checkbox' - input.id = path - input.checked = active || false - input.setAttribute('data-md-toggle', path) - return input - } - - function createNavLabel(path, active, contentNode) { - var label = document.createElement('label') - label.classList.add('md-nav__link') - if (active) - label.classList.add('md-nav__link--active') - label.setAttribute('for', path) - if (contentNode) - label.appendChild(contentNode) - return label - } - - function visitListItem(item, path, level) { - item.classList.add('md-nav__item') - - var link = item.querySelector(':scope > a') - if (link) { - link.classList.add('md-nav__link') - link.classList.remove('page') - if (link.classList.contains('active')) { - item.classList.add('md-nav__item--active') - link.classList.add('md-nav__link--active') - } - link.setAttribute('data-md-state', '') - } - - var nestedNav = null - var nestedRoot = item.querySelector(':scope > ul') - if (nestedRoot) { - var active = item.querySelector(':scope a.active') != null - item.classList.add('md-nav__item--nested') - var nestedNav = document.createElement('nav') - nestedNav.classList.add('md-nav') - nestedNav.setAttribute('data-md-component', 'collapsible') - nestedNav.setAttribute('data-md-level', level) - - var input = createNavToggle(path, active) - - var label = createNavLabel(path, false, link) - if (link) - link.classList.remove('md-nav__link') - - var labelInner = document.createElement('label') - labelInner.classList.add('md-nav__title') - labelInner.setAttribute('for', path) - labelInner.textContent = link ? link.textContent : '???' - - nestedNav.appendChild(labelInner) - nestedNav.appendChild(nestedRoot) - item.appendChild(input) - item.appendChild(label) - item.appendChild(nestedNav) - visitList(nestedRoot, path, level + 1) - } - - if (link && link.classList.contains('active')) { - var toc = document.querySelector('nav.md-nav--primary > .md-nav--secondary') - if (toc && toc.children.length > 0) { - var input = createNavToggle('__toc', false) - var labelText = nestedNav ? 'Table of contents' : link ? link.textContent : '???' - var label = createNavLabel('__toc', true, document.createTextNode(labelText)) - - if (nestedNav) { - var node = nestedNav.children[1] - nestedNav.insertBefore(input, node) - nestedNav.insertBefore(label, node) - nestedNav.appendChild(toc) - } else if (link) { - item.insertBefore(input, link) - item.insertBefore(label, link) - item.appendChild(toc) - } - } - } - } - - function visitList(list, path, level) { - list.classList.add('md-nav__list') - list.setAttribute('data-md-scrollfix', '') - list.querySelectorAll('li').forEach((item, itemIndex) => { - visitListItem(item, path + '-' + itemIndex, level) - }) - } - - visitList(root, 'nav-' + rootIndex, 1) - var projectVersion = document.getElementById("project.version") - if (projectVersion) { - root.appendChild(projectVersion) - } - root.parentNode.style.visibility = 'visible' - }) - - document.querySelectorAll('.md-sidebar--secondary .md-nav--secondary > ul').forEach(tocRoot => { - function visitListItem(item) { - item.classList.add('md-nav__item') - item.querySelectorAll(':scope> a').forEach(link => { - link.classList.add('md-nav__link') - link.setAttribute('data-md-state', '') - }) - item.querySelectorAll(':scope > ul').forEach(list => { - visitList(list) - }) - } - - function visitList(list) { - list.classList.add('md-nav__list') - list.querySelectorAll(':scope > li').forEach(item => { - visitListItem(item) - }) - } - - var parent = tocRoot.parentNode - parent.removeChild(tocRoot) - - tocRoot.querySelectorAll(':scope > li > ul').forEach(list => { - parent.append(list) - list.setAttribute('data-md-scrollfix', '') - visitList(list) - }) - - parent.style.visibility = 'visible'; - }) - - document.querySelectorAll('dl').forEach(dl => { - const tabContents = dl.querySelectorAll(':scope > dd > pre') - if (tabContents.length > 0) { - dl.classList.add('mdc-tab-bar') - var first = true - var contentContainer = document.createElement('div') - contentContainer.classList.add('mdc-tab-content-container') - - tabContents.forEach(pre => { - var dd = pre.parentNode - var dt = dd.previousSibling - while (dt.nodeType != dt.ELEMENT_NODE) { - dt = dt.previousSibling - } - - var tabContent = document.createElement('div') - tabContent.classList.add('mdc-tab-content') - contentContainer.appendChild(tabContent) - while (dd.childNodes.length > 0) { - tabContent.appendChild(dd.childNodes[0]); - } - dl.removeChild(dd) - - dt.classList.add('mdc-tab') - if (first) { - dt.classList.add('mdc-tab--active') - tabContent.classList.add('mdc-tab-content--active') - } - first = false - dt.activate = function() { - dl.querySelectorAll(':scope .mdc-tab--active').forEach(active => { - active.classList.remove('mdc-tab--active') - }) - contentContainer.querySelectorAll(':scope .mdc-tab-content--active').forEach(active => { - active.classList.remove('mdc-tab-content--active') - }) - dt.classList.add('mdc-tab--active') - tabContent.classList.add('mdc-tab-content--active') - } - dt.onclick = event => { - dt.activate() - } - }) - - if (dl.nextSibling) - dl.parentNode.insertBefore(contentContainer, dl.nextSibling) - else - dl.parentNode.appendChild(contentContainer) - } - }) -} - -initParadoxMaterialTheme() diff --git a/theme/src/main/assets/assets/stylesheets/pekko-theme.css b/theme/src/main/assets/assets/stylesheets/pekko-theme.css deleted file mode 100644 index d9531af..0000000 --- a/theme/src/main/assets/assets/stylesheets/pekko-theme.css +++ /dev/null @@ -1,123 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -select.supergroup { - width: 50%; - border: none; - font-size: larger; - margin: 1rem; - padding: 0.5rem; -} - -ul.md-nav__links li { - display: inline; -} -ul.md-nav__links li a { - display: inline; -} - -/* fix paradox snippet links to fit with material docs style */ - -/* material docs brings its own copy button, remove ours */ -.snippet-button.copy-snippet { display: none; } - -/* style our "link to source" similar to material docs one */ -.snippet-button.go-to-source { - font-family: "Material Icons"; - position: absolute; - top: 0.6rem; - right: 2.6rem; - width: 2.8rem; - height: 2.8rem; - border-radius: 0.2rem; - font-size: 1.6rem; - cursor: pointer; - z-index: 1; - -webkit-backface-visibility: hidden; - backface-visibility: hidden; -} - -/* remove link text */ -.snippet-button.go-to-source span { display: none; } - -/* and replace with button similar to material copy one */ -.snippet-button.go-to-source::before { - transition: color 0.25s, opacity 0.25s; - color: rgba(0, 0, 0, 0.07); - content: "\E157"; -} - -pre:hover .snippet-button.go-to-source::before { - color: rgba(0, 0, 0, 0.54); -} - -a.snippet-button.go-to-source:hover::before, .snippet-button.go-to-source:active::before { - color: #ff9100; -} - -/* style for tables */ -tbody th { - font-weight: bold; -} - -tbody th, tbody td { - padding: 5px; -} - -tbody tr:nth-child(even) { - background-color: #eaeaea; -} - - -/* Footer styling */ -.md-footer-meta__inner p { - color: #999; - font-size: 14px; -} - -.md-footer-meta__inner { - box-sizing: border-box; - flex-wrap: wrap; - display: flex; - align-items: center; - justify-content: center; -} - -@media (max-width: 850px) { - .md-footer-meta__inner { - flex-direction: column; - } -} - -.md-footer-meta__inner div { - flex: 1; - text-align: center; -} - -.md-footer-meta__inner .md-footer-copyright { - flex-basis: 100%; -} - -#incubator__logo { - background-color: white; - max-width: inherit; - padding: 10px; - width: 380px; - margin: auto; -} diff --git a/theme/src/main/assets/page.st b/theme/src/main/assets/page.st index 6a23137..fe37b0b 100644 --- a/theme/src/main/assets/page.st +++ b/theme/src/main/assets/page.st @@ -54,21 +54,21 @@ $! $ else $ $page.home.title$ $ endif $ - + $ if (page.properties.("material.color.primary")) $ - + $ if (page.properties.("material.color.primary.theme")) $ - + $ endif $ $ endif $ - - - - - - + + + + + + $ if (page.properties.("material.custom.stylesheet")) $ - + $ endif $ $partials/footer()$ - - + + $! The ending "." enables search to work without providing the site URL, since the @@ -146,10 +146,10 @@ $! !$ - - - - + + + +