tecitheme 0.0.20 → 0.0.23

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.
@@ -2,11 +2,12 @@
2
2
  export let image;
3
3
  export let title;
4
4
  export let caption;
5
+ export let link;
5
6
  </script>
6
7
 
7
8
  <section class="flex justify-center not-prose mb-8">
8
9
  <figure class="bg-white w-auto mx-auto shadow-lg border border-slate-100 p-2">
9
- <a href={image}>
10
+ <a href={link ? link : image}>
10
11
  <img class="w-full" src={image} alt={title} title={title}>
11
12
  </a>
12
13
  {#if caption}
@@ -5,6 +5,7 @@ export default class Figure extends SvelteComponentTyped<{
5
5
  image: any;
6
6
  title: any;
7
7
  caption: any;
8
+ link: any;
8
9
  }, {
9
10
  [evt: string]: CustomEvent<any>;
10
11
  }, {}> {
@@ -18,6 +19,7 @@ declare const __propDef: {
18
19
  image: any;
19
20
  title: any;
20
21
  caption: any;
22
+ link: any;
21
23
  };
22
24
  events: {
23
25
  [evt: string]: CustomEvent<any>;
@@ -13,7 +13,7 @@ import Video from './Video.svelte'
13
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="w-full aspect-video object-cover border bg-black border-gray-200 shadow-md"
16
+ <img class="w-full aspect-video object-cover border bg-black border-gray-200 shadow-md {data.imageClass ? data.imageClass : ''}"
17
17
  src={data.image} alt={data.name}
18
18
  />
19
19
  </a>
@@ -2,6 +2,7 @@
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
6
 
6
7
  export let data;
7
8
 
@@ -13,9 +14,13 @@
13
14
  let pageSize = data.pageSize;
14
15
 
15
16
  function termExists(arr, terms) {
16
- return terms.some((value) => {
17
- return arr.includes(value);
18
- });
17
+ if (arr) {
18
+ return terms.some((term) => {
19
+ return arr.includes(term);
20
+ });
21
+ } else {
22
+ return false
23
+ }
19
24
  }
20
25
 
21
26
  function filterPosts(arr, terms) {
@@ -38,7 +43,7 @@
38
43
  $: paginatedItems = paginate({ items, pageSize, currentPage });
39
44
  </script>
40
45
 
41
- <div class="relative mx-auto w-full">
46
+ <div class="relative w-full mx-auto">
42
47
  <div
43
48
  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
49
  >
@@ -67,6 +72,7 @@
67
72
  >
68
73
  </div>
69
74
  </div>
75
+ {#if (items.length > 0)}
70
76
  <div class="paginator mx-auto flex justify-center pt-4">
71
77
  <PaginationNav
72
78
  totalItems="{items.length}"
@@ -81,8 +87,9 @@
81
87
  class="grid gap-16 pt-8 md:grid-cols-2 lg:grid-cols-3 lg:gap-x-5 lg:gap-y-12"
82
88
  >
83
89
  {#each paginatedItems as post}
84
- <a class="block h-full" href="{post.path}">
85
- <div class="flex h-full flex-col items-stretch">
90
+ <div class="h-full">
91
+ <a class="block h-full" href="/{post.path}">
92
+ <div class="h-full flex flex-col items-stretch ">
86
93
  <time
87
94
  class="mb-1 block text-sm text-gray-500"
88
95
  datetime="{post.meta.date}"
@@ -102,6 +109,15 @@
102
109
  Missing Summary Text
103
110
  </p>
104
111
  {/if}
112
+ {#if post.meta.categories}
113
+ <div class="w-full text-sm flex flex-wrap">
114
+ {#each (post.meta.categories.sort()) as term}
115
+ <a class="inline-block mr-2 mb-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>
117
+ </a>
118
+ {/each}
119
+ </div>
120
+ {/if}
105
121
  <p
106
122
  class="text-sm font-semibold text-teci-blue-light hover:text-teci-blue-dark"
107
123
  >
@@ -109,6 +125,7 @@
109
125
  </p>
110
126
  </div>
111
127
  </a>
128
+ </div>
112
129
  {/each}
113
130
  </div>
114
131
  <div class="paginator mx-auto flex justify-center pt-8">
@@ -121,4 +138,12 @@
121
138
  on:setPage="{(e) => (currentPage = e.detail.page)}"
122
139
  />
123
140
  </div>
141
+ {: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>
148
+ {/if}
124
149
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tecitheme",
3
- "version": "0.0.20",
3
+ "version": "0.0.23",
4
4
  "svelte": true,
5
5
  "devDependencies": {
6
6
  "@jsdevtools/rehype-toc": "^3.0.2",