Skip to content

Commit

Permalink
Give child pages the full box width
Browse files Browse the repository at this point in the history
  • Loading branch information
kneasle committed Jan 13, 2024
1 parent da15f7f commit 5dc0a1d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
4 changes: 3 additions & 1 deletion build/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ function renderFrontmatteredMarkdown(
// Create subpage
const pageDir = path.join(OUT_DIR, slug);
ensureDirExists(pageDir);
Deno.writeTextFileSync(path.join(pageDir, "index.html"), renderMarkdown(markdown));
const content = renderMarkdown(markdown);
const html = renderTemplate("page-prose", { content });
Deno.writeTextFileSync(path.join(pageDir, "index.html"), html);

return [page];
}
Expand Down
26 changes: 3 additions & 23 deletions templates/main-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ <h2>{{title}}</h2>

<div class="padding"></div>
<p class="description">{{description}}</p>
<div class="content-container">
<div id="page-content" class="page-content content">
<!-- content goes here -->
</div>
<div id="page-content" class="content-container">
<!-- page content goes here when loaded in the overlay -->
</div>
</div>
</div>
Expand All @@ -92,25 +90,7 @@ <h2>{{title}}</h2>
</div>
<!-- end of normal scroll layer -->

<!-- page overlay -->
<div id="page-overlay">
<!-- TODO: Actually remove this -->
<div class="page-overlay-box" style="display: none;">
<!-- overlay header -->
<div style="display: flex; flex-direction: row;">
<div id="page-overlay-header" style="flex-grow: 1"></div>
<svg class="page-overlay-x-button" onclick="closeOverlay()"
viewBox="0 0 85 85" xmlns="http://www.w3.org/2000/svg">
<path style="stroke-width: 8px; stroke-linecap:round;" d="M 25,25 60,60" />
<path style="stroke-width: 8px; stroke-linecap:round;" d="M 25,60 60,25" />
</svg>
</div>

<!-- overlay content -->
<iframe src="/comp-data"></iframe>
</div>
</div>
<!-- end of page overlay -->
<div id="page-overlay"></div>
</body>

</html>
3 changes: 3 additions & 0 deletions templates/page-prose.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="page-content content">
{{{content}}}
</div>

0 comments on commit 5dc0a1d

Please sign in to comment.