Skip to content

Commit a7e5299

Browse files
Hyeok KimHyeok Kim
authored andcommitted
bg url fix
1 parent 99498be commit a7e5299

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

src/lib/pasre-post.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ export function parsePostData(text: string, web_name: string): BlogPost {
2727

2828
const md = markdownit({ html: true, linkify: true });
2929
const rendered_post = md.render(post)
30-
const first_image = meta.banner ?? rendered_post.match(/<img[^<>]*src=\"([^<>\"]+)\"[^<>]*>/i)?.[1] ?? null;
30+
let first_image = meta.banner ?? rendered_post.match(/<img[^<>]*src=\"([^<>\"]+)\"[^<>]*>/i)?.[1] ?? null;
31+
if (first_image && first_image.startsWith("../")) first_image = first_image.replace("../", "");
3132

3233
return { meta, post: rendered_post, first_image };
3334
}

static/blog-index.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"recent": true
1010
},
1111
"post": "Error analysis is a compass, and we need it to be accurate.\nError analysis — the attempt to analyze ",
12-
"first_image": "../blog-assets/images/2019-08-12-errudite-1.webp"
12+
"first_image": "blog-assets/images/2019-08-12-errudite-1.webp"
1313
},
1414
{
1515
"meta": {
@@ -21,7 +21,7 @@
2121
"recent": true
2222
},
2323
"post": "From academic courses to online articles, discussions of visualization often abound with design guid",
24-
"first_image": "../blog-assets/images/2018-10-22-draco-1.webp"
24+
"first_image": "blog-assets/images/2018-10-22-draco-1.webp"
2525
},
2626
{
2727
"meta": {
@@ -33,7 +33,7 @@
3333
"recent": true
3434
},
3535
"post": "\nIn daily life, we often find ourselves trying to separate signal from noise. For example, does the ",
36-
"first_image": "../blog-assets/images/2018-10-16-hops-1.webp"
36+
"first_image": "blog-assets/images/2018-10-16-hops-1.webp"
3737
},
3838
{
3939
"meta": {
@@ -46,7 +46,7 @@
4646
"recent": true
4747
},
4848
"post": "\n\n\n\nFig. 1. A bivariate map (left) and a Value-Suppressing Uncertainty Palette (VSUP, right), showin",
49-
"first_image": "../blog-assets/images/2018-07-19-value-suppressing-1.webp"
49+
"first_image": "blog-assets/images/2018-07-19-value-suppressing-1.webp"
5050
},
5151
{
5252
"meta": {
@@ -60,7 +60,7 @@
6060
"recent": true
6161
},
6262
"post": "This is an external post.\n",
63-
"first_image": "../blog-assets/images/2018-04-02-multi-comparison-1.webp"
63+
"first_image": "blog-assets/images/2018-04-02-multi-comparison-1.webp"
6464
},
6565
{
6666
"meta": {
@@ -73,7 +73,7 @@
7373
"recent": false
7474
},
7575
"post": "We are excited to announce the official version 2 release of Vega-Lite, a high-level language for ra",
76-
"first_image": "../blog-assets/images/2017-10-31-vegalite2-banner.webp"
76+
"first_image": "blog-assets/images/2017-10-31-vegalite2-banner.webp"
7777
},
7878
{
7979
"meta": {
@@ -88,7 +88,7 @@
8888
"recent": false
8989
},
9090
"post": "This is an external post.\n",
91-
"first_image": "../blog-assets/images/2017-07-11-gap-1.webp"
91+
"first_image": "blog-assets/images/2017-07-11-gap-1.webp"
9292
},
9393
{
9494
"meta": {
@@ -103,7 +103,7 @@
103103
"recent": false
104104
},
105105
"post": "This is an external post.\n",
106-
"first_image": "../blog-assets/images/2017-05-23-graphscape-1.gif"
106+
"first_image": "blog-assets/images/2017-05-23-graphscape-1.gif"
107107
},
108108
{
109109
"meta": {
@@ -115,7 +115,7 @@
115115
"recent": false
116116
},
117117
"post": "William Playfair was an early pioneer of information visualization. Here is one of his charts, a 178",
118-
"first_image": "../blog-assets/images/2017-05-02-regression-by-eye-1.webp"
118+
"first_image": "blog-assets/images/2017-05-02-regression-by-eye-1.webp"
119119
},
120120
{
121121
"meta": {
@@ -127,7 +127,7 @@
127127
"recent": false
128128
},
129129
"post": "\nIn 1977, Jerry Ehman — an astronomer working with the SETI project to seek out alien life — came ac",
130-
"first_image": "../blog-assets/images/2016-09-27-surprise-1.webp"
130+
"first_image": "blog-assets/images/2016-09-27-surprise-1.webp"
131131
},
132132
{
133133
"meta": {
@@ -141,7 +141,7 @@
141141
"recent": false
142142
},
143143
"post": "This is an external post.\n",
144-
"first_image": "../blog-assets/images/2016-07-21-atlas-1.webp"
144+
"first_image": "blog-assets/images/2016-07-21-atlas-1.webp"
145145
},
146146
{
147147
"meta": {
@@ -167,7 +167,7 @@
167167
"recent": false
168168
},
169169
"post": "This is an external post.\n",
170-
"first_image": "../blog-assets/images/2016-02-23-vegalite-banner.webp"
170+
"first_image": "blog-assets/images/2016-02-23-vegalite-banner.webp"
171171
},
172172
{
173173
"meta": {
@@ -182,7 +182,7 @@
182182
"recent": false
183183
},
184184
"post": "This is an external post.\n",
185-
"first_image": "../blog-assets/images/2016-01-26-hops.gif"
185+
"first_image": "blog-assets/images/2016-01-26-hops.gif"
186186
},
187187
{
188188
"meta": {
@@ -193,6 +193,6 @@
193193
"recent": false
194194
},
195195
"post": "Given its youth and interdisciplinary nature, research methods and training in the field of data vis",
196-
"first_image": "../blog-assets/images/2015-12-17-next-steps-1.webp"
196+
"first_image": "blog-assets/images/2015-12-17-next-steps-1.webp"
197197
}
198198
]

0 commit comments

Comments
 (0)