20 Commits

Author SHA1 Message Date
Renovate Bot
5c6f25b095 Update dependency eslint to v9 2024-10-09 23:06:33 +00:00
40fd695d03 Merge pull request 'Update dependency eslint-config-next to v14.2.15' (#5) from renovate/eslint-config-next-14.x into master
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m54s
Reviewed-on: #5
2024-10-09 15:52:41 -07:00
Renovate Bot
9c69c76d52 Update dependency eslint-config-next to v14.2.15 2024-10-09 22:13:16 +00:00
5e2946d00c updates
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m32s
Took 5 minutes
2024-10-09 17:43:25 -04:00
cf8530c750 footer configuration
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m29s
Took 8 minutes
2024-10-09 17:38:36 -04:00
3d44677d82 fix build warnings
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m23s
Took 12 minutes
2024-10-09 17:29:43 -04:00
6e949539ab add metadata & viewport to the config
Some checks failed
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Failing after 33s
Took 11 minutes
2024-10-09 17:17:21 -04:00
45d5a0e2d4 copy docs content
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m11s
Took 2 minutes
2024-10-09 17:05:59 -04:00
18b31bcb7b now will this deploy?
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m12s
Took 1 minute
2024-10-09 17:02:31 -04:00
a7da175499 test
Some checks failed
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Failing after 17s
Took 30 seconds
2024-10-09 17:01:27 -04:00
24d6eb52f6 test
Some checks failed
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Failing after 7s
Took 2 minutes
2024-10-09 17:00:58 -04:00
0cd347714e add config.json to the Dockerfile
Some checks failed
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Failing after 7s
Took 4 minutes
2024-10-09 16:58:58 -04:00
d364ea83b5 add support from pulling from a Git repo for docs content
Some checks failed
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Failing after 47s
Took 24 minutes
2024-10-09 16:54:36 -04:00
1614889a62 add a config
Some checks failed
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Failing after 19s
Took 52 minutes
2024-10-09 16:30:22 -04:00
7c6fd8a5ef make the 404 page more responsive
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m5s
Took 6 minutes
2024-10-09 14:45:17 -04:00
e26a9e0267 fix hover on the sidebar in light mode
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m5s
Took 8 minutes
2024-10-09 14:38:54 -04:00
1634fb7520 make indentation lines more visible in light mode
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m4s
Took 2 minutes
2024-10-09 14:31:10 -04:00
d4209bc23d custom 404 page
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m2s
Took 13 minutes
2024-10-09 14:28:54 -04:00
876d0094ca light mode
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m48s
Took 35 minutes
2024-10-09 14:15:16 -04:00
cbc9dcb1ab some changes
Took 1 hour 4 minutes
2024-10-09 13:40:01 -04:00
35 changed files with 553 additions and 284 deletions

2
.gitignore vendored
View File

@ -6,7 +6,7 @@ node_modules
.env*.local .env*.local
next-env.d.ts next-env.d.ts
.sentryclirc .sentryclirc
.env config.json
sw.* sw.*
workbox-* workbox-*
swe-worker-* swe-worker-*

View File

@ -14,6 +14,7 @@ WORKDIR /usr/src/app
COPY --from=depends /usr/src/app/node_modules ./node_modules COPY --from=depends /usr/src/app/node_modules ./node_modules
COPY . . COPY . .
ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_TELEMETRY_DISABLED 1
RUN --mount=type=bind,target=/config,from=docs cp /config/config.json ./config.json
RUN bun run build RUN bun run build
@ -32,6 +33,8 @@ COPY --from=builder --chown=nextjs:nextjs /usr/src/app/.next ./.next
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/public ./public COPY --from=builder --chown=nextjs:nextjs /usr/src/app/public ./public
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/next.config.mjs ./next.config.mjs COPY --from=builder --chown=nextjs:nextjs /usr/src/app/next.config.mjs ./next.config.mjs
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/package.json ./package.json COPY --from=builder --chown=nextjs:nextjs /usr/src/app/package.json ./package.json
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/config.json ./config.json
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/docs ./docs
ENV NODE_ENV production ENV NODE_ENV production

View File

@ -1,3 +1,2 @@
# docs # docs
The source coded for the Pulse App documentation site.
The public documentation for Pulse App.

BIN
bun.lockb

Binary file not shown.

88
config.json.example Normal file
View File

@ -0,0 +1,88 @@
{
"siteName": "Pulse App",
"metadata": {
"title": {
"default": "Pulse Docs",
"template": "%s • Pulse Docs"
},
"description": "A lightweight service monitoring solution for tracking the availability of whatever service your heart desires!",
"openGraph": {
"images": [
{
"url": "https://pulseapp.cc/media/logo.png",
"width": 128,
"height": 128
}
]
},
"twitter": {
"card": "summary"
}
},
"viewport": {
"themeColor": "#A855F7"
},
"contentSource": "{process}/docs",
"socialLinks": [
{
"name": "GitHub",
"tooltip": "View our Github",
"logo": "./github.svg",
"href": "https://github.com/PulseAppCC",
"navbar": true
},
{
"name": "Discord",
"tooltip": "Join our Discord",
"logo": "./discord.svg",
"href": "https://discord.pulseapp.cc",
"navbar": true
},
{
"name": "Email",
"tooltip": "Email us",
"logo": "Mail",
"href": "mailto:support@pulseapp.cc",
"navbar": false
}
],
"footer": {
"homeUrl": "https://pulseapp.cc",
"links": {
"Resources": [
{
"name": "Support",
"href": "https://support.pulseapp.cc"
},
{
"name": "Jobs",
"href": "https://jobs.pulseapp.cc"
},
{
"name": "Developers",
"shortName": "Devs",
"href": "https://dev.pulseapp.cc",
"external": true
},
{
"name": "System Status",
"shortName": "Status",
"href": "https://status.pulseapp.cc",
"external": true
}
],
"Legal": [
{
"name": "Terms & Conditions",
"shortName": "Terms",
"href": "/legal/terms"
},
{
"name": "Privacy Policy",
"shortName": "Privacy",
"href": "/legal/privacy"
}
]
}
}
}

View File

@ -1,6 +1,6 @@
--- ---
title: '🐋 Docker' title: '🐋 Docker'
published: '2024-10-07' updated: '2024-10-07'
summary: 'petentium usu tota noluisse errem elaboraret auctor.' summary: 'petentium usu tota noluisse errem elaboraret auctor.'
order: 4 order: 4
--- ---

View File

@ -1,6 +1,6 @@
--- ---
title: '🧩 Components' title: '🧩 Components'
published: '2024-10-07' updated: '2024-10-07'
summary: 'petentium usu tota noluisse errem elaboraret auctor.' summary: 'petentium usu tota noluisse errem elaboraret auctor.'
order: 2 order: 2
--- ---

View File

@ -1,6 +1,6 @@
--- ---
title: '✔️ Supported Services' title: '✔️ Supported Services'
published: '2024-10-07' updated: '2024-10-07'
summary: 'petentium usu tota noluisse errem elaboraret auctor.' summary: 'petentium usu tota noluisse errem elaboraret auctor.'
order: 3 order: 3
--- ---

View File

@ -1,6 +1,6 @@
--- ---
title: '🚀 Introduction' title: '🚀 Introduction'
published: '2024-10-06' updated: '2024-10-06'
summary: 'petentium usu tota noluisse errem elaboraret auctor.' summary: 'petentium usu tota noluisse errem elaboraret auctor.'
order: 1 order: 1
--- ---
@ -8,10 +8,8 @@ order: 1
> [!IMPORTANT] > [!IMPORTANT]
> These docs are currently a work in progress and are subject to change. > These docs are currently a work in progress and are subject to change.
# Pulse App # <span className="flex gap-2.5 items-center"><Activity className="w-6 h-6 text-primary" /> Pulse App</span>
<span className="flex gap-2 items-center select-none"> A lightweight service monitoring solution for tracking the availability of whatever service your heart desires!
<Activity className="w-4 h-4 text-primary" /> <span>A lightweight service monitoring solution for tracking the availability of whatever service your heart desires!</span>
</span>
## Getting Started ## Getting Started
Let's get you up and running—this will only take a few minutes! Start by [creating your account](#creating-your-account) and Let's get you up and running—this will only take a few minutes! Start by [creating your account](#creating-your-account) and

View File

@ -32,6 +32,7 @@
"react-dom": "^19.0.0-rc-1460d67c-20241003", "react-dom": "^19.0.0-rc-1460d67c-20241003",
"remark-gfm": "^4.0.0", "remark-gfm": "^4.0.0",
"remote-mdx": "^0.0.8", "remote-mdx": "^0.0.8",
"simple-git": "^3.27.0",
"tailwind-merge": "^2.5.3", "tailwind-merge": "^2.5.3",
"tailwindcss-animate": "^1.0.7" "tailwindcss-animate": "^1.0.7"
}, },
@ -41,7 +42,7 @@
"@types/react": "^18", "@types/react": "^18",
"@types/react-dom": "^18", "@types/react-dom": "^18",
"eslint": "^9.0.0", "eslint": "^9.0.0",
"eslint-config-next": "14.2.14", "eslint-config-next": "14.2.15",
"postcss": "^8", "postcss": "^8",
"tailwindcss": "^3.4.1", "tailwindcss": "^3.4.1",
"typescript": "^5" "typescript": "^5"

