tecitheme 0.15.4 → 0.15.5
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,33 +1,21 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
|
|
2
|
+
import { getTeciImageURL, makeIdString } from "../utils";
|
|
3
3
|
|
|
4
4
|
export let image = undefined;
|
|
5
5
|
export let title = undefined;
|
|
6
6
|
export let caption = undefined;
|
|
7
7
|
export let link = undefined;
|
|
8
|
+
export let site = undefined;
|
|
8
9
|
|
|
9
|
-
let figureImage;
|
|
10
|
-
let figureLink;
|
|
10
|
+
let figureImage = getTeciImageURL(image, site);
|
|
11
|
+
let figureLink = link ? link : figureImage;
|
|
11
12
|
let id = makeIdString(title);
|
|
12
|
-
|
|
13
|
-
if (image.startsWith("http")) {
|
|
14
|
-
figureImage = image;
|
|
15
|
-
figureLink = link ? link : image;
|
|
16
|
-
} else if (image.includes("gif")) {
|
|
17
|
-
figureImage = "https://files.thunderheadeng.com/www/images/" + image;
|
|
18
|
-
figureLink = link ? link : "https://files.thunderheadeng.com/www/images/" + image;
|
|
19
|
-
} else {
|
|
20
|
-
figureImage = "https://files.thunderheadeng.com/www/images/" +
|
|
21
|
-
image +
|
|
22
|
-
"?auto=compress&auto=format";
|
|
23
|
-
figureLink = link ? link : "https://files.thunderheadeng.com/www/images/" + image;
|
|
24
|
-
}
|
|
25
13
|
</script>
|
|
26
14
|
|
|
27
15
|
{#if image}
|
|
28
16
|
<section {id} class="not-prose mb-8 flex justify-center">
|
|
29
17
|
<figure class="mx-auto w-auto border border-slate-100 p-2 shadow-lg">
|
|
30
|
-
<a class="inline-block w-full bg-slate-200 p-1" href={figureLink}>
|
|
18
|
+
<a class="inline-block w-full bg-slate-200 p-1" href={figureLink} rel="external">
|
|
31
19
|
<img class="mx-auto w-auto" src={figureImage} alt={title} {title} />
|
|
32
20
|
</a>
|
|
33
21
|
{#if caption}
|
|
@@ -6,6 +6,7 @@ export default class Figure extends SvelteComponent<{
|
|
|
6
6
|
link?: any;
|
|
7
7
|
title?: any;
|
|
8
8
|
image?: any;
|
|
9
|
+
site?: any;
|
|
9
10
|
}, {
|
|
10
11
|
[evt: string]: CustomEvent<any>;
|
|
11
12
|
}, {}> {
|
|
@@ -20,6 +21,7 @@ declare const __propDef: {
|
|
|
20
21
|
link?: any;
|
|
21
22
|
title?: any;
|
|
22
23
|
image?: any;
|
|
24
|
+
site?: any;
|
|
23
25
|
};
|
|
24
26
|
events: {
|
|
25
27
|
[evt: string]: CustomEvent<any>;
|