Skip to content

Commit

Permalink
Add events to permalinks
Browse files Browse the repository at this point in the history
  • Loading branch information
phazonoverload committed Feb 13, 2024
1 parent 1d8397a commit 35e40e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,14 @@ const fetchPagePermalinks = async () => {
readItems('episodes', { fields: ['slug', { season: ['*', { show: ['slug'] }] }], limit: -1 }),
);

const events = await directusTv.request(readItems('events', { fields: ['slug'], limit: -1 }));

permalinks.push(...pages.map((page) => page.permalink));
permalinks.push(...resources.map((resource) => `/${resource.type.slug}/${resource.slug}`));
permalinks.push(...team.map((member) => `/team/${member.slug}`));
permalinks.push(...shows.map((show) => `/tv/${show.slug}`));
permalinks.push(...episodes.map((ep) => `/tv/${ep.season.show.slug}/${ep.slug}`));
permalinks.push(...events.map((ev) => `/tv/live/${ev.slug}`));

return permalinks;
};
Expand Down

0 comments on commit 35e40e8

Please sign in to comment.