From f381c8ea036ba03451e856d09e020334ee9fb4ac Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Wed, 11 Jan 2023 14:04:31 +1100 Subject: [PATCH] add help page and page titles - add page titles - add help page - update header --- server.js | 16 +++++++++++----- templates/help.spy | 24 ++++++++++++++++++++++++ templates/partials/head.spy | 2 +- templates/partials/header.spy | 3 ++- 4 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 templates/help.spy diff --git a/server.js b/server.js index 4ec9f6b..8756175 100644 --- a/server.js +++ b/server.js @@ -49,8 +49,10 @@ app.set('view engine', 'spy'); app.get('/', requireLoggedIn, (req, res) => { let data = { + title: 'Home', disabled: '', - message: getSavedFile(req.session.user.username)} + message: getSavedFile(req.session.user.username) + } let today = getNow().toISOString().slice(0,10) let latestPost = req.session.user.latest_post if (today === latestPost) { @@ -64,22 +66,26 @@ app.get('/login', (req, res) => { if (req.session.user) { res.redirect('/') } else { - res.render('login.spy') + res.render('login.spy', {title: 'Log In'}) } }) app.get('/edit', requireLoggedIn, (req, res) => { getLatestPost( req.session.user.directory, (data, path) => { - res.render('edit.spy', {data: data, path: path}) + res.render('edit.spy', {data: data, path: path, title: 'Edit'}) }) }) app.get('/settings', requireLoggedIn, (req, res) => { - res.render('settings.spy') + res.render('settings.spy', {title: 'Settings'}) }) app.get('/try-again', requireLoggedIn, (req, res, next) => { - res.render('try-again.spy') + res.render('try-again.spy', {title: 'Log In'}) +}) + +app.get('/help', requireLoggedIn, (req, res, next) => { + res.render('help.spy', {title: 'Help'}) }) // POST diff --git a/templates/help.spy b/templates/help.spy new file mode 100644 index 0000000..319ffee --- /dev/null +++ b/templates/help.spy @@ -0,0 +1,24 @@ +<< partials/head >> + + << partials/header >> +
+

Help

+

Soyuz is a web app for writing Gemini posts.

+
+ +

Takes you to the home page where you can start writing today's post. The title of your post should be indicated by a level 1 heading at the top of the page.

+ +

Edit the most recent post - this could have been published with soyuz, or another way. If you change the title, this will be changed in the year archive and capsule homepage.

+ +

Change your password, or log out.

+ +

Display this help page.

+ +

Save a draft of your post. Any drafts will be deleted on the next publish.

+ +

Publish the current draft to your Gemini capsule, and delete any saved drafts. You can only publish one post per day, but if you like you can update your day's post by using the 'edit' function.

+
+
+ + + diff --git a/templates/partials/head.spy b/templates/partials/head.spy index 2f3097e..ab788a9 100644 --- a/templates/partials/head.spy +++ b/templates/partials/head.spy @@ -5,5 +5,5 @@ - Soyuz + Soyuz - {{ title }} diff --git a/templates/partials/header.spy b/templates/partials/header.spy index 831e6a7..e23cff2 100644 --- a/templates/partials/header.spy +++ b/templates/partials/header.spy @@ -1,5 +1,6 @@
New | Edit | - Settings + Settings | + Help