hide projects too

This commit is contained in:
2026-09-10 00:26:59 -05:00
parent eae5d0effe
commit a788c71edf
7 changed files with 33 additions and 8 deletions
+5 -2
View File
@@ -10,6 +10,7 @@ import {
isExternalHref,
projectEntryHref,
projectOgImage,
sortProjects,
} from '~/utils/projects';
const route = useRoute();
@@ -30,7 +31,7 @@ const folderName = computed(
const { data } = await useAsyncData(
() => `projects:${route.path}`,
async () => {
const all = await queryCollection('projects').order('title', 'ASC').all();
const all = await queryCollection('projects').all();
const visible = all.filter((page) => import.meta.dev || !page.hidden);
const project = visible.find(
(page) =>
@@ -44,7 +45,9 @@ const { data } = await useAsyncData(
const prefix = contentPath.value.endsWith('/')
? contentPath.value
: `${contentPath.value}/`;
const pages = visible.filter((page) => page.path.startsWith(prefix));
const pages = sortProjects(
visible.filter((page) => page.path.startsWith(prefix)),
);
if (!pages.length) return null;
return { kind: 'folder' as const, project: null, pages };
+8 -3
View File
@@ -6,11 +6,16 @@ import {
personId,
websiteId,
} from '~/utils/site';
import { isExternalHref, projectEntryHref } from '~/utils/projects';
import {
isExternalHref,
projectEntryHref,
sortProjects,
} from '~/utils/projects';
const { data: pages } = await useAsyncData('project-pages', async () => {
const all = await queryCollection('projects').order('title', 'ASC').all();
return import.meta.dev ? all : all.filter((page) => !page.hidden);
const all = await queryCollection('projects').all();
const visible = all.filter((page) => !page.hidden);
return sortProjects(visible);
});
const projectsUrl = `${SITE_URL}/projects`;
+3 -2
View File
@@ -6,6 +6,7 @@ import {
} from '~/utils/fonts';
import { BG_THEMES } from '~/utils/themes';
import { SITE_URL } from '~/utils/site';
import { sortProjects } from '~/utils/projects';
const TOKEN_NAMES = [
'--bg',
@@ -51,8 +52,8 @@ const { data: writingPages } = await useAsyncData(
const { data: projectPages } = await useAsyncData(
'styleguide-projects',
async () => {
const all = await queryCollection('projects').order('title', 'ASC').all();
return all.filter((page) => !page.hidden).slice(0, 4);
const all = await queryCollection('projects').all();
return sortProjects(all.filter((page) => !page.hidden)).slice(0, 4);
},
);
+1 -1
View File
@@ -9,7 +9,7 @@ import {
const { data: pages } = await useAsyncData('writing-pages', async () => {
const all = await queryCollection('writing').order('date', 'DESC').all();
return import.meta.dev ? all : all.filter((page) => !page.hidden);
return all.filter((page) => !page.hidden);
});
const writingUrl = `${SITE_URL}/writing`;