Skip to content

Commit

Permalink
[Website] Link the logo to the homepage and remove the “Home” link (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitrySharabin authored Jun 30, 2024
1 parent bd61e6a commit 8395a03
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 32 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<header class="home no-home-link">
<header>

<img src="/logo.svg" width="100" alt="Logo showing a cloud presented as a tree" />
<a href="/">
<img src="/logo.svg" width="100" alt="Logo showing a cloud presented as a tree" />
</a>

<h1 class="logo"><span class="ma">ma</span>data</h1>

Expand Down
7 changes: 4 additions & 3 deletions _includes/page.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@

{% if page.url and page.url !== "/" %}
<header>
<img src="{{ page | relative }}/logo.svg" alt="logo" />
<a href="/" class="home">Home</a>
<a href="/">
<img src="{{ page | relative }}/logo.svg" width="100" alt="Logo showing a cloud presented as a tree" />
</a>

<h1 class="logo"><span class="ma">ma</span>data</h1>

Expand All @@ -42,7 +43,7 @@

<footer>
<div class="logo">
<img src="{{ page | relative }}/logo.svg" alt="logo" /> madata
<img src="{{ page | relative }}/logo.svg" alt="Logo showing a cloud presented as a tree" /> madata
</div>

<nav>
Expand Down
7 changes: 0 additions & 7 deletions global.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ function renderDemos () {
}
}

let h1 = document.querySelector("h1");
if (!h1.matches(".no-home-link *")) {
if (h1 && !h1.parentNode.querySelector(".home")) {
h1.insertAdjacentHTML("beforebegin", `<a href="../index.html" class="home">Madata</a>`);
}
}

// Wrap all elements with data-alternates attribute in a div.alternates-container
for (let el of $$("[data-alternates]")) {
let alternates = el.dataset.alternates.split("\n");
Expand Down
24 changes: 4 additions & 20 deletions style.postcss
Original file line number Diff line number Diff line change
Expand Up @@ -267,29 +267,13 @@ body > * {
}
}

& img {
& a {
position: absolute;
right: var(--space-x);
width: auto;
height: 7em;
}

& a {
color: inherit;
}

& .home {
text-transform: uppercase;
font-weight: 900;
font-size: 75%;

&:not(:hover) {
text-decoration: none;
}

&::before {
content: "🏠";
margin-right: .3em;
& img {
width: auto;
height: 7em;
}
}
}
Expand Down

0 comments on commit 8395a03

Please sign in to comment.