Skip to content

Commit

Permalink
fix: show pathname in custom 404
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanFama592 committed Feb 9, 2024
1 parent 4eaf8ee commit 4697bc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "tic-tac-toe-world",
"version": "1.2.4",
"version": "1.2.5",
"scripts": {
"dev": "astro dev --host",
"start:build": "astro check && astro build && astro preview --host",
Expand Down
11 changes: 8 additions & 3 deletions src/pages/404.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@ import FramePage from "@/layouts/FramePage.astro";
---

<Html
title={Astro.url.pathname}
title="Pagina no encontrada"
description=""
>
<FramePage>
<div class="flex items-center justify-center size-full m-auto">
<p class="m-5 text-2xl text-center text-pretty">
Lo sentimos pero <span class="p-1 bg-base-100 rounded-md font-semibold"
>{Astro.url.pathname}</span
Lo sentimos pero <span id="pathnameSpan" class="p-1 bg-base-100 rounded-md font-semibold"
>esta pagina</span
> no existe o ha sido eliminada. No te preocupes, tenemos muchas
otras cosas que ofrecerte.
</p>
</div>
</FramePage>
</Html>

<script defer>
document.querySelector("title").innerText = document.querySelector("title").innerText + ": " + window.location.pathname
document.querySelector("#pathnameSpan").innerText = window.location.pathname
</script>

0 comments on commit 4697bc6

Please sign in to comment.