Skip to content

Commit

Permalink
Clean up HTML properly
Browse files Browse the repository at this point in the history
  • Loading branch information
whitep4nth3r committed Mar 5, 2024
1 parent b7475a6 commit de44ee9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 46 deletions.
46 changes: 18 additions & 28 deletions src/_components/webring.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
function Webring({ members, prevUrl, nextUrl }) {
return /* html */ `
<div class="card">
<div class="card__imageContainer">
<img src="/img/theclaw_webring_logo.svg" class="tcwr__logo" alt="The panther moth with a tattoo style banner that reads The Claw" />
</div>
<div class="card__inner">
<div class="tcwr">
<h2 class="tcwr__title">The Claw <span>webring</span></h2>
<div class="tcwr__nav">
<a href=${prevUrl} class="tcwr__navItem">Previous</a>
<button class="tcwr__navItem--random" data-webring-random>Random</button>
<a href="${nextUrl}" class="tcwr__navItem">Next</a>
</div>
<ul class="tcwr__membersList">
${members
.map(
(member) => `
<li class="tcwr__membersListItem">
<a href="${member.url}" class="tcwr__membersListItemLink">
${member.name}
</a>
</li>`,
)
.join("")}
</ul>
<a href="https://github.com/whitep4nth3r/the-claw-webring#join-the-claw-webring" class="tcwr__join">Join</a>
<span class="card__metaLabel">Webring</span>
</div>
</div>
<h2 class="tcwr__title">The Claw <span>webring</span></h2>
<div class="tcwr__nav">
<a href=${prevUrl} class="tcwr__navItem">Previous</a>
<button class="tcwr__navItem--random" data-webring-random>Random</button>
<a href="${nextUrl}" class="tcwr__navItem">Next</a>
</div>
<ul class="tcwr__membersList">
${members
.map(
(member) => `
<li class="tcwr__membersListItem">
<a href="${member.url}" class="tcwr__membersListItemLink">
${member.name}
</a>
</li>`,
)
.join("")}
</ul>
<a href="https://github.com/whitep4nth3r/the-claw-webring#join-the-claw-webring" class="tcwr__join">Join</a>
<script type="text/json" id="members">
${JSON.stringify(members)}
</script>
Expand Down
6 changes: 1 addition & 5 deletions src/_css/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/_css/main.css.map

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions src/_sass/_webring.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.tcwr {
--gap-unit: 0.25rem;
}

.tcwr__title {
@include font_bold;
color: var(--color-link);
Expand Down Expand Up @@ -58,7 +54,7 @@
color: var(--color-fg-copy);
display: block;
font-size: 1rem;
padding: var(--gap-unit);
padding: 0.25rem;
border-radius: var(--border-radius-base);
}

Expand Down
21 changes: 14 additions & 7 deletions src/index.11ty.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,20 @@ exports.render = function (data) {
<span class="card__metaLabel">Newsletter</span>
</div>
</div>
${Webring({
members: webring.members,
prevUrl: webring.prevUrl,
nextUrl: webring.nextUrl,
})}
</div>
${feedItems.map((item) => ActivityFeedItem({ item })).join("")}
<div class="card">
<div class="card__imageContainer">
<img src="/img/theclaw_webring_logo.svg" class="tcwr__logo" alt="The panther moth with a tattoo style banner that reads The Claw" />
</div>
<div class="card__inner">
${Webring({
members: webring.members,
prevUrl: webring.prevUrl,
nextUrl: webring.nextUrl,
})}
<span class="card__metaLabel">Webring</span>
</div>
</div>
${feedItems.map((item) => ActivityFeedItem({ item })).join("")}
</div>
</div>
</section>
Expand Down

0 comments on commit de44ee9

Please sign in to comment.