|
1 | 1 | <script> |
2 | 2 | import { base } from '$app/paths' |
3 | 3 | import Author from '$lib/components/Author.svelte' |
| 4 | + import BlogItem from '$lib/components/blogs/BlogItem.svelte' |
4 | 5 | import RenderMarkdown from '$lib/components/RenderMarkdown.svelte' |
5 | 6 | import { config } from '$lib/config' |
6 | 7 |
|
7 | 8 | export let post |
8 | 9 | export let author |
9 | 10 | </script> |
10 | 11 |
|
11 | | -<div class="mx-auto max-w-3xl px-4 sm:px-6 xl:max-w-5xl xl:px-0"> |
| 12 | +<div class="mx-auto max-w-3xl px-4 sm:px-6 xl:max-w-4xl xl:px-0"> |
12 | 13 | <article> |
13 | 14 | <div class="xl:divide-y xl:divide-gray-200 xl:dark:divide-gray-700"> |
14 | 15 | <header class="pt-6 xl:pb-6"> |
15 | | - <div class="space-y-1 text-center"> |
16 | | - <div> |
| 16 | + <div class="space-y-1 text-center lg:text-start"> |
| 17 | + <div class="py-5"> |
17 | 18 | <h1 |
18 | | - class="md:leading-14 text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-5xl" |
| 19 | + class="md:leading-14 text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-6xl" |
19 | 20 | > |
20 | 21 | {post.title} |
21 | 22 | </h1> |
22 | 23 | </div> |
23 | | - <dl class="space-y-10"> |
24 | | - <div> |
| 24 | + <div class="flex flex-row items-center gap-4"> |
| 25 | + <dl class="py-3"> |
| 26 | + <dt class="sr-only">Authors</dt> |
| 27 | + <dd> |
| 28 | + <ul |
| 29 | + class="flex justify-center space-x-8 sm:space-x-12 xl:block xl:space-x-0 xl:space-y-8" |
| 30 | + > |
| 31 | + <li class="flex items-center space-x-2"> |
| 32 | + <Author author={author.name} avatar={author.avatar} twitter={author.twitter} /> |
| 33 | + </li> |
| 34 | + </ul> |
| 35 | + </dd> |
| 36 | + </dl> |
| 37 | + <div class="flex flex-col border-s-2 pl-4 text-start"> |
25 | 38 | <dt class="sr-only">Published on</dt> |
26 | 39 | <dd class="text-sm font-medium leading-6 text-gray-500 dark:text-gray-400"> |
27 | 40 | Published on: <time dateTime={post.date}> |
|
42 | 55 | })} |
43 | 56 | </time> |
44 | 57 | </dd> |
45 | | - <dd class="mt-4 text-justify lg:text-start"> |
46 | | - {post.summary} |
47 | | - </dd> |
48 | 58 | </div> |
| 59 | + </div> |
| 60 | + <dl class="space-y-10"> |
| 61 | + <dd class="mt-4 text-justify lg:text-start"> |
| 62 | + {post.summary} |
| 63 | + </dd> |
49 | 64 | </dl> |
50 | 65 | </div> |
51 | 66 | </header> |
52 | 67 | <div |
53 | 68 | class="divide-y divide-gray-200 pb-8 dark:divide-gray-700 xl:grid xl:grid-cols-4 xl:gap-x-6 xl:divide-y-0" |
54 | 69 | style="grid-template-rows: auto 1fr;" |
55 | 70 | > |
56 | | - <dl class="py-6 xl:border-b xl:border-gray-200 xl:pt-10 xl:dark:border-gray-700"> |
57 | | - <dt class="sr-only">Authors</dt> |
58 | | - <dd> |
59 | | - <ul |
60 | | - class="flex justify-center space-x-8 sm:space-x-12 xl:block xl:space-x-0 xl:space-y-8" |
61 | | - > |
62 | | - <li class="flex items-center space-x-2"> |
63 | | - <Author author={author.name} avatar={author.avatar} twitter={author.twitter} /> |
64 | | - </li> |
65 | | - </ul> |
66 | | - </dd> |
67 | | - </dl> |
68 | | - |
69 | 71 | <div |
70 | | - class="divide-y divide-gray-200 dark:divide-gray-700 xl:col-span-3 xl:row-span-2 xl:pb-0" |
| 72 | + class="divide-y divide-gray-200 dark:divide-gray-700 xl:col-span-4 xl:row-span-2 xl:pb-0" |
71 | 73 | > |
72 | 74 | <div |
73 | 75 | class="prose max-w-none pb-8 pt-10 prose-a:text-arkOrange prose-a:no-underline hover:prose-a:underline" |
|
82 | 84 | <RenderMarkdown content={post.content} /> |
83 | 85 | </div> |
84 | 86 | </div> |
85 | | - <footer class=""> |
86 | | - <div |
87 | | - class="divide-gray-200 text-sm font-medium leading-5 dark:divide-gray-700 xl:col-start-1 xl:row-start-2 xl:divide-y" |
88 | | - > |
89 | | - <!-- {#if post.tags} |
90 | | - <div class="py-4 xl:py-8"> |
91 | | - <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"> |
92 | | - Tags |
93 | | - </h2> |
94 | | - <div class="flex flex-wrap"> |
95 | | - {#each post.tags as tag} |
96 | | - <Tag text={tag} /> |
97 | | - {/each} |
98 | | - </div> |
99 | | - </div> |
100 | | - {/if} --> |
101 | | - {#if post.next || post.prev} |
102 | | - <div class="flex justify-between py-4 xl:block xl:space-y-8 xl:py-8"> |
103 | | - {#if post.prev} |
104 | | - <div> |
105 | | - <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"> |
106 | | - Previous Article |
107 | | - </h2> |
108 | | - <div |
109 | | - class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" |
110 | | - > |
111 | | - <a href={base + `/blog/${post.prev.slug}`}>{post.prev.title}</a> |
112 | | - </div> |
| 87 | + </div> |
| 88 | + |
| 89 | + <footer class=""> |
| 90 | + <div class="divide-gray-200 text-sm font-medium leading-5 dark:divide-gray-700"> |
| 91 | + {#if post.next || post.prev} |
| 92 | + <h2 class="py-4 text-2xl font-bold">More Blog Posts</h2> |
| 93 | + |
| 94 | + <div class="flex flex-row gap-4 py-4 xl:py-8"> |
| 95 | + {#if post.prev} |
| 96 | + <div class="max-w-md flex-1"> |
| 97 | + <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"> |
| 98 | + Previous Article |
| 99 | + </h2> |
| 100 | + <div class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400"> |
| 101 | + <!-- <a href={base + `/blog/${post.prev.slug}`}>{post.prev.title}</a> --> |
| 102 | + <BlogItem post={post.prev} /> |
113 | 103 | </div> |
114 | | - {/if} |
115 | | - {#if post.next} |
116 | | - <div> |
117 | | - <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"> |
118 | | - Next Article |
119 | | - </h2> |
120 | | - <div |
121 | | - class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" |
122 | | - > |
123 | | - <a href={base + `/blog/${post.next.slug}`}>{post.next.title}</a> |
124 | | - </div> |
| 104 | + </div> |
| 105 | + {/if} |
| 106 | + {#if post.next} |
| 107 | + <div class="max-w-md flex-1"> |
| 108 | + <h2 class="text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400"> |
| 109 | + Next Article |
| 110 | + </h2> |
| 111 | + <div class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400"> |
| 112 | + <!-- <a href={base + `/blog/${post.next.slug}`}>{post.next.title}</a> --> |
| 113 | + <BlogItem post={post.next} /> |
125 | 114 | </div> |
126 | | - {/if} |
127 | | - </div> |
128 | | - {/if} |
129 | | - </div> |
130 | | - <div class="pt-4 xl:pt-8"> |
131 | | - <a |
132 | | - href="{base}/blog" |
133 | | - class="text-primary-500 hover:text-primary-600 dark:hover:text-primary-400" |
134 | | - > |
135 | | - ← Back to the blog |
136 | | - </a> |
137 | | - </div> |
138 | | - </footer> |
139 | | - </div> |
| 115 | + </div> |
| 116 | + {/if} |
| 117 | + </div> |
| 118 | + {/if} |
| 119 | + </div> |
| 120 | + </footer> |
140 | 121 | </div> |
141 | 122 | </article> |
142 | 123 | </div> |
0 commit comments