1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-28 09:19:37 +02:00

SEO Optimization

This commit is contained in:
Sean Morley 2024-04-20 01:17:34 +00:00
parent 348c545419
commit 7086877ba3
11 changed files with 232 additions and 148 deletions

View file

@ -51,3 +51,11 @@
/> />
{/each} {/each}
</div> </div>
<svelte:head>
<title>Featured Adventures | AdventureLog</title>
<meta
name="description"
content="Featured Adventure Locations from around the world. Add them to your visited list!"
/>
</svelte:head>

View file

@ -117,7 +117,7 @@
console.log("Success:", data); console.log("Success:", data);
// update local array with new data // update local array with new data
adventures = adventures.map((adventure) => adventures = adventures.map((adventure) =>
adventure.id === event.detail.id ? event.detail : adventure, adventure.id === event.detail.id ? event.detail : adventure
); );
editId = NaN; editId = NaN;
editName = ""; editName = "";
@ -132,7 +132,7 @@
function editAdventure(event: { detail: number }) { function editAdventure(event: { detail: number }) {
const adventure = adventures.find( const adventure = adventures.find(
(adventure) => adventure.id === event.detail, (adventure) => adventure.id === event.detail
); );
if (adventure) { if (adventure) {
editId = adventure.id; editId = adventure.id;
@ -206,7 +206,7 @@
console.log("Success:", data); console.log("Success:", data);
// remove adventure from array where id matches // remove adventure from array where id matches
adventures = adventures.filter( adventures = adventures.filter(
(adventure) => adventure.id !== event.detail, (adventure) => adventure.id !== event.detail
); );
showToast("Adventure removed successfully!"); showToast("Adventure removed successfully!");
visitCount.update((n) => n - 1); visitCount.update((n) => n - 1);
@ -312,3 +312,11 @@
</button> </button>
</div> </div>
{/if} {/if}
<svelte:head>
<title>My Log | AdventureLog</title>
<meta
name="description"
content="Displays the user's visited adventure locations."
/>
</svelte:head>

View file

@ -68,3 +68,11 @@
<!-- <footer class="text-sm">- Steve Jobs</footer> --> <!-- <footer class="text-sm">- Steve Jobs</footer> -->
</blockquote> </blockquote>
</div> </div>
<svelte:head>
<title>Login | AdventureLog</title>
<meta
name="description"
content="Login to your AdventureLog account to start logging your adventures!"
/>
</svelte:head>

View file

@ -70,3 +70,11 @@
<small class="text-center" <small class="text-center"
><b>For Debug Use:</b> UUID={user_id} Signup Date={signup_date} Role={role}</small ><b>For Debug Use:</b> UUID={user_id} Signup Date={signup_date} Role={role}</small
> >
<svelte:head>
<title>User Settings | AdventureLog</title>
<meta
name="description"
content="Update your user account settings here. Change your username, first name, last name, and profile icon."
/>
</svelte:head>

View file

@ -84,17 +84,17 @@ export const actions: Actions = {
} }
let adminUser = await db let adminUser = await db
.select() .select()
.from(userTable) .from(userTable)
.where(eq(userTable.role, 'admin')) .where(eq(userTable.role, "admin"))
.execute(); .execute();
if (adminUser != null && adminUser.length > 0) { if (adminUser != null && adminUser.length > 0) {
return fail(400, { return fail(400, {
message: "Admin user already exists", message: "Admin user already exists",
}); });
} }
await db await db
.insert(userTable) .insert(userTable)
.values({ .values({

View file

@ -1,44 +1,52 @@
<script lang="ts"> <script lang="ts">
import { enhance } from "$app/forms"; import { enhance } from "$app/forms";
</script> </script>
<h1 class="text-center font-bold text-4xl">AdventureLog Setup</h1> <h1 class="text-center font-bold text-4xl">AdventureLog Setup</h1>
<!-- centered text descripton welcomeing the user --> <!-- centered text descripton welcomeing the user -->
<p class="text-center mt-4"> <p class="text-center mt-4">
Welcome to AdventureLog! Please follow the steps below to setup your server. Welcome to AdventureLog! Please follow the steps below to setup your server.
</p> </p>
<!-- step 1 create admin user --> <!-- step 1 create admin user -->
<h2 class="text-center font-bold text-2xl mt-6">Create Admin User</h2> <h2 class="text-center font-bold text-2xl mt-6">Create Admin User</h2>
<div class="flex justify-center"> <div class="flex justify-center">
<form method="post" use:enhance class="w-full max-w-xs"> <form method="post" use:enhance class="w-full max-w-xs">
<label for="username">Username</label> <label for="username">Username</label>
<input <input
name="username" name="username"
id="username" id="username"
class="block mb-2 input input-bordered w-full max-w-xs" class="block mb-2 input input-bordered w-full max-w-xs"
/><br /> /><br />
<label for="first_name">First Name</label> <label for="first_name">First Name</label>
<input <input
name="first_name" name="first_name"
id="first_name" id="first_name"
class="block mb-2 input input-bordered w-full max-w-xs" class="block mb-2 input input-bordered w-full max-w-xs"
/><br /> /><br />
<label for="last_name">Last Name</label> <label for="last_name">Last Name</label>
<input <input
name="last_name" name="last_name"
id="last_name" id="last_name"
class="block mb-2 input input-bordered w-full max-w-xs" class="block mb-2 input input-bordered w-full max-w-xs"
/><br /> /><br />
<label for="password">Password</label> <label for="password">Password</label>
<input <input
type="password" type="password"
name="password" name="password"
id="password" id="password"
class="block mb-2 input input-bordered w-full max-w-xs" class="block mb-2 input input-bordered w-full max-w-xs"
/><br /> /><br />
<button class="py-2 px-4 btn btn-primary">Signup</button> <button class="py-2 px-4 btn btn-primary">Signup</button>
</form> </form>
</div> </div>
<svelte:head>
<title>Setup | AdventureLog</title>
<meta
name="description"
content="Setup AdventureLog with your admin account"
/>
</svelte:head>;

View file

@ -29,3 +29,11 @@
/> />
{/each} {/each}
</div> </div>
<svelte:head>
<title>Shared List by {data.name} | AdventureLog</title>
<meta
name="description"
content="Shared Adventure List from around the world. Add them to your visited list!"
/>
</svelte:head>

View file

@ -54,3 +54,11 @@
</div> </div>
<!-- username first last pass --> <!-- username first last pass -->
<svelte:head>
<title>Signup | AdventureLog</title>
<meta
name="description"
content="Signup for AdventureLog to start logging your adventures!"
/>
</svelte:head>;

View file

@ -1,27 +1,35 @@
<script lang="ts"> <script lang="ts">
import { goto } from "$app/navigation"; import { goto } from "$app/navigation";
import { getFlag } from "$lib"; import { getFlag } from "$lib";
import AdventureCard from "$lib/components/AdventureCard.svelte"; import AdventureCard from "$lib/components/AdventureCard.svelte";
export let data: any; export let data: any;
async function nav(loc: string) { async function nav(loc: string) {
goto(`/worldtravel/${loc}`); goto(`/worldtravel/${loc}`);
} }
</script> </script>
<h1 class="text-center font-bold text-4xl mb-4">Country List</h1> <h1 class="text-center font-bold text-4xl mb-4">Country List</h1>
{#each data.response as item} {#each data.response as item}
<button <button
class="btn btn-primary mr-4 mb-2" class="btn btn-primary mr-4 mb-2"
on:click={() => nav(item.country_code)} on:click={() => nav(item.country_code)}
>{item.name} >{item.name}
<img <img
src={getFlag(24, item.country_code)} src={getFlag(24, item.country_code)}
class="inline-block -mt-1 mr-1" class="inline-block -mt-1 mr-1"
alt="Flag" alt="Flag"
/></button /></button
> >
<!-- <p>Name: {item.name}, Continent: {item.continent}</p> --> <!-- <p>Name: {item.name}, Continent: {item.continent}</p> -->
{/each} {/each}
<svelte:head>
<title>WorldTravel | AdventureLog</title>
<meta
name="description"
content="Explore the world and add countries to your visited list!"
/>
</svelte:head>;

View file

@ -1,109 +1,119 @@
<script lang="ts"> <script lang="ts">
export let data; export let data;
import AdventureCard from "$lib/components/AdventureCard.svelte"; import AdventureCard from "$lib/components/AdventureCard.svelte";
import { countryCodeToName } from "$lib"; import { countryCodeToName } from "$lib";
import { getFlag } from "$lib"; import { getFlag } from "$lib";
import { goto } from "$app/navigation"; import { goto } from "$app/navigation";
import { onMount } from "svelte"; import { onMount } from "svelte";
import Us from "$lib/components/maps/US.svelte"; import Us from "$lib/components/maps/US.svelte";
let viewType: String = "cards"; let viewType: String = "cards";
function markVisited(event: { detail: string }) { function markVisited(event: { detail: string }) {
console.log(`Marked ${event.detail} as visited`); console.log(`Marked ${event.detail} as visited`);
fetch("/api/regionvisit", { fetch("/api/regionvisit", {
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
}, },
body: JSON.stringify({ body: JSON.stringify({
region_id: event.detail, region_id: event.detail,
country_code: data.countrycode, country_code: data.countrycode,
}), }),
}).then((response) => { }).then((response) => {
if (response.status === 401) { if (response.status === 401) {
goto("/login"); goto("/login");
} }
return response.json(); return response.json();
});
}
function removeVisit(event: { detail: string }) {
console.log(`Removed visit to ${event.detail}`);
fetch("/api/regionvisit", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
region_id: event.detail,
}),
}).then((response) => {
if (response.status === 401) {
goto("/login");
}
return response.json();
});
}
function setViewType(type: String) {
viewType = type;
}
onMount(() => {
console.log(data.visitedRegions);
}); });
}
function removeVisit(event: { detail: string }) {
console.log(`Removed visit to ${event.detail}`);
fetch("/api/regionvisit", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
region_id: event.detail,
}),
}).then((response) => {
if (response.status === 401) {
goto("/login");
}
return response.json();
});
}
function setViewType(type: String) {
viewType = type;
}
onMount(() => {
console.log(data.visitedRegions);
});
</script> </script>
<h1 class="text-center text-4xl font-bold"> <h1 class="text-center text-4xl font-bold">
Regions in {countryCodeToName(data.countrycode)} Regions in {countryCodeToName(data.countrycode)}
<img <img
src={getFlag(40, data.countrycode)} src={getFlag(40, data.countrycode)}
class="inline-block -mt-1 mr-1" class="inline-block -mt-1 mr-1"
alt="Flag" alt="Flag"
/> />
</h1> </h1>
<div class="join items-center justify-center flex"> <div class="join items-center justify-center flex">
<input <input
class="join-item btn btn-neutral" class="join-item btn btn-neutral"
type="radio" type="radio"
name="viewtype" name="viewtype"
checked checked
aria-label="Cards" aria-label="Cards"
on:click={() => setViewType("cards")} on:click={() => setViewType("cards")}
/> />
<input <input
class="join-item btn btn-neutral" class="join-item btn btn-neutral"
type="radio" type="radio"
name="viewtype" name="viewtype"
aria-label="Map" aria-label="Map"
on:click={() => setViewType("map")} on:click={() => setViewType("map")}
/> />
</div> </div>
{#if viewType == "cards"} {#if viewType == "cards"}
<div <div
class="grid xl:grid-cols-3 lg:grid-cols-3 md:grid-cols-2 sm:grid-cols-1 gap-4 mt-4 content-center auto-cols-auto ml-6 mr-6" class="grid xl:grid-cols-3 lg:grid-cols-3 md:grid-cols-2 sm:grid-cols-1 gap-4 mt-4 content-center auto-cols-auto ml-6 mr-6"
> >
{#each data.regions as region (region.id)} {#each data.regions as region (region.id)}
<AdventureCard <AdventureCard
type="worldtravelregion" type="worldtravelregion"
countryCode={data.countrycode} countryCode={data.countrycode}
regionId={region.id} regionId={region.id}
name={region.name} name={region.name}
on:markVisited={markVisited} on:markVisited={markVisited}
visited={data.visitedRegions.some( visited={data.visitedRegions.some(
(visitedRegion) => visitedRegion.region_id === region.id, (visitedRegion) => visitedRegion.region_id === region.id
)} )}
on:removeVisit={removeVisit} on:removeVisit={removeVisit}
/> />
{/each} {/each}
</div> </div>
{/if} {/if}
{#if viewType == "map"} {#if viewType == "map"}
{#if data.countrycode.toLowerCase() == "us"} {#if data.countrycode.toLowerCase() == "us"}
<Us on:marked={markVisited} /> <Us on:marked={markVisited} />
{/if} {/if}
{/if} {/if}
<svelte:head>
<title>{countryCodeToName(data.countrycode)} Regions | AdventureLog</title>
<meta
name="description"
content="Explore the regions in {countryCodeToName(
data.countrycode
)} and add them to your visited list!"
/>
</svelte:head>

10
static/robots.txt Normal file
View file

@ -0,0 +1,10 @@
User-agent: *
Allow: /
# Google adsbot ignores robots.txt unless specifically named!
User-agent: AdsBot-Google
Allow: /
User-agent: GPTBot
Disallow: /