init ready for modification for ssg
This commit is contained in:
@ -4,6 +4,7 @@
|
|||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"start": "vite dev",
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "npm run build && wrangler pages dev",
|
"preview": "npm run build && wrangler pages dev",
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
</head>
|
</head>
|
||||||
<body data-sveltekit-preload-data="hover">
|
<body data-sveltekit-preload-data="hover" style="margin: 0px">
|
||||||
<div style="display: contents">%sveltekit.body%</div>
|
<div style="display: contents">%sveltekit.body%</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
11
src/routes/+error.svelte
Normal file
11
src/routes/+error.svelte
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<script>
|
||||||
|
import { page } from '$app/state';
|
||||||
|
|
||||||
|
console.log(page.status);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h1>{page.status} Page not found</h1>
|
||||||
|
<p>We are terribly sorry, but the page you requested doesn't exist.</p>
|
||||||
|
<a href="/"><button>Return Home Here</button></a>
|
||||||
|
</div>
|
1
src/routes/+layout.js
Normal file
1
src/routes/+layout.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const prerender = true;
|
1
src/routes/+layout.server.js
Normal file
1
src/routes/+layout.server.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const prerender = true;
|
11
src/routes/+layout.svelte
Normal file
11
src/routes/+layout.svelte
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<script>
|
||||||
|
let { children } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<header></header>
|
||||||
|
|
||||||
|
{@render children()}
|
||||||
|
|
||||||
|
<footer></footer>
|
||||||
|
|
||||||
|
<style></style>
|
13
src/routes/routes/+error.svelte
Normal file
13
src/routes/routes/+error.svelte
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<script>
|
||||||
|
import { page } from '$app/state';
|
||||||
|
|
||||||
|
console.log(page.status);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<title>The Red Deer Market - Page Not Found</title>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h1>{page.status} Page not found</h1>
|
||||||
|
<p>We are terribly sorry, but the page you requested doesn't exist.</p>
|
||||||
|
<a href="/"><button>Return Home Here</button></a>
|
||||||
|
</div>
|
1
src/routes/routes/+layout.js
Normal file
1
src/routes/routes/+layout.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const prerender = true;
|
1
src/routes/routes/+layout.server.js
Normal file
1
src/routes/routes/+layout.server.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const prerender = true;
|
184
src/routes/routes/+layout.svelte
Normal file
184
src/routes/routes/+layout.svelte
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
<script>
|
||||||
|
import FreeSite from '$lib/components/FreeSite.svelte';
|
||||||
|
import redDeerMarketLogo from '$lib/static/Red-Deer-Logo.webp';
|
||||||
|
|
||||||
|
const date = new Date();
|
||||||
|
|
||||||
|
let { children } = $props();
|
||||||
|
let isDropdownVisible = $state(false);
|
||||||
|
|
||||||
|
//makes the drop down menu visible when the mouse enters the Club Membership & Upcoming events button area
|
||||||
|
function handleMouseEnter() {
|
||||||
|
isDropdownVisible = true;
|
||||||
|
}
|
||||||
|
//makes the drop down menu invisible when the mouse leaves the Club Membership & Upcoming events button area
|
||||||
|
function handleMouseLeave() {
|
||||||
|
isDropdownVisible = false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<meta name="keywords" content="Farmer's Market Red Deer" />
|
||||||
|
<!-- <meta name="author" content=""> -->
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
|
||||||
|
<header>
|
||||||
|
<nav>
|
||||||
|
<a href="/">
|
||||||
|
<img src={redDeerMarketLogo} alt="Red Deer Market logo" />
|
||||||
|
</a>
|
||||||
|
<ul>
|
||||||
|
<li><a href="/">Home</a></li>
|
||||||
|
<li><a href="/market-history">Market History</a></li>
|
||||||
|
|
||||||
|
<li onmouseenter={handleMouseEnter} onmouseleave={handleMouseLeave} class="dropdown">
|
||||||
|
<a class="dropdown-header" href="/customer-faqs">FAQs</a>
|
||||||
|
<ul class="hide">
|
||||||
|
<li><a href="/customer-faqs">Customer FAQs</a></li>
|
||||||
|
<li><a href="/vendor-faqs">Vendor FAQs</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li><a href="/gallery">Gallery</a></li>
|
||||||
|
<li><a href="/contact-us">Contact Us</a></li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
{@render children()}
|
||||||
|
|
||||||
|
<footer>
|
||||||
|
<p>The Original Market at Red Deer {date.getFullYear()}</p>
|
||||||
|
<a href="https://g.co/kgs/hpy3hnb">
|
||||||
|
<p>Location: 100 Donald Blvd, Red Deer, AB T4N 5H5</p>
|
||||||
|
</a>
|
||||||
|
<div>
|
||||||
|
<a href="https://www.facebook.com/Marketatreddeer/">
|
||||||
|
<img src="https://www.svgrepo.com/show/452196/facebook-1.svg" alt="Facebook icon" />
|
||||||
|
Facebook
|
||||||
|
</a>
|
||||||
|
<a href="https://g.co/kgs/hpy3hnb">
|
||||||
|
<img
|
||||||
|
src="https://www.svgrepo.com/show/375444/google-maps-platform.svg"
|
||||||
|
alt="Google Maps icon"
|
||||||
|
/>
|
||||||
|
Google Maps
|
||||||
|
</a>
|
||||||
|
<a href="https://google.com">
|
||||||
|
<img src="https://www.svgrepo.com/show/491226/email.svg" alt="Email icon" />
|
||||||
|
Email
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<FreeSite />
|
||||||
|
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--nav-background-colour: rgb(101, 140, 96);
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
padding: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav {
|
||||||
|
background-color: var(--nav-background-colour);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
padding-left: 2svw;
|
||||||
|
overflow: visible;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav ul {
|
||||||
|
list-style-type: none;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-self: center;
|
||||||
|
justify-self: center;
|
||||||
|
margin: 0svh auto;
|
||||||
|
padding: 0px;
|
||||||
|
column-gap: 1svw;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav ul a {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
border: 1px solid white;
|
||||||
|
align-items: center;
|
||||||
|
padding: 2svh 1svw;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav ul a:hover {
|
||||||
|
background-color: gray;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav ul li ul {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav img {
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown {
|
||||||
|
position: relative;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: column;
|
||||||
|
text-align: center;
|
||||||
|
text-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown a {
|
||||||
|
cursor: pointer;
|
||||||
|
width: 130px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hide {
|
||||||
|
visibility: hidden;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
|
background-color: var(--nav-background-colour);
|
||||||
|
top: 100%;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* makes dropdown visible */
|
||||||
|
.dropdown:hover .hide {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
display: flex;
|
||||||
|
background-color: rgba(34, 34, 34, 0.9);
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
row-gap: 2svh;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer div {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-self: stretch;
|
||||||
|
justify-content: space-evenly;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer div a {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer div a img {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
</style>
|
8
src/routes/routes/+page.svelte
Normal file
8
src/routes/routes/+page.svelte
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<title>The Red Deer Market - Home</title>
|
||||||
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Welcome to the home page of Red Deer Market. Proudly celebrating its 55th year. Great vendors and wonderful customers. See you at the Market!"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<h1>Welcome to SvelteKit</h1>
|
||||||
|
<p>Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation</p>
|
@ -1,4 +1,4 @@
|
|||||||
import adapter from "@sveltejs/adapter-cloudflare";
|
import adapter from '@sveltejs/adapter-cloudflare';
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config} */
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
const config = {
|
const config = {
|
||||||
@ -6,7 +6,19 @@ const config = {
|
|||||||
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
|
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
|
||||||
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
||||||
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
|
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
|
||||||
adapter: adapter()
|
adapter: adapter(),
|
||||||
|
prerender: {
|
||||||
|
entries: ['*'],
|
||||||
|
handleHttpError: 'ignore'
|
||||||
|
|
||||||
|
// default options are shown. On some platforms
|
||||||
|
// these options are set automatically — see below
|
||||||
|
// pages: 'build',
|
||||||
|
// assets: 'build',
|
||||||
|
// fallback: 'plaintext'
|
||||||
|
// precompress: false,
|
||||||
|
// strict: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user