Skip to content

Commit 91f7f4d

Browse files
committed
blog fix typescript errors
1 parent e225592 commit 91f7f4d

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/components/client-side/ClientMarkdown.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Markdown from "react-markdown";
22
import rehypeRaw from "rehype-raw";
33
// For v2.0.0 this import should work correctly
44
import rehypeLinks from "rehype-external-links";
5+
import type { Plugin } from 'unified';
56

67
type Props = {
78
data: string;
@@ -11,9 +12,9 @@ const ClientMarkdown = ({ data }: Props) => {
1112
return (
1213
<Markdown
1314
rehypePlugins={[
14-
rehypeRaw,
15+
rehypeRaw as Plugin,
1516
[
16-
rehypeLinks,
17+
rehypeLinks as Plugin,
1718
{
1819
target: "_blank",
1920
rel: ["nofollow", "noopener", "noreferrer"],

src/pages/blog/[slug].astro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const { Content, headings, remarkPluginFrontmatter } = await entry.render();
1919
2020
2121
// Format the publication date
22-
const formatDate = (date) => {
22+
const formatDate = (date: Date) => {
2323
return new Date(date).toLocaleDateString('en-US', {
2424
year: 'numeric',
2525
month: 'long',
@@ -34,6 +34,10 @@ const url = `https://defguard.net/blog/${entry.slug}`;
3434
<ProductLayout
3535
title={title}
3636
url={url}
37+
featuredImage="github.com/DefGuard/defguard.github.io/raw/main/public/images/png/defguard.png"
38+
imageWidth="1080"
39+
imageHeight="540"
40+
tags={[]}
3741
>
3842
<Navigation activeSlug="/blog" />
3943

src/pages/blog/index.astro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const sortedPosts = allPosts.sort(
1414
(a, b) => new Date(b.data.publishDate).valueOf() - new Date(a.data.publishDate).valueOf()
1515
);
1616
17-
const formatDate = (date) => {
17+
const formatDate = (date: Date) => {
1818
return new Date(date).toLocaleDateString('en-US', {
1919
year: 'numeric',
2020
month: 'long',
@@ -29,6 +29,10 @@ const url = "https://defguard.net/blog";
2929
<ProductLayout
3030
title={title}
3131
url={url}
32+
featuredImage="github.com/DefGuard/defguard.github.io/raw/main/public/images/png/defguard.png"
33+
imageWidth="1080"
34+
imageHeight="540"
35+
tags={[]}
3236
>
3337
<Navigation activeSlug="/blog" />
3438

0 commit comments

Comments
 (0)