mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-04 13:23:28 +00:00
Urgent landing page fixes (#1724)
* don't trigger rebuild if release is draft * be more strict about drafts * fix
This commit is contained in:
parent
23e9cf0553
commit
b7354a4580
|
@ -25,6 +25,8 @@ export async function POST(req: Request) {
|
|||
}
|
||||
|
||||
webhook.on('release', ({ payload }) => {
|
||||
if (payload.release.draft) return;
|
||||
|
||||
revalidateTag(getRelease(payload.release.tag_name).path);
|
||||
revalidateTag(getRecentReleases.path);
|
||||
revalidateTag(getLatestRelease.path);
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import { notFound } from 'next/navigation';
|
||||
|
||||
import { getRelease, getReleaseFrontmatter, githubFetch } from '../../github';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
export async function GET(_: Request, { params }: { params: { version: string } }) {
|
||||
const release = await githubFetch(getRelease(params.version));
|
||||
if (release.draft) notFound();
|
||||
|
||||
return Response.json({
|
||||
...getReleaseFrontmatter(release),
|
||||
|
|
|
@ -6,12 +6,14 @@ export async function GET() {
|
|||
const releases = await githubFetch(getRecentReleases);
|
||||
|
||||
return Response.json(
|
||||
releases.map((release) => {
|
||||
return {
|
||||
...getReleaseFrontmatter(release),
|
||||
version: release.tag_name,
|
||||
published_at: release.published_at
|
||||
};
|
||||
})
|
||||
releases
|
||||
.filter((r) => !r.draft)
|
||||
.map((release) => {
|
||||
return {
|
||||
...getReleaseFrontmatter(release),
|
||||
version: release.tag_name,
|
||||
published_at: release.published_at
|
||||
};
|
||||
})
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { bundleMDX } from 'mdx-bundler';
|
||||
import { getMDXComponent } from 'next-contentlayer/hooks';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { getRelease, githubFetch } from '~/app/api/github';
|
||||
import { DocMDXComponents } from '~/components/mdx';
|
||||
import { toTitleCase } from '~/utils/util';
|
||||
|
@ -29,6 +30,7 @@ export async function generateMetadata({ params }: Props) {
|
|||
|
||||
export default async function Page({ params }: Props) {
|
||||
const release = await githubFetch(getRelease(params.tag));
|
||||
if (release.draft) notFound();
|
||||
|
||||
const { code } = await bundleMDX({ source: processComments(release.body ?? '') });
|
||||
const MDXContent = getMDXComponent(code);
|
||||
|
|
|
@ -8,7 +8,9 @@ export async function getReleasesCategories(): Promise<SectionMeta['categories']
|
|||
|
||||
const categories: Record<string, SectionMeta['categories'][number]> = {};
|
||||
|
||||
for (const release of releases) {
|
||||
for (const release of releases ?? []) {
|
||||
if (release.draft) continue;
|
||||
|
||||
const { frontmatter } = getReleaseFrontmatter(release);
|
||||
|
||||
const slug = frontmatter.category;
|
||||
|
|
Loading…
Reference in a new issue