From 3189926f526a1a4a9c2eac6b79c5511693c222fc Mon Sep 17 00:00:00 2001 From: Liviu Ionescu Date: Sun, 13 Oct 2024 00:21:52 +0300 Subject: [PATCH] website: updates --- website/src/components/HomepageTools/index.tsx | 5 +++-- website/src/plugins/SelectReleasesPlugin.js | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/website/src/components/HomepageTools/index.tsx b/website/src/components/HomepageTools/index.tsx index 7ad2837..84f4fe3 100644 --- a/website/src/components/HomepageTools/index.tsx +++ b/website/src/components/HomepageTools/index.tsx @@ -126,12 +126,13 @@ function Tool({ appName, appLcName }) { <>
- {appLcName} - xPack {appName} + {appLcName} - xPack {appName}
GitHub Release  GitHub Release Date  GitHub Downloads (all assets, all releases) +  GitHub Repo stars
@@ -142,7 +143,7 @@ function ToolWork({ appName, appLcName }) { return ( <>
- {appLcName} - xPack {appName} + {appLcName} - xPack {appName}
) diff --git a/website/src/plugins/SelectReleasesPlugin.js b/website/src/plugins/SelectReleasesPlugin.js index efa6544..22f65df 100644 --- a/website/src/plugins/SelectReleasesPlugin.js +++ b/website/src/plugins/SelectReleasesPlugin.js @@ -13,14 +13,14 @@ */ // import util from 'util' -// import logger from '@docusaurus/logger' +import logger from '@docusaurus/logger' // https://github.com/facebook/docusaurus/pull/9931 export default async function SelectReleasesPlugin(context, options) { return { name: 'select-releases', - async allContentLoaded({allContent, actions}) { + async allContentLoaded({ allContent, actions }) { const allBlogs = allContent['docusaurus-plugin-content-blog'] // logger.info('SelectReleasesPlugin 1 ' + util.inspect(allBlogs)) @@ -33,9 +33,13 @@ export default async function SelectReleasesPlugin(context, options) { // logger.info('SelectReleasesPlugin 3 ' + util.inspect(post.metadata.tags)) post.metadata.tags.forEach(tag => { if (tag.label === 'releases') { + const permalink = post.metadata.permalink.endsWith('/') ? + post.metadata.permalink : + post.metadata.permalink + '/' + // logger.info(permalink) releasesTable.push({ title: post.metadata.title, - permalink: post.metadata.permalink, + permalink, downloadUrl: post.metadata.frontMatter['download_url'] }) } @@ -44,7 +48,7 @@ export default async function SelectReleasesPlugin(context, options) { // logger.info('SelectReleasesPlugin 4 ' + util.inspect(releasesTable)) - actions.setGlobalData({releasesTable: releasesTable}) + actions.setGlobalData({ releasesTable: releasesTable }) }, }; }