mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-28 04:06:54 +00:00
Update page.tsx
This commit is contained in:
parent
220d044f37
commit
ddd296a930
@ -1,15 +1,20 @@
|
||||
import fs from "fs"
|
||||
import path from "path"
|
||||
import ReactMarkdown from "react-markdown"
|
||||
import { remark } from "remark"
|
||||
import html from "remark-html"
|
||||
|
||||
async function getChangelog() {
|
||||
const changelogPath = path.join(process.cwd(), "..", "CHANGELOG.md")
|
||||
try {
|
||||
const fileContents = fs.readFileSync(changelogPath, "utf8")
|
||||
return fileContents
|
||||
|
||||
// Convertir Markdown a HTML
|
||||
const result = await remark().use(html).process(fileContents)
|
||||
|
||||
return result.toString()
|
||||
} catch (error) {
|
||||
console.error("Error reading changelog file:", error)
|
||||
return "Changelog content not found."
|
||||
return "<p>Changelog content not found.</p>"
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,9 +25,10 @@ export default async function ChangelogPage() {
|
||||
<div className="bg-white text-gray-900 min-h-screen">
|
||||
<div className="container mx-auto px-4 py-16 max-w-4xl">
|
||||
<h1 className="text-4xl font-bold mb-8">Changelog</h1>
|
||||
<div className="prose prose-lg max-w-none bg-gray-100 p-4 border border-gray-300 rounded-md">
|
||||
<ReactMarkdown>{changelogContent}</ReactMarkdown>
|
||||
</div>
|
||||
<div
|
||||
className="prose prose-lg max-w-none bg-gray-100 p-4 border border-gray-300 rounded-md"
|
||||
dangerouslySetInnerHTML={{ __html: changelogContent }} // Renderizar como HTML
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user