Skip to content

Commit 7d5084a

Browse files
committed
Link to live page
Use the WEEKNOTES_LIVE_PAGE env variable Closes #2
1 parent 1141a21 commit 7d5084a

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async function buildClientsideAssets() {
3131
}
3232

3333
childProcess.execSync(
34-
"npx tailwindcss -i ./statics/css/style.css -o ./public/css/style.css"
34+
"npx tailwindcss -i ./statics/css/style.css -o ./public/css/style.css",
3535
);
3636

3737
// build js bundle with esbuild
@@ -51,6 +51,7 @@ async function buildClientsideAssets() {
5151
}
5252

5353
const routePrefix = process.env.WEEKNOTES_ROUTE_PREFIX ?? "";
54+
const livePage = process.env.WEEKNOTES_LIVE_PAGE ?? "";
5455

5556
await buildClientsideAssets();
5657

@@ -90,6 +91,7 @@ app.get(getRoutePath(), (req, reply) => {
9091
return reply.view("./views/index.liquid", {
9192
links,
9293
routePrefix,
94+
livePage,
9395
});
9496
});
9597

views/index.liquid

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
Weeknotes Collector
1818
</h1>
1919
<p class="text-gray-500">Save links across the web for curation</p>
20+
{% if livePage != "" %}
21+
<p class="text-gray-500">Live: <a class="text-white hover:underline" href="{{ livePage }}">{{ livePage }}</a></p>
22+
{% endif %}
2023
</header>
2124

2225
{% comment %}<!-- prettier-ignore -->{% endcomment %}

0 commit comments

Comments
 (0)