View File

@ -1,4 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 127.14 96.36"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 127.14 96.36">
<path fill="#fff" <path fill="#5865f2"
d="M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z"/> d="M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 777 B

After

Width:  |  Height:  |  Size: 780 B

View File

@ -1,5 +1,50 @@
<svg width="98" height="96" xmlns="http://www.w3.org/2000/svg"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 96 96" id="Github-Octocat--Streamline-Svg-Logos.svg"
<path fill-rule="evenodd" clip-rule="evenodd" height="98" width="98" stroke-width="1">
d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" <desc>Github Octocat Streamline Icon: https://streamlinehq.com</desc>
fill="#fff"/> <path fill="#9EDCF2"
d="M74.4304 73.4278c0 5.0396-11.6744 9.1002-26.068 9.1002-14.3936 0-26.068-4.0969-26.068-9.1002 0-5.0396 11.6744-9.1002 26.068-9.1002 14.3936 0 26.068 4.0606 26.068 9.1002Z"></path>
<mask id="a" width="30" height="25" x="33" y="70" maskUnits="userSpaceOnUse" style="mask-type:luminance">
<path fill="#fff"
d="M37.159 89.7428c.5801 2.7192 1.9941 4.3145 3.4081 5.2571h14.9012c1.8128-1.2327 3.6618-3.553 3.6618-7.9037V75.8568s.2175-2.7917 2.7917-3.6981c0 0 1.4865-1.0514-.1088-1.6315 0 0-7.0699-.5801-7.0699 5.2209v8.5564s.2901 3.1542-1.3777 4.4594V78.1772s.1088-3.3718 1.8491-4.6407c0 0 1.1602-2.0666-1.3777-1.5228 0 0-4.8583.6889-5.0759 6.381l-.1087 10.8768H47.492l-.1088-10.8768c-.2175-5.6559-5.0758-6.381-5.0758-6.381-2.5379-.5801-1.3777 1.5228-1.3777 1.5228 1.7402 1.2689 1.849 4.6407 1.849 4.6407v10.6955c-1.6678-1.1965-1.3777-4.5682-1.3777-4.5682v-8.5564c0-5.801-7.0699-5.2209-7.0699-5.2209-1.6315.5801-.1088 1.6315-.1088 1.6315 2.5379.9427 2.7917 3.6981 2.7917 3.6981v7.8676l.145 6.0184Z"></path>
</mask>
<g mask="url(#a)">
<path fill="#7DBCE7"
d="M74.4304 73.4276c0 5.0395-11.6744 9.1002-26.068 9.1002-14.3936 0-26.068-4.0969-26.068-9.1002 0-5.0396 11.6744-9.1003 26.068-9.1003 14.3936 0 26.068 4.0607 26.068 9.1003Z"></path>
</g>
<path fill="#9EDCF2"
d="m18.5959 46.6347-.7614 2.6104s-.1812.9427.6889 1.124c.9426-.0363.8701-.9064.7976-1.1602l-.7251-2.5742Z"></path>
<path fill="#010101"
d="m94.3348 35.6491.0725-.3263c-7.65-1.5227-15.4812-1.559-20.2308-1.3414.7614-2.7917 1.0152-6.0548 1.0152-9.6441 0-5.1846-1.9578-9.3177-5.0758-12.4358.5438-1.7765 1.2689-5.72838-.7251-10.76795 0 0-3.5531-1.12392813-11.6382 4.2782-3.1542-.79763-6.526-1.19645-9.8978-1.19645-3.6981 0-7.4325.47133-10.9493 1.41398C28.5667-.0628898 24.9048 1.0973 24.9048 1.0973c-2.3929 5.98222-.9064 10.4417-.4713 11.5294-2.828 3.0455-4.532 6.9248-4.532 11.6744 0 3.5893.3988 6.8161 1.414 9.6078-4.7858-.1813-12.32702-.1088-19.72321 1.3777l.07251.3263c7.39619-1.4865 15.0099-1.5228 19.7594-1.3415.2176.5801.4714 1.1602.7252 1.704-4.7133.1451-12.72585.7614-20.41209 2.9368l.10877.3263C9.60483 37.0631 17.6899 36.483 22.3669 36.338c2.828 5.2208 8.3389 8.6289 18.2004 9.6803-1.4139.9427-2.8279 2.5379-3.408 5.2571-1.9216.9064-7.94 3.1543-11.5656-3.0817 0 0-2.0304-3.6981-5.9097-3.9882 0 0-3.7706-.0725-.2538 2.3567 0 0 2.5016 1.1964 4.2419 5.6559 0 0 2.2841 7.6137 13.1971 5.1483v7.795s-.2175 2.7917-2.7917 3.6981c0 0-1.5227 1.0514.1088 1.6315 0 0 7.0699.5801 7.0699-5.2208v-8.5564s-.29-3.408 1.3777-4.5682v14.0672s-.1087 3.3718-1.849 4.6408c0 0-1.1602 2.0666 1.3777 1.5227 0 0 4.8583-.6888 5.0758-6.381l.1088-14.2485h1.1602l.1088 14.2485c.2175 5.6559 5.0758 6.381 5.0758 6.381 2.5379.5801 1.3777-1.5227 1.3777-1.5227-1.7403-1.269-1.8491-4.6408-1.8491-4.6408V52.2543c1.6678 1.3052 1.3778 4.4595 1.3778 4.4595v8.5564c0 5.8009 7.0699 5.2208 7.0699 5.2208 1.6315-.5801.1087-1.6315.1087-1.6315-2.5379-.9426-2.7917-3.6981-2.7917-3.6981V53.9221c0-4.387-1.849-6.7073-3.6618-7.9038 10.5142-1.0514 15.5538-4.4232 17.8741-9.7166 4.6045.1088 12.9071.6889 20.8109 2.9368l.1088-.3263c-7.8676-2.2116-16.0976-2.7917-20.7746-2.9368.2175-.5438.3988-1.0876.5801-1.6677 4.8582-.1813 12.7258-.1813 20.412 1.3414Z"></path>
<path fill="#F5CCB3"
d="M64.8947 24.0835c2.2479 2.0666 3.5893 4.532 3.5893 7.1787 0 12.472-9.2815 12.7983-20.7383 12.7983-11.4569 0-20.7384-1.7403-20.7384-12.7983 0-2.6467 1.3052-5.1121 3.5531-7.1424 3.7344-3.4081 10.0429-1.5953 17.1853-1.5953 7.1424 0 13.4147-1.849 17.149 1.559Z"></path>
<path fill="#fff"
d="M40.8579 31.9148c0 3.4443-1.9216 6.1997-4.3144 6.1997-2.3929 0-4.3145-2.7917-4.3145-6.1997 0-3.4443 1.9216-6.1998 4.3145-6.1998 2.3928-.0362 4.3144 2.7555 4.3144 6.1998Z"></path>
<path fill="#AF5C51"
d="M39.4794 31.9872c0 2.2842-1.3052 4.1332-2.8642 4.1332-1.5953 0-2.8642-1.849-2.8642-4.1332 0-2.2841 1.3052-4.1331 2.8642-4.1331s2.8642 1.849 2.8642 4.1331Z"></path>
<path fill="#fff"
d="M64.0254 31.9148c0 3.4443-1.9216 6.1997-4.3145 6.1997s-4.3144-2.7917-4.3144-6.1997c0-3.4443 1.9215-6.1998 4.3144-6.1998 2.3567-.0362 4.3145 2.7555 4.3145 6.1998Z"></path>
<path fill="#AF5C51"
d="M62.6108 31.9872c0 2.2842-1.3053 4.1332-2.8643 4.1332-1.5952 0-2.8642-1.849-2.8642-4.1332 0-2.2841 1.3052-4.1331 2.8642-4.1331 1.5953 0 2.8643 1.849 2.8643 4.1331Z"></path>
<path fill="#AF5C51"
d="M48.9068 37.4257c0 .5801-.4713 1.0877-1.0877 1.0877-.5801 0-1.0877-.4714-1.0877-1.0877 0-.6164.4714-1.0877 1.0877-1.0877.5801 0 1.0877.4713 1.0877 1.0877Z"></path>
<path fill="#AF5C51"
d="M45.3171 40.1449c-.0725-.1813.0363-.3625.2176-.4351.1813-.0725.3625.0363.4351.2176.29.7976 1.0151 1.3052 1.849 1.3052.8339 0 1.559-.5438 1.8491-1.3052.0725-.1813.2537-.2901.435-.2176.1813.0726.2901.2538.2176.4351-.3626 1.0514-1.3778 1.7766-2.5017 1.7766-1.1239 0-2.1391-.7252-2.5017-1.7766Z"></path>
<path fill="#C4E5D9"
d="M21.3518 45.0757c0 .29-.3263.5076-.7613.5076-.3988 0-.7614-.2176-.7614-.5076 0-.29.3263-.5076.7614-.5076.435 0 .7613.2176.7613.5076Z"></path>
<path fill="#C4E5D9"
d="M23.4544 46.2359c0 .29-.3263.5075-.7614.5075-.3988 0-.7614-.2175-.7614-.5075 0-.2901.3263-.5076.7614-.5076s.7614.2175.7614.5076Z"></path>
<path fill="#C4E5D9"
d="M24.7229 47.7586c0 .2901-.3263.5076-.7613.5076-.3988 0-.7614-.2175-.7614-.5076 0-.29.3263-.5076.7614-.5076.435-.0362.7613.2176.7613.5076Z"></path>
<path fill="#C4E5D9"
d="M25.8836 49.499c0 .29-.3263.5075-.7614.5075-.3988 0-.7614-.2175-.7614-.5075 0-.2901.3263-.5076.7614-.5076.4351-.0363.7614.2175.7614.5076Z"></path>
<path fill="#C4E5D9"
d="M27.1521 51.0941c0 .2901-.3263.5076-.7613.5076-.3988 0-.7614-.2175-.7614-.5076 0-.29.3263-.5076.7614-.5076.435 0 .7613.2176.7613.5076Z"></path>
<path fill="#C4E5D9"
d="M28.8924 52.5081c0 .2901-.3263.5076-.7614.5076-.3988 0-.7614-.2175-.7614-.5076 0-.29.3263-.5076.7614-.5076.4351-.0362.7614.2176.7614.5076Z"></path>
<path fill="#C4E5D9"
d="M31.3216 53.4146c0 .29-.3263.5075-.7614.5075-.3988 0-.7614-.2175-.7614-.5075 0-.2901.3263-.5076.7614-.5076s.7614.2175.7614.5076Z"></path>
<path fill="#C4E5D9"
d="M33.7517 53.4146c0 .29-.3263.5075-.7613.5075-.3988 0-.7614-.2175-.7614-.5075 0-.2901.3263-.5076.7614-.5076.435 0 .7613.2175.7613.5076Z"></path>
<path fill="#C4E5D9"
d="M36.2166 53.0157c0 .29-.3263.5076-.7614.5076-.3988 0-.7614-.2176-.7614-.5076 0-.29.3263-.5076.7614-.5076.3988 0 .7614.2176.7614.5076Z"></path>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 986 B

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
public/media/mike.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -30,7 +30,7 @@ const DocsPage = async ({
); );
// Get the content to display based on the provided slug // Get the content to display based on the provided slug
const pages: DocsContentMetadata[] = getDocsContent(); const pages: DocsContentMetadata[] = await getDocsContent();
const decodedSlug: string = decodeURIComponent(slug || ""); const decodedSlug: string = decodeURIComponent(slug || "");
const page: DocsContentMetadata | undefined = pages.find( const page: DocsContentMetadata | undefined = pages.find(
(metadata: DocsContentMetadata): boolean => (metadata: DocsContentMetadata): boolean =>
@ -101,7 +101,9 @@ export const generateMetadata = async ({
"/" "/"
); // The slug of the content ); // The slug of the content
if (slug) { if (slug) {
const content: DocsContentMetadata | undefined = getDocsContent().find( const content: DocsContentMetadata | undefined = (
await getDocsContent()
).find(
(metadata: DocsContentMetadata): boolean => metadata.slug === slug (metadata: DocsContentMetadata): boolean => metadata.slug === slug
); // Get the content based on the provided slug ); // Get the content based on the provided slug
if (content) { if (content) {

7
src/app/config.ts Normal file
View File

@ -0,0 +1,7 @@
/**
* The configuration for this app.
*/
import config from "@/configJson";
import { Config } from "@/types/config";
export default config as Config;

View File

@ -6,42 +6,25 @@ import Navbar from "@/components/navbar/navbar";
import Sidebar from "@/components/sidebar/sidebar"; import Sidebar from "@/components/sidebar/sidebar";
import Footer from "@/components/footer"; import Footer from "@/components/footer";
import { TooltipProvider } from "@/components/ui/tooltip"; import { TooltipProvider } from "@/components/ui/tooltip";
import { getDocsContent } from "@/lib/mdx";
import config from "@/config";
/** /**
* The metadata for this app. * The metadata for this app.
*/ */
export const metadata: Metadata = { export const metadata: Metadata = config.metadata;
title: { export const viewport: Viewport = config.viewport;
default: "Pulse Docs",
template: "%s • Pulse Docs",
},
description:
"A lightweight service monitoring solution for tracking the availability of whatever service your heart desires!",
openGraph: {
images: [
{
url: "https://pulseapp.cc/media/logo.png",
width: 128,
height: 128,
},
],
},
twitter: {
card: "summary",
},
};
export const viewport: Viewport = {
themeColor: "#A855F7",
};
/** /**
* The primary layout for this app. * The primary layout for this app.
*/ */
const RootLayout = ({ const RootLayout = async ({
children, children,
}: Readonly<{ }: Readonly<{
children: ReactNode; children: ReactNode;
}>): ReactElement => ( }>): Promise<ReactElement> => {
const pages: DocsContentMetadata[] = await getDocsContent();
return (
<html lang="en"> <html lang="en">
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem> <ThemeProvider attribute="class" defaultTheme="dark" enableSystem>
<body <body
@ -52,10 +35,10 @@ const RootLayout = ({
> >
<TooltipProvider delayDuration={100}> <TooltipProvider delayDuration={100}>
<div className="px-3 md:px-7 max-w-screen-2xl min-h-screen mx-auto flex flex-col transition-all"> <div className="px-3 md:px-7 max-w-screen-2xl min-h-screen mx-auto flex flex-col transition-all">
<Navbar /> <Navbar pages={pages} />
<div className="pt-[4.5rem] w-full h-full flex flex-grow gap-5"> <div className="pt-[4.5rem] w-full h-full flex flex-grow gap-5 sm:gap-8 transition-all transform-gpu">
<div className="relative hidden xs:flex"> <div className="relative hidden xs:flex">
<Sidebar /> <Sidebar pages={pages} />
</div> </div>
{children} {children}
</div> </div>
@ -65,5 +48,6 @@ const RootLayout = ({
</body> </body>
</ThemeProvider> </ThemeProvider>
</html> </html>
); );
};
export default RootLayout; export default RootLayout;

33
src/app/not-found.tsx Normal file
View File

@ -0,0 +1,33 @@
import { ReactElement } from "react";
import Image from "next/image";
/**
* The not found page.
*
* @return the page jsx
*/
const NotFoundPage = (): ReactElement => (
<main className="w-full pt-[25vh] min-h-screen flex justify-center select-none pointer-events-none">
<div className="h-fit flex gap-5 sm:gap-10 items-center transition-all transform-gpu">
{/* Image */}
<div className="relative w-24 h-24 xs:w-20 xs:h-20 sm:w-44 sm:h-44">
<Image
src="/media/mike.png"
alt="Mike Wazowski"
fill
draggable={false}
/>
</div>
{/* Message */}
<div className="flex flex-col gap-0.5">
<h1 className="text-3xl font-bold">Wrong Door!</h1>
<p className="max-w-72 sm:text-lg opacity-75">
The documentation page you were looking for could not be
found.
</p>
</div>
</div>
</main>
);
export default NotFoundPage;

View File

@ -20,13 +20,13 @@ body {
--card-foreground: 240 10% 3.9%; --card-foreground: 240 10% 3.9%;
--popover: 0 0% 100%; --popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%; --popover-foreground: 240 10% 3.9%;
--primary: 240 5.9% 10%; --primary: 271 91% 65%;
--primary-foreground: 0 0% 98%; --primary-foreground: 0 0% 98%;
--secondary: 240 4.8% 95.9%; --secondary: 240 4.8% 95.9%;
--secondary-foreground: 240 5.9% 10%; --secondary-foreground: 240 5.9% 10%;
--muted: 240 4.8% 95.9%; --muted: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%; --muted-foreground: 240 3.8% 46.1%;
--accent: 240 4.8% 95.9%; --accent: 0 0% 90%;
--accent-foreground: 240 5.9% 10%; --accent-foreground: 240 5.9% 10%;
--destructive: 0 84.2% 60.2%; --destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%; --destructive-foreground: 0 0% 98%;

94
src/app/types/config.ts Normal file
View File

@ -0,0 +1,94 @@
import type { Metadata, Viewport } from "next";
export type Config = {
/**
* The name of this app.
*/
siteName: string;
/**
* The metadata for this app.
*/
metadata: Metadata;
/**
* The viewport for this app.
*/
viewport: Viewport;
/**
* The source to get the content from.
* This can either be a local source, or
* a remote Git repository.
*/
contentSource: string;
/**
* Social links for this app.
*/
socialLinks: SocialLinkType[];
/**
* Configuration for the footer.
*/
footer: {
/**
* The URL to link to when the branding is clicked.
*/
homeUrl: string;
/**
* Links for the footer.
*/
links: {
[category: string]: FooterLink[];
};
};
};
export type SocialLinkType = {
/**
* The name of this social link.
*/
name: string;
/**
* The tooltip for this social link.
*/
tooltip: string;
/**
* The logo for this social link.
* This can either be an image URL, or
* the name of an icon from <a href="https://lucide.dev/icons">Lucide Icons</a>
*/
logo: string;
/**
* The href for this social link.
*/
href: string;
/**
* Whether to show this social link in the navbar.
*/
navbar: boolean;
};
export type FooterLink = {
/**
* The name of this link.
*/
name: string;
/**
* The href for this link.
*/
href: string;
/**
* The optional name to show
* when the screen size is small.
*/
shortName?: string;
};

View File

@ -8,9 +8,9 @@ type DocsContentMetadata = MDXMetadata & {
title: string; title: string;
/** /**
* The date this content was published. * The date this content was updated.
*/ */
published: string; updated: string;
/** /**
* The summary of this content. * The summary of this content.

View File

@ -24,14 +24,14 @@ const DocsFooter = ({
const next: DocsContentMetadata | undefined = const next: DocsContentMetadata | undefined =
current < pages.length - 1 ? pages[current + 1] : undefined; current < pages.length - 1 ? pages[current + 1] : undefined;
const [publicationDate, setPublicationDate] = useState<string | null>( const [updatedDate, setUpdatedDate] = useState<string | null>(
DateTime.fromISO(pages[current]?.published).toRelative() DateTime.fromISO(pages[current]?.updated).toRelative()
); );
useEffect(() => { useEffect(() => {
const interval = setInterval(() => { const interval = setInterval(() => {
setPublicationDate( setUpdatedDate(
DateTime.fromISO(pages[current]?.published).toRelative() DateTime.fromISO(pages[current]?.updated).toRelative()
); );
}, 1000); }, 1000);
return () => clearInterval(interval); return () => clearInterval(interval);
@ -39,22 +39,22 @@ const DocsFooter = ({
return ( return (
<footer className="xs:mx-5 sm:mx-10 my-2 flex flex-col select-none transition-all transform-gpu"> <footer className="xs:mx-5 sm:mx-10 my-2 flex flex-col select-none transition-all transform-gpu">
{/* Publish Date */} {/* updated Date */}
<div className="ml-auto pt-4"> <div className="ml-auto pt-4">
<SimpleTooltip <SimpleTooltip
content={DateTime.fromISO( content={`Last updated on ${DateTime.fromISO(
pages[current]?.published pages[current]?.updated
).toLocaleString(DateTime.DATETIME_MED)} ).toLocaleString(DateTime.DATETIME_MED)}`}
> >
<span className="text-xs sm:text-sm opacity-75 transition-all transform-gpu"> <span className="text-xs sm:text-sm opacity-75 transition-all transform-gpu">
Published {publicationDate} Updated {updatedDate}
</span> </span>
</SimpleTooltip> </SimpleTooltip>
</div> </div>
{/* Pages */} {/* Pages */}
{previous || next ? ( {previous || next ? (
<Separator className="my-4 bg-separator-gradient" /> <Separator className="my-4 dark:bg-separator-gradient" />
) : undefined} ) : undefined}
<div className="flex justify-between text-xs sm:text-base"> <div className="flex justify-between text-xs sm:text-base">
{/* Previous */} {/* Previous */}

View File

@ -5,44 +5,10 @@ import AnimatedGridPattern from "@/components/ui/animated-grid-pattern";
import Link from "next/link"; import Link from "next/link";
import Image from "next/image"; import Image from "next/image";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { ExternalLink, Mail } from "lucide-react"; import { ExternalLink } from "lucide-react";
import SocialLink from "@/components/social-link";
const links = { import config from "@/config";
Resources: [ import { SocialLinkType } from "@/types/config";
{
name: "Support",
href: "https://support.pulseapp.cc",
},
{
name: "Jobs",
href: "https://jobs.pulseapp.cc",
},
{
name: "Developers",
shortName: "Devs",
href: "https://dev.pulseapp.cc",
external: true,
},
{
name: "System Status",
shortName: "Status",
href: "https://status.pulseapp.cc",
external: true,
},
],
Legal: [
{
name: "Terms & Conditions",
shortName: "Terms",
href: "/legal/terms",
},
{
name: "Privacy Policy",
shortName: "Privacy",
href: "/legal/privacy",
},
],
};
const Footer = (): ReactElement => ( const Footer = (): ReactElement => (
<footer className="relative mt-3 h-[19.5rem] md:h-[17rem] flex justify-center border-t border-zinc-700/75 overflow-hidden select-none"> <footer className="relative mt-3 h-[19.5rem] md:h-[17rem] flex justify-center border-t border-zinc-700/75 overflow-hidden select-none">
@ -54,40 +20,34 @@ const Footer = (): ReactElement => (
{/* Socials */} {/* Socials */}
<div className="pl-1 flex gap-2.5 items-center z-50"> <div className="pl-1 flex gap-2.5 items-center z-50">
{config.socialLinks.map((link: SocialLinkType) => (
<SocialLink <SocialLink
name="GitHub" key={link.name}
logo="github.svg" className="w-5 h-5"
href="https://github.com/PulseAppCC" {...link}
/>
<SocialLink
name="Discord"
logo="discord.svg"
href="https://discord.pulseapp.cc"
/>
<SocialLink
name="Email"
logo={<Mail className="opacity-95 w-6 h-6" />}
href="mailto:support@pulseapp.cc"
/> />
))}
</div> </div>
</div> </div>
{/* Links */} {/* Links */}
<div className="flex gap-7 md:gap-12 transition-all transform-gpu"> <div className="flex gap-7 md:gap-12 transition-all transform-gpu">
{Object.entries(links).map(([title, links]) => ( {Object.entries(config.footer.links).map(
([title, links]) => (
<LinkCategory key={title} title={title}> <LinkCategory key={title} title={title}>
{links.map((link) => ( {links.map((link) => (
<FooterLink key={link.name} {...link} /> <FooterLink key={link.name} {...link} />
))} ))}
</LinkCategory> </LinkCategory>
))} )
)}
</div> </div>
</div> </div>
{/* Copyright */} {/* Copyright */}
<p className="absolute inset-x-0 bottom-3.5 flex text-sm text-center justify-center opacity-60"> <p className="absolute inset-x-0 bottom-3.5 flex text-sm text-center justify-center opacity-60">
Copyright &copy; {new Date().getFullYear()} Pulse App. All Copyright &copy; {new Date().getFullYear()} {config.siteName}.
rights reserved. All rights reserved.
</p> </p>
</div> </div>
@ -105,46 +65,17 @@ const Footer = (): ReactElement => (
const Branding = () => ( const Branding = () => (
<Link <Link
className="flex gap-3 items-center hover:opacity-75 transition-all transform-gpu" className="flex gap-3 items-center hover:opacity-75 transition-all transform-gpu"
href="https://pulseapp.cc" href={config.footer.homeUrl}
draggable={false} draggable={false}
> >
<Image <Image
src="/media/logo.png" src="/media/logo.png"
alt="Pulse App Logo" alt={`${config.siteName} Logo`}
width={40} width={40}
height={40} height={40}
draggable={false} draggable={false}
/> />
<h1 className="text-xl font-bold">Pulse App</h1> <h1 className="text-xl font-bold">{config.siteName}</h1>
</Link>
);
const SocialLink = ({
name,
logo,
href,
}: {
name: string;
logo: string | ReactElement;
href: string;
}) => (
<Link
className="hover:opacity-75 transition-all transform-gpu"
href={href}
target="_blank"
draggable={false}
>
{typeof logo === "string" ? (
<Image
src={`/media/${logo}`}
alt={`${name}'s Logo`}
width={20}
height={20}
draggable={false}
/>
) : (
logo
)}
</Link> </Link>
); );

View File

@ -13,6 +13,7 @@ import {
import Link from "next/link"; import Link from "next/link";
import { capitalizeWords } from "@/lib/string"; import { capitalizeWords } from "@/lib/string";
import ImageViewer from "@/components/image-viewer"; import ImageViewer from "@/components/image-viewer";
import Image from "next/image";
const blockquoteStyles: { [key: string]: any } = { const blockquoteStyles: { [key: string]: any } = {
NOTE: { NOTE: {
@ -96,10 +97,13 @@ const components = {
// Media // Media
img: ({ src, alt }: { src: string; alt: string }): ReactElement => ( img: ({ src, alt }: { src: string; alt: string }): ReactElement => (
<ImageViewer className="m-2 my-2.5"> <ImageViewer className="m-2 my-2.5">
<img <Image
className="ring-1 ring-muted/45 rounded-2xl select-none" className="ring-1 ring-muted/45 rounded-2xl select-none"
src={src} src={src}
alt={alt} alt={alt}
width={1920}
height={1080}
unoptimized
draggable={false} draggable={false}
/> />
</ImageViewer> </ImageViewer>

View File

@ -1,14 +1,16 @@
"use client";
import { ReactElement } from "react"; import { ReactElement } from "react";
import Link from "next/link"; import Link from "next/link";
import Image from "next/image"; import Image from "next/image";
import QuickSearchDialog from "@/components/navbar/search-dialog"; import QuickSearchDialog from "@/components/navbar/search-dialog";
import { getDocsContent } from "@/lib/mdx";
import Sidebar from "@/components/sidebar/sidebar"; import Sidebar from "@/components/sidebar/sidebar";
import SocialLink from "@/components/social-link";
import config from "@/config";
import { SocialLinkType } from "@/types/config";
const Navbar = (): ReactElement => { const Navbar = ({ pages }: { pages: DocsContentMetadata[] }): ReactElement => (
const pages: DocsContentMetadata[] = getDocsContent(); <nav className="fixed left-0 inset-x-0 bg-white/95 dark:bg-white/[0.007] backdrop-saturate-100 backdrop-blur-xl border-b z-50">
return (
<nav className="fixed left-0 inset-x-0 bg-white/[0.007] backdrop-saturate-100 backdrop-blur-xl border-b z-50">
<div className="px-3 md:px-7 max-w-screen-2xl mx-auto py-4 flex justify-between items-center transition-all transform-gpu"> <div className="px-3 md:px-7 max-w-screen-2xl mx-auto py-4 flex justify-between items-center transition-all transform-gpu">
{/* Branding */} {/* Branding */}
<Link <Link
@ -19,7 +21,7 @@ const Navbar = (): ReactElement => {
<h1 className="text-lg font-semibold">docs.</h1> <h1 className="text-lg font-semibold">docs.</h1>
<Image <Image
src="/media/logo.png" src="/media/logo.png"
alt="Pulse App Logo" alt={`${config.siteName} Logo`}
width={36} width={36}
height={36} height={36}
draggable={false} draggable={false}
@ -35,42 +37,19 @@ const Navbar = (): ReactElement => {
{/* Social */} {/* Social */}
<div className="flex gap-5 items-center"> <div className="flex gap-5 items-center">
<SocialLink {config.socialLinks
name="GitHub" .filter((link: SocialLinkType) => link.navbar)
link="https://github.com/PulseAppCC" .map((link: SocialLinkType) => (
icon="/media/github.svg" <SocialLink key={link.name} {...link} />
/> ))}
<SocialLink
name="Discord"
link="https://discord.pulseapp.cc"
icon="/media/discord.svg"
/>
</div> </div>
{/* Mobile Sidebar */} {/* Mobile Sidebar */}
<div className="flex xs:hidden"> <div className="flex xs:hidden">
<Sidebar /> <Sidebar pages={pages} />
</div> </div>
</div> </div>
</div> </div>
</nav> </nav>
);
};
const SocialLink = ({
name,
link,
icon,
}: {
name: string;
link: string;
icon: string;
}): ReactElement => (
<div className="relative w-6 h-6 hover:opacity-75 transition-all transform-gpu select-none">
<Link href={link} target="_blank" draggable={false}>
<Image src={icon} alt={`${name} Logo`} fill draggable={false} />
</Link>
</div>
); );
export default Navbar; export default Navbar;

View File

@ -52,7 +52,7 @@ const QuickSearchDialog = ({
className="cursor-pointer hover:opacity-85 transition-all transform-gpu select-none" className="cursor-pointer hover:opacity-85 transition-all transform-gpu select-none"
onClick={() => setOpen(true)} onClick={() => setOpen(true)}
> >
<div className="absolute top-2.5 left-3 z-10"> <div className="absolute top-[0.55rem] left-3 z-10">
<Search className="w-[1.15rem] h-[1.15rem]" /> <Search className="w-[1.15rem] h-[1.15rem]" />
</div> </div>
@ -114,5 +114,4 @@ const QuickSearchDialog = ({
</> </>
); );
}; };
export default QuickSearchDialog; export default QuickSearchDialog;

View File

@ -33,7 +33,7 @@ const OnThisPage = ({ page }: { page: DocsContentMetadata }): ReactElement => {
let match; let match;
while ((match = headerRegex.exec(page.content)) !== null) { while ((match = headerRegex.exec(page.content)) !== null) {
const level: number = match[1].length; // The number of # symbols determines the header level const level: number = match[1].length; // The number of # symbols determines the header level
const text: string = match[2].trim(); const text: string = match[2].trim().replace(/<[^>]*>/g, "");
const id: string = text const id: string = text
.toLowerCase() .toLowerCase()
.replace(/\s+/g, "-") .replace(/\s+/g, "-")
@ -79,7 +79,7 @@ const OnThisPage = ({ page }: { page: DocsContentMetadata }): ReactElement => {
return ( return (
<motion.div <motion.div
ref={ref} ref={ref}
className="sticky top-[7rem] w-44 max-h-[calc(100vh-3.5rem)] flex flex-col gap-2 text-sm select-none" className="sticky top-[7.5rem] w-44 max-h-[calc(100vh-3.5rem)] flex flex-col gap-2 text-sm select-none"
initial={{ opacity: 0 }} initial={{ opacity: 0 }}
animate={{ opacity: inView ? 1 : 0 }} animate={{ opacity: inView ? 1 : 0 }}
transition={{ duration: 0.2 }} transition={{ duration: 0.2 }}
@ -106,7 +106,7 @@ const OnThisPage = ({ page }: { page: DocsContentMetadata }): ReactElement => {
{/* Indentation */} {/* Indentation */}
{header.level > 1 && ( {header.level > 1 && (
<div <div
className="absolute left-0 top-0 bottom-0 border-l border-muted" className="absolute left-0 top-0 bottom-0 border-l border-accent"
style={{ style={{
left: `${(header.level - 2) * 16 + 4}px`, left: `${(header.level - 2) * 16 + 4}px`,
}} }}
@ -119,7 +119,7 @@ const OnThisPage = ({ page }: { page: DocsContentMetadata }): ReactElement => {
draggable={false} draggable={false}
className="block py-1" className="block py-1"
> >
{truncateText(header.text, 24)} {truncateText(header.text, 20)}
</Link> </Link>
</li> </li>
))} ))}
@ -127,7 +127,7 @@ const OnThisPage = ({ page }: { page: DocsContentMetadata }): ReactElement => {
{/* Footer */} {/* Footer */}
<div> <div>
<Separator className="mt-1 mb-3.5 bg-separator-gradient" /> <Separator className="mt-1 mb-3.5 dark:bg-separator-gradient" />
<Footer page={page} /> <Footer page={page} />
</div> </div>
</motion.div> </motion.div>

View File

@ -51,12 +51,12 @@ const CategoryItem = ({
const hasChildren = Object.keys(node.children).length > 0; const hasChildren = Object.keys(node.children).length > 0;
return ( return (
<div className={cn(`relative select-none`, depth > 0 && "ml-4")}> <div className={cn(`relative select-none`, depth > 0 && "ml-3")}>
{/* Indentation */} {/* Indentation */}
{depth > 0 && ( {depth > 0 && (
<div <div
className={cn( className={cn(
"absolute left-0 bottom-0 border-l border-muted", "absolute left-0 bottom-0 border-l border-accent",
isLast ? "h-[32px]" : "h-[100%]", isLast ? "h-[32px]" : "h-[100%]",
active && "border-primary" active && "border-primary"
)} )}
@ -72,10 +72,13 @@ const CategoryItem = ({
> >
<Button <Button
className={cn( className={cn(
`relative w-full px-1.5 h-8 lg:text-base justify-between hover:bg-accent/20`, `relative w-full px-1.5 h-8 justify-between hover:bg-accent/35`,
node.isFolder
? "mb-0.5 text-sm font-semibold"
: "lg:text-base",
depth > 0 && "pl-4", depth > 0 && "pl-4",
active && active &&
"text-primary/95 font-bold hover:text-primary" "text-primary/95 font-semibold hover:text-primary"
)} )}
variant="ghost" variant="ghost"
> >

View File

@ -1,13 +1,12 @@
import { ReactElement } from "react"; import { ReactElement } from "react";
import { Separator } from "@/components/ui/separator"; import { Separator } from "@/components/ui/separator";
import { getDocsContent } from "@/lib/mdx";
import SidebarLinks from "@/components/sidebar/sidebar-links"; import SidebarLinks from "@/components/sidebar/sidebar-links";
import ThemeSwitcher from "@/components/theme-switcher"; import ThemeSwitcher from "@/components/theme-switcher";
import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet"; import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet";
import QuickSearchDialog from "@/components/navbar/search-dialog"; import QuickSearchDialog from "@/components/navbar/search-dialog";
import { AlignRightIcon } from "lucide-react"; import { AlignRightIcon } from "lucide-react";
const Sidebar = (): ReactElement => ( const Sidebar = ({ pages }: { pages: DocsContentMetadata[] }): ReactElement => (
<> <>
{/* Mobile */} {/* Mobile */}
<div className="xs:hidden"> <div className="xs:hidden">
@ -16,21 +15,23 @@ const Sidebar = (): ReactElement => (
<AlignRightIcon className="w-6 h-6" /> <AlignRightIcon className="w-6 h-6" />
</SheetTrigger> </SheetTrigger>
<SheetContent className="h-full px-5 pt-11" side="right"> <SheetContent className="h-full px-5 pt-11" side="right">
<SidebarContent /> <SidebarContent pages={pages} />
</SheetContent> </SheetContent>
</Sheet> </Sheet>
</div> </div>
{/* Desktop */} {/* Desktop */}
<div className="hidden xs:flex sticky top-[4.5rem] max-h-[calc(100vh-3.5rem)] overflow-y-auto min-w-32 w-40 lg:w-52 py-5 flex-col justify-between transition-all transform-gpu"> <div className="hidden xs:flex sticky top-[4.5rem] max-h-[calc(100vh-3.5rem)] overflow-y-auto min-w-32 w-40 lg:w-52 py-5 flex-col justify-between transition-all transform-gpu">
<SidebarContent /> <SidebarContent pages={pages} />
</div> </div>
</> </>
); );
const SidebarContent = (): ReactElement => { const SidebarContent = ({
const pages: DocsContentMetadata[] = getDocsContent(); pages,
return ( }: {
pages: DocsContentMetadata[];
}): ReactElement => (
<div className="h-full flex flex-col justify-between"> <div className="h-full flex flex-col justify-between">
{/* Top */} {/* Top */}
<div className="flex flex-col"> <div className="flex flex-col">
@ -42,11 +43,10 @@ const SidebarContent = (): ReactElement => {
{/* Theme Switcher */} {/* Theme Switcher */}
<div className="flex flex-col items-center"> <div className="flex flex-col items-center">
<Separator className="mb-3 bg-separator-gradient" /> <Separator className="mb-3 dark:bg-separator-gradient" />
<ThemeSwitcher /> <ThemeSwitcher />
</div> </div>
</div> </div>
); );
};
export default Sidebar; export default Sidebar;

View File

@ -39,7 +39,10 @@ const SimpleTooltip = ({
}: SimpleTooltipProps): ReactElement => ( }: SimpleTooltipProps): ReactElement => (
<Tooltip> <Tooltip>
<TooltipTrigger asChild>{children}</TooltipTrigger> <TooltipTrigger asChild>{children}</TooltipTrigger>
<TooltipContent className="bg-muted text-white" side={side}> <TooltipContent
className="bg-accent text-accent-foreground"
side={side}
>
{content} {content}
</TooltipContent> </TooltipContent>
</Tooltip> </Tooltip>

View File

@ -0,0 +1,46 @@
import SimpleTooltip from "@/components/simple-tooltip";
import Link from "next/link";
import Image from "next/image";
import { cn } from "@/lib/utils";
import Icon from "@/components/ui/icon";
import { icons } from "lucide-react";
import { SocialLinkType } from "@/types/config";
type SocialLinkProps = SocialLinkType & {
className?: string | undefined;
};
const SocialLink = ({
className,
name,
tooltip,
logo,
href,
}: SocialLinkProps) => (
<SimpleTooltip content={tooltip}>
<Link
className={cn(
"w-6 h-6 hover:opacity-75 transition-all transform-gpu select-none",
className
)}
href={href}
target="_blank"
draggable={false}
>
{logo.startsWith("./") ? (
<Image
src={`/media/${logo.substring(2)}`}
alt={`${name}'s Logo`}
fill
draggable={false}
/>
) : (
<Icon
className="opacity-95 w-full h-full"
name={logo as keyof typeof icons}
/>
)}
</Link>
</SimpleTooltip>
);
export default SocialLink;

View File

@ -10,9 +10,9 @@ import SimpleTooltip from "@/components/simple-tooltip";
import { capitalizeWords } from "@/lib/string"; import { capitalizeWords } from "@/lib/string";
const themes = { const themes = {
system: <Monitor className="w-4 h-4" />,
dark: <MoonStar className="w-4 h-4" />, dark: <MoonStar className="w-4 h-4" />,
light: <Sun className="w-4 h-4" />, light: <Sun className="w-4 h-4" />,
system: <Monitor className="w-4 h-4" />,
}; };
/** /**
@ -29,7 +29,7 @@ const ThemeSwitcher = (): ReactElement => {
}, []); }, []);
return ( return (
<div className="w-fit p-1 flex gap-1.5 bg-black/30 ring-1 ring-white/5 rounded-full"> <div className="w-fit p-1 flex gap-1.5 bg-gray-600/5 dark:bg-black/30 ring-1 light:ring-inset ring-gray-600/5 dark:ring-white/5 rounded-full">
{Object.entries(themes).map(([theme, icon]) => { {Object.entries(themes).map(([theme, icon]) => {
const active: boolean = mounted && theme === activeTheme; const active: boolean = mounted && theme === activeTheme;
return ( return (
@ -41,7 +41,7 @@ const ThemeSwitcher = (): ReactElement => {
className={cn( className={cn(
"p-1 h-6 opacity-80 rounded-full", "p-1 h-6 opacity-80 rounded-full",
active && active &&
"ring-1 bg-zinc-900 ring-white/15 opacity-100" "ring-1 bg-white dark:bg-zinc-900 ring-gray-900/10 dark:ring-white/15 hover:bg-white hover:dark:bg-zinc-900 opacity-100"
)} )}
variant="ghost" variant="ghost"
onClick={() => setTheme(theme)} onClick={() => setTheme(theme)}
@ -54,5 +54,4 @@ const ThemeSwitcher = (): ReactElement => {
</div> </div>
); );
}; };
export default ThemeSwitcher; export default ThemeSwitcher;

View File

@ -83,14 +83,16 @@ export function GridPattern({
}); });
} }
}); });
let current = undefined;
if (containerRef.current) { if (containerRef.current) {
resizeObserver.observe(containerRef.current); resizeObserver.observe(containerRef.current);
current = containerRef.current;
} }
return () => { return () => {
if (containerRef.current) { if (current) {
resizeObserver.unobserve(containerRef.current); resizeObserver.unobserve(current);
} }
}; };
}, [containerRef]); }, [containerRef]);

View File

@ -0,0 +1,10 @@
import { icons, LucideProps } from "lucide-react";
interface IconProps extends LucideProps {
name: keyof typeof icons;
}
export default function Icon({ name, color, size, ...props }: IconProps) {
const LucideIcon = icons[name];
return <LucideIcon color={color} size={size} {...props} />;
}

View File

@ -1,6 +1,9 @@
import * as fs from "node:fs"; import * as fs from "node:fs";
import { Stats } from "node:fs"; import { Stats } from "node:fs";
import path from "node:path"; import path from "node:path";
import config from "@/config";
import simpleGit from "simple-git";
import os from "node:os";
/** /**
* The regex to match for metadata. * The regex to match for metadata.
@ -8,18 +11,45 @@ import path from "node:path";
const METADATA_REGEX: RegExp = /---\s*([\s\S]*?)\s*---/; const METADATA_REGEX: RegExp = /---\s*([\s\S]*?)\s*---/;
/** /**
* The directory docs are stored in. * Check if the DOCS_DIR is a Git URL.
*/ */
const DOCS_DIR: string = path.join(process.cwd(), "docs"); const isGitUrl = (url: string): boolean => {
return /^https?:\/\/|git@|\.git$/.test(url);
};
/** /**
* Get the content to * The directory docs are stored in.
* display in the docs.
*/ */
export const getDocsContent = (): DocsContentMetadata[] => { const DOCS_DIR: string = isGitUrl(config.contentSource)
? config.contentSource
: path.join(config.contentSource.replace("{process}", process.cwd()));
/**
* Clone the Git repository if DOCS_DIR is a URL, else use the local directory.
* If it's a Git URL, clone it to a cache directory and reuse it.
*/
const getDocsDirectory = async (): Promise<string> => {
if (isGitUrl(DOCS_DIR)) {
const repoHash: string = Buffer.from(DOCS_DIR).toString("base64"); // Create a unique identifier based on the repo URL
const cacheDir: string = path.join(os.tmpdir(), "docs_cache", repoHash);
// Pull the latest changes from the repo if we don't have it
if (!fs.existsSync(cacheDir) || fs.readdirSync(cacheDir).length < 1) {
await simpleGit().clone(DOCS_DIR, cacheDir, { "--depth": 1 });
}
return cacheDir;
}
return DOCS_DIR;
};
/**
* Get the content to display in the docs.
*/
export const getDocsContent = async (): Promise<DocsContentMetadata[]> => {
const docsDir: string = await getDocsDirectory();
const content: DocsContentMetadata[] = []; const content: DocsContentMetadata[] = [];
for (const directory of getRecursiveDirectories(DOCS_DIR)) { for (const directory of getRecursiveDirectories(docsDir)) {
content.push(...getMetadata<DocsContentMetadata>(DOCS_DIR, directory)); content.push(...getMetadata<DocsContentMetadata>(docsDir, directory));
} }
return content.sort((a: DocsContentMetadata, b: DocsContentMetadata) => { return content.sort((a: DocsContentMetadata, b: DocsContentMetadata) => {
const orderA = a.order ?? Number.MAX_SAFE_INTEGER; const orderA = a.order ?? Number.MAX_SAFE_INTEGER;

View File

@ -24,6 +24,15 @@
"paths": { "paths": {
"@/*": [ "@/*": [
"./src/*" "./src/*"
],
"@/config": [
"./src/app/config.ts"
],
"@/types/*": [
"./src/app/types/*"
],
"@/configJson": [
"./config.json"
] ]
}, },
"target": "ES2017" "target": "ES2017"