Skip to content

Commit a1e270d

Browse files
committed
Added the Explorer Component to the individual portfolio item layout
- Made some related edits and removals
1 parent ddf43ca commit a1e270d

4 files changed

Lines changed: 47 additions & 58 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "2023"
2+
title: "Ignore"
33
date: 2024-03-06 8:30 pm
44
tags:
55
- life

content/portfolio/dev/example-portfolio-entry.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

quartz.layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export const portfolioItemPageLayout: PageLayout = {
9191
Component.Divider()
9292
],
9393
left: [
94+
Component.DesktopOnly(Component.Explorer()),
9495
],
9596
right: [
9697
Component.DesktopOnly(Component.TableOfContents()),

quartz/components/ExplorerNode.tsx

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -184,42 +184,52 @@ export function ExplorerNode({ node, opts, fullPath, fileData }: ExplorerNodePro
184184
</li>
185185
) : (
186186
<li>
187-
{node.name !== "" && (
188-
// Node with entire folder
189-
// Render svg button + folder name, then children
190-
<div class="folder-container">
191-
<svg
192-
xmlns="http://www.w3.org/2000/svg"
193-
width="12"
194-
height="12"
195-
viewBox="5 8 14 8"
196-
fill="none"
197-
stroke="currentColor"
198-
stroke-width="2"
199-
stroke-linecap="round"
200-
stroke-linejoin="round"
201-
class="folder-icon"
202-
>
203-
<polyline points="6 9 12 15 18 9"></polyline>
204-
</svg>
205-
{/* render <a> tag if folderBehavior is "link", otherwise render <button> with collapse click event */}
206-
<div key={node.name} data-folderpath={folderPath}>
207-
{folderBehavior === "link" ? (
208-
<a
209-
href={resolveRelative(fileData.slug!, folderPath as SimpleSlug)}
210-
data-for={node.name}
211-
class="folder-title"
187+
{node.name !== "" && (
188+
node.children.length !== 0 ? (
189+
// Node with entire folder
190+
// Render svg button + folder name, then children
191+
<div class="folder-container">
192+
<svg
193+
xmlns="http://www.w3.org/2000/svg"
194+
width="12"
195+
height="12"
196+
viewBox="5 8 14 8"
197+
fill="none"
198+
stroke="currentColor"
199+
stroke-width="2"
200+
stroke-linecap="round"
201+
stroke-linejoin="round"
202+
class="folder-icon"
212203
>
213-
{node.displayName}
214-
</a>
215-
) : (
216-
<button class="folder-button">
217-
<span class="folder-title">{node.displayName}</span>
218-
</button>
219-
)}
220-
</div>
221-
</div>
222-
)}
204+
<polyline points="6 9 12 15 18 9"></polyline>
205+
</svg>
206+
{/* render <a> tag if folderBehavior is "link", otherwise render <button> with collapse click event */}
207+
<div key={node.name} data-folderpath={folderPath}>
208+
{folderBehavior === "link" ? (
209+
<a
210+
href={resolveRelative(fileData.slug!, folderPath as SimpleSlug)}
211+
data-for={node.name}
212+
class="folder-title"
213+
>
214+
{node.displayName}
215+
</a>
216+
) : (
217+
<button class="folder-button">
218+
<span class="folder-title">{node.displayName}</span>
219+
</button>
220+
)}
221+
</div>
222+
</div>
223+
) :
224+
(
225+
{
226+
'Software Development Experience': <a href='../../portfolio/dev'>Software Development Experience</a>,
227+
'Technical Writing Experience': <a href='../../portfolio/technical-writing'>Technical Writing Experience</a>,
228+
'Front Porch': null
229+
}[node.displayName]
230+
)
231+
)
232+
}
223233
{/* Recursively render children of folder */}
224234
<div class={`folder-outer ${node.depth === 0 || isDefaultOpen ? "open" : ""}`}>
225235
<ul

0 commit comments

Comments
 (0)