Skip to content

Commit 46a73ac

Browse files
authored
Remove canonical field from blog post (#367)
We don't really use it for blog post
1 parent 4ea216c commit 46a73ac

7 files changed

+3
-35
lines changed

_blogposts/2020-11-17-editor-support-custom-operators-and-more.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ badge: roadmap
66
title: "Editor Support, Custom Operators and More"
77
description: |
88
Update on what we're doing around the end of 2020 and early next year.
9-
canonical: https://rescript-lang.org/blog/rescript-the-road-ahead
109
---
1110

1211
import Video from "src/components/Video"

_blogposts/2020-11-26-editor-support-release-1-0.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ badge: release
77
title: "Editor Plugin for VSCode and Vim Officially Released!"
88
description: |
99
Type hints, jump to definition, error diagnostics, and more.
10-
canonical: https://rescript-lang.org/blog/editor-support-release-1-0
1110
---
1211

1312

pages/blogpost-guide.mdx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ title: Bloomberg announces BuckleScript 1.0
4848
description: |
4949
some multiline
5050
description
51-
canonical: https://rescript-lang.org/blog/2017/10/01/announcing-1-0
5251
---
5352
```
5453

@@ -64,8 +63,6 @@ canonical: https://rescript-lang.org/blog/2017/10/01/announcing-1-0
6463
- `title`: The title of the article (h1 headline)
6564
- `description`: A description, which will be shown in the Featured blog post
6665
in the blog overview, and also as an introductory text in the blog article
67-
- `canonical`: This is used to point to a canonical url (mostly for refering to
68-
the original source of a post, in case it is duplicated content)
6966

7067
> **For Maintainers:** The implementation for the frontmatter logic can be found in the
7168
`common/BlogFrontmatter.res` module.

src/BlogArticle.mjs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ function $$default(props) {
127127
var content;
128128
if (fm.TAG === /* Ok */0) {
129129
var match = fm._0;
130-
var canonical = match.canonical;
131130
var description = match.description;
132131
var title = match.title;
133132
var tmp = {
@@ -138,10 +137,6 @@ function $$default(props) {
138137
if (tmp$1 !== undefined) {
139138
tmp.description = tmp$1;
140139
}
141-
var tmp$2 = canonical === null ? undefined : Caml_option.some(canonical);
142-
if (tmp$2 !== undefined) {
143-
tmp.canonical = tmp$2;
144-
}
145140
content = React.createElement("div", {
146141
className: "w-full"
147142
}, React.createElement(Meta.make, tmp), React.createElement("div", {
@@ -157,13 +152,7 @@ function $$default(props) {
157152
className: "flex justify-center"
158153
}, React.createElement("div", {
159154
className: "max-w-740 w-full"
160-
}, archivedNote, children, canonical !== null ? React.createElement("div", {
161-
className: "mt-12 text-14"
162-
}, "This article was originally released on ", React.createElement("a", {
163-
href: canonical,
164-
rel: "noopener noreferrer",
165-
target: "_blank"
166-
}, canonical)) : null, React.createElement("div", {
155+
}, archivedNote, children, React.createElement("div", {
167156
className: "mt-12"
168157
}, React.createElement(BlogArticle$Line, {}), React.createElement("div", {
169158
className: "pt-20 flex flex-col items-center"

src/BlogArticle.res

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,11 @@ let default = (props: props) => {
153153
: React.null
154154

155155
let content = switch fm {
156-
| Ok({date, author, co_authors, title, description, canonical, articleImg, previewImg}) =>
156+
| Ok({date, author, co_authors, title, description, articleImg, previewImg}) =>
157157
<div className="w-full">
158158
<Meta
159159
title={title ++ " | ReScript Blog"}
160160
description=?{description->Js.Null.toOption}
161-
canonical=?{canonical->Js.Null.toOption}
162161
ogImage={previewImg->Js.Null.toOption->Belt.Option.getWithDefault(Blog.defaultPreviewImg)}
163162
/>
164163
<div className="mb-10 md:mb-20">
@@ -175,16 +174,6 @@ let default = (props: props) => {
175174
<div className="max-w-740 w-full">
176175
archivedNote
177176
children
178-
{switch canonical->Js.Null.toOption {
179-
| Some(canonical) =>
180-
<div className="mt-12 text-14">
181-
{React.string("This article was originally released on ")}
182-
<a href=canonical target="_blank" rel="noopener noreferrer">
183-
{React.string(canonical)}
184-
</a>
185-
</div>
186-
| None => React.null
187-
}}
188177
<div className="mt-12">
189178
<Line />
190179
<div className="pt-20 flex flex-col items-center">

src/common/BlogFrontmatter.mjs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,7 @@ function decode(json) {
155155
}), json)),
156156
description: Json_decode.nullable((function (param) {
157157
return Json_decode.field("description", Json_decode.string, param);
158-
}), json),
159-
canonical: Js_null.fromOption(Json_decode.optional((function (param) {
160-
return Json_decode.field("canonical", Json_decode.string, param);
161-
}), json))
158+
}), json)
162159
};
163160
}
164161
catch (raw_str){

src/common/BlogFrontmatter.res

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ type t = {
9090
title: string,
9191
badge: Js.null<Badge.t>,
9292
description: Js.null<string>,
93-
canonical: Js.null<string>,
9493
}
9594

9695
let decodeBadge = (str: string): Badge.t =>
@@ -133,7 +132,6 @@ let decode = (json: Js.Json.t): result<t, string> => {
133132
articleImg: json->optional(field("articleImg", string), _)->Js.Null.fromOption,
134133
title: json->field("title", string, _),
135134
description: json->nullable(field("description", string), _),
136-
canonical: json->optional(field("canonical", string), _)->Js.Null.fromOption,
137135
} {
138136
| fm => Ok(fm)
139137
| exception DecodeError(str) => Error(str)

0 commit comments

Comments
 (0)