tecitheme 0.0.18 → 0.0.21

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.
@@ -5,27 +5,27 @@
5
5
  </script>
6
6
 
7
7
  <!-- This example requires Tailwind CSS v2.0+ -->
8
- <div class="w-full text-center">
9
- {#if data.toptext}
10
- <p class="text-base font-semibold text-teci-blue-dark uppercase">
11
- {data.toptext}
12
- </p>
13
- {/if}
14
- {#if (data.title || data.logo)}
15
- {#if data.logo}
16
- <div class="grid place-items-center">
17
- <h1 class="sr-only">{data.title}</h1>
18
- <Icon classes={data.classes} icon={data.logo} />
19
- </div>
20
- {:else}
21
- <h1 class="mt-1 text-4xl font-bold text-gray-900 sm:text-5xl sm:tracking-tight lg:text-6xl">
22
- {data.title}
23
- </h1>
24
- {/if}
25
- {/if}
26
- {#if data.subtitle}
27
- <p class="max-w-4xl mt-5 mx-auto text-xl text-gray-500">
28
- {data.subtitle}
8
+ <section class="w-full text-center">
9
+ {#if data.toptext}
10
+ <p class="text-base font-semibold text-teci-blue-dark uppercase">
11
+ {data.toptext}
29
12
  </p>
13
+ {/if}
14
+ {#if (data.title || data.logo)}
15
+ {#if data.logo}
16
+ <div class="grid place-items-center">
17
+ <h1 class="sr-only">{data.title}</h1>
18
+ <Icon classes={data.classes} icon={data.logo} />
19
+ </div>
20
+ {:else}
21
+ <h1 class="mt-1 text-4xl font-bold text-gray-900 sm:text-5xl sm:tracking-tight lg:text-6xl">
22
+ {data.title}
23
+ </h1>
30
24
  {/if}
31
- </div>
25
+ {/if}
26
+ {#if data.subtitle}
27
+ <p class="max-w-4xl mt-5 mx-auto text-xl text-gray-500">
28
+ {data.subtitle}
29
+ </p>
30
+ {/if}
31
+ </section>
@@ -4,16 +4,18 @@ import Video from './Video.svelte'
4
4
  export let data;
5
5
  </script>
6
6
 
7
- <section class="w-full mx-auto flex flex-col md:flex-row items-center justify-center">
7
+ <section class="w-full mx-auto flex flex-col md:flex-row items-start justify-center">
8
8
  {#if data.v}
9
- <div class="w-full max-w-xl {data.position === 'right' ? 'mb-4 md:mb-0' : 'mb-0'}">
9
+ <div class="block w-full max-w-xl {data.position === 'right' ? 'mb-4 md:mb-0' : 'mb-0'}">
10
10
  <Video bind:data />
11
11
  </div>
12
12
  {:else if data.image}
13
- <div class="block w-full max-w-xl mb-4 md:mb-0">
13
+ <div class="block w-full max-w-xl {data.position === 'right' ? 'mb-4 md:mb-0' : 'mb-0'}">
14
14
  <figure>
15
15
  <a href={data.image}>
16
- <img class="aspect-video object-cover" src={data.image} alt={data.name}/>
16
+ <img class="w-full aspect-video object-cover border bg-black border-gray-200 shadow-md {data.imageClass ? data.imageClass : ''}"
17
+ src={data.image} alt={data.name}
18
+ />
17
19
  </a>
18
20
  </figure>
19
21
  </div>
@@ -0,0 +1,28 @@
1
+ <script>
2
+ export let title
3
+ export let description
4
+ export let image
5
+ export let url
6
+
7
+ function imageURL(str)
8
+ {
9
+ var tarea = str;
10
+ if (tarea.indexOf("http://") == 0 || tarea.indexOf("https://") == 0) {
11
+ return true
12
+ }
13
+ return false
14
+ }
15
+ </script>
16
+
17
+ <meta property="og:type" content="website">
18
+ <meta property="og:url" content="{url.href}">
19
+ <meta name="og:title" content={title} >
20
+ <meta name="og:description" content={description} >
21
+ {#if imageURL(image)}
22
+ <meta name="og:image" content="{image}" >
23
+ {:else}
24
+ <meta name="og:image" content="https://{url.hostname}{image}" >
25
+ {/if}
26
+ <meta name="twitter:card" content="summary_large_image">
27
+ <meta name="twitter:site" content="@thunderheadeng">
28
+ <meta name="twitter:creator" content="@thunderheadeng">
@@ -0,0 +1,29 @@
1
+ /** @typedef {typeof __propDef.props} MetaSocialProps */
2
+ /** @typedef {typeof __propDef.events} MetaSocialEvents */
3
+ /** @typedef {typeof __propDef.slots} MetaSocialSlots */
4
+ export default class MetaSocial extends SvelteComponentTyped<{
5
+ title: any;
6
+ description: any;
7
+ image: any;
8
+ url: any;
9
+ }, {
10
+ [evt: string]: CustomEvent<any>;
11
+ }, {}> {
12
+ }
13
+ export type MetaSocialProps = typeof __propDef.props;
14
+ export type MetaSocialEvents = typeof __propDef.events;
15
+ export type MetaSocialSlots = typeof __propDef.slots;
16
+ import { SvelteComponentTyped } from "svelte";
17
+ declare const __propDef: {
18
+ props: {
19
+ title: any;
20
+ description: any;
21
+ image: any;
22
+ url: any;
23
+ };
24
+ events: {
25
+ [evt: string]: CustomEvent<any>;
26
+ };
27
+ slots: {};
28
+ };
29
+ export {};
@@ -1,32 +1,33 @@
1
1
  <script>
2
- import { DateTime } from "luxon";
2
+ import { DateTime } from 'luxon';
3
3
  import { getContext } from 'svelte';
4
- import { paginate, LightPaginationNav } from 'svelte-paginate'
4
+ import { paginate, PaginationNav } from 'svelte-paginate';
5
5
 
6
6
  export let data;
7
7
 
8
8
  const posts = getContext('newsPosts');
9
+
9
10
  let filteredPosts = [];
10
11
  let items = [];
11
12
  let currentPage = 1;
12
13
  let pageSize = data.pageSize;
13
14
 
14
15
  function termExists(arr, terms) {
15
- return terms.some(value => {
16
- return arr.includes(value)
16
+ return terms.some((value) => {
17
+ return arr.includes(value);
17
18
  });
18
19
  }
19
20
 
20
21
  function filterPosts(arr, terms) {
21
- for (let i = 0; i < arr.length;) {
22
+ for (let i = 0; i < arr.length; ) {
22
23
  if (termExists(arr[i].meta.categories, terms)) {
23
24
  i++;
24
- continue
25
- };
26
- arr.splice(i,1)
27
- };
25
+ continue;
26
+ }
27
+ arr.splice(i, 1);
28
+ }
28
29
  return arr;
29
- };
30
+ }
30
31
 
31
32
  if (data.filter) {
32
33
  items = filterPosts(posts, data.filter);
@@ -34,40 +35,90 @@
34
35
  items = posts;
35
36
  }
36
37
 
37
- $: paginatedItems = paginate({ items, pageSize, currentPage })
38
+ $: paginatedItems = paginate({ items, pageSize, currentPage });
38
39
  </script>
39
40
 
40
41
  <div class="relative mx-auto w-full">
41
- <div class="flex flex-col sm:flex-row justify-between sm:items-end space-y-4 sm:space-y-0 pb-4 border-b-2 border-gray-200">
42
+ <div
43
+ class="flex flex-col justify-between space-y-4 border-b-2 border-gray-200 pb-4 sm:flex-row sm:items-end sm:space-y-0"
44
+ >
42
45
  <div>
43
- <h1 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">{data.title}</h1>
46
+ <h1 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">
47
+ {data.title}
48
+ </h1>
44
49
  <p class="text-xl text-gray-500">{data.subtitle}</p>
45
50
  </div>
46
51
  <div class="w-32">
47
- <data id="mj-w-res-data" data-token="f594659941689957f270ca278a80dc7d" class="mj-w-data" data-apikey="3aOX" data-w-id="Fbu" data-lang="en_US" data-base="https://app.mailjet.com" data-width="640" data-height="480" data-statics="statics"></data>
48
- <button class="w-full flex items-center justify-center px-4 py-2 border border-transparent text-base leading-6 font-medium text-white hover:bg-teci-blue-dark bg-teci-blue-light focus:outline-none focus:border-teci-blue-dark transition duration-150 ease-in-out" data-token="f594659941689957f270ca278a80dc7d" onclick="mjOpenPopin(event, this)">Subscribe</button>
52
+ <data
53
+ id="mj-w-res-data"
54
+ data-token="f594659941689957f270ca278a80dc7d"
55
+ class="mj-w-data"
56
+ data-apikey="3aOX"
57
+ data-w-id="Fbu"
58
+ data-lang="en_US"
59
+ data-base="https://app.mailjet.com"
60
+ data-width="640"
61
+ data-height="480"
62
+ data-statics="statics"></data>
63
+ <button
64
+ class="flex w-full items-center justify-center border border-transparent bg-teci-blue-light px-4 py-2 text-base font-medium leading-6 text-white transition duration-150 ease-in-out hover:bg-teci-blue-dark focus:border-teci-blue-dark focus:outline-none"
65
+ data-token="f594659941689957f270ca278a80dc7d"
66
+ onclick="mjOpenPopin(event, this)">Subscribe</button
67
+ >
49
68
  </div>
50
69
  </div>
51
- <div class="mt-6 grid gap-16 pt-10 md:grid-cols-2 lg:grid-cols-3 lg:gap-x-5 lg:gap-y-12">
70
+ <div class="paginator mx-auto flex justify-center pt-4">
71
+ <PaginationNav
72
+ totalItems="{items.length}"
73
+ pageSize="{pageSize ? pageSize : 6}"
74
+ currentPage="{currentPage}"
75
+ limit="{1}"
76
+ showStepOptions="{true}"
77
+ on:setPage="{(e) => (currentPage = e.detail.page)}"
78
+ />
79
+ </div>
80
+ <div
81
+ class="grid gap-16 pt-8 md:grid-cols-2 lg:grid-cols-3 lg:gap-x-5 lg:gap-y-12"
82
+ >
52
83
  {#each paginatedItems as post}
53
- <a class="block h-full" href={post.path}>
54
- <div class="flex flex-col items-stretch h-full">
55
- <time class="block mb-1 text-sm text-gray-500" datetime={post.meta.date}>{DateTime.fromISO(post.meta.date).toLocaleString()}</time>
56
- <p class="mb-2 text-xl font-semibold text-gray-900">{post.meta.title}</p>
57
- <p class="flex-1 mb-2 text-base text-gray-500">{post.meta.summary.length > 190 ? post.meta.summary.substring(0,190) + " ..." : post.meta.summary}</p>
58
- <p class="text-sm font-semibold text-teci-blue-light hover:text-teci-blue-dark">Read full article<span aria-hidden="true">&nbsp;→</span></p>
59
- </div>
60
- </a>
84
+ <a class="block h-full" href="{post.path}">
85
+ <div class="flex h-full flex-col items-stretch">
86
+ <time
87
+ class="mb-1 block text-sm text-gray-500"
88
+ datetime="{post.meta.date}"
89
+ >{DateTime.fromISO(post.meta.date).toLocaleString()}</time
90
+ >
91
+ <p class="mb-2 text-xl font-semibold text-gray-900">
92
+ {post.meta.title}
93
+ </p>
94
+ {#if post.meta.summary}
95
+ <p class="mb-2 flex-1 text-base text-gray-500">
96
+ {post.meta.summary.length > 190
97
+ ? post.meta.summary.substring(0, 190) + ' ...'
98
+ : post.meta.summary}
99
+ </p>
100
+ {:else}
101
+ <p class="mb-2 flex-1 text-base text-red-500">
102
+ Missing Summary Text
103
+ </p>
104
+ {/if}
105
+ <p
106
+ class="text-sm font-semibold text-teci-blue-light hover:text-teci-blue-dark"
107
+ >
108
+ Read full article<span aria-hidden="true">&nbsp;→</span>
109
+ </p>
110
+ </div>
111
+ </a>
61
112
  {/each}
62
113
  </div>
63
- <div class="pt-8 w-auto max-w-sm mx-auto">
64
- <LightPaginationNav
114
+ <div class="paginator mx-auto flex justify-center pt-8">
115
+ <PaginationNav
65
116
  totalItems="{items.length}"
66
117
  pageSize="{pageSize ? pageSize : 6}"
67
118
  currentPage="{currentPage}"
68
119
  limit="{1}"
69
120
  showStepOptions="{true}"
70
- on:setPage="{(e) => currentPage = e.detail.page}"
121
+ on:setPage="{(e) => (currentPage = e.detail.page)}"
71
122
  />
72
123
  </div>
73
124
  </div>
@@ -26,11 +26,13 @@
26
26
  <section bind:clientWidth={w} class="relative flex flex-row { data.fullWidth ? 'mx-0' : 'mx-auto'} {(data.toc || data.rightRail) ? 'md:space-x-8' : 'space-x-0'}">
27
27
 
28
28
  <div id="content" class="prose w-full { data.fullWidth ? 'max-w-none' : 'max-w-prose'}">
29
+ {#if !data.hideTitle}
29
30
  <h1>{title}</h1>
30
- {#if formattedDate}
31
- <p>Published: {formattedDate}{#if (formattedLastModDate != formattedDate && formattedLastModDate)}, Updated: {formattedLastModDate}{/if}</p>
32
31
  {/if}
33
32
  <slot />
33
+ {#if (formattedDate && data.showDate)}
34
+ <p class="text-sm">Published: {formattedDate}{#if (formattedLastModDate != formattedDate && formattedLastModDate)}, Updated: {formattedLastModDate}{/if}</p>
35
+ {/if}
34
36
  </div>
35
37
  <aside class="relative w-0 {(data.toc || data.rightRail) ? 'md:w-60' : 'hidden'}">
36
38
  {#if data.toc}
@@ -7,13 +7,13 @@
7
7
  </script>
8
8
 
9
9
  <!-- This example requires Tailwind CSS v2.0+ -->
10
- <div class="mx-auto w-full">
10
+ <section class="mx-auto w-full">
11
11
  {#if data.title}
12
12
  <h2 class="sr-only">{data.title}</h2>
13
13
  {/if}
14
- <dl class="space-y-10 sm:grid sm:grid-cols-2 sm:gap-8 sm:space-y-0 md:grid-cols-3">
14
+ <div class="grid grid-cols-1 gap-4 md:grid-cols-3">
15
15
  {#each data.cards as card}
16
16
  <Card bind:data={card} bind:halfHeight={data.halfHeight} />
17
17
  {/each}
18
- </dl>
19
- </div>
18
+ </div>
19
+ </section>
@@ -1,4 +1,6 @@
1
1
  <script>
2
+ import {page} from "$app/stores"
3
+
2
4
  import CTA from '../components/CTA.svelte';
3
5
  import HeadingCentered from '../components/HeadingCentered.svelte';
4
6
  import MediaFeature from '../components/MediaFeature.svelte';
@@ -8,6 +10,7 @@
8
10
  import ThreeColumn from '../components/ThreeColumn.svelte';
9
11
  import TrialForm from '../components/TrialForm.svelte';
10
12
  import Video from '../components/Video.svelte';
13
+ import MetaSocial from '../components/MetaSocial.svelte';
11
14
 
12
15
  let blocks = [
13
16
  {ref: "cta-center", component: CTA},
@@ -25,13 +28,23 @@
25
28
  export let date;
26
29
  export let lastmod;
27
30
  export let summary;
31
+ export let images = [];
28
32
  export let layout;
29
33
  export let page_sections;
34
+
35
+ let featuredImage;
36
+
37
+ if (images.length > 0) {
38
+ featuredImage = images[0]
39
+ } else {
40
+ featuredImage = "https://www.thunderheadeng.com/wp-content/uploads/2022/01/femtc-brno.jpg"
41
+ }
30
42
  </script>
31
43
 
32
44
  <svelte:head>
33
45
  <title>{title} | Thunderhead Engineering</title>
34
46
  <meta name="description" content={summary}>
47
+ <MetaSocial title={title} description={summary} image={featuredImage} url={$page.url} />
35
48
  </svelte:head>
36
49
 
37
50
  <article class="flex flex-col space-y-12 {layout}">
@@ -2,12 +2,13 @@
2
2
  /** @typedef {typeof __propDef.events} BlocksEvents */
3
3
  /** @typedef {typeof __propDef.slots} BlocksSlots */
4
4
  export default class Blocks extends SvelteComponentTyped<{
5
+ summary: any;
5
6
  title: any;
6
7
  date: any;
7
8
  lastmod: any;
8
- summary: any;
9
9
  layout: any;
10
10
  page_sections: any;
11
+ images?: any[];
11
12
  }, {
12
13
  [evt: string]: CustomEvent<any>;
13
14
  }, {
@@ -20,12 +21,13 @@ export type BlocksSlots = typeof __propDef.slots;
20
21
  import { SvelteComponentTyped } from "svelte";
21
22
  declare const __propDef: {
22
23
  props: {
24
+ summary: any;
23
25
  title: any;
24
26
  date: any;
25
27
  lastmod: any;
26
- summary: any;
27
28
  layout: any;
28
29
  page_sections: any;
30
+ images?: any[];
29
31
  };
30
32
  events: {
31
33
  [evt: string]: CustomEvent<any>;
package/package.json CHANGED
@@ -1,50 +1,47 @@
1
1
  {
2
2
  "name": "tecitheme",
3
- "version": "0.0.18",
3
+ "version": "0.0.21",
4
4
  "svelte": true,
5
5
  "devDependencies": {
6
6
  "@jsdevtools/rehype-toc": "^3.0.2",
7
- "@sveltejs/adapter-auto": "next",
8
7
  "@sveltejs/adapter-netlify": "next",
9
8
  "@sveltejs/kit": "next",
10
9
  "@tailwindcss/forms": "^0.5.1",
11
10
  "@tailwindcss/typography": "^0.5.2",
12
11
  "@types/cookie": "^0.5.1",
13
- "@typescript-eslint/eslint-plugin": "^5.19.0",
14
- "@typescript-eslint/parser": "^5.22.0",
12
+ "@typescript-eslint/eslint-plugin": "^5.27.0",
13
+ "@typescript-eslint/parser": "^5.27.0",
15
14
  "autoprefixer": "^10.4.7",
16
- "dotenv": "^16.0.0",
15
+ "dotenv": "^16.0.1",
17
16
  "encoding": "^0.1.13",
18
- "eslint": "^8.14.0",
17
+ "eslint": "^8.16.0",
19
18
  "eslint-config-prettier": "^8.5.0",
20
- "eslint-plugin-svelte3": "^3.4.1",
21
- "luxon": "^2.3.2",
22
- "mdsvex": "^0.10.5",
23
- "postcss": "^8.4.13",
19
+ "eslint-plugin-svelte3": "^4.0.0",
20
+ "luxon": "^2.4.0",
21
+ "mdsvex": "^0.10.6",
22
+ "postcss": "^8.4.14",
24
23
  "prettier": "^2.6.2",
25
- "prettier-plugin-tailwindcss": "^0.1.10",
24
+ "prettier-plugin-tailwindcss": "^0.1.11",
26
25
  "rehype-parse": "^8.0.4",
27
26
  "rehype-slug": "^5.0.1",
28
27
  "rehype-stringify": "^9.0.3",
29
28
  "stream": "^0.0.2",
30
29
  "svelte": "^3.48.0",
31
- "svelte-check": "^2.7.0",
32
- "svelte-cubed": "^0.2.1",
30
+ "svelte-check": "^2.7.1",
33
31
  "svelte-paginate": "^0.0.1",
34
32
  "svelte-preprocess": "^4.10.6",
35
- "svelte2tsx": "^0.5.9",
33
+ "svelte2tsx": "^0.5.10",
36
34
  "tailwindcss": "^3.0.24",
37
- "three": "^0.140.0",
38
35
  "tslib": "^2.4.0",
39
- "typescript": "^4.6.4",
40
- "vite": "^2.9.8",
36
+ "typescript": "^4.7.2",
37
+ "vite": "^2.9.9",
41
38
  "vite-plugin-autoimport": "^1.6.6"
42
39
  },
43
40
  "type": "module",
44
41
  "dependencies": {
45
42
  "@lukeed/uuid": "^2.0.0",
46
43
  "cookie": "^0.5.0",
47
- "katex": "^0.15.3"
44
+ "katex": "^0.15.6"
48
45
  },
49
46
  "exports": {
50
47
  "./package.json": "./package.json",
@@ -61,6 +58,7 @@
61
58
  "./components/Icon.svelte": "./components/Icon.svelte",
62
59
  "./components/Math.svelte": "./components/Math.svelte",
63
60
  "./components/MediaFeature.svelte": "./components/MediaFeature.svelte",
61
+ "./components/MetaSocial.svelte": "./components/MetaSocial.svelte",
64
62
  "./components/Modal.svelte": "./components/Modal.svelte",
65
63
  "./components/NewsGrid.svelte": "./components/NewsGrid.svelte",
66
64
  "./components/SidebarContent.svelte": "./components/SidebarContent.svelte",