@edgedev/create-edge-site 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,9 @@
1
1
  <script setup>
2
- import ScrollReveal from 'scrollreveal'
3
2
  import { onMounted } from 'vue'
4
3
 
5
- function initObserver() {
4
+ onMounted(async () => {
5
+ const ScrollReveal = (await import('scrollreveal')).default
6
+
6
7
  const rows = document.querySelectorAll('.sr-row')
7
8
 
8
9
  const observer = new IntersectionObserver((entries, obs) => {
@@ -21,18 +22,14 @@ function initObserver() {
21
22
  reset: false,
22
23
  })
23
24
 
24
- obs.unobserve(row) // only trigger once
25
+ obs.unobserve(row)
25
26
  }
26
27
  })
27
28
  }, {
28
- threshold: 0.3, // only trigger when 30% of the row is visible
29
+ threshold: 0.3,
29
30
  })
30
31
 
31
32
  rows.forEach(row => observer.observe(row))
32
- }
33
-
34
- onMounted(() => {
35
- initObserver()
36
33
  })
37
34
  </script>
38
35
 
@@ -15,7 +15,7 @@ const scrollReveal: ObjectDirective = {
15
15
 
16
16
  const observer = new IntersectionObserver(
17
17
  ([entry]) => {
18
- if (entry.isIntersecting) {
18
+ if (entry && entry.isIntersecting) {
19
19
  setTimeout(() => {
20
20
  el.classList.remove('opacity-0', 'translate-y-8')
21
21
  el.classList.add('opacity-100', 'translate-y-0')
@@ -30,7 +30,7 @@ onMounted(() => {
30
30
  <Head>
31
31
  <Title>Edge Website - An awesome Edge website</Title>
32
32
  <Meta name="description" content="This is an Edge website template" />
33
- <Link rel="canonical" href="https://edgemarketingdesign.com/" />
33
+ <Link rel="canonical" href="https://edgemarketingdesign.com/contact" />
34
34
  </Head>
35
35
 
36
36
  <titleSection
@@ -8,7 +8,7 @@ onMounted(() => {
8
8
  <Head>
9
9
  <Title>Edge Website - An awesome Edge website</Title>
10
10
  <Meta name="description" content="This is an Edge website template" />
11
- <Link rel="canonical" href="https://edgemarketingdesign.com/" />
11
+ <Link rel="canonical" href="https://edgemarketingdesign.com/stuff" />
12
12
  </Head>
13
13
 
14
14
  <titleSection
package/nuxt.config.ts CHANGED
@@ -2,6 +2,9 @@ import process from 'node:process'
2
2
  import { defineNuxtConfig } from 'nuxt/config'
3
3
 
4
4
  export default defineNuxtConfig({
5
+ future: {
6
+ compatibilityVersion: 4,
7
+ },
5
8
  ssr: true,
6
9
  nitro: {
7
10
  preset: 'cloudflare-pages',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgedev/create-edge-site",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Create Edge Starter Site",
5
5
  "bin": {
6
6
  "create-edge-site": "./bin/cli.js"
@@ -1,7 +1,7 @@
1
1
  import fs from 'node:fs/promises'
2
2
  import path from 'node:path'
3
3
 
4
- const rootFolder = 'public/images'
4
+ const rootFolder = '../public/images'
5
5
  const output = {}
6
6
 
7
7
  async function scanFolder(dirPath) {
@@ -1,3 +1,5 @@
1
+ import { readFile } from 'fs/promises'
2
+ import { join } from 'path'
1
3
  export default defineEventHandler(async (event) => {
2
4
  const rawParam = event.context.params?.path;
3
5
  const pathSegments = Array.isArray(rawParam)
@@ -9,8 +11,9 @@ export default defineEventHandler(async (event) => {
9
11
  const requestedPath = pathSegments.join('/');
10
12
 
11
13
  try {
12
- const manifestModule = await import('~/public/images/image-manifest.json');
13
- const manifest = manifestModule.default;
14
+ const manifestPath = join(process.cwd(), 'public/images/image-manifest.json');
15
+ const raw = await readFile(manifestPath, 'utf-8');
16
+ const manifest = JSON.parse(raw);
14
17
 
15
18
  if (!manifest || typeof manifest !== 'object') {
16
19
  return sendError(event, createError({
@@ -1,7 +1,11 @@
1
+ import { readFile } from 'fs/promises'
2
+ import { join } from 'path'
3
+
1
4
  export default defineEventHandler(async (event) => {
2
5
  try {
3
- const manifestModule = await import('~/public/images/image-manifest.json');
4
- const manifest = manifestModule.default;
6
+ const manifestPath = join(process.cwd(), 'public/images/image-manifest.json');
7
+ const raw = await readFile(manifestPath, 'utf-8');
8
+ const manifest = JSON.parse(raw);
5
9
 
6
10
  return { images: manifest };
7
11
  } catch (err) {
@@ -1,4 +1,4 @@
1
- import { getKVValue } from '~/server/utils/getKV'
1
+ import { getKVValue } from '../../../server/utils/getKV'
2
2
 
3
3
  export default defineEventHandler(async (event) => {
4
4
  const { key } = getRouterParams(event)
@@ -0,0 +1,33 @@
1
+ export default defineEventHandler(async (event) => {
2
+ const host =
3
+ event.node?.req?.headers?.host ||
4
+ event.req?.headers?.['host'] ||
5
+ 'localhost'
6
+
7
+ const protocol = host.startsWith('localhost') ? 'http' : 'https'
8
+ const baseURL = `${protocol}://${host.replace(/^www\./, '')}`
9
+
10
+ // Your routes here
11
+ const routes = [
12
+ '', // homepage
13
+ 'stuff',
14
+ 'contact',
15
+ ]
16
+
17
+ const sitemap = `<?xml version="1.0" encoding="UTF-8"?>
18
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
19
+ ${routes
20
+ .map(
21
+ (path) => `
22
+ <url>
23
+ <loc>${baseURL}/${path}</loc>
24
+ <changefreq>monthly</changefreq>
25
+ <priority>0.7</priority>
26
+ </url>`
27
+ )
28
+ .join('')}
29
+ </urlset>`
30
+
31
+ event.node.res.setHeader('Content-Type', 'application/xml')
32
+ return sitemap
33
+ })
@@ -1,27 +1,27 @@
1
1
  /** @type {import('tailwindcss').Config} */
2
2
  export default {
3
- content: [
4
- "./components/**/*.{vue,js,ts}",
5
- "./layouts/**/*.{vue,js,ts}",
6
- "./pages/**/*.{vue,js,ts}",
7
- "./app.vue",
8
- ],
9
- theme: {
10
- extend: {
11
- colors: {
12
- dblue: "#30464C", // Dark Blue
13
- mblue: "#46616F", // Medium Blue
14
- lgray: "#A2A8AE", // Light Gray
15
- lblue: "#87B4B7", // Light Blue
16
- burntorange: "#B65B33", // Burnt Orange
17
- tan: "#BDA86A", // Tan
18
- cream: "#D9D0C4", // Cream
19
- },
20
- fontFamily: {
21
- sans: ["Overpass", "sans-serif"],
22
- serif: ["Rokkitt", "serif"],
23
- },
3
+ content: [
4
+ './app/components/**/*.{vue,js,ts}',
5
+ './app/layouts/**/*.{vue,js,ts}',
6
+ './app/pages/**/*.{vue,js,ts}',
7
+ './app/app.vue',
8
+ ],
9
+ theme: {
10
+ extend: {
11
+ colors: {
12
+ dblue: '#30464C', // Dark Blue
13
+ mblue: '#46616F', // Medium Blue
14
+ lgray: '#A2A8AE', // Light Gray
15
+ lblue: '#87B4B7', // Light Blue
16
+ burntorange: '#B65B33', // Burnt Orange
17
+ tan: '#BDA86A', // Tan
18
+ cream: '#D9D0C4', // Cream
19
+ },
20
+ fontFamily: {
21
+ sans: ['Overpass', 'sans-serif'],
22
+ serif: ['Rokkitt', 'serif'],
24
23
  },
25
24
  },
26
- plugins: [],
27
- };
25
+ },
26
+ plugins: [],
27
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes