diff --git a/src/.vuepress/config.ts b/src/.vuepress/config.ts index 8263c2b..d470c38 100644 --- a/src/.vuepress/config.ts +++ b/src/.vuepress/config.ts @@ -73,7 +73,8 @@ export default defineUserConfig({ }, async onPrepared(app) { - await buildPageCache(app, "posts", "posts/") + await buildPageCache(app, "posts", "posts/", { reverse: true }) + await buildPageCache(app, "projects", "projects/") await buildPageCache(app, "licenses", "licenses/") }, diff --git a/src/.vuepress/utils/pageCache.ts b/src/.vuepress/utils/pageCache.ts index f3e444c..1c39dca 100644 --- a/src/.vuepress/utils/pageCache.ts +++ b/src/.vuepress/utils/pageCache.ts @@ -1,15 +1,33 @@ import { App } from "vuepress"; -export async function buildPageCache(app: App, name: string, prefix: string): Promise { +interface BuildPageCacheOptions { + reverse?: boolean + includeReadme?: boolean + requireExcerpt?: boolean +} + +const defaultBuildPageCacheOptions: BuildPageCacheOptions = { + reverse: false, + includeReadme: false, + requireExcerpt: true +} + +export async function buildPageCache(app: App, name: string, prefix: string, options: BuildPageCacheOptions = {}): Promise { + options = { + ...defaultBuildPageCacheOptions, + ...options + } + const pages = app.pages - .filter(page => page.filePathRelative?.startsWith(prefix) && page.filePathRelative !== `${prefix}/README.md`) + .filter(page => page.filePathRelative?.startsWith(prefix)) + .filter(page => options.includeReadme || page.filePathRelative !== `${prefix}/README.md`) .map(page => ({ ...page, excerpt: page.contentRendered.includes("") ? page.contentRendered.split("")[0] : null })) - .filter(page => !!page.excerpt) + .filter(page => !options.requireExcerpt || !!page.excerpt) - pages.sort((a, b) => b.filePathRelative! > a.filePathRelative! ? 1 : -1) + pages.sort((a, b) => (b.filePathRelative! > a.filePathRelative! ? -1 : 1) * (options.reverse ? -1 : 1)) await app.writeTemp(`${name}.js`, `export const ${name} = ${JSON.stringify(pages)}`) } \ No newline at end of file diff --git a/src/projects/README.md b/src/projects/README.md index 6e3932a..b22d520 100644 --- a/src/projects/README.md +++ b/src/projects/README.md @@ -5,14 +5,16 @@ comments: false editLink: false --- - + \ No newline at end of file diff --git a/src/projects/arma2ml.md b/src/projects/arma2ml.md index d44a2fa..642bea1 100644 --- a/src/projects/arma2ml.md +++ b/src/projects/arma2ml.md @@ -16,6 +16,8 @@ ArmA 2 Mod Launcher is a command-line based application which enables you to qui ArmA 2 with a custom selection of mods. Its lightweight nature and easy to use command line syntax makes creating shortcuts for your favourite mod configurations dead easy. + + * **Load Your Favourite Mods And Join Your Favourite Server From A Single Shortcut** ArmA 2 Mod Launcher allows you to easily construct shortcuts which launch ArmA 2 with @@ -39,8 +41,6 @@ line syntax makes creating shortcuts for your favourite mod configurations dead [View on GitHub](https://github.com/SierraSoftworks/arma2ml) ::: - - ## Usage ```bash diff --git a/src/projects/bash-cli.md b/src/projects/bash-cli.md index 4e8bdb2..580e68d 100644 --- a/src/projects/bash-cli.md +++ b/src/projects/bash-cli.md @@ -17,6 +17,8 @@ and tools for a project. Rather than port the scripts to something like Go or Py or merge them into a single bash script, we opted to build a framework which allows and executable to be presented as a sub-command. + + ## Example ```sh diff --git a/src/projects/bender.md b/src/projects/bender.md index bee944d..a31f1ab 100644 --- a/src/projects/bender.md +++ b/src/projects/bender.md @@ -16,6 +16,8 @@ Bender is a small API which allows you to run a BaaS stack (Bender as a Service) for those times you really wish you could tell a web app to bite your shiny metal ass. + + ::: tip You can go directly to [Bender](https://bender.sierrasoftworks.com/api/v1/quote) and get your dose of Futurama if you're more interested in that than the API docs. diff --git a/src/projects/coremonitor.md b/src/projects/coremonitor.md index 5033180..8462fa4 100644 --- a/src/projects/coremonitor.md +++ b/src/projects/coremonitor.md @@ -17,14 +17,14 @@ download: https://cdn.sierrasoftworks.com/coremonitor/CoreMonitorSetup.exe # CoreMonitor Easily monitor your system's resource usage using our powerful replacement for the default Logitech G15/G19 resource monitor widget. + + ::: tip [Download CoreMonitor](https://cdn.sierrasoftworks.com/coremonitor/CoreMonitorSetup.exe) [View on GitHub](https://github.com/SierraSoftworks/coremonitor) ::: - - ## Features ### Graphed CPU Usage diff --git a/src/projects/git-tool.md b/src/projects/git-tool.md index f3a079a..f580852 100644 --- a/src/projects/git-tool.md +++ b/src/projects/git-tool.md @@ -21,6 +21,8 @@ its biggest advantages is that you no longer need to think about where your development directory is on different devices. Just `gt o my-repo` and you're ready to start developing, even if the code wasn't already cloned. + + ## Features - **Quickly open repositories** whether they are already cloned locally or not, using your favourite Git services and a concise folder structure. @@ -29,8 +31,6 @@ ready to start developing, even if the code wasn't already cloned. - **Aliases** to make opening your most common repositories as quick as possible. - **Fast autocompletion** on all platforms with support for "sequence search" (`ssgt` matches `SierraSoftworks/git-tool`) as found in Sublime and VSCode. - - ## Example ```powershell diff --git a/src/projects/wkd.md b/src/projects/wkd.md index ef76110..2ed74a0 100644 --- a/src/projects/wkd.md +++ b/src/projects/wkd.md @@ -12,8 +12,9 @@ download: https://cdn.sierrasoftworks.com/wkd/WKDSetup.exe --- # Web Comic Downloader -WKD is a web comic downloader which allows you to easily download a large number of comics automatically. It makes use of XPath queries to locate images, similarly to the way your web browser does. This allows it to download images which are not named sequentially (1, 2, 3...) without any problems. - +WKD is a web comic downloader which allows you to easily download a large number of comics automatically. It makes use of XPath queries to locate images, similarly to the way your web browser does. This allows it to download images which are not named sequentially (1, 2, 3...) without any problems. + + ::: tip [Download WKD](https://cdn.sierrasoftworks.com/wkd/WKDSetup.exe) @@ -21,8 +22,6 @@ WKD is a web comic downloader which allows you to easily download a large number [View on GitHub](https://github.com/SierraSoftworks/web-comic-downloader) ::: - - ## Why make WKD? I am one of many people who routinely reads web comics, alas I get to the stage where I am not willing to click through each of the 700 strips in a comic. It is just so much easier to browse it on your hard drive, where it loads immediately and can be traversed quickly using thumbnails. Previously there was an application which performed a similar purpose, called Woofy. It's development ceased a few years ago and it was never able to run on a 64-bit OS. This was a major drawback for me since I only use 64-bit OSes.