diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 46c2e6904a..410159c6a9 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -30,6 +30,22 @@ const lightCodeTheme = themes.github; const darkCodeTheme = themes.dracula; const DEFAULT_LOCALE = "en"; +function createEditUrl({ + locale, + versionDocsDirPath, + docPath, +}: { + locale: string; + versionDocsDirPath: string; + docPath: string; +}): string { + if (locale !== DEFAULT_LOCALE) { + return `https://translate.unraid.net/unraid-docs/${locale}`; + } + const branch = process.env.GITHUB_BRANCH || "main"; + return `https://github.com/unraid/docs/edit/${branch}/${versionDocsDirPath}/${docPath}`; +} + const config: Config = { title: "Unraid Docs", tagline: "Unraid Documentation", @@ -50,14 +66,10 @@ const config: Config = { projectName: "docs", // Usually your repo name. onBrokenLinks: "warn", + onBrokenMarkdownLinks: "warn", // Even if you don't use internalization, you can use this field to set useful // metadata like html lang. For example, if your site is Chinese, you may want // to replace "en" with "zh-Hans". - markdown: { - hooks: { - onBrokenMarkdownLinks: () => "warn", - }, - }, i18n: { defaultLocale: DEFAULT_LOCALE, locales: ["en", "es", "fr", "de", "zh"], @@ -77,16 +89,7 @@ const config: Config = { sidebarPath: "./sidebars.js", // Please change this to your repo. // Remove this to remove the "edit this page" links. - editUrl: ({ locale, versionDocsDirPath, docPath }) => { - // Link to Crowdin for non-English docs - if (locale !== DEFAULT_LOCALE) { - return `https://translate.unraid.net/unraid-docs/${locale}`; - } - // Link to GitHub for English docs - // Use PR branch if available, otherwise default to main - const branch = process.env.GITHUB_BRANCH || "main"; - return `https://github.com/unraid/docs/edit/${branch}/${versionDocsDirPath}/${docPath}`; - }, + editUrl: createEditUrl, editLocalizedFiles: true, async sidebarItemsGenerator({ defaultSidebarItemsGenerator, @@ -180,6 +183,11 @@ const config: Config = { style: { width: "30px" }, }, items: [ + { + to: "/guides/", + label: "Community App Guides", + position: "left", + }, { items: [ { href: "https://unraid.net", label: "Unraid Home" }, @@ -260,6 +268,16 @@ const config: Config = { plugins: [ "docusaurus-plugin-image-zoom", + [ + "@docusaurus/plugin-content-docs", + { + id: "guides", + path: "guides", + routeBasePath: "guides", + sidebarPath: "./sidebarsGuides.js", + editUrl: createEditUrl, + }, + ], [ "@docusaurus/plugin-ideal-image", { diff --git a/guides/intro.mdx b/guides/intro.mdx new file mode 100644 index 0000000000..8f28b959f1 --- /dev/null +++ b/guides/intro.mdx @@ -0,0 +1,18 @@ +--- +sidebar_position: 1 +title: About these guides +slug: / +--- + +This section contains step-by-step tutorials and how-to guides for third-party and community applications that run on Unraid. It is maintained separately from the main Unraid documentation. + +These guides provide general setup steps for common self-hosted applications; however, we strongly recommend reviewing each application's official documentation for detailed support and troubleshooting. + +There is no guarantee that every guide will remain current. However, for popular guides, we may dedicate resources to update them to the best of our ability. + +## Contributing to or using a guide + +- Each guide **must** include a "Last validated [date]" note indicating when the steps were last reviewed. +- If you notice that a guide is out of date, you can suggest changes via pull requests or report issues in the repository so the community can help keep useful guides current. + +More guides will be added over time. If you have a guide you'd like to submit, see the [main documentation repository](https://github.com/unraid/docs) for contribution guidelines. diff --git a/guides/paperless-ngx.mdx b/guides/paperless-ngx.mdx new file mode 100644 index 0000000000..2866ffe70e --- /dev/null +++ b/guides/paperless-ngx.mdx @@ -0,0 +1,15 @@ +--- +sidebar_position: 2 +title: Paperless NGX +description: Paperless NGX on Unraid +--- + +:::info[Last validated] + +*[Date to be filled when real content is added]* + +::: + +## Paperless NGX on Unraid + +This is a placeholder page for the Paperless NGX guide. It demonstrates how a guide appears in the Community App Guides section alongside the rest of the site. diff --git a/sidebarsGuides.js b/sidebarsGuides.js new file mode 100644 index 0000000000..f1f70312b4 --- /dev/null +++ b/sidebarsGuides.js @@ -0,0 +1,6 @@ +/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ +const sidebars = { + guidesSidebar: [{ type: 'autogenerated', dirName: '.' }], +}; + +module.exports = sidebars;