Skip to content

Commit e338d32

Browse files
committed
Update build system for root-level presentations
- Update Taskfile.yml to create presentations at root level instead of presentations/ subdirectory - Update template paths from ../../lib/ to ../lib/ for root-level presentations - Update list task to find presentations at root level by checking for index.html + slides.md - This ensures future presentations will be created with the correct URL structure Future presentations will be accessible at: /{presentation-name}/ Instead of: /presentations/{presentation-name}/
1 parent 97d7bfd commit e338d32

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

Taskfile.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22

33
vars:
4-
PRESENTATIONS_DIR: presentations
4+
PRESENTATIONS_DIR: .
55
SERVER_PORT: 8000
66

77
tasks:
@@ -26,7 +26,7 @@ tasks:
2626
exit 1
2727
fi
2828
SLUG="{{.CLI_ARGS}}"
29-
PRES_DIR="{{.PRESENTATIONS_DIR}}/${SLUG}"
29+
PRES_DIR="${SLUG}"
3030
if [ -d "${PRES_DIR}" ]; then
3131
echo "Error: Presentation '${SLUG}' already exists"
3232
exit 1
@@ -37,26 +37,32 @@ tasks:
3737
sed -i "s/PRESENTATION_TITLE/${SLUG}/g" "${PRES_DIR}/slides.md"
3838
echo "✅ Created new presentation: ${SLUG}"
3939
echo "📂 Location: ${PRES_DIR}"
40-
echo "🌐 Will be available at: /presentations/${SLUG}/"
40+
echo "🌐 Will be available at: /${SLUG}/"
4141
echo ""
4242
echo "Next steps:"
4343
echo " 1. Edit ${PRES_DIR}/slides.md to add your slides (Markdown format)"
4444
echo " 2. Run 'task serve' to preview locally"
45-
echo " 3. View at http://localhost:{{.SERVER_PORT}}/presentations/${SLUG}/"
45+
echo " 3. View at http://localhost:{{.SERVER_PORT}}/${SLUG}/"
4646
4747
list:
4848
desc: List all presentations
4949
cmds:
5050
- |
5151
echo "Available presentations:"
52-
if [ -d "{{.PRESENTATIONS_DIR}}" ]; then
53-
for dir in {{.PRESENTATIONS_DIR}}/*/; do
54-
if [ -d "$dir" ]; then
55-
name=$(basename "$dir")
56-
echo " 📊 ${name} - /presentations/${name}/"
52+
# Look for directories that contain index.html and slides.md (presentation indicators)
53+
# Exclude known non-presentation directories
54+
found=false
55+
for dir in */; do
56+
if [ -d "$dir" ] && [ -f "${dir}index.html" ] && [ -f "${dir}slides.md" ]; then
57+
name=$(basename "$dir")
58+
# Skip known system directories
59+
if [[ "$name" != "lib" && "$name" != "node_modules" && "$name" != ".git" && "$name" != "templates" && "$name" != "scripts" && "$name" != "presentations" ]]; then
60+
echo " 📊 ${name} - /${name}/"
61+
found=true
5762
fi
58-
done
59-
else
63+
fi
64+
done
65+
if [ "$found" = false ]; then
6066
echo " No presentations found"
6167
fi
6268

templates/presentation/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>PRESENTATION_TITLE - Codebase Interface</title>
7-
<link rel="stylesheet" href="../../lib/reveal.js/dist/reset.css">
8-
<link rel="stylesheet" href="../../lib/reveal.js/dist/reveal.css">
9-
<link rel="stylesheet" href="../../lib/reveal.js/dist/theme/black.css">
10-
<link rel="stylesheet" href="../../lib/reveal.js/plugin/highlight/monokai.css">
7+
<link rel="stylesheet" href="../lib/reveal.js/dist/reset.css">
8+
<link rel="stylesheet" href="../lib/reveal.js/dist/reveal.css">
9+
<link rel="stylesheet" href="../lib/reveal.js/dist/theme/black.css">
10+
<link rel="stylesheet" href="../lib/reveal.js/plugin/highlight/monokai.css">
1111
</head>
1212
<body>
1313
<div class="reveal">
@@ -22,10 +22,10 @@
2222
</div>
2323
</div>
2424

25-
<script src="../../lib/reveal.js/dist/reveal.js"></script>
26-
<script src="../../lib/reveal.js/plugin/notes/notes.js"></script>
27-
<script src="../../lib/reveal.js/plugin/markdown/markdown.js"></script>
28-
<script src="../../lib/reveal.js/plugin/highlight/highlight.js"></script>
25+
<script src="../lib/reveal.js/dist/reveal.js"></script>
26+
<script src="../lib/reveal.js/plugin/notes/notes.js"></script>
27+
<script src="../lib/reveal.js/plugin/markdown/markdown.js"></script>
28+
<script src="../lib/reveal.js/plugin/highlight/highlight.js"></script>
2929
<script>
3030
Reveal.initialize({
3131
hash: true,

0 commit comments

Comments
 (0)