Skip to content

Commit

Permalink
Fix entry links
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoshino committed Dec 18, 2024
1 parent f081790 commit a0c63d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/lib/components/assets/shared/info-panel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@
<section>
<h4>{$_('used_in')}</h4>
{#each usedEntries as entry (entry.sha)}
{@const { slug } = entry}
{#each getAssociatedCollections(entry) as collection (collection.name)}
{@const collectionLabel = collection.label || collection.name}
{#each getFilesByEntry(collection, entry) as collectionFile (collectionFile.name)}
Expand All @@ -164,7 +163,7 @@
})}
{:else}
{@render usedEntryLink({
link: `/collections/${collection.name}/entries/${slug}`,
link: `/collections/${collection.name}/entries/${entry.subPath}`,
collectionLabel,
entryLabel: getEntrySummary(collection, entry, { useTemplate: true }),
})}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/contents/details/toolbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
} else {
if (isNew) {
// Update the URL
goto(`/collections/${collectionName}/entries/${savedEntry.slug}`, {
goto(`/collections/${collectionName}/entries/${savedEntry.subPath}`, {
replaceState: true,
notifyChange: false,
});
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/search/entry-result-item.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
export let entry;
$: ({ slug, locales } = entry);
$: ({ locales, subPath } = entry);
</script>

{#snippet resultRow(
Expand All @@ -27,7 +27,7 @@
{#if content}
<GridRow
onclick={() => {
goto(`/collections/${collection?.name}/entries/${collectionFile?.name || slug}`);
goto(`/collections/${collection?.name}/entries/${collectionFile?.name || subPath}`);
}}
>
<GridCell class="image">
Expand Down

0 comments on commit a0c63d5

Please sign in to comment.