Skip to content

Commit ce7f0c6

Browse files
committed
chore: add initial content
1 parent 7af1657 commit ce7f0c6

File tree

4 files changed

+54
-20
lines changed

4 files changed

+54
-20
lines changed

content/aesthetics.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Aesthetics
2+
3+
### Styling
4+
5+
- [tw-in-js/twind](https://github.com/tw-in-js/twind) - The smallest, fastest, most feature complete Tailwind-in-JS solution in existence.
6+

content/developer-experience.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Developer Experience
2+
3+
### Bundlers
4+
5+
- [parcel-bundler/parcel](https://github.com/parcel-bundler/parcel) - The zero configuration build tool for the web. 📦🚀
6+
- [vitejs/vite](https://github.com/vitejs/vite) - Next generation frontend tooling. It's fast!

content/essentials.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,3 @@
77
### State Management
88
- [preactjs/signals](https://github.com/preactjs/signals) - Manage state with style in every framework
99

10-
### Bundlers
11-
12-
- [parcel-bundler/parcel](https://github.com/parcel-bundler/parcel) - The zero configuration build tool for the web. 📦🚀
13-
- [vitejs/vite](https://github.com/vitejs/vite) - Next generation frontend tooling. It's fast!
14-

main.js

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ const sideBar = {
1515
source: "/content/essentials",
1616
key: "essentials",
1717
},
18+
aesthetics: {
19+
order: 3,
20+
label: "Aesthetics",
21+
source: "/content/aesthetics",
22+
key: "aesthetics",
23+
},
24+
"developer-experience": {
25+
order: 4,
26+
label: "Developer Experience",
27+
source: "/content/developer-experience",
28+
key: "developer-experience",
29+
},
1830
};
1931

2032
main();
@@ -35,11 +47,12 @@ async function main() {
3547
sidebarRoot
3648
);
3749

50+
let storedContent = new Array(Object.keys(sideBar).length);
3851
const promiseChain = Object.entries(sideBar)
3952
.sort((x, y) => x[1].order - y[1].order)
4053
.map(async (entry, index, source) => {
4154
const [key, value] = entry;
42-
fetch(`${value.source}.md`).then(async (d) => {
55+
return fetch(`${value.source}.md`).then(async (d) => {
4356
if (!d.ok) {
4457
return;
4558
}
@@ -53,16 +66,30 @@ async function main() {
5366
if (source.length - 1 == index) {
5467
layoutSpacing.push("pb-12 mb-12");
5568
}
56-
contentRoot.innerHTML += `<section id="${key}" class="flex flex-col ${layoutSpacing
57-
.filter(Boolean)
58-
.join(" ")}">
59-
${await marked(content, {})}
60-
</section>`;
69+
storedContent.push({
70+
order: value.order,
71+
content: `<section id="${key}" class="flex flex-col ${layoutSpacing
72+
.filter(Boolean)
73+
.join(" ")}">
74+
${await marked(content, {})}
75+
</section>`,
76+
});
6177
});
6278
});
79+
6380
await promiseChain.reduce((acc, item) => {
6481
return acc.then((_) => item);
6582
}, Promise.resolve());
83+
84+
console.log({ storedContent });
85+
const usableContent = storedContent
86+
// .sort((x, y) => x.order - y.order)
87+
.map((x) => {
88+
return x.content;
89+
})
90+
.join("\n");
91+
92+
contentRoot.innerHTML = usableContent;
6693
}
6794

6895
function Sidebar({ items = [] } = {}) {
@@ -91,15 +118,15 @@ function Sidebar({ items = [] } = {}) {
91118
}
92119

93120
function SidebarItem({ item, active, onPress }) {
94-
return html`<li>
95-
<a
96-
href="#${item.key}"
97-
onClick=${onPress}
98-
class="text-zinc-600 hover:underline hover:text-black underline-offset-4 ${active
99-
? "underline !text-black"
100-
: ""}"
101-
>${item.label}</a
102-
>
121+
return html`<li class="w-fit">
122+
<a href="#${item.key}" onClick=${onPress} class="group text-zinc-600"
123+
>${item.label}
124+
<span
125+
class="block max-w-0 group-hover:max-w-full transition-all duration-500 h-0.5 bg-black ${active
126+
? "max-w-full !bg-zinc-600"
127+
: ""}"
128+
></span>
129+
</a>
103130
</li>`;
104131
}
105132

0 commit comments

Comments
 (0)