-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: delete old entry when frontmatter slug changed (#12966)
- Loading branch information
Showing
6 changed files
with
75 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Ensures old content collection entry is deleted if a markdown frontmatter slug is changed in dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/astro/test/fixtures/content-layer/src/content/space/exomars.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title: Rosalind Franklin Rover | ||
description: 'Learn about the Rosalind Franklin Rover.' | ||
publishedDate: '2022-09-19' | ||
tags: [space, 2020s] | ||
# slug: rosalind-franklin-rover | ||
--- | ||
**Source:** [Wikipedia](https://en.wikipedia.org/wiki/Rosalind_Franklin_(rover)) | ||
|
||
The Rosalind Franklin rover is a planned robotic Mars rover, part of the ExoMars mission led by the European Space Agency and the Russian space agency Roscosmos. The mission is scheduled to launch in September 2022, and the rover is expected to land on Mars in June 2023. The rover is named after the British biophysicist Rosalind Franklin, who made key contributions to the discovery of the structure of DNA. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/astro/test/fixtures/content-layer/src/pages/spacecraft/index.astro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
import { getCollection } from "astro:content"; | ||
const collection = await getCollection("spacecraft"); | ||
--- | ||
<html> | ||
<head> | ||
<title>Spacecraft</title> | ||
</head> | ||
<body> | ||
<h1>Spacecraft</h1> | ||
<ul> | ||
{collection.map((craft) => ( | ||
<li><a href={`/spacecraft/${craft.id}`}>{ craft.data?.title }</a></li> | ||
))} | ||
</ul> | ||
</body> | ||
</html> |