Skip to content

Commit 0c888e1

Browse files
committed
chore: add md button for every mdx file
1 parent f49e3b1 commit 0c888e1

21 files changed

Lines changed: 41 additions & 20 deletions

src/components/Common/PageActionButtons.jsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
GoChevronDown,
99
GoCheck,
1010
GoPencil,
11+
GoFileCode,
1112
} from "react-icons/go";
1213

1314
const PageActionButtons = () => {
@@ -79,6 +80,13 @@ const PageActionButtons = () => {
7980
}
8081
};
8182

83+
const viewMarkdown = () => {
84+
const path = router.asPath.replace(/\/$/, ""); // Remove trailing slash
85+
const mdUrl = `${window.location.origin}/llms${path}.md`;
86+
window.open(mdUrl, "_blank");
87+
setIsOpen(false);
88+
};
89+
8290
return (
8391
<div className="relative mb-4" ref={dropdownRef}>
8492
<div
@@ -111,6 +119,19 @@ const PageActionButtons = () => {
111119
style={{ backgroundColor: "#333" }}
112120
>
113121
<div className="py-1">
122+
<button
123+
onClick={viewMarkdown}
124+
className="flex items-center gap-3 w-full px-4 py-2 text-sm text-white hover:opacity-80 transition-colors"
125+
>
126+
<GoFileCode className="text-gray-400" />
127+
<div className="text-right">
128+
<div className="text-white">نمایش MarkDown</div>
129+
<div className="text-gray-400 text-xs">
130+
مشاهده فایل MarkDown این صفحه
131+
</div>
132+
</div>
133+
</button>
134+
114135
<button
115136
onClick={editOnGitHub}
116137
className="flex items-center gap-3 w-full px-4 py-2 text-sm text-white hover:opacity-80 transition-colors"

src/pages/mirrors/about.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ import Head from "next/head";
134134

135135
<div className="h-4" />
136136
<div className="grid md:grid-cols-3 gap-4">
137-
{[
137+
{[
138138
{ alt: 'https://media.liara.ir/logos/composer.png', platform: 'Composer', link: "/mirrors/composer" },
139139
{ alt: 'go', platform: 'Go', link: "/mirrors/go" },
140140
{ alt: 'nodejs', platform: 'NPM', link: "/mirrors/npm" },

src/pages/mirrors/alpine-linux.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ echo "https://linux-mirror.liara.ir/repository/alpine/v\${ALPINE_VERSION}/commun
8080
</Highlight>
8181
</div>
8282
</>
83-
)
83+
)
8484
},
8585
{
8686
step: "۳",

src/pages/mirrors/arch-linux.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ import Head from "next/head";
9898
}
9999
]}
100100
/>
101-
101+
102102
<div className="h-4" />
103103

104104
با انجام کارهای فوق، میرورهای لیارا در سیستم عامل شما تنظیم خواهند شد و درخواست‌های آپدیت یا دانلود پکیج

src/pages/mirrors/centos.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ EOF
8585
</Highlight>
8686
</div>
8787
</>
88-
)
88+
)
8989
},
9090
{
9191
step: "۳",

src/pages/mirrors/composer.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ import Head from "next/head";
6565
</Highlight>
6666
</div>
6767
<div className="h-2" />
68-
68+
6969
</Layout>

src/pages/mirrors/debian.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ https://linux-mirror.liara.ir/repository/debian-security/`}
5151
برای تنظیم میرورهای فوق در سیستم عامل debian خود، گام‌های زیر را طی کنید:
5252

5353
<Step steps={[
54-
{
54+
{
5555
step: "۱",
5656
content: (
5757
<>

src/pages/mirrors/docker.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ import Head from "next/head";
9090
</>
9191
)
9292
},
93-
{
93+
{
9494
step: "۳",
9595
content: (
9696
<>

src/pages/mirrors/fedora.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
127127
skip_if_unavailable=False`}
128128
</Highlight>
129129
</div>
130-
<div className="h-2" />
130+
<div className="h-2" />
131131
<p>در نهایت <Important>CTRL + X</Important> را بزنید و سپس <Important>Y</Important> و بعد از آن، <Important>Enter</Important> را بزنید تا تغییرات، ذخیره شوند.</p>
132132
<div className="h-2" />
133133
</>

src/pages/mirrors/ghcr.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@ systemctl restart docker`}
114114
با انجام کارهای فوق، میرورهای لیارا در سیستم عامل شما تنظیم خواهند شد و درخواست‌های آپدیت یا دانلود پکیج
115115
به این میرورها ارسال خواهند شد.
116116

117-
</Layout>
117+
</Layout>

0 commit comments

Comments
 (0)