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

Aberta Para iniciantes
#77 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
1/5
Tempo estimado
Menos de uma hora
Facilidade para iniciantes
88/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
css, html, javascript
Domínio
frontend

Direção de pesquisa

A issue pede um novo 404.html na raiz do repositório, que o GitHub Pages serve para caminhos desconhecidos. Leia index.html e css/style.css para reutilizar o visual do site, e use caminhos absolutos como /Static_Chess/css/style.css e /Static_Chess/ para que os links funcionem em qualquer profundidade. Está pronto quando uma URL desconhecida em /Static_Chess/ exibe uma página estilizada com um link funcional de volta ao jogo; confirme que a resposta continua sendo 404 e execute npm test.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
JavaScript
Estrelas
4
Forks
2
Merge médio
4h 8min
PRs com merge (30d)
1

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/Static_Chess

Todas as issues de TMHSDigital/Static_Chess

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.