Skip to content

Commit 09693d1

Browse files
committed
View as markdown on docs
1 parent bd79751 commit 09693d1

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

www/routes/docs/[...slug].tsx

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,27 @@ export default definePage(function DocsPage(props) {
217217
<TableOfContents headings={headings} />
218218

219219
<div class="lg:order-1 min-w-0 max-w-3xl w-full">
220+
<div class="px-4 md:px-0 mb-2">
221+
<a
222+
href={`${props.url.pathname}.md`}
223+
class="inline-flex items-center gap-1 text-xs text-foreground-secondary hover:text-foreground-primary hover:underline"
224+
>
225+
<svg
226+
class="h-3.5 w-3.5"
227+
viewBox="0 0 24 24"
228+
fill="none"
229+
stroke="currentColor"
230+
stroke-width="2"
231+
stroke-linecap="round"
232+
stroke-linejoin="round"
233+
aria-hidden="true"
234+
>
235+
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
236+
<path d="M14 2v6h6" />
237+
</svg>
238+
View as Markdown
239+
</a>
240+
</div>
220241
<h1 class="text-4xl text-foreground-primary tracking-tight font-bold md:mt-0 px-4 md:px-0 mb-4">
221242
{page.title}
222243
</h1>
@@ -235,7 +256,7 @@ export default definePage(function DocsPage(props) {
235256
/>
236257
</div>
237258
<hr />
238-
<div class="px-4 md:px-0 flex flex-wrap gap-3 justify-between my-6">
259+
<div class="px-4 md:px-0 flex justify-between my-6">
239260
<a
240261
href={`https://github.com/denoland/fresh/edit/main/${page.file}`}
241262
class="text-gray-700 dark:text-gray-200 text-md flex items-center bg-[#ebedf0] dark:bg-[#2c2d39] px-4 py-2 rounded-sm hover:bg-gray-200 dark:hover:bg-[#36394c] transition-colors"
@@ -245,12 +266,6 @@ export default definePage(function DocsPage(props) {
245266
<span class="mr-2 inline-flex">Edit this page</span>
246267
<Icons.GitHub />
247268
</a>
248-
<a
249-
href={`${props.url.pathname}.md`}
250-
class="text-gray-700 dark:text-gray-200 text-md flex items-center bg-[#ebedf0] dark:bg-[#2c2d39] px-4 py-2 rounded-sm hover:bg-gray-200 dark:hover:bg-[#36394c] transition-colors"
251-
>
252-
View as Markdown
253-
</a>
254269
</div>
255270
</div>
256271
</div>

0 commit comments

Comments
 (0)