tecitheme 0.0.22 → 0.1.0

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.
@@ -47,7 +47,7 @@
47
47
  </a>
48
48
  {#if data.text}
49
49
  <div class="flex w-full flex-1 flex-col">
50
- {data.text}
50
+ {@html data.text}
51
51
  {#if data.cardActionStyle == 'link'}
52
52
  <a class="inline-block mt-2 text-sm font-medium text-teci-blue-light" href={data.cardURL}>
53
53
  {data.cardLinkText}<span aria-hidden="true"> →</span>
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  import Icon from './Icon.svelte';
3
3
  import { slide } from 'svelte/transition';
4
- import { cubicIn, cubicOut, bounceIn, bounceOut } from 'svelte/easing';
4
+ import { cubicIn, cubicOut } from 'svelte/easing';
5
5
 
6
6
  let openMenu = '';
7
7
 
@@ -746,7 +746,7 @@
746
746
  </a>
747
747
 
748
748
  <a
749
- href="https://www.thunderheadeng.com/pyrosim/pyrosim-licensing/#distributors"
749
+ href="https://www.thunderheadeng.com/pyrosim/licensing/#distributors"
750
750
  class="-m-3 flex items-start p-3 transition duration-150 ease-in-out hover:bg-gray-50"
751
751
  >
752
752
  <svg
@@ -3,6 +3,7 @@
3
3
  export let description
4
4
  export let image
5
5
  export let url
6
+ export let host
6
7
 
7
8
  function imageURL(str)
8
9
  {
@@ -15,13 +16,13 @@
15
16
  </script>
16
17
 
17
18
  <meta property="og:type" content="website">
18
- <meta property="og:url" content="{url.href}">
19
+ <meta property="og:url" content="{url}">
19
20
  <meta name="og:title" content={title} >
20
21
  <meta name="og:description" content={description} >
21
22
  {#if imageURL(image)}
22
23
  <meta name="og:image" content="{image}" >
23
24
  {:else}
24
- <meta name="og:image" content="https://{url.hostname}{image}" >
25
+ <meta name="og:image" content="https://{host}/{image}" >
25
26
  {/if}
26
27
  <meta name="twitter:card" content="summary_large_image">
27
28
  <meta name="twitter:site" content="@thunderheadeng">
@@ -6,6 +6,7 @@ export default class MetaSocial extends SvelteComponentTyped<{
6
6
  description: any;
7
7
  image: any;
8
8
  url: any;
9
+ host: any;
9
10
  }, {
10
11
  [evt: string]: CustomEvent<any>;
11
12
  }, {}> {
@@ -20,6 +21,7 @@ declare const __propDef: {
20
21
  description: any;
21
22
  image: any;
22
23
  url: any;
24
+ host: any;
23
25
  };
24
26
  events: {
25
27
  [evt: string]: CustomEvent<any>;
@@ -2,25 +2,32 @@
2
2
  import { DateTime } from 'luxon';
3
3
  import { getContext } from 'svelte';
4
4
  import { paginate, PaginationNav } from 'svelte-paginate';
5
- import Icon from './Icon.svelte'
5
+ import Icon from './Icon.svelte';
6
6
 
7
7
  export let data;
8
8
 
9
- const posts = getContext('newsPosts');
9
+ let posts = getContext('newsPosts');
10
10
 
11
11
  let filteredPosts = [];
12
12
  let items = [];
13
13
  let currentPage = 1;
14
14
  let pageSize = data.pageSize;
15
+ let postLimit = data.limit;
16
+ let showPagination = true;
17
+
18
+ if (postLimit > 0) {
19
+ posts = posts.slice(0, postLimit);
20
+ postLimit <= pageSize ? (showPagination = false) : (showPagination = true);
21
+ }
15
22
 
16
23
  function termExists(arr, terms) {
17
24
  if (arr) {
18
25
  return terms.some((term) => {
19
- return arr.includes(term);
26
+ return arr.includes(term);
20
27
  });
21
28
  } else {
22
- return false
23
- }
29
+ return false;
30
+ }
24
31
  }
25
32
 
26
33
  function filterPosts(arr, terms) {
@@ -43,7 +50,7 @@
43
50
  $: paginatedItems = paginate({ items, pageSize, currentPage });
44
51
  </script>
45
52
 
46
- <div class="relative w-full mx-auto">
53
+ <div class="relative mx-auto w-full">
47
54
  <div
48
55
  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"
49
56
  >
@@ -72,78 +79,100 @@
72
79
  >
73
80
  </div>
74
81
  </div>
75
- {#if (items.length > 0)}
76
- <div class="paginator mx-auto flex justify-center pt-4">
77
- <PaginationNav
78
- totalItems="{items.length}"
79
- pageSize="{pageSize ? pageSize : 6}"
80
- currentPage="{currentPage}"
81
- limit="{1}"
82
- showStepOptions="{true}"
83
- on:setPage="{(e) => (currentPage = e.detail.page)}"
84
- />
85
- </div>
86
- <div
87
- class="grid gap-16 pt-8 md:grid-cols-2 lg:grid-cols-3 lg:gap-x-5 lg:gap-y-12"
88
- >
89
- {#each paginatedItems as post}
90
- <div class="h-full">
91
- <a class="block" href="/{post.path}">
92
- <div class="h-full flex flex-col items-stretch ">
93
- <time
94
- class="mb-1 block text-sm text-gray-500"
95
- datetime="{post.meta.date}"
96
- >{DateTime.fromISO(post.meta.date).toLocaleString()}</time
97
- >
98
- <p class="mb-2 text-xl font-semibold text-gray-900">
99
- {post.meta.title}
100
- </p>
101
- {#if post.meta.summary}
102
- <p class="mb-2 flex-1 text-base text-gray-500">
103
- {post.meta.summary.length > 190
104
- ? post.meta.summary.substring(0, 190) + ' ...'
105
- : post.meta.summary}
106
- </p>
107
- {:else}
108
- <p class="mb-2 flex-1 text-base text-red-500">
109
- Missing Summary Text
110
- </p>
111
- {/if}
112
- {#if post.meta.categories}
113
- <div class="w-full mb-2 text-sm flex flex-row">
114
- {#each (post.meta.categories.sort()) as term}
115
- <a class="inline-block mr-2" href="/news/{term}" rel="external">
116
- <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs bg-teci-blue-dark text-white">{term}</span>
82
+ {#if items.length > 0}
83
+ {#if showPagination}
84
+ <div class="paginator mx-auto flex justify-center pt-4">
85
+ <PaginationNav
86
+ totalItems="{items.length}"
87
+ pageSize="{pageSize ? pageSize : 6}"
88
+ currentPage="{currentPage}"
89
+ limit="{1}"
90
+ showStepOptions="{true}"
91
+ on:setPage="{(e) => (currentPage = e.detail.page)}"
92
+ />
93
+ </div>
94
+ {/if}
95
+ <div
96
+ class="grid gap-8 pt-8 md:grid-cols-2 md:gap-16 lg:grid-cols-3 lg:gap-x-5 lg:gap-y-12"
97
+ >
98
+ {#each paginatedItems as post}
99
+ <div class="h-full">
100
+ <div class="flex h-full flex-col items-stretch ">
101
+ <time
102
+ class="mb-1 block text-sm text-gray-500"
103
+ datetime="{post.meta.date}"
104
+ >{DateTime.fromISO(post.meta.date).toLocaleString()}</time
105
+ >
106
+ <h2 class="mb-2 text-xl font-semibold text-gray-900">
107
+ <a href="/{post.path}">
108
+ {post.meta.title}
109
+ </a>
110
+ </h2>
111
+ {#if post.meta.summary}
112
+ <p class="mb-2 flex-1 text-base text-gray-500">
113
+ <a href="/{post.path}">
114
+ {post.meta.summary.length > 190
115
+ ? post.meta.summary.substring(0, 190) + ' ...'
116
+ : post.meta.summary}
117
+ </a>
118
+ </p>
119
+ {:else}
120
+ <p class="mb-2 flex-1 text-base text-red-500">
121
+ Missing Summary Text
122
+ </p>
123
+ {/if}
124
+ {#if post.meta.categories}
125
+ <div class="flex w-full flex-wrap text-sm">
126
+ {#each post.meta.categories.sort() as term}
127
+ <a
128
+ class="mr-2 mb-2 inline-block"
129
+ href="/news/{term}"
130
+ rel="external"
131
+ >
132
+ <span
133
+ class="inline-flex items-center rounded-full bg-teci-blue-dark px-2.5 py-0.5 text-xs text-white hover:bg-teci-blue-light"
134
+ >{term}</span
135
+ >
136
+ </a>
137
+ {/each}
138
+ </div>
139
+ {/if}
140
+ <p
141
+ class="text-sm font-semibold text-teci-blue-light hover:text-teci-blue-dark"
142
+ >
143
+ <a href="/{post.path}">
144
+ Read full article<span aria-hidden="true">&nbsp;→</span>
117
145
  </a>
118
- {/each}
146
+ </p>
119
147
  </div>
120
- {/if}
121
- <p
122
- class="text-sm font-semibold text-teci-blue-light hover:text-teci-blue-dark"
123
- >
124
- Read full article<span aria-hidden="true">&nbsp;→</span>
125
- </p>
126
148
  </div>
127
- </a>
149
+ {/each}
128
150
  </div>
129
- {/each}
130
- </div>
131
- <div class="paginator mx-auto flex justify-center pt-8">
132
- <PaginationNav
133
- totalItems="{items.length}"
134
- pageSize="{pageSize ? pageSize : 6}"
135
- currentPage="{currentPage}"
136
- limit="{1}"
137
- showStepOptions="{true}"
138
- on:setPage="{(e) => (currentPage = e.detail.page)}"
139
- />
140
- </div>
151
+ {#if showPagination}
152
+ <div class="paginator mx-auto flex justify-center pt-8">
153
+ <PaginationNav
154
+ totalItems="{items.length}"
155
+ pageSize="{pageSize ? pageSize : 6}"
156
+ currentPage="{currentPage}"
157
+ limit="{1}"
158
+ showStepOptions="{true}"
159
+ on:setPage="{(e) => (currentPage = e.detail.page)}"
160
+ />
161
+ </div>
162
+ {/if}
163
+ {#if !showPagination}
164
+ <div class="mt-8 w-full">
165
+ <a class="btn float-right" href="/news" rel="external">All News Posts</a
166
+ >
167
+ </div>
168
+ {/if}
141
169
  {:else}
142
- <div class="prose">
143
- <p class="pt-8">
144
- Sorry, there isn't any news for you to see here.<br>
145
- Please visit the <a rel="external" href="/news">All News</a> page for an updated list.
146
- </p>
147
- </div>
170
+ <div class="prose">
171
+ <p class="pt-8">
172
+ Sorry, there isn't any news for you to see here.<br />
173
+ Please visit the <a rel="external" href="/news">All News</a> page for an
174
+ updated list.
175
+ </p>
176
+ </div>
148
177
  {/if}
149
- </div>
178
+ </div>
@@ -1,5 +1,6 @@
1
1
  <script>
2
- import {page} from "$app/stores"
2
+ import { browser } from '$app/env';
3
+ import { getContext } from 'svelte';
3
4
 
4
5
  import CTA from '../components/CTA.svelte';
5
6
  import HeadingCentered from '../components/HeadingCentered.svelte';
@@ -33,6 +34,11 @@
33
34
  export let page_sections;
34
35
 
35
36
  let featuredImage;
37
+ let url;
38
+ let host;
39
+
40
+ url = getContext('currentURL');
41
+ host = getContext('currentHost');
36
42
 
37
43
  if (images.length > 0) {
38
44
  featuredImage = images[0]
@@ -44,7 +50,9 @@
44
50
  <svelte:head>
45
51
  <title>{title} | Thunderhead Engineering</title>
46
52
  <meta name="description" content={summary}>
47
- <MetaSocial title={title} description={summary} image={featuredImage} url={$page.url} />
53
+ {#if browser}
54
+ <MetaSocial title={title} description={summary} image={featuredImage} {url} {host} />
55
+ {/if}
48
56
  </svelte:head>
49
57
 
50
58
  <article class="flex flex-col space-y-12 {layout}">
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "tecitheme",
3
- "version": "0.0.22",
3
+ "version": "0.1.0",
4
4
  "svelte": true,
5
5
  "devDependencies": {
6
6
  "@jsdevtools/rehype-toc": "^3.0.2",
7
7
  "@sveltejs/adapter-netlify": "next",
8
8
  "@sveltejs/kit": "next",
9
- "@tailwindcss/forms": "^0.5.1",
9
+ "@tailwindcss/forms": "^0.5.2",
10
10
  "@tailwindcss/typography": "^0.5.2",
11
11
  "@types/cookie": "^0.5.1",
12
12
  "@typescript-eslint/eslint-plugin": "^5.27.0",
@@ -14,7 +14,7 @@
14
14
  "autoprefixer": "^10.4.7",
15
15
  "dotenv": "^16.0.1",
16
16
  "encoding": "^0.1.13",
17
- "eslint": "^8.16.0",
17
+ "eslint": "^8.17.0",
18
18
  "eslint-config-prettier": "^8.5.0",
19
19
  "eslint-plugin-svelte3": "^4.0.0",
20
20
  "luxon": "^2.4.0",
@@ -27,14 +27,15 @@
27
27
  "rehype-stringify": "^9.0.3",
28
28
  "stream": "^0.0.2",
29
29
  "svelte": "^3.48.0",
30
- "svelte-check": "^2.7.1",
30
+ "svelte-check": "^2.7.2",
31
31
  "svelte-paginate": "^0.0.1",
32
- "svelte-preprocess": "^4.10.6",
32
+ "svelte-preprocess": "^4.10.7",
33
33
  "svelte2tsx": "^0.5.10",
34
- "tailwindcss": "^3.0.24",
34
+ "tailwindcss": "^3.1.3",
35
35
  "tslib": "^2.4.0",
36
- "typescript": "^4.7.2",
37
- "vite": "^2.9.9",
36
+ "typescript": "^4.7.3",
37
+ "uuid-by-string": "^3.0.7",
38
+ "vite": "^2.9.12",
38
39
  "vite-plugin-autoimport": "^1.6.6"
39
40
  },
40
41
  "type": "module",