mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-14 08:54:04 +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 }) => {
|
webhook.on('release', ({ payload }) => {
|
||||||
|
if (payload.release.draft) return;
|
||||||
|
|
||||||
revalidateTag(getRelease(payload.release.tag_name).path);
|
revalidateTag(getRelease(payload.release.tag_name).path);
|
||||||
revalidateTag(getRecentReleases.path);
|
revalidateTag(getRecentReleases.path);
|
||||||
revalidateTag(getLatestRelease.path);
|
revalidateTag(getLatestRelease.path);
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
|
import { notFound } from 'next/navigation';
|
||||||
|
|
||||||
import { getRelease, getReleaseFrontmatter, githubFetch } from '../../github';
|
import { getRelease, getReleaseFrontmatter, githubFetch } from '../../github';
|
||||||
|
|
||||||
export const runtime = 'edge';
|
export const runtime = 'edge';
|
||||||
|
|
||||||
export async function GET(_: Request, { params }: { params: { version: string } }) {
|
export async function GET(_: Request, { params }: { params: { version: string } }) {
|
||||||
const release = await githubFetch(getRelease(params.version));
|
const release = await githubFetch(getRelease(params.version));
|
||||||
|
if (release.draft) notFound();
|
||||||
|
|
||||||
return Response.json({
|
return Response.json({
|
||||||
...getReleaseFrontmatter(release),
|
...getReleaseFrontmatter(release),
|
||||||
|
|
|
@ -6,7 +6,9 @@ export async function GET() {
|
||||||
const releases = await githubFetch(getRecentReleases);
|
const releases = await githubFetch(getRecentReleases);
|
||||||
|
|
||||||
return Response.json(
|
return Response.json(
|
||||||
releases.map((release) => {
|
releases
|
||||||
|
.filter((r) => !r.draft)
|
||||||
|
.map((release) => {
|
||||||
return {
|
return {
|
||||||
...getReleaseFrontmatter(release),
|
...getReleaseFrontmatter(release),
|
||||||
version: release.tag_name,
|
version: release.tag_name,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { bundleMDX } from 'mdx-bundler';
|
import { bundleMDX } from 'mdx-bundler';
|
||||||
import { getMDXComponent } from 'next-contentlayer/hooks';
|
import { getMDXComponent } from 'next-contentlayer/hooks';
|
||||||
|
import { notFound } from 'next/navigation';
|
||||||
import { getRelease, githubFetch } from '~/app/api/github';
|
import { getRelease, githubFetch } from '~/app/api/github';
|
||||||
import { DocMDXComponents } from '~/components/mdx';
|
import { DocMDXComponents } from '~/components/mdx';
|
||||||
import { toTitleCase } from '~/utils/util';
|
import { toTitleCase } from '~/utils/util';
|
||||||
|
@ -29,6 +30,7 @@ export async function generateMetadata({ params }: Props) {
|
||||||
|
|
||||||
export default async function Page({ params }: Props) {
|
export default async function Page({ params }: Props) {
|
||||||
const release = await githubFetch(getRelease(params.tag));
|
const release = await githubFetch(getRelease(params.tag));
|
||||||
|
if (release.draft) notFound();
|
||||||
|
|
||||||
const { code } = await bundleMDX({ source: processComments(release.body ?? '') });
|
const { code } = await bundleMDX({ source: processComments(release.body ?? '') });
|
||||||
const MDXContent = getMDXComponent(code);
|
const MDXContent = getMDXComponent(code);
|
||||||
|
|
|
@ -8,7 +8,9 @@ export async function getReleasesCategories(): Promise<SectionMeta['categories']
|
||||||
|
|
||||||
const categories: Record<string, SectionMeta['categories'][number]> = {};
|
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 { frontmatter } = getReleaseFrontmatter(release);
|
||||||
|
|
||||||
const slug = frontmatter.category;
|
const slug = frontmatter.category;
|
||||||
|
|
Loading…
Reference in a new issue