diff --git a/.changeset/center-markdown-only-home.md b/.changeset/center-markdown-only-home.md new file mode 100644 index 00000000..fbbf2509 --- /dev/null +++ b/.changeset/center-markdown-only-home.md @@ -0,0 +1,5 @@ +--- +"@luzzle/web": patch +--- + +Center custom homepage Markdown below the navigation when both latest and random sections are disabled, while preserving normal layouts when either section is enabled. diff --git a/apps/web/src/routes/(root)/+page.server.ts b/apps/web/src/routes/(root)/+page.server.ts index dbca5ac1..f244d87a 100644 --- a/apps/web/src/routes/(root)/+page.server.ts +++ b/apps/web/src/routes/(root)/+page.server.ts @@ -27,5 +27,6 @@ export const load: PageServerLoad = async () => { hydrateWithAssets(latestRows), hydrateWithAssets(randomRows) ]) - return { types, body, latest, random } + const centerContent = Boolean(body) && !settings.latest && !settings.random + return { types, body, latest, random, centerContent } } diff --git a/apps/web/src/routes/(root)/+page.svelte b/apps/web/src/routes/(root)/+page.svelte index fe535c9e..83e876cb 100644 --- a/apps/web/src/routes/(root)/+page.svelte +++ b/apps/web/src/routes/(root)/+page.svelte @@ -22,46 +22,65 @@ /> - +
+ -
- {#if data.body === undefined} -
-

luzzle pieces

-

export all the pieces

- {#if data.types.length} -

types

-
- {#each data.types as type (type)} - {type} - {/each} -
- {/if} -
- {:else if data.body} -
- {/if} - - {#each collections as collection (collection.title)} - {#if collection.pieces.length} +
+ {#if data.body === undefined}
-

{collection.title}

-
- {#each collection.pieces as piece (piece.id)} - -
- - {piece.title} -
-
- {/each} -
+

luzzle pieces

+

export all the pieces

+ {#if data.types.length} +

types

+
+ {#each data.types as type (type)} + {type} + {/each} +
+ {/if}
+ {:else if data.body} +
{/if} - {/each} -
+ + {#each collections as collection (collection.title)} + {#if collection.pieces.length} +
+

{collection.title}

+
+ {#each collection.pieces as piece (piece.id)} + +
+ + {piece.title} +
+
+ {/each} +
+
+ {/if} + {/each} +
+