Skip to content

Commit 336ff5c

Browse files
committed
Add Pebble link-preview (Open Graph) branding to logviewer
Replace the upstream per-thread og:* tags with a fixed Pebble card (title, description, self-hosted og:image) so shared log links show consistent branding instead of leaking recipient details. Rebrand the page title and theme color, and ship a placeholder og.png to swap out. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013vqQJQAud7rmfykwWKJACY
1 parent 0f9f458 commit 336ff5c

3 files changed

Lines changed: 46 additions & 8 deletions

File tree

deploy/oracle/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,23 @@ image and injects that stylesheet as the last `<link>` in the templates, so the
133133
bot's message-rendering logic is untouched — only the appearance changes. Edit
134134
the CSS and re-run `docker compose up -d --build` to iterate on the design.
135135

136+
### Link-preview (Open Graph) branding
137+
138+
The Dockerfile also replaces the per-thread Open Graph tags with a fixed Pebble
139+
card (title, description, and image) so shared log links show consistent
140+
branding instead of leaking recipient details. The preview image is served from
141+
your own domain at `/static/img/og.png`.
142+
143+
`logviewer/static/img/og.png` is currently a **plain placeholder**. Replace it
144+
with the real image (keep the same path/filename, ideally ~1200×630 PNG/JPG),
145+
then rebuild:
146+
147+
```bash
148+
docker compose up -d --build
149+
```
150+
151+
Discord caches previews, so use Discord's link or repost to refresh the embed.
152+
136153
## Updating later
137154

138155
```bash

deploy/oracle/logviewer/Dockerfile

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,35 @@
1-
# Custom logviewer image: upstream logviewer + an Apple dark-mode skin.
1+
# Custom logviewer image: upstream logviewer + an Apple dark-mode skin and
2+
# Pebble link-preview (Open Graph) branding.
23
#
34
# We keep the upstream app and all of its message-rendering templates untouched,
4-
# and only overlay one extra stylesheet (applemode.css) that overrides the look.
5-
# The stylesheet is injected as the LAST <link> in each template so it wins the
6-
# CSS cascade — no template logic is modified.
5+
# and only overlay one extra stylesheet (applemode.css) plus replace the page
6+
# metadata. No template logic is modified.
77
FROM ghcr.io/modmail-dev/logviewer:master
88

9+
# Apple dark-mode skin + the link-preview image (served at /static/img/og.png).
910
COPY static/css/applemode.css /logviewer/static/css/applemode.css
11+
COPY static/img/og.png /logviewer/static/img/og.png
1012

11-
# Append the Apple stylesheet right before </head> in both page templates.
12-
RUN sed -i 's#</head># <link href="/static/css/applemode.css" type="text/css" rel="stylesheet" media="screen,projection" />\n</head>#' \
13-
/logviewer/templates/base.html \
14-
/logviewer/templates/logbase.html
13+
# Inject the Apple stylesheet, set the Pebble link-preview (Open Graph) tags,
14+
# and rebrand the page title. The og:* tags shown when a log link is shared
15+
# (e.g. in Discord) become a fixed Pebble card instead of leaking recipient
16+
# details — and point at our own self-hosted image so they never expire.
17+
RUN set -eux; \
18+
for f in base.html logbase.html; do \
19+
t="/logviewer/templates/$f"; \
20+
# drop the upstream per-thread og:* tags and any existing theme-color
21+
sed -i '/property=.og:/d; /name=.theme-color./d' "$t"; \
22+
# rebrand the browser/tab title
23+
sed -i 's#<title>[^<]*</title>#<title>Pebble</title>#' "$t"; \
24+
# inject our stylesheet + Open Graph card just before </head>
25+
sed -i 's@</head>@\
26+
<link href="/static/css/applemode.css" type="text/css" rel="stylesheet" media="screen,projection" />\
27+
<meta property="og:type" content="website" />\
28+
<meta property="og:site_name" content="Pebble" />\
29+
<meta property="og:title" content="Pebble" />\
30+
<meta property="og:description" content="Pebble logs are used by Plover contributors to assist in customer support inquiries." />\
31+
<meta property="og:image" content="https://pebble.getplover.com/static/img/og.png" />\
32+
<meta name="twitter:card" content="summary_large_image" />\
33+
<meta name="theme-color" content="#0A84FF" />\
34+
</head>@' "$t"; \
35+
done
3.09 KB
Loading

0 commit comments

Comments
 (0)