Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,24 @@ The Platform documentation is versioned and lives in the `platform-enterprise_ve

We have a script which can select a commit (or ideally release tag) to be used for publishing a new version on the docs website.

### Build modes

The site build is controlled by `DOCS_SITE_MODE`:

- `main` builds `docs.seqera.io`
- `enterprise-archive` builds `docs-archive.seqera.io`

The main site serves the current Platform Enterprise docs (`24.1+`) together with the active product docs. The archive site serves legacy Platform Enterprise versions (`23.4`, `23.3`, `23.2`, and `23.1`) only.

For local archive preview and builds:

- `DOCS_SITE_MODE=enterprise-archive npm run dev`
- `npm run dev:archive`
- `DOCS_SITE_MODE=enterprise-archive npm run build`
- `npm run build:archive`

In archive mode, the startup/build preparation step skips fetching the external OSS doc repos because they are not required for the legacy Enterprise-only site.

## Write and edit content

### Install pre-commit
Expand Down Expand Up @@ -168,8 +186,17 @@ This works using the following principles:
- Based on the presence or absence of named environment variables, they are included in the Docuaurus config or not
- By defining these ENV vars in your build environment, you can selectively skip chunks in the build

Deployment works because we have two Netlify sites: `seqera-docs` and `seqera-docs-api`.
They're the same except that they have different environment variable set in their configuration.
This means that whenever you push to `master`, both deploy and both sites update.
Deployment works because we split large docsets into separate Netlify sites with different build-time configuration.

Today this includes:

- `seqera-docs` for the main docs site
- `seqera-docs-api` for the API docs split
- `docs-archive.seqera.io` for legacy Platform Enterprise docs

The main site's `netlify.toml` includes redirects for these split deployments:

- API docs use `200` proxy-style redirects so they continue to resolve under `docs.seqera.io`
- Legacy Platform Enterprise docs use cross-domain `301` redirects so old versioned URLs canonicalize to `docs-archive.seqera.io`

The site's `netlify.toml` includes some redirects with `200` statuses that take links to missing content on the primary deployment to fetch data from the secondary deployment, without affecting the browser bar URL.
The archive deployment is intended to be mostly frozen. Normal `master` changes should not rebuild it. If a legacy Enterprise fix is required, apply that change to the dedicated archive branch/site rather than treating it like a normal main-site update.
184 changes: 131 additions & 53 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,70 @@
const path = require("path");
import "dotenv/config";
import platform_enterprise_latest_version from "./platform-enterprise_latest_version.js";
import {
createSeqeraConfig,
getSeqeraThemeConfig,
getSeqeraPresetOptions
} from "@seqera/docusaurus-preset-seqera";

export default async function createConfigAsync() {
const DOCS_SITE_MODE = process.env.DOCS_SITE_MODE ?? "main";
const MAIN_SITE_MODE = "main";
const ENTERPRISE_ARCHIVE_SITE_MODE = "enterprise-archive";
const isEnterpriseArchiveSite =
DOCS_SITE_MODE === ENTERPRISE_ARCHIVE_SITE_MODE;

const enterpriseVersionsBySiteMode = {
[MAIN_SITE_MODE]: ["25.3", "25.2", "25.1", "24.2", "24.1"],
[ENTERPRISE_ARCHIVE_SITE_MODE]: ["23.4", "23.3", "23.2", "23.1"],
};
const activeEnterpriseVersions =
enterpriseVersionsBySiteMode[DOCS_SITE_MODE] ??
enterpriseVersionsBySiteMode[MAIN_SITE_MODE];
const activeEnterpriseLastVersion = activeEnterpriseVersions[0];
const docsSiteUrl = isEnterpriseArchiveSite
? "https://docs-archive.seqera.io"
: "https://docs.seqera.io";
const supportedEnterpriseDocsUrl =
"https://docs.seqera.io/platform-enterprise/";
const legacyEnterpriseArchiveUrl =
"https://docs-archive.seqera.io/platform-enterprise/";

const mainNavbarItems = [
{
label: "Cloud",
href: "/platform-cloud/",
},
{
label: "Enterprise",
href: "/platform-enterprise/",
},
{
label: "Nextflow",
href: "/nextflow/",
},
{
label: "MultiQC",
href: "/multiqc/",
},
{
label: "Wave",
href: "/wave/",
},
{
label: "Fusion",
href: "/fusion/",
},
];

const archiveNavbarItems = [
{
label: "Enterprise",
href: "/platform-enterprise/",
},
{
label: "Supported versions",
href: supportedEnterpriseDocsUrl,
},
];

const changelog = {
blogTitle: "Seqera Changelog",
Expand Down Expand Up @@ -35,8 +92,10 @@ export default async function createConfigAsync() {
routeBasePath: "/platform-enterprise",
path: "platform-enterprise_docs",
// For PR Previews we want to see the latest doc-set with expected changes.
includeCurrentVersion: process.env.INCLUDE_NEXT ? true : false,
lastVersion: platform_enterprise_latest_version,
includeCurrentVersion:
!isEnterpriseArchiveSite && process.env.INCLUDE_NEXT ? true : false,
lastVersion: activeEnterpriseLastVersion,
onlyIncludeVersions: activeEnterpriseVersions,
remarkPlugins: [
(await import("remark-code-import")).default,
(await require("remark-math")).default,
Expand Down Expand Up @@ -156,6 +215,7 @@ export default async function createConfigAsync() {
];

console.log(
"\n DOCS_SITE_MODE: " + DOCS_SITE_MODE,
"\n EXCLUDE_CHANGELOG: " + (process.env.EXCLUDE_CHANGELOG ? true : false),
"\n EXCLUDE_PLATFORM_ENTERPRISE: " +
(process.env.EXCLUDE_PLATFORM_ENTERPRISE ? true : false),
Expand All @@ -171,12 +231,16 @@ export default async function createConfigAsync() {
"\n EXCLUDE_FUSION: " + (process.env.EXCLUDE_FUSION ? true : false),
"\n EXCLUDE_WAVE: " + (process.env.EXCLUDE_WAVE ? true : false),
"\n INCLUDE_NEXT: " + (process.env.INCLUDE_NEXT ? true : false),
"\n ACTIVE_PLATFORM_ENTERPRISE_VERSIONS: " +
activeEnterpriseVersions.join(", "),
);

return createSeqeraConfig({
title: "Seqera Docs",
tagline: "Documentation for Seqera products",
url: "https://docs.seqera.io",
title: isEnterpriseArchiveSite ? "Seqera Docs Archive" : "Seqera Docs",
tagline: isEnterpriseArchiveSite
? "Archived documentation for Seqera Platform Enterprise"
: "Documentation for Seqera products",
url: docsSiteUrl,
/*
* Enable faster Docusaurus optimizations (experimental v4 features)
* Reference: https://github.com/facebook/docusaurus/issues/10556
Expand Down Expand Up @@ -218,25 +282,34 @@ export default async function createConfigAsync() {
},

customFields: {
// Put your custom environment here
docsSiteMode: DOCS_SITE_MODE,
activeEnterpriseVersions,
supportedEnterpriseDocsUrl,
legacyEnterpriseArchiveUrl,
},

clientModules: [
require.resolve('./src/client-modules/cross-site-nav.js'),
require.resolve('./src/client-modules/posthog-search.js'),
require.resolve("./src/client-modules/cross-site-nav.js"),
...(isEnterpriseArchiveSite
? []
: [require.resolve("./src/client-modules/posthog-search.js")]),
],


presets: [
[
"@seqera/docusaurus-preset-seqera",
await getSeqeraPresetOptions({
blog: process.env.EXCLUDE_CHANGELOG ? false : changelog,
blog:
isEnterpriseArchiveSite || process.env.EXCLUDE_CHANGELOG
? false
: changelog,
docs: false,
theme: {
customCss: require.resolve("./src/custom.css"),
},
openapi: process.env.EXCLUDE_PLATFORM_OPENAPI
openapi:
isEnterpriseArchiveSite || process.env.EXCLUDE_PLATFORM_OPENAPI
? false
: {
id: "api",
Expand All @@ -262,13 +335,23 @@ export default async function createConfigAsync() {
],
],
plugins: [
process.env.EXCLUDE_PLATFORM_ENTERPRISE ? null : docs_platform_enterprise,
process.env.EXCLUDE_PLATFORM_CLOUD ? null : docs_platform_cloud,
process.env.EXCLUDE_PLATFORM_API ? null : docs_platform_api,
process.env.EXCLUDE_PLATFORM_CLI ? null : docs_platform_cli,
process.env.EXCLUDE_MULTIQC ? null : docs_multiqc,
process.env.EXCLUDE_FUSION ? null : docs_fusion,
process.env.EXCLUDE_WAVE ? null : docs_wave,
docs_platform_enterprise,
isEnterpriseArchiveSite || process.env.EXCLUDE_PLATFORM_CLOUD
? null
: docs_platform_cloud,
isEnterpriseArchiveSite || process.env.EXCLUDE_PLATFORM_API
? null
: docs_platform_api,
isEnterpriseArchiveSite || process.env.EXCLUDE_PLATFORM_CLI
? null
: docs_platform_cli,
isEnterpriseArchiveSite || process.env.EXCLUDE_MULTIQC
? null
: docs_multiqc,
isEnterpriseArchiveSite || process.env.EXCLUDE_FUSION
? null
: docs_fusion,
isEnterpriseArchiveSite || process.env.EXCLUDE_WAVE ? null : docs_wave,

// Disable expensive bundler options.
// https://github.com/facebook/docusaurus/pull/11176
Expand All @@ -287,30 +370,41 @@ export default async function createConfigAsync() {
],

themeConfig: getSeqeraThemeConfig({
announcementBar: isEnterpriseArchiveSite
? {
id: "enterprise-archive-notice",
content: `Legacy Seqera Platform Enterprise documentation. For supported releases, visit <a href="${supportedEnterpriseDocsUrl}">docs.seqera.io/platform-enterprise/</a>.`,
backgroundColor: "#f3f4f6",
textColor: "#111827",
isCloseable: false,
}
: undefined,
typesense: {
typesenseCollectionName: 'seqera_docs',
searchPagePath: '/search',
typesenseCollectionName: "seqera_docs",
searchPagePath: isEnterpriseArchiveSite ? false : "/search",
typesenseServerConfig: {
nodes: [
{
host: 'uk4gflrza0d8yx5sp-1.a1.typesense.net',
host: "uk4gflrza0d8yx5sp-1.a1.typesense.net",
port: 443,
protocol: 'https',
protocol: "https",
},
],
apiKey: 'KZsuSjc7jPqDm7pkl1kN8TkoHH9b3dwY',
apiKey: "KZsuSjc7jPqDm7pkl1kN8TkoHH9b3dwY",
connectionTimeoutSeconds: 2,
},
typesenseSearchParameters: {
query_by: 'content,hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3',
group_by: 'url_without_anchor',
query_by:
"content,hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3",
group_by: "url_without_anchor",
group_limit: 1,
num_typos: 1,
prioritize_exact_match: true,
filter_by: 'docusaurus_tag:!=[default,doc_tag_doc_list,blog_posts_list,blog_tags_posts,doc_tags_list,blog_tags_list]', // TODO Remove once the scraper is updated
filter_by:
"docusaurus_tag:!=[default,doc_tag_doc_list,blog_posts_list,blog_tags_posts,doc_tags_list,blog_tags_list]", // TODO Remove once the scraper is updated
},
contextualSearch: false,
placeholder: 'Search Seqera docs...',
placeholder: "Search Seqera docs...",
},
prism: {
additionalLanguages: [
Expand All @@ -332,32 +426,16 @@ export default async function createConfigAsync() {
],
},
navbar: {
items: [
{
label: 'Cloud',
href: '/platform-cloud/',
},
{
label: 'Enterprise',
href: '/platform-enterprise/',
},
{
label: 'Nextflow',
href: '/nextflow/',
},
{
label: 'MultiQC',
href: '/multiqc/',
},
{
label: 'Wave',
href: '/wave/',
},
{
label: 'Fusion',
href: '/fusion/',
items: isEnterpriseArchiveSite ? archiveNavbarItems : mainNavbarItems,
},
seqera: {
docs: {
versionDropdown: {
"platform-enterprise": {
enabled: true,
},
},
],
},
},
}),
});
Expand Down
20 changes: 20 additions & 0 deletions internal/prepare-site.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {spawn} from "node:child_process";

const docsSiteMode = process.env.DOCS_SITE_MODE ?? "main";

if (docsSiteMode === "enterprise-archive") {
console.log(
"DOCS_SITE_MODE=enterprise-archive: skipping OSS docs fetch for local startup/build.",
);
process.exit(0);
}

const child = spawn("npm", ["run", "fetch-docs-oss"], {
stdio: "inherit",
shell: true,
env: process.env,
});

child.on("exit", (code) => {
process.exit(code ?? 1);
});
40 changes: 40 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,46 @@
to = "https://seqera-docs-api.netlify.app/platform-api/:splat"
status = 200

[[redirects]]
from = "/platform-enterprise/23.4"
to = "https://docs-archive.seqera.io/platform-enterprise/"
status = 301

[[redirects]]
from = "/platform-enterprise/23.4/*"
to = "https://docs-archive.seqera.io/platform-enterprise/:splat"
status = 301

[[redirects]]
from = "/platform-enterprise/23.3"
to = "https://docs-archive.seqera.io/platform-enterprise/23.3/"
status = 301

[[redirects]]
from = "/platform-enterprise/23.3/*"
to = "https://docs-archive.seqera.io/platform-enterprise/23.3/:splat"
status = 301

[[redirects]]
from = "/platform-enterprise/23.2"
to = "https://docs-archive.seqera.io/platform-enterprise/23.2/"
status = 301

[[redirects]]
from = "/platform-enterprise/23.2/*"
to = "https://docs-archive.seqera.io/platform-enterprise/23.2/:splat"
status = 301

[[redirects]]
from = "/platform-enterprise/23.1"
to = "https://docs-archive.seqera.io/platform-enterprise/23.1/"
status = 301

[[redirects]]
from = "/platform-enterprise/23.1/*"
to = "https://docs-archive.seqera.io/platform-enterprise/23.1/:splat"
status = 301

[[redirects]]
from = "/nextflow/*"
to = "https://docs-migration.netlify.app/nextflow/:splat"
Expand Down
Loading