pages: republish in place, keeping the slug

Aperta
#9,366 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cli, javascript
Ambito
api, cli

Direzione di ricerca

Start by reading the chroxy publish command and the POST /api/pages handler, then inspect the existing page persistence and publish tests. Trace how page content, slug, title, timestamp, and authentication are handled. Done means replacement preserves the URL, missing slugs fail without creating a page, the page list still has one entry, JSON output retains its shape, and tests cover replacement, missing slugs, and auth.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

complexity: low enhancement server

Problem

chroxy publish always creates a new slug. A page that is rebuilt on a schedule (for example a monthly report) gets a new share URL every time, so:

  • the people holding the link have to be sent a new one after every rebuild, and
  • the publisher has to remember to chroxy pages rm the previous slug, or old copies stay live.

Proposal

Let a publish replace the content of an existing page and keep its slug:

chroxy publish out/index.html --replace <slug>
  • Writes the new HTML to the existing page, keeps the slug and share URL, and updates its title and timestamp.
  • Fails (non-zero exit, nothing changed) if the slug does not exist, so a typo never mints a new page by accident.
  • --json output stays the same shape as a normal publish.
  • The matching POST /api/pages call takes the slug and has the same auth as publish.
  • A way to rotate the slug on purpose stays available: publish new, then rm the old one.

Acceptance

  • Replacing a page keeps its URL working, and the URL serves the new content.
  • Replacing a slug that does not exist exits non-zero and creates nothing.
  • chroxy pages list shows one entry for the page before and after a replace.
  • Tests cover replace, a missing slug and auth.
Lingua principale
JavaScript
Stelle
7
Fork
1
Merge medio
2h 3m
PR unite (30g)
333

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di blamechris/chroxy

Tutte le issue di blamechris/chroxy

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.