portosaurus 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +116 -0
  3. package/bin/portosaurus.js +337 -0
  4. package/internal/notes/index.md +10 -0
  5. package/internal/sidebars.js +20 -0
  6. package/internal/src/components/AboutSection/index.js +67 -0
  7. package/internal/src/components/AboutSection/styles.module.css +492 -0
  8. package/internal/src/components/ContactSection/index.js +94 -0
  9. package/internal/src/components/ContactSection/styles.module.css +327 -0
  10. package/internal/src/components/ExperienceSection/index.js +25 -0
  11. package/internal/src/components/ExperienceSection/styles.module.css +180 -0
  12. package/internal/src/components/HeroSection/index.js +61 -0
  13. package/internal/src/components/HeroSection/styles.module.css +471 -0
  14. package/internal/src/components/NoteIndex/index.js +127 -0
  15. package/internal/src/components/NoteIndex/styles.module.css +143 -0
  16. package/internal/src/components/ProjectsSection/index.js +529 -0
  17. package/internal/src/components/ProjectsSection/styles.module.css +830 -0
  18. package/internal/src/components/ScrollToTop/index.js +98 -0
  19. package/internal/src/components/ScrollToTop/styles.module.css +96 -0
  20. package/internal/src/components/SocialLinks/index.js +129 -0
  21. package/internal/src/components/SocialLinks/styles.module.css +55 -0
  22. package/internal/src/components/Tooltip/index.js +30 -0
  23. package/internal/src/components/Tooltip/styles.module.css +92 -0
  24. package/internal/src/config/iconMappings.js +329 -0
  25. package/internal/src/config/metaTags.js +240 -0
  26. package/internal/src/config/prism.js +179 -0
  27. package/internal/src/config/sidebar.js +20 -0
  28. package/internal/src/css/bootstrap.css +6 -0
  29. package/internal/src/css/catppuccin.css +632 -0
  30. package/internal/src/css/custom.css +186 -0
  31. package/internal/src/css/tasks.css +868 -0
  32. package/internal/src/pages/index.js +98 -0
  33. package/internal/src/pages/notes.js +88 -0
  34. package/internal/src/pages/tasks.js +310 -0
  35. package/internal/src/utils/HashNavigation.js +250 -0
  36. package/internal/src/utils/appVersion.js +27 -0
  37. package/internal/src/utils/compileConfig.js +82 -0
  38. package/internal/src/utils/cssUtils.js +99 -0
  39. package/internal/src/utils/filterEnabledItems.js +21 -0
  40. package/internal/src/utils/generateFavicon.js +256 -0
  41. package/internal/src/utils/generateRobotsTxt.js +97 -0
  42. package/internal/src/utils/iconExtractor.js +159 -0
  43. package/internal/src/utils/imageDownloader.js +88 -0
  44. package/internal/src/utils/imageProcessor.js +134 -0
  45. package/internal/src/utils/linkShortner.js +0 -0
  46. package/internal/src/utils/updateTitle.js +107 -0
  47. package/package.json +51 -0
  48. package/template/.github/workflows/deploy.yml +57 -0
  49. package/template/README.md +70 -0
  50. package/template/blog/authors.yml +5 -0
  51. package/template/blog/welcome.md +10 -0
  52. package/template/config.js +233 -0
  53. package/template/notes/getting-started.md +7 -0
  54. package/template/static/README.md +33 -0
  55. package/utils/createConfig.js +227 -0
  56. package/utils/logger.js +19 -0
  57. package/utils/packageManager.js +88 -0
