Skip to content

Commit

Permalink
Redesigned Plugin page (#1152)
Browse files Browse the repository at this point in the history
* Redesigned the plugin page ui and more

- redesigned plugin page ui
- new fields for plugin.json:
  - license
  - keywords
  - contributors
  - changelog

* fix: spacing issue

* Fix formatting
  • Loading branch information
bajrangCoder authored Jan 20, 2025
1 parent b4d19cc commit f91be50
Show file tree
Hide file tree
Showing 12 changed files with 475 additions and 229 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@
"yargs": "^17.7.2"
},
"browserslist": "cover 100%,not android < 5"
}
}
22 changes: 22 additions & 0 deletions src/pages/plugin/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ export default async function PluginInclude(
const description = await fsOperation(
Url.join(PLUGIN_DIR, id, "readme.md"),
).readFile("utf8");
const changelog = installedPlugin.changelog
? await fsOperation(
Url.join(PLUGIN_DIR, id, installedPlugin.changelog),
).readFile("utf8")
: "";
const iconUrl = await helpers.toInternalUri(
Url.join(PLUGIN_DIR, id, "icon.png"),
);
Expand All @@ -94,7 +99,11 @@ export default async function PluginInclude(
author: author.name,
author_github: author.github,
source: installedPlugin.source,
license: installedPlugin.license,
keywords: installedPlugin.keywords,
contributors: installedPlugin.contributors,
description,
changelog,
};

isPaid = installedPlugin.price > 0;
Expand Down Expand Up @@ -302,6 +311,19 @@ export default async function PluginInclude(
})
.use(markdownItTaskLists)
.render(plugin.description),
changelog: plugin.changelog
? markdownIt({ html: true, xhtmlOut: true })
.use(MarkdownItGitHubAlerts)
.use(anchor, {
slugify: (s) =>
s
.trim()
.toLowerCase()
.replace(/[^a-z0-9]+/g, "-"),
})
.use(markdownItTaskLists)
.render(plugin.changelog)
: null,
purchased,
installed,
update,
Expand Down
Loading

0 comments on commit f91be50

Please sign in to comment.