No custom 404 page: unknown URLs show GitHub's generic page with no way back

Aperta Adatta ai principianti
#77 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
88/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
css, html, javascript
Ambito
frontend

Direzione di ricerca

L'issue chiede un nuovo 404.html nella radice del repository, che GitHub Pages serve per i percorsi sconosciuti. Leggi index.html e css/style.css per riutilizzare l'aspetto del sito, e usa percorsi assoluti come /Static_Chess/css/style.css e /Static_Chess/ così che i link funzionino a qualsiasi profondità. È completato quando un URL sconosciuto sotto /Static_Chess/ mostra una pagina con stile e un link funzionante per tornare al gioco; verifica che la risposta resti 404 ed esegui npm test.

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

Descrizione

enhancement good first issue severity: low

Summary

The site has no 404.html, so a mistyped or outdated URL under /Static_Chess/ shows GitHub's generic "File not found" page, which has no link back to the game.

Where

  • 404.html does not exist in the repository root
  • Live example: https://tmhsdigital.github.io/Static_Chess/nope-404

Details

The Pages API reports custom_404: false. The page served for an unknown path is titled "Page not found · GitHub Pages" and contains no link to any URL on this site.

Impact

A visitor who follows a broken link has to edit the address by hand to reach the game.

Steps to reproduce

  1. Open https://tmhsdigital.github.io/Static_Chess/nope-404.

Suggested fix

Add a small 404.html at the repository root that uses the site's stylesheet and links to the game. GitHub Pages serves it for unknown paths at any depth, so use absolute paths in it (/Static_Chess/css/style.css, /Static_Chess/), because relative ones break for URLs such as /Static_Chess/a/b.

Acceptance criteria

  • An unknown URL under /Static_Chess/ shows a page in the site's style with a working link to the game
  • The response status is still 404

Getting started

  • Relevant files: index.html, css/style.css
  • How to run tests: npm test, npm run format

Filed by repo-audit/pages-audit at 0144de7. Severity: low. Effort: S. audit-key: enhancement|404.html|custom-404

Lingua principale
JavaScript
Stelle
4
Fork
2
Merge medio
4h 8m
PR unite (30g)
1

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 TMHSDigital/Static_Chess

Tutte le issue di TMHSDigital/Static_Chess

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.