Skip to content

Commit

Permalink
EthicalAd: specific placement for Antora
Browse files Browse the repository at this point in the history
Based on #473
  • Loading branch information
humitos committed Dec 18, 2024
1 parent 28bb43c commit 300dec5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ethicalads.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ export class EthicalAdsAddon extends AddonBase {
placement.classList.add("ethical-alabaster");
placement.classList.add("ethical-docsify");

placement.setAttribute("data-ea-type", "readthedocs-sidebar");
placement.setAttribute("data-ea-style", "image");
knownPlacementFound = true;
}
} else if (docTool.isAntora()) {
selector = "aside nav.nav-menu";
element = document.querySelector(selector);

if (this.elementAboveTheFold(element)) {
placement.classList.add("ethical-alabaster");

placement.setAttribute("data-ea-type", "readthedocs-sidebar");
placement.setAttribute("data-ea-style", "image");
knownPlacementFound = true;
Expand Down

0 comments on commit 300dec5

Please sign in to comment.