Skip to content

Commit ed4ddfa

Browse files
Hyeok KimHyeok Kim
authored andcommitted
fix
1 parent bbd4aa0 commit ed4ddfa

6 files changed

Lines changed: 38 additions & 16 deletions

File tree

README.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,20 @@ Create a new branch (`git checkout -b my-branch-name`), commit as normal, then p
7070

7171
- How do I add a new blog post?
7272

73-
Create a markdown file under `static/blog-assets/posts`. The filename will be the slug in the URL. It can technically be anything, but the convention is `year-month-date-keyword.md` for consistency. Write a post by taking the following steps:
73+
Create a markdown file under `static/blog-assets/posts`. The filename will be the slug in the URL. It can technically be anything, but the convention is `year-month-date-keyword.md` for consistency (e.g., `2015-12-17-next-steps.md`). In that file, write a post by taking the following steps:
7474

75-
1. Write meta data for sorting and linking. At the top of your markdown file, write meta data between `---` and `---` in YAML format.
75+
1. Sepcify meta data in YAML format, between `---` and `---`, at the top of your markdown post file. This is necessary for linking and sorting.
7676

7777
```yaml
7878
---
79-
date: 2017-10-31 # required. year-month-date
80-
title: "Introducing Vega-Lite 2.0" # required. in quotes
79+
date: 2017-10-31 # required. year-month-date, in numbers.
80+
title: "Introducing Vega-Lite 2.0" # required. in double-quotes
8181
banner: "../blog-assets/images/2017-10-31-vegalite2-banner.webp" # optional. if provided, it appears before the title.
82-
paper: vega-lite # optional paper keyword. if provided, it will create a link to the paper under the title.
83-
headlinener: "..." # optional if you want to have some special summary for your post. Make sure it is about 100 letters. If external is provided (see below), it is required.
84-
external: URL # if it is posted on an external blog, then just provide that url here. While you are still need to say something in the post for parsing purposes, it will be ignored. To do so, headliner must be provided.
82+
paper: vega-lite # optional. if provided, it will create a link to the paper under the title (in the post page).
83+
headliner: "..." # (1) optional, if your post is not external (i.e., there is content below this meta data section) and you want to have some custom summary for your post
84+
# (2) required, if your post is external (i.e., the below `external' field is provided)
85+
# For both cases, make sure it is about 100 letters for the layout purposes.
86+
external: URL # if it is posted on an external blog, then just provide that url here. While you are still need to say something in the post for the parsing purposes (put something like "external post"), it will be ignored. When this field is provided, then the above "headliner" field is required. This will be checked when you run the test script.
8587
---
8688
```
8789

@@ -105,8 +107,25 @@ external: URL # if it is posted on an external blog, then just provide that url
105107
</div>
106108
107109
*Your caption goes here.*
110+
```
111+
112+
c. A display text:
113+
```
114+
<p class="display">Some text</p>
115+
```
116+
117+
d. A quote (Note: markdown formatting does not work within a `<blockquote>` tag, so any formatting, such as boldface or italic, must be specified using HTML):
118+
```
119+
<blockquote>
120+
Some text <em>italic</em> and <strong>bold</em>
121+
</blockquote>
122+
```
123+
124+
e. A space divider (This will be rendered as a short, center-aligned horizontal line):
125+
```
126+
* * *
108127
```
109128

110129
3. Store images in `static/blog-assets/images` directory. For maintenence purposes, name your images starting with your post's file name.
111130

112-
4. Supported headlines `<h2>` (`##`) and `<h3>` (`###`).
131+
4. Supported headings `<h2>` (`##`) and `<h3>` (`###`).

src/lib/pasre-post.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function parsePostData(text: string, web_name: string): BlogPost {
1010
}
1111
const meta: BlogPostMeta = {
1212
date: metaRaw.date,
13-
display_date: metaRaw.date ? (new Date(metaRaw.date + " PST")).toLocaleDateString("us-EN", {
13+
display_date: metaRaw.date ? (new Date(metaRaw.date.replace(/-/g, "/") + " PST")).toLocaleDateString("us-EN", {
1414
year: "numeric",
1515
month: "short",
1616
day: "numeric",
@@ -21,6 +21,9 @@ export function parsePostData(text: string, web_name: string): BlogPost {
2121
if (metaRaw.banner) meta.banner = metaRaw.banner;
2222
if (metaRaw.headliner) meta.headliner = metaRaw.headliner;
2323
if (metaRaw.external) meta.external = metaRaw.external;
24+
if (meta.external && !meta.headliner) {
25+
console.error("An external post must have a headliner.");
26+
}
2427
if (metaRaw.paper) meta.paper = metaRaw.paper;
2528

2629
const post = parts.length == 3 ? parts[2] : parts[0];

src/lib/post-thumb.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@
1313
<div class="thumbnail mb-2 md:mt-1 grow-0 shrink-0 mr-5">
1414
<div
1515
class="rounded-lg w-[120px] h-[80px] post-thumb-image"
16-
style={`background-image: url(${post.first_image})`}
16+
style={`background-image: url(${base}/${post.first_image})`}
1717
></div>
1818
</div>
19+
{:else}
20+
<div class="thumbnail mb-2 md:mt-1 grow-0 shrink-0 mr-5">
21+
<div class="rounded-lg w-[120px] h-[80px]" style={`background-color: white;`}></div>
22+
</div>
1923
{/if}
2024
<div class="leading-tight">
2125
<div class="md:block">

src/routes/blog/[slug]/+page.svelte

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
await navigator.clipboard.writeText(url);
2424
alert('Copied the URL to clipboard.');
2525
}
26-
console.log(paper);
2726
</script>
2827

2928
<svelte:head>
@@ -69,9 +68,7 @@
6968
{#if !meta.external}
7069
<Markdown {content} />
7170
{:else}
72-
This is an external post. Click <a href={meta.external} target="_blank" rel="noopener noreferrer"
73-
>here</a
74-
> for redirection.
71+
This is an external post. Click <a href={meta.external} target="_blank" rel="noopener noreferrer">here</a> for redirection.
7572
{/if}
7673

7774
<!-- share -->

src/routes/blog/[slug]/+page.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export const load: PageLoad = async ({ params, fetch }) => {
2424
// find paper
2525
const paper = post.meta.paper ? await fetch(`${base}/papers/${post.meta.paper}.json`)
2626
.then((x) => x ? x.json() as Promise<Paper[]> : null) : null;
27-
console.log(paper)
2827

2928
const posts = await fetch(`${base}/blog-index.json`)
3029
.then((x) => x.json() as Promise<BlogPost[]>);

static/blog-assets/posts/2019-08-12-errudite.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The problem is, an error group defined in this way is subjective, and experts ca
5757
In fact, in our user study we observed such inconsistencies even for simple group definitions (please see our paper for details!): When given identical descriptions of an error type from a prior published analysis and asked to reproduce it, our expert users produced groups that vary in size from 13.8% to 45.2% of all errors — which further illustrates the ambiguity in subjective manual labeling. This leads us to our first principle:
5858

5959
<blockquote>
60-
**P1: Error hypotheses should be defined precisely with concrete descriptions.**
60+
<em>P1: Error hypotheses should be defined precisely with concrete descriptions.</em>
6161
</blockquote>
6262

6363
* * *

0 commit comments

Comments
 (0)