tecitheme 0.0.24 → 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.
- package/components/Card.svelte +1 -1
- package/components/Header.svelte +2 -2
- package/components/NewsGrid.svelte +106 -79
- package/package.json +3 -3
package/components/Card.svelte
CHANGED
|
@@ -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>
|
package/components/Header.svelte
CHANGED
|
@@ -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
|
|
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/
|
|
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
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
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,80 +79,100 @@
|
|
|
72
79
|
>
|
|
73
80
|
</div>
|
|
74
81
|
</div>
|
|
75
|
-
{#if
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
<div class="h-full flex flex-col items-stretch ">
|
|
92
|
-
<time
|
|
93
|
-
class="mb-1 block text-sm text-gray-500"
|
|
94
|
-
datetime="{post.meta.date}"
|
|
95
|
-
>{DateTime.fromISO(post.meta.date).toLocaleString()}</time
|
|
96
|
-
>
|
|
97
|
-
<h2 class="mb-2 text-xl font-semibold text-gray-900">
|
|
98
|
-
<a href="/{post.path}">
|
|
99
|
-
{post.meta.title}
|
|
100
|
-
</a>
|
|
101
|
-
</h2>
|
|
102
|
-
{#if post.meta.summary}
|
|
103
|
-
<p class="mb-2 flex-1 text-base text-gray-500">
|
|
104
|
-
<a href="/{post.path}">
|
|
105
|
-
{post.meta.summary.length > 190
|
|
106
|
-
? post.meta.summary.substring(0, 190) + ' ...'
|
|
107
|
-
: post.meta.summary}
|
|
108
|
-
</a>
|
|
109
|
-
</p>
|
|
110
|
-
{:else}
|
|
111
|
-
<p class="mb-2 flex-1 text-base text-red-500">
|
|
112
|
-
Missing Summary Text
|
|
113
|
-
</p>
|
|
114
|
-
{/if}
|
|
115
|
-
{#if post.meta.categories}
|
|
116
|
-
<div class="w-full text-sm flex flex-wrap">
|
|
117
|
-
{#each (post.meta.categories.sort()) as term}
|
|
118
|
-
<a class="inline-block mr-2 mb-2" href="/news/{term}" rel="external">
|
|
119
|
-
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs bg-teci-blue-dark text-white">{term}</span>
|
|
120
|
-
</a>
|
|
121
|
-
{/each}
|
|
122
|
-
</div>
|
|
123
|
-
{/if}
|
|
124
|
-
<p class="text-sm font-semibold text-teci-blue-light hover:text-teci-blue-dark">
|
|
125
|
-
<a href="/{post.path}">
|
|
126
|
-
Read full article<span aria-hidden="true"> →</span>
|
|
127
|
-
</a>
|
|
128
|
-
</p>
|
|
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
|
+
/>
|
|
129
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"> →</span>
|
|
145
|
+
</a>
|
|
146
|
+
</p>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
{/each}
|
|
130
150
|
</div>
|
|
131
|
-
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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}
|
|
143
169
|
{:else}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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>
|
|
150
177
|
{/if}
|
|
151
|
-
</div>
|
|
178
|
+
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tecitheme",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"svelte": true,
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@jsdevtools/rehype-toc": "^3.0.2",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"svelte-paginate": "^0.0.1",
|
|
32
32
|
"svelte-preprocess": "^4.10.7",
|
|
33
33
|
"svelte2tsx": "^0.5.10",
|
|
34
|
-
"tailwindcss": "^3.1.
|
|
34
|
+
"tailwindcss": "^3.1.3",
|
|
35
35
|
"tslib": "^2.4.0",
|
|
36
36
|
"typescript": "^4.7.3",
|
|
37
37
|
"uuid-by-string": "^3.0.7",
|
|
38
|
-
"vite": "^2.9.
|
|
38
|
+
"vite": "^2.9.12",
|
|
39
39
|
"vite-plugin-autoimport": "^1.6.6"
|
|
40
40
|
},
|
|
41
41
|
"type": "module",
|