Add configurable title and subtitle v0.6.1
This commit is contained in:
1 parent
47b8d42295
commit
c2640cf75a
8 files changed
+34
-9
No files matched your search
+5
-1
@@ -7,6 +7,10 @@ APP_PORT=8080
|
|||||||
|
|
||||||
# Optional settings
|
# Optional settings
|
||||||
APP_NAME=Photo Date Editor
|
APP_NAME=Photo Date Editor
|
||||||
|
# Optional visible page heading. Falls back to APP_NAME when omitted.
|
||||||
|
APP_TITLE=Mork Photo Date Editor
|
||||||
|
# Optional text shown directly below the page heading.
|
||||||
|
APP_SUBTITLE=Family photo metadata editor
|
||||||
MAX_UPLOAD_MB=150
|
MAX_UPLOAD_MB=150
|
||||||
LOG_LEVEL=INFO
|
LOG_LEVEL=INFO
|
||||||
|
|
||||||
@@ -23,4 +27,4 @@ DEFAULT_MAP_LON=11.0
|
|||||||
DEFAULT_MAP_ZOOM=5
|
DEFAULT_MAP_ZOOM=5
|
||||||
GEOCODER_URL=https://nominatim.openstreetmap.org/search
|
GEOCODER_URL=https://nominatim.openstreetmap.org/search
|
||||||
# Optional custom identification sent to the geocoder. The default uses APP_NAME, version and APP_URL.
|
# Optional custom identification sent to the geocoder. The default uses APP_NAME, version and APP_URL.
|
||||||
# GEOCODER_USER_AGENT=MorkPhotoDateEditor/0.5.0 (+https://edit.mork.fyi)
|
# GEOCODER_USER_AGENT=MorkPhotoDateEditor/0.6.1 (+https://edit.mork.fyi)
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.6.1
|
||||||
|
|
||||||
|
- Add optional `APP_TITLE` and `APP_SUBTITLE` environment variables for the visible page heading and subtitle.
|
||||||
|
- Keep `APP_NAME` backward-compatible as the title fallback and application identity.
|
||||||
|
- Update the browser tab title from the configured page title.
|
||||||
|
- Bump the application and service-worker cache version to 0.6.1.
|
||||||
|
|
||||||
## 0.6.0
|
## 0.6.0
|
||||||
|
|
||||||
- Add HEIC, HEIF, and HIF folder scanning and in-place metadata processing.
|
- Add HEIC, HEIF, and HIF folder scanning and in-place metadata processing.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Photo Date Editor
|
# Photo Date Editor
|
||||||
|
|
||||||
Version 0.6.0
|
Version 0.6.1
|
||||||
|
|
||||||
A self-hosted browser UI for manually dating scanned photographs. The browser receives temporary read/write access to a local computer or Chromebook folder, sends one image at a time to the Docker backend for ExifTool processing, and overwrites the same local file after processing.
|
A self-hosted browser UI for manually dating scanned photographs. The browser receives temporary read/write access to a local computer or Chromebook folder, sends one image at a time to the Docker backend for ExifTool processing, and overwrites the same local file after processing.
|
||||||
|
|
||||||
@@ -52,6 +52,8 @@ Example `.env`:
|
|||||||
APP_URL=https://photos.example.internal
|
APP_URL=https://photos.example.internal
|
||||||
APP_PORT=8080
|
APP_PORT=8080
|
||||||
APP_NAME=Photo Date Editor
|
APP_NAME=Photo Date Editor
|
||||||
|
APP_TITLE=Mork Photo Date Editor
|
||||||
|
APP_SUBTITLE=Family photo metadata editor
|
||||||
MAX_UPLOAD_MB=150
|
MAX_UPLOAD_MB=150
|
||||||
LOG_LEVEL=INFO
|
LOG_LEVEL=INFO
|
||||||
|
|
||||||
@@ -78,7 +80,7 @@ Replace the project files with this version and rebuild:
|
|||||||
docker compose up -d --build
|
docker compose up -d --build
|
||||||
```
|
```
|
||||||
|
|
||||||
The existing `.env` can be kept. The preview variables are optional. Browser progress from earlier releases remains compatible. A normal refresh should load the new service-worker cache; use a hard refresh if an old UI remains visible.
|
The existing `.env` can be kept. `APP_TITLE` and `APP_SUBTITLE` are optional. When `APP_TITLE` is omitted, the visible page title continues to use `APP_NAME`; the subtitle uses the built-in format description when omitted. Browser progress from earlier releases remains compatible. A normal refresh should load the new service-worker cache; use a hard refresh if an old UI remains visible.
|
||||||
|
|
||||||
## Caddy example
|
## Caddy example
|
||||||
|
|
||||||
|
|||||||
+9
-2
@@ -29,8 +29,13 @@ from pillow_heif import register_heif_opener
|
|||||||
register_heif_opener()
|
register_heif_opener()
|
||||||
|
|
||||||
APP_NAME = os.getenv("APP_NAME", "Photo Date Editor")
|
APP_NAME = os.getenv("APP_NAME", "Photo Date Editor")
|
||||||
|
APP_TITLE = os.getenv("APP_TITLE") or APP_NAME
|
||||||
|
APP_SUBTITLE = (
|
||||||
|
os.getenv("APP_SUBTITLE")
|
||||||
|
or "Local folder · in-place JPG, PNG, TIFF and HEIF metadata"
|
||||||
|
)
|
||||||
APP_URL = os.getenv("APP_URL", "http://localhost:8080")
|
APP_URL = os.getenv("APP_URL", "http://localhost:8080")
|
||||||
APP_VERSION = "0.6.0"
|
APP_VERSION = "0.6.1"
|
||||||
MAX_UPLOAD_MB = int(os.getenv("MAX_UPLOAD_MB", "150"))
|
MAX_UPLOAD_MB = int(os.getenv("MAX_UPLOAD_MB", "150"))
|
||||||
MAX_UPLOAD_BYTES = MAX_UPLOAD_MB * 1024 * 1024
|
MAX_UPLOAD_BYTES = MAX_UPLOAD_MB * 1024 * 1024
|
||||||
PREVIEW_MAX_EDGE = int(os.getenv("PREVIEW_MAX_EDGE", "2400"))
|
PREVIEW_MAX_EDGE = int(os.getenv("PREVIEW_MAX_EDGE", "2400"))
|
||||||
@@ -96,7 +101,7 @@ class FavoriteLocationInput(BaseModel):
|
|||||||
longitude: float = Field(ge=-180, le=180)
|
longitude: float = Field(ge=-180, le=180)
|
||||||
|
|
||||||
|
|
||||||
app = FastAPI(title=APP_NAME, docs_url=None, redoc_url=None)
|
app = FastAPI(title=APP_TITLE, docs_url=None, redoc_url=None)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/api/health")
|
@app.get("/api/health")
|
||||||
@@ -108,6 +113,8 @@ def health() -> dict[str, str]:
|
|||||||
def config() -> dict[str, str | int | float]:
|
def config() -> dict[str, str | int | float]:
|
||||||
return {
|
return {
|
||||||
"appName": APP_NAME,
|
"appName": APP_NAME,
|
||||||
|
"appTitle": APP_TITLE,
|
||||||
|
"appSubtitle": APP_SUBTITLE,
|
||||||
"appUrl": APP_URL,
|
"appUrl": APP_URL,
|
||||||
"version": APP_VERSION,
|
"version": APP_VERSION,
|
||||||
"maxUploadMb": MAX_UPLOAD_MB,
|
"maxUploadMb": MAX_UPLOAD_MB,
|
||||||
|
|||||||
+5
-2
@@ -20,6 +20,7 @@ const $$ = (selector) => [...document.querySelectorAll(selector)];
|
|||||||
|
|
||||||
const elements = {
|
const elements = {
|
||||||
appName: $('#app-name'),
|
appName: $('#app-name'),
|
||||||
|
appSubtitle: $('#app-subtitle'),
|
||||||
openButtons: [$('#open-folder'), $('#open-folder-top'), $('#open-folder-center')],
|
openButtons: [$('#open-folder'), $('#open-folder-top'), $('#open-folder-center')],
|
||||||
rescan: $('#rescan-folder'),
|
rescan: $('#rescan-folder'),
|
||||||
folderName: $('#folder-name'),
|
folderName: $('#folder-name'),
|
||||||
@@ -1029,8 +1030,10 @@ async function initialise() {
|
|||||||
const response = await fetch('/api/config', { cache: 'no-store' });
|
const response = await fetch('/api/config', { cache: 'no-store' });
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const config = await response.json();
|
const config = await response.json();
|
||||||
elements.appName.textContent = config.appName;
|
const pageTitle = config.appTitle || config.appName;
|
||||||
document.title = config.appName;
|
elements.appName.textContent = pageTitle;
|
||||||
|
elements.appSubtitle.textContent = config.appSubtitle;
|
||||||
|
document.title = pageTitle;
|
||||||
state.mapConfig = config;
|
state.mapConfig = config;
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<div class="brand-mark" aria-hidden="true">◫</div>
|
<div class="brand-mark" aria-hidden="true">◫</div>
|
||||||
<div>
|
<div>
|
||||||
<h1 id="app-name">Photo Date Editor</h1>
|
<h1 id="app-name">Photo Date Editor</h1>
|
||||||
<p>Local folder · in-place JPG, PNG, TIFF and HEIF metadata</p>
|
<p id="app-subtitle">Local folder · in-place JPG, PNG, TIFF and HEIF metadata</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="top-actions">
|
<div class="top-actions">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const CACHE_NAME = 'photo-date-editor-v6-0';
|
const CACHE_NAME = 'photo-date-editor-v6-1';
|
||||||
const SHELL = ['/', '/styles.css', '/app.js', '/manifest.webmanifest', '/vendor/leaflet/leaflet.css', '/vendor/leaflet/leaflet.js'];
|
const SHELL = ['/', '/styles.css', '/app.js', '/manifest.webmanifest', '/vendor/leaflet/leaflet.css', '/vendor/leaflet/leaflet.js'];
|
||||||
|
|
||||||
self.addEventListener('install', (event) => {
|
self.addEventListener('install', (event) => {
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
APP_URL: "${APP_URL:-http://localhost:8080}"
|
APP_URL: "${APP_URL:-http://localhost:8080}"
|
||||||
APP_NAME: "${APP_NAME:-Photo Date Editor}"
|
APP_NAME: "${APP_NAME:-Photo Date Editor}"
|
||||||
|
APP_TITLE: "${APP_TITLE:-}"
|
||||||
|
APP_SUBTITLE: "${APP_SUBTITLE:-}"
|
||||||
MAX_UPLOAD_MB: "${MAX_UPLOAD_MB:-150}"
|
MAX_UPLOAD_MB: "${MAX_UPLOAD_MB:-150}"
|
||||||
LOG_LEVEL: "${LOG_LEVEL:-INFO}"
|
LOG_LEVEL: "${LOG_LEVEL:-INFO}"
|
||||||
DATA_DIR: "/data"
|
DATA_DIR: "/data"
|
||||||
|
|||||||
Reference in new issue
Block a user