Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"linkedom": "^0.18.5",
"parse-github-url": "^1.0.3",
"reading-time": "^1.5.0",
"starlight-blog": "^0.12.0",
"starlight-blog": "^0.13.0",
"starlight-links-validator": "^0.12.1",
"starlight-showcases": "^0.2.0",
"tsx": "^4.19.1",
Expand Down
5 changes: 3 additions & 2 deletions src/components/Head.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ const filteredAstroPropsId = Astro.props.id.replace(/\/index./, '.');

// Force the og:image to be the index image for the homepage for these kind of pages:
// - articles/tags/*
// - articles/authors/*
// - 404
// - articles.*
// - articles/[0-9]*/
const isOgIndex = Astro.props.id.startsWith('articles/tags/') || Astro.props.id.startsWith('articles.') || /^articles\/\d+/.test(Astro.props.id) || Astro.props.id.startsWith('404');
const isOgIndex = Astro.props.id.startsWith('articles/tags/') || Astro.props.id.startsWith('articles.') || /^articles\/\d+/.test(Astro.props.id) || Astro.props.id.startsWith('404') || Astro.props.id.startsWith('articles/authors/');

// Get the URL of the generated image for the current page using its
// ID and replace the file extension with `.png`.
Expand All @@ -24,7 +25,7 @@ const ogImageUrl = new URL(
const { entry } = Astro.props;
const { data } = entry;

const isArticle = Astro.props.slug.startsWith('articles/') && !Astro.props.slug.startsWith('articles/tags') && !Astro.props.slug.match('articles/[0-9]*$');
const isArticle = Astro.props.slug.startsWith('articles/') && !Astro.props.slug.startsWith('articles/tags') && !Astro.props.slug.startsWith('articles/authors') && !Astro.props.slug.match('articles/[0-9]*$');

let articleSchema;
if (isArticle) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Props } from '@astrojs/starlight/props';
import Default from '@astrojs/starlight/components/Header.astro';
import ProgressScroll from './ProgressScroll.astro';

const displayProgressScroll = Astro.props.slug.startsWith('guide') || Astro.props.slug.startsWith('articles/') && !Astro.props.slug.startsWith('articles/tags') && !Astro.props.slug.match('articles/[0-9]*$');
const displayProgressScroll = Astro.props.slug.startsWith('guide') || Astro.props.slug.startsWith('articles/') && !Astro.props.slug.startsWith('articles/tags') && !Astro.props.slug.startsWith('articles/authors') && !Astro.props.slug.match('articles/[0-9]*$');
---
<Default {...Astro.props}>
<slot />
Expand Down
2 changes: 1 addition & 1 deletion src/components/PageTitleThenReadingTime.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { date } = Astro.props.entry.data;
const { entry, lang } = Astro.props;

const isGuide = Astro.props.slug.startsWith('guide');
const displayReadingTime = (isGuide && date) || Astro.props.slug.startsWith('articles') && !Astro.props.slug.startsWith('articles/tags');
const displayReadingTime = (isGuide && date) || Astro.props.slug.startsWith('articles') && !Astro.props.slug.startsWith('articles/tags') && !Astro.props.slug.startsWith('articles/authors');
const displayDate = date && isGuide;
---

Expand Down