@@ -0,0 +1,98 @@
1
+ import Layout from "@theme/Layout";
2
+ import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
3
+ import UpdateTitle from '@site/src/utils/updateTitle';
4
+
5
+ // Import components
6
+ import HeroSection from "@site/src/components/HeroSection";
7
+ import AboutSection from "@site/src/components/AboutSection";
8
+ import ProjectsSection from "@site/src/components/ProjectsSection";
9
+ import ContactSection from "@site/src/components/ContactSection";
10
+ import ExperienceSection from "@site/src/components/ExperienceSection";
11
+ import ScrollToTop from "@site/src/components/ScrollToTop";
12
+
13
+
14
+ export default function Home() {
15
+ const { siteConfig } = useDocusaurusContext();
16
+ const { customFields } = siteConfig;
17
+
18
+ const aboutMe = customFields.aboutMe || {};
19
+ const projects = customFields.projects || {};
20
+ const socialLinks = customFields.socialLinks || {};
21
+ const experience = customFields.experience || {};
22
+
23
+ const sectionTitles = {
24
+ 'me': `Home | ${siteConfig.title}`,
25
+ 'about': `About Me | ${siteConfig.title}`,
26
+ 'projects': `Projects | ${siteConfig.title}`,
27
+ 'experience': `Experience | ${siteConfig.title}`,
28
+ 'contact': `Contact | ${siteConfig.title}`
29
+ };
30
+
31
+ const customStyles = `
32
+ /* For future */
33
+ `;
34
+
35
+
36
+ return (
37
+ <Layout
38
+ title="Me"
39
+ description="My portfolio website"
40
+ >
41
+ {/* Custom styles */}
42
+ <style>{customStyles}</style>
43
+
44
+ <UpdateTitle
45
+ sections={sectionTitles}
46
+ defaultTitle={siteConfig.title}
47
+ />
48
+
49
+ <main>
50
+
51
+ {/* Hero Section */}
52
+ <HeroSection
53
+ id="me"
54
+ />
55
+
56
+ {/* About Section */}
57
+ {(aboutMe.enable !== false) && (
58
+ <AboutSection
59
+ id="about"
60
+ title="About Me"
61
+ />
62
+ )}
63
+
64
+ {/* Projects Section */}
65
+ {(projects.enable !== false) && (
66
+ <ProjectsSection
67
+ id="projects"
68
+ title="My Projects"
69
+ subtitle="A collection of all my works, with featured projects highlighted"
70
+ />
71
+ )}
72
+
73
+ {/* Experience Section */}
74
+ {(experience.enable !== false) && (
75
+ <ExperienceSection
76
+ id="experience"
77
+ title="Experience"
78
+ subtitle="My professional journey and work experience"
79
+ />
80
+ )}
81
+
82
+ {/* Contact Section */}
83
+ {(socialLinks.enable !== false) && (
84
+ <ContactSection
85
+ id="contact"
86
+ title="Get In Touch"
87
+ subtitle="Feel free to reach out for collaborations, questions, or just to say hello!"
88
+ />
89
+ )}
90
+
91
+ {/* Scroll to top button */}
92
+ <ScrollToTop
93
+ hideDelay={3500}
94
+ />
95
+ </main>
96
+ </Layout>
97
+ );
98
+ }
@@ -0,0 +1,88 @@
1
+ import React from 'react';
2
+ import Layout from '@theme/Layout';
3
+ import NoteCards from '@site/src/components/NoteIndex';
4
+ import { usePluginData } from '@docusaurus/useGlobalData';
5
+ import ScrollToTop from '../components/ScrollToTop';
6
+ import HashNavigation from '../utils/HashNavigation';
7
+
8
+ const style = {
9
+
10
+ notesContainer: {
11
+ padding: '2rem 0',
12
+ maxWidth: '1200px',
13
+ margin: '0 auto'
14
+ },
15
+
16
+ pageTitle: {
17
+ fontSize: '2.5rem',
18
+ textAlign: 'center',
19
+ marginBottom: '0.5rem',
20
+ color: 'var(--ifm-color-primary)',
21
+ animation: 'slideUp 0.5s ease-out forwards'
22
+ },
23
+
24
+ pageDescription: {
25
+ fontSize: '0.9rem',
26
+ textAlign: 'center',
27
+ color: 'var(--ifm-font-color-tertiary)',
28
+ marginBottom: '2rem',
29
+ animation: 'slideUp 0.5s ease-out 0.2s forwards',
30
+ },
31
+
32
+ '@keyframes slideUp': {
33
+ from: {
34
+ opacity: 0,
35
+ transform: 'translateY(20px)'
36
+ },
37
+ to: {
38
+ opacity: 1,
39
+ transform: 'translateY(0)'
40
+ }
41
+ },
42
+
43
+ '@media (prefers-reduced-motion: reduce)': {
44
+ notesContainer: {
45
+ animation: 'none !important'
46
+ },
47
+ pageTitle: {
48
+ animation: 'none !important'
49
+ },
50
+ pageDescription: {
51
+ animation: 'none !important',
52
+ opacity: 1
53
+ }
54
+ }
55
+ };
56
+
57
+ export default function Notes() {
58
+ const { path: docsBasePath } = usePluginData('docusaurus-plugin-content-docs');
59
+ const pathName = docsBasePath.replace('/', '');
60
+ const pageTitle = pathName.charAt(0).toUpperCase() + pathName.slice(1);
61
+
62
+ return (
63
+ <Layout
64
+ title={pageTitle}
65
+ description={`My ${pageTitle}`}
66
+ >
67
+ <main style={style.notesContainer}>
68
+ <div className="container">
69
+ <header className="text-center mb-4">
70
+ <h1 style={style.pageTitle}>
71
+ My Notes
72
+ </h1>
73
+ <p style={style.pageDescription}>
74
+ A collection of my self written notes & reference guides
75
+ </p>
76
+ </header>
77
+ <NoteCards/>
78
+ <ScrollToTop/>
79
+ <HashNavigation
80
+ elementPrefix="note-"
81
+ elementSelector=".note-card"
82
+ effectDuration={6000}
83
+ />
84
+ </div>
85
+ </main>
86
+ </Layout>
87
+ );
88
+ }
@@ -0,0 +1,310 @@
1
+ /*
2
+ __ ___ _ ____ _
3
+ \ \ / (_) |__ ___ / ___|___ __| | ___
4
+ \ \ / /| | '_ \ / _ \ | | / _ \ / _` |/ _ \
5
+ \ V / | | |_) | __/ | |__| (_) | (_| | __/
6
+ \_/ |_|_.__/ \___| \____\___/ \__,_|\___|
7
+
8
+ This Page is completely Vibe coded. No code except small tweaks is written by me.
9
+ */
10
+
11
+ import { useState } from "react";
12
+ import Layout from "@theme/Layout";
13
+ import Head from "@docusaurus/Head";
14
+ import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
15
+ import "../css/tasks.css";
16
+ import {
17
+ FaClipboardList,
18
+ FaSyncAlt,
19
+ FaClock,
20
+ FaCheckCircle,
21
+ FaFire,
22
+ FaThermometerHalf,
23
+ FaSnowflake,
24
+ FaTasks,
25
+ FaExclamationTriangle,
26
+ } from "react-icons/fa";
27
+
28
+ function TaskList({ filterStatus, taskList }) {
29
+ if (!taskList || !Array.isArray(taskList)) {
30
+ return (
31
+ <div className="task-empty-state">
32
+ <FaTasks className="task-empty-icon" />
33
+ <p>No tasks available</p>
34
+ </div>
35
+ );
36
+ }
37
+
38
+ const filteredTasks = taskList.filter((task) =>
39
+ filterStatus ? task.status === filterStatus : true,
40
+ );
41
+
42
+ if (filteredTasks.length === 0) {
43
+ return (
44
+ <div className="task-empty-state">
45
+ <FaTasks className="task-empty-icon" />
46
+ <p>No tasks in this category</p>
47
+ </div>
48
+ );
49
+ }
50
+
51
+ // Sort tasks by status first (with completed tasks at bottom), then by priority
52
+ const sortedTasks = [...filteredTasks].sort((a, b) => {
53
+ const statusOrder = { active: 1, pending: 2, completed: 3 };
54
+ const statusDiff = statusOrder[a.status] - statusOrder[b.status];
55
+
56
+ if (statusDiff !== 0) return statusDiff;
57
+
58
+ // Priority order: high, medium, low
59
+ const priorityOrder = { high: 1, medium: 2, low: 3 };
60
+ return priorityOrder[a.priority] - priorityOrder[b.priority];
61
+ });
62
+
63
+ return (
64
+ <div className="task-list-container">
65
+ <div className="task-list-table">
66
+ <div className="task-list-header">
67
+ <div className="task-cell task-cell-status">Status</div>
68
+ <div className="task-cell task-cell-title">Task Details</div>
69
+ <div className="task-cell task-cell-priority">Priority</div>
70
+ </div>
71
+
72
+ <div className="task-rows">
73
+ {sortedTasks.map((task, index) => (
74
+ <div
75
+ key={index}
76
+ className={`task-row ${task.status === "completed" ? "task-row-completed" : ""} ${index % 2 === 1 ? "task-row-striped" : ""}`}
77
+ >
78
+ <div className="task-cell task-cell-status">
79
+ <span className={`badge badge-status-${task.status}`}>
80
+ {task.status === "completed" && (
81
+ <>
82
+ <FaCheckCircle className="badge-icon" /> Done
83
+ </>
84
+ )}
85
+ {task.status === "active" && (
86
+ <>
87
+ <FaSyncAlt className="badge-icon spin" /> In Progress
88
+ </>
89
+ )}
90
+ {task.status === "pending" && (
91
+ <>
92
+ <FaClock className="badge-icon" /> Planned
93
+ </>
94
+ )}
95
+ </span>
96
+ </div>
97
+
98
+ <div className="task-cell task-cell-title">
99
+ <div className="task-title">{task.title}</div>
100
+ {task.description && (
101
+ <div className="task-description">{task.description}</div>
102
+ )}
103
+ </div>
104
+
105
+ <div className="task-cell task-cell-priority">
106
+ <span className={`badge badge-priority-${task.priority}`}>
107
+ {task.priority === "high" && (
108
+ <>
109
+ <FaFire className="badge-icon" /> High
110
+ </>
111
+ )}
112
+ {task.priority === "medium" && (
113
+ <>
114
+ <FaThermometerHalf className="badge-icon" /> Medium
115
+ </>
116
+ )}
117
+ {task.priority === "low" && (
118
+ <>
119
+ <FaSnowflake className="badge-icon" /> Low
120
+ </>
121
+ )}
122
+ </span>
123
+ </div>
124
+ </div>
125
+ ))}
126
+ </div>
127
+ </div>
128
+ </div>
129
+ );
130
+ }
131
+
132
+ function TaskStats({ taskList }) {
133
+ if (!taskList || !Array.isArray(taskList)) {
134
+ return null;
135
+ }
136
+
137
+ const total = taskList.length;
138
+ const completed = taskList.filter(
139
+ (task) => task.status === "completed",
140
+ ).length;
141
+ const active = taskList.filter((task) => task.status === "active").length;
142
+ const pending = taskList.filter((task) => task.status === "pending").length;
143
+ const percentComplete = total > 0 ? Math.round((completed / total) * 100) : 0;
144
+
145
+ return (
146
+ <div className="stats-container">
147
+ <div className="stat-box">
148
+ <div className="stat-label">Total Tasks</div>
149
+ <div className="stat-value">{total}</div>
150
+ </div>
151
+ <div className="stat-box">
152
+ <div className="stat-label">Completed</div>
153
+ <div className="stat-value stat-value-completed">{completed}</div>
154
+ </div>
155
+ <div className="stat-box">
156
+ <div className="stat-label">In Progress</div>
157
+ <div className="stat-value stat-value-active">{active}</div>
158
+ </div>
159
+ <div className="stat-box">
160
+ <div className="stat-label">Planned</div>
161
+ <div className="stat-value stat-value-pending">{pending}</div>
162
+ </div>
163
+ <div className="stat-box">
164
+ <div className="stat-label">Progress</div>
165
+ <div className="stat-value">{percentComplete}%</div>
166
+ <div className="progress-bar-container">
167
+ <div
168
+ className="progress-bar"
169
+ style={{ width: `${percentComplete}%` }}
170
+ ></div>
171
+ </div>
172
+ </div>
173
+ </div>
174
+ );
175
+ }
176
+
177
+ function TaskTabs({ taskList }) {
178
+ const [activeTab, setActiveTab] = useState("all");
179
+
180
+ if (!taskList || !Array.isArray(taskList)) {
181
+ return null;
182
+ }
183
+
184
+ const tabData = [
185
+ {
186
+ id: "all",
187
+ label: "All Tasks",
188
+ icon: <FaClipboardList />,
189
+ count: taskList.length,
190
+ },
191
+ {
192
+ id: "active",
193
+ label: "In Progress",
194
+ icon: <FaSyncAlt className="spin" />,
195
+ count: taskList.filter((t) => t.status === "active").length,
196
+ },
197
+ {
198
+ id: "pending",
199
+ label: "Planned",
200
+ icon: <FaClock />,
201
+ count: taskList.filter((t) => t.status === "pending").length,
202
+ },
203
+ {
204
+ id: "completed",
205
+ label: "Completed",
206
+ icon: <FaCheckCircle />,
207
+ count: taskList.filter((t) => t.status === "completed").length,
208
+ },
209
+ ];
210
+
211
+ return (
212
+ <div className="task-tabs-container">
213
+ <div className="task-tabs" role="tablist" aria-label="Task categories">
214
+ {tabData.map((tab) => (
215
+ <button
216
+ key={tab.id}
217
+ className={`task-tab ${activeTab === tab.id ? "task-tab-active" : ""}`}
218
+ onClick={() => setActiveTab(tab.id)}
219
+ role="tab"
220
+ aria-selected={activeTab === tab.id}
221
+ aria-controls={`tab-content-${tab.id}`}
222
+ id={`tab-${tab.id}`}
223
+ >
224
+ <span className="task-tab-icon" aria-hidden="true">
225
+ {tab.icon}
226
+ </span>
227
+ <span className="task-tab-label">{tab.label}</span>
228
+ <span className="task-tab-count">{tab.count}</span>
229
+ </button>
230
+ ))}
231
+ </div>
232
+
233
+ <div
234
+ className="task-tab-content"
235
+ role="tabpanel"
236
+ id={`tab-content-${activeTab}`}
237
+ aria-labelledby={`tab-${activeTab}`}
238
+ >
239
+ {activeTab === "all" && <TaskList taskList={taskList} />}
240
+ {activeTab === "active" && (
241
+ <TaskList taskList={taskList} filterStatus="active" />
242
+ )}
243
+ {activeTab === "pending" && (
244
+ <TaskList taskList={taskList} filterStatus="pending" />
245
+ )}
246
+ {activeTab === "completed" && (
247
+ <TaskList taskList={taskList} filterStatus="completed" />
248
+ )}
249
+ </div>
250
+ </div>
251
+ );
252
+ }
253
+
254
+ export default function TasksPage() {
255
+ const { siteConfig } = useDocusaurusContext();
256
+ const { customFields } = siteConfig || {};
257
+
258
+ const tasksPage = customFields?.tasksPage;
259
+ const title = tasksPage.title;
260
+ const description = tasksPage.description;
261
+ const taskList =
262
+ tasksPage.enable && tasksPage.taskList ? tasksPage.taskList : [];
263
+
264
+ // If tasks are disabled, show a notice box instead
265
+ if (!tasksPage || !tasksPage.enable) {
266
+ return (
267
+ <Layout
268
+ title="Tasks are Disabled"
269
+ description="Tasks are currently disabled"
270
+ >
271
+ <div className="tasks-container">
272
+ <div className="tasks-content">
273
+ <div className="tasks-disabled-notice">
274
+ <div className="disabled-icon">
275
+ <FaExclamationTriangle aria-hidden="true" />
276
+ </div>
277
+ <h2 className="disabled-title">Tasks are currently disabled</h2>
278
+ <p className="disabled-help">
279
+ To enable tasks, set <code>tasks_page.enable</code> to{" "}
280
+ <code>true</code>
281
+ </p>
282
+ </div>
283
+ </div>
284
+ </div>
285
+ </Layout>
286
+ );
287
+ }
288
+
289
+ return (
290
+ <Layout title={title} description={description}>
291
+ <Head>
292
+ <meta property="og:title" content={title} />
293
+ <meta property="og:description" content={description} />
294
+ <meta name="twitter:title" content={title} />
295
+ <meta name="twitter:description" content={description} />
296
+ </Head>
297
+
298
+ <div className="tasks-container">
299
+ <div className="tasks-header">
300
+ <h1 className="tasks-heading">{title}</h1>
301
+ </div>
302
+
303
+ <div className="tasks-content">
304
+ <TaskStats taskList={taskList} />
305
+ <TaskTabs taskList={taskList} />
306
+ </div>
307
+ </div>
308
+ </Layout>
309
+ );
310
+ }