> = {}
+
+ for (const { type, ...rest } of implications) {
+ implications_by_type[type] ??= []
+ implications_by_type[type].push(display_implication(rest))
+ }
+
+ return { structures_by_type, properties_by_type, implications_by_type }
}
diff --git a/src/routes/content/[id]/+page.svelte b/src/routes/content/[id]/+page.svelte
index d397ef18..7296ce4a 100644
--- a/src/routes/content/[id]/+page.svelte
+++ b/src/routes/content/[id]/+page.svelte
@@ -1,10 +1,19 @@
@@ -13,48 +22,31 @@
{@html data.html}
-
-
-{#if data.categories.length > 0 || data.category_properties.length > 0 || data.category_implications.length > 0 || data.functors.length > 0 || data.morphisms.length > 0}
+{#if has_context}
Context
- {#if data.categories.length > 0}
- This page is referenced by the following categories.
-
-
- {/if}
-
- {#if data.category_properties.length > 0}
-
- This page is referenced by the following properties of categories.
-
-
-
- {/if}
-
- {#if data.category_implications.length > 0}
- This page is referenced by the following implications.
-
-
- {#each data.category_implications as { id }}
- -
- {id}
-
- {/each}
-
- {/if}
+ {#each STRUCTURE_TYPES as type}
+ {#if data.structures_by_type?.[type]?.length}
+ This page is referenced by the following {PLURALS[type]}.
+
+ {/if}
- {#if data.functors.length > 0}
- This page is referenced by the following functors.
+ {#if data.properties_by_type?.[type]?.length}
+
+ This page is referenced by the following properties of {PLURALS[type]}.
+
-
- {/if}
+
+ {/if}
- {#if data.morphisms.length > 0}
- This page is referenced by the following morphisms.
+ {#if data.implications_by_type?.[type]?.length}
+
+ This page is referenced by the following {remove_underscores(type)} implications.
+
-
- {/if}
+
+ {/if}
+ {/each}
{/if}