commit cf8d9259645824ff1bd5fd875b6e9eb2bd285baf
parent 5899940ff3e6fce18358d385458149b36feac0bf
Author: David Eisinger <[email protected]>
Date: Wed, 8 Oct 2025 15:34:09 -0400
Page titles + login link
Diffstat:
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/internal/web/app.js b/internal/web/app.js
@@ -21,6 +21,11 @@ createApp({
mounted() {
this.initView();
},
+ watch: {
+ view() { this.updateTitle(); },
+ viewUser() { this.updateTitle(); },
+ me() { this.updateTitle(); },
+ },
methods: {
async initView() {
// Determine logged-in user
@@ -35,6 +40,7 @@ createApp({
return;
}
this.view = 'login';
+ this.updateTitle();
return;
}
this.viewUser = pathUser;
@@ -46,6 +52,15 @@ createApp({
this.view = 'public';
this.loadPublic();
}
+ this.updateTitle();
+ },
+ updateTitle() {
+ const base = 'marky';
+ if (this.view === 'public' || this.view === 'self') {
+ const u = this.view === 'self' && this.me && this.me.username ? this.me.username : this.viewUser;
+ if (u) { document.title = `${u} | ${base}`; return; }
+ }
+ document.title = base;
},
renderMarkdown(text) {
try {
diff --git a/internal/web/bookmarklet.html b/internal/web/bookmarklet.html
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>Marky Bookmarklet</title>
+ <title>bookmarklet | marky</title>
<link rel="stylesheet" href="/styles.css" />
<style>
a.btn{display:inline-block;background:#222;color:#fff;text-decoration:none;padding:10px 14px;border-radius:6px}
diff --git a/internal/web/header.html b/internal/web/header.html
@@ -36,5 +36,10 @@
<a href="/bookmarklet" title="Install the Save to Marky bookmarklet">Bookmarklet</a>
</div>
</template>
+ <template v-else>
+ <div class="user-line">
+ <a href="/" title="Log in to Marky">Log in</a>
+ </div>
+ </template>
</nav>
</header>