diff --git a/src/app/(posts)/components/file-dropdown/index.tsx b/src/app/(posts)/components/file-dropdown/index.tsx
index f4b9680c..1d8723ad 100644
--- a/src/app/(posts)/components/file-dropdown/index.tsx
+++ b/src/app/(posts)/components/file-dropdown/index.tsx
@@ -6,6 +6,7 @@ import styles from "./dropdown.module.css"
import buttonStyles from "@components/button/button.module.css"
import { ChevronDown, Code, File as FileIcon } from "react-feather"
import { Spinner } from "@components/spinner"
+import Link from "next/link"
type Item = File & {
icon: JSX.Element
@@ -51,12 +52,12 @@ const FileDropdown = ({
diff --git a/src/app/(posts)/components/preview/preview.module.css b/src/app/(posts)/components/preview/preview.module.css
index 1fd9b2f9..2436fee8 100644
--- a/src/app/(posts)/components/preview/preview.module.css
+++ b/src/app/(posts)/components/preview/preview.module.css
@@ -1,5 +1,7 @@
.markdownPreview {
padding: var(--gap-quarter);
+ font-size: 18px;
+ line-height: 1.75;
}
.markdownPreview p {
diff --git a/src/app/(posts)/post/[id]/components/post-files/view-document/index.tsx b/src/app/(posts)/post/[id]/components/post-files/view-document/index.tsx
index d23aa006..2ace79e8 100644
--- a/src/app/(posts)/post/[id]/components/post-files/view-document/index.tsx
+++ b/src/app/(posts)/post/[id]/components/post-files/view-document/index.tsx
@@ -1,6 +1,6 @@
"use client"
-import { memo } from "react"
+import { memo, useEffect } from "react"
import styles from "./document.module.css"
import Skeleton from "@components/skeleton"
import Link from "next/link"
@@ -81,10 +81,22 @@ const Document = ({ skeleton, ...props }: Props) => {
const { title, initialTab, id, content, preview } = props
+ // if the query has our title, we can use it to scroll to the file.
+ // we can't use the browsers implementation because the data isn't loaded yet
+ if (title) {
+ const hash = window.location.hash
+ if (hash && hash === `#${title}`) {
+ const element = document.getElementById(title)
+ if (element) {
+ element.scrollIntoView()
+ }
+ }
+ }
+
return (
<>