From c33f749515a6a97034863b1eaf9293707214d0ef Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Tue, 8 Oct 2024 14:56:34 -0700 Subject: [PATCH] Frontend hosted-docs (#2107) Fixes #2106 Docs are now hosted as part of the frontend at `/docs` by default. - If `docs_url` is set in the helm chart, the `/docs` endpoint will redirect to that endpoint instead - Use multi-stage python image to build mkdocs as part of frontend, then copy static output - Dir layout: mkdocs.yml and docs into frontend/docs - CI: Update docs build GH action to use new path - Update all frontend paths to use `/docs/` instead of `https://docs.browsertrix.com/` --------- Co-authored-by: Henry Wilkinson --- .github/workflows/docs-publish.yaml | 4 +- chart/templates/frontend.yaml | 5 + chart/values.yaml | 5 + docs/overrides/main.html | 6 - docs/stylesheets/extra.css | 188 ---------------- frontend/.eslintrc.js | 2 +- frontend/.prettierignore | 1 + frontend/Dockerfile | 13 ++ frontend/docs/.gitignore | 1 + {docs => frontend/docs/docs}/CNAME | 0 .../assets/brand/browsertrix-icon-white.svg | 0 .../docs/docs}/assets/brand/favicon.svg | 0 .../docs}/assets/fonts/Inter-Italic.var.woff2 | Bin .../docs/docs}/assets/fonts/Inter.var.woff2 | Bin .../assets/fonts/Recursive_VF_1.084.woff2 | Bin .../docs}/deploy/admin/org-import-export.md | 0 .../docs/docs}/deploy/ansible/digitalocean.md | 0 .../docs/docs}/deploy/ansible/k3s.md | 0 .../docs/docs}/deploy/ansible/microk8s.md | 0 .../docs/docs}/deploy/customization.md | 0 {docs => frontend/docs/docs}/deploy/index.md | 0 {docs => frontend/docs/docs}/deploy/local.md | 0 .../docs/docs}/deploy/proxies.md | 0 {docs => frontend/docs/docs}/deploy/remote.md | 0 {docs => frontend/docs/docs}/develop/docs.md | 0 .../docs/docs}/develop/frontend-dev.md | 0 {docs => frontend/docs/docs}/develop/index.md | 0 .../docs/docs}/develop/local-dev-setup.md | 0 .../docs/docs}/helm-repo/.gitignore | 0 {docs => frontend/docs/docs}/index.md | 0 .../docs/docs}/js/insertversion.js | 4 +- .../overrides/.icons/bootstrap/bug-fill.svg | 0 .../.icons/bootstrap/chat-left-text-fill.svg | 0 .../.icons/bootstrap/check-circle-fill.svg | 0 .../.icons/bootstrap/dash-square-fill.svg | 0 .../bootstrap/exclamation-circle-fill.svg | 0 .../bootstrap/exclamation-diamond-fill.svg | 0 .../bootstrap/exclamation-square-fill.svg | 0 .../bootstrap/exclamation-triangle-fill.svg | 0 .../.icons/bootstrap/exclamation-triangle.svg | 0 .../docs}/overrides/.icons/bootstrap/eye.svg | 0 .../bootstrap/file-earmark-text-fill.svg | 0 .../overrides/.icons/bootstrap/github.svg | 0 .../overrides/.icons/bootstrap/globe.svg | 0 .../.icons/bootstrap/hourglass-split.svg | 0 .../.icons/bootstrap/info-circle-fill.svg | 0 .../overrides/.icons/bootstrap/mastodon.svg | 0 .../.icons/bootstrap/mortarboard-fill.svg | 0 .../.icons/bootstrap/motherboard-fill.svg | 0 .../.icons/bootstrap/pencil-fill.svg | 0 .../overrides/.icons/bootstrap/pencil.svg | 0 .../.icons/bootstrap/question-circle-fill.svg | 0 .../overrides/.icons/bootstrap/quote.svg | 0 .../overrides/.icons/bootstrap/upload.svg | 0 .../.icons/bootstrap/x-octagon-fill.svg | 0 .../overrides/.icons/bootstrap/youtube.svg | 0 .../overrides/.icons/btrix/status-dot.svg | 0 frontend/docs/docs/overrides/main.html | 2 + frontend/docs/docs/stylesheets/extra.css | 204 ++++++++++++++++++ .../docs/docs}/user-guide/archived-items.md | 0 .../docs/docs}/user-guide/browser-profiles.md | 0 .../docs/docs}/user-guide/collection.md | 0 .../docs/docs}/user-guide/collections.md | 0 .../docs/docs}/user-guide/contribute.md | 0 .../docs/docs}/user-guide/crawl-workflows.md | 0 .../docs/docs}/user-guide/getting-started.md | 0 .../docs/docs}/user-guide/index.md | 0 .../docs/docs}/user-guide/join.md | 0 .../docs/docs}/user-guide/org-members.md | 0 .../docs/docs}/user-guide/org-settings.md | 0 .../docs/docs}/user-guide/org.md | 0 .../docs/docs}/user-guide/overview.md | 0 .../docs/docs}/user-guide/review.md | 0 .../docs/docs}/user-guide/running-crawl.md | 0 .../docs/docs}/user-guide/signup.md | 0 .../docs/docs}/user-guide/user-settings.md | 0 .../docs/docs}/user-guide/workflow-setup.md | 0 mkdocs.yml => frontend/docs/mkdocs.yml | 2 +- frontend/frontend.conf.template | 11 + .../crawl-workflows/workflow-editor.ts | 2 +- frontend/src/index.ts | 33 ++- frontend/src/pages/invite/ui/inviteMessage.ts | 2 +- .../src/pages/org/browser-profiles-new.ts | 2 +- frontend/src/pages/org/workflows-new.ts | 5 +- frontend/webpack.config.js | 4 +- frontend/xliff/es.xlf | 24 +-- 86 files changed, 283 insertions(+), 237 deletions(-) delete mode 100644 docs/overrides/main.html delete mode 100644 docs/stylesheets/extra.css create mode 100644 frontend/docs/.gitignore rename {docs => frontend/docs/docs}/CNAME (100%) rename {docs => frontend/docs/docs}/assets/brand/browsertrix-icon-white.svg (100%) rename {docs => frontend/docs/docs}/assets/brand/favicon.svg (100%) rename {docs => frontend/docs/docs}/assets/fonts/Inter-Italic.var.woff2 (100%) rename {docs => frontend/docs/docs}/assets/fonts/Inter.var.woff2 (100%) rename {docs => frontend/docs/docs}/assets/fonts/Recursive_VF_1.084.woff2 (100%) rename {docs => frontend/docs/docs}/deploy/admin/org-import-export.md (100%) rename {docs => frontend/docs/docs}/deploy/ansible/digitalocean.md (100%) rename {docs => frontend/docs/docs}/deploy/ansible/k3s.md (100%) rename {docs => frontend/docs/docs}/deploy/ansible/microk8s.md (100%) rename {docs => frontend/docs/docs}/deploy/customization.md (100%) rename {docs => frontend/docs/docs}/deploy/index.md (100%) rename {docs => frontend/docs/docs}/deploy/local.md (100%) rename {docs => frontend/docs/docs}/deploy/proxies.md (100%) rename {docs => frontend/docs/docs}/deploy/remote.md (100%) rename {docs => frontend/docs/docs}/develop/docs.md (100%) rename {docs => frontend/docs/docs}/develop/frontend-dev.md (100%) rename {docs => frontend/docs/docs}/develop/index.md (100%) rename {docs => frontend/docs/docs}/develop/local-dev-setup.md (100%) rename {docs => frontend/docs/docs}/helm-repo/.gitignore (100%) rename {docs => frontend/docs/docs}/index.md (100%) rename {docs => frontend/docs/docs}/js/insertversion.js (97%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/bug-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/chat-left-text-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/check-circle-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/dash-square-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/exclamation-circle-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/exclamation-diamond-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/exclamation-square-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/exclamation-triangle-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/exclamation-triangle.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/eye.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/file-earmark-text-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/github.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/globe.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/hourglass-split.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/info-circle-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/mastodon.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/mortarboard-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/motherboard-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/pencil-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/pencil.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/question-circle-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/quote.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/upload.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/x-octagon-fill.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/bootstrap/youtube.svg (100%) rename {docs => frontend/docs/docs}/overrides/.icons/btrix/status-dot.svg (100%) create mode 100644 frontend/docs/docs/overrides/main.html create mode 100644 frontend/docs/docs/stylesheets/extra.css rename {docs => frontend/docs/docs}/user-guide/archived-items.md (100%) rename {docs => frontend/docs/docs}/user-guide/browser-profiles.md (100%) rename {docs => frontend/docs/docs}/user-guide/collection.md (100%) rename {docs => frontend/docs/docs}/user-guide/collections.md (100%) rename {docs => frontend/docs/docs}/user-guide/contribute.md (100%) rename {docs => frontend/docs/docs}/user-guide/crawl-workflows.md (100%) rename {docs => frontend/docs/docs}/user-guide/getting-started.md (100%) rename {docs => frontend/docs/docs}/user-guide/index.md (100%) rename {docs => frontend/docs/docs}/user-guide/join.md (100%) rename {docs => frontend/docs/docs}/user-guide/org-members.md (100%) rename {docs => frontend/docs/docs}/user-guide/org-settings.md (100%) rename {docs => frontend/docs/docs}/user-guide/org.md (100%) rename {docs => frontend/docs/docs}/user-guide/overview.md (100%) rename {docs => frontend/docs/docs}/user-guide/review.md (100%) rename {docs => frontend/docs/docs}/user-guide/running-crawl.md (100%) rename {docs => frontend/docs/docs}/user-guide/signup.md (100%) rename {docs => frontend/docs/docs}/user-guide/user-settings.md (100%) rename {docs => frontend/docs/docs}/user-guide/workflow-setup.md (100%) rename mkdocs.yml => frontend/docs/mkdocs.yml (98%) diff --git a/.github/workflows/docs-publish.yaml b/.github/workflows/docs-publish.yaml index e1e83257..d90569ee 100644 --- a/.github/workflows/docs-publish.yaml +++ b/.github/workflows/docs-publish.yaml @@ -19,6 +19,6 @@ jobs: - run: pip install mkdocs-material requests pyyaml - name: Generate Helm Chart Index - run: python ./scripts/generate-helm-index.py > ./docs/helm-repo/index.yaml + run: python ./scripts/generate-helm-index.py > ./frontend/docs/docs/helm-repo/index.yaml - - run: mkdocs gh-deploy --force + - run: cd frontend/docs; mkdocs gh-deploy --force diff --git a/chart/templates/frontend.yaml b/chart/templates/frontend.yaml index 45278586..92d5270d 100644 --- a/chart/templates/frontend.yaml +++ b/chart/templates/frontend.yaml @@ -49,6 +49,11 @@ spec: - name: RWP_BASE_URL value: {{ .Values.rwp_base_url }} + {{- if .Values.docs_url }} + - name: DOCS_URL + value: {{ .Values.docs_url }} + {{- end }} + {{- if .Values.minio_local }} - name: LOCAL_MINIO_HOST value: "{{ .Values.minio_host }}" diff --git a/chart/values.yaml b/chart/values.yaml index 3a5f836a..8631232b 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -156,6 +156,11 @@ local_service_port: 30870 frontend_alias: "http://browsertrix-cloud-frontend" +# custom URL for where Browsertrix docs are hosted +# by default, docs are served from /docs/ but can be served from a custom +# URL specified here. +# docs_url: "https://browsertrix-docs.example.com/" + # Autoscaling # ----------- # max number of backend pods to scale to diff --git a/docs/overrides/main.html b/docs/overrides/main.html deleted file mode 100644 index 8f4b4b48..00000000 --- a/docs/overrides/main.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "base.html" %} - -{% block icons %} - {% set icon_path = "overrides/.icons/bootstrap/" %} - {{ super() }} -{% endblock %} \ No newline at end of file diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css deleted file mode 100644 index 650af87a..00000000 --- a/docs/stylesheets/extra.css +++ /dev/null @@ -1,188 +0,0 @@ -/* Font style definitions */ - -@font-face { - font-family: 'Recursive'; - font-style: oblique 0deg 15deg; - font-weight: 300 1000; - src: url('../assets/fonts/Recursive_VF_1.084.woff2') format('woff2'); - font-feature-settings: "ss12"; -} - -@font-face { - font-family: 'Inter'; - font-weight: 100 900; - font-display: swap; - font-style: normal; - src: url('../assets/fonts/Inter.var.woff2') format('woff2'); - font-feature-settings: "ss03"; -} - -@font-face { - font-family: 'Inter'; - font-weight: 100 900; - font-display: swap; - font-style: italic; - src: url('../assets/fonts/Inter-Italic.var.woff2') format('woff2'); - font-feature-settings: "ss03"; -} - -@font-face { - font-family: 'Konsole'; - font-weight: 100 900; - font-display: swap; - font-style: normal; - src: url('https://wr-static.sfo3.cdn.digitaloceanspaces.com/fonts/konsole/Konsolev1.1-VF.woff2') format('woff2'); -} - -:root { - --md-display-font: "Konsole", "Helvetica", sans-serif; - --md-code-font: "Recursive", monospace; - --md-text-font: "Inter", "Helvetica", "Arial", sans-serif; - --wr-blue-primary: #088eaf; - --wr-orange-primary: #bb4a00; -} - -[data-md-color-scheme="webrecorder"] { - --md-primary-fg-color: #4D7C0F; - --md-primary-fg-color--light: #057894; - --md-primary-fg-color--dark: #035b71; - --md-typeset-color: black; - --md-accent-fg-color: #057894; - --md-typeset-a-color: #035b71; - --md-code-bg-color: #F9FAFB; - } - -/* Nav changes */ - -.md-header__title, .md-nav__title { - font-family: var(--md-display-font); - text-transform: uppercase; - font-variation-settings: "wght" 750, "wdth" 87; - margin-left: 0 !important; -} - -.md-header__title--active { - font-family: var(--md-display-font); - text-transform: none; - font-variation-settings: "wght" 550, "wdth" 90; -} - -.md-header__button { - margin-right: 0 !important; -} - -/* Custom menu item hover */ - -.md-tabs__link { - font-family: var(--md-code-font); - font-weight: 400; - opacity: .9; - transition: .4s cubic-bezier(.1,.7,.1,1),opacity .25s -} - -.md-tabs__link:hover { - font-weight: 600; -} - -/* Custom body typography rules */ - -.md-typeset a { - text-decoration: underline; -} - -.headerlink { - text-decoration: none!important; -} - -code, pre, kbd { - font-variation-settings: "MONO" 1; - font-feature-settings: "ss01", "ss02", "ss08"; -} - -code { - border-width: 1px; - border-color: #D1D5DB; - border-style: solid; -} - -.md-typeset h1, h2, h3, h4, h5 { - color: black; -} - -.md-typeset h1, h2, h3 { - font-weight: 650 !important; - font-variation-settings: "OPSZ" 35; -} - -/* Custom badge classes, applies custom overrides to inline-code blocks */ - -.badge-blue { - background-color: var(--wr-blue-primary) !important; - border-color: var(--wr-blue-primary) !important; - color: white !important; - font-family: var(--md-text-font); - font-weight: 600; -} - -.badge-green { - background-color: hsl(142 76% 36%) !important; - border-color: hsl(142 76% 36%) !important; - color: white !important; - font-family: var(--md-text-font); - font-weight: 600; -} - -.badge-orange { - background-color: var(--wr-orange-primary) !important; - border-color: var(--wr-orange-primary) !important; - color: white !important; - font-family: var(--md-text-font); - font-weight: 600; -} - -/* Status Styling */ - -.status-success { - font-family: var(--md-code-font); - font-weight: 500; - white-space: nowrap; - & svg { - color: hsl(142.1 76.2% 36.3%); - } -} - -.status-neutral { - font-family: var(--md-code-font); - font-weight: 500; - white-space: nowrap; - & svg { - color: hsl(32.1 94.6% 43.7%); - } -} - -.status-warning { - font-family: var(--md-code-font); - font-weight: 500; - white-space: nowrap; - & svg { - color: hsl(21, 90%, 48%); - } -} - -.status-danger { - font-family: var(--md-code-font); - font-weight: 500; - white-space: nowrap; - & svg { - color: hsl(0 72.2% 50.6%); - } -} - -.status-waiting { - font-family: var(--md-code-font); - font-weight: 500; - white-space: nowrap; - & svg { - color: hsl(271.5 81.3% 55.9%); - } -} diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 0b6f92d5..eb834143 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -138,7 +138,7 @@ module.exports = { typescript: true, }, }, - ignorePatterns: ["__generated__", "__mocks__", "dist"], + ignorePatterns: ["__generated__", "__mocks__", "dist", "docs"], overrides: [ { extends: ["plugin:@typescript-eslint/disable-type-checked"], diff --git a/frontend/.prettierignore b/frontend/.prettierignore index 250127a9..faca7bf8 100644 --- a/frontend/.prettierignore +++ b/frontend/.prettierignore @@ -2,3 +2,4 @@ __generated__ __mocks__ assets dist +docs diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 1ea7136a..1322dd9e 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -35,10 +35,23 @@ ENV GIT_COMMIT_HASH=${GIT_COMMIT_HASH} \ RUN yarn build && \ rm -rf ./node_modules +FROM --platform=$BUILDPLATFORM docker.io/library/python:3.12-slim as build_docs + +WORKDIR /docs + +RUN pip install mkdocs-material + +COPY --link ./docs/mkdocs.yml . +COPY --link ./docs/docs ./docs + +RUN mkdocs build + FROM docker.io/library/nginx:1.23.2 COPY --link --from=build_deps /app/dist /usr/share/nginx/html +COPY --link --from=build_docs /docs/site /usr/share/nginx/html/docs + #COPY ./nginx.conf /etc/nginx/nginx.conf COPY --link ./frontend.conf.template /etc/nginx/templates/ COPY --link ./minio.conf /etc/nginx/includes/ diff --git a/frontend/docs/.gitignore b/frontend/docs/.gitignore new file mode 100644 index 00000000..1320f90e --- /dev/null +++ b/frontend/docs/.gitignore @@ -0,0 +1 @@ +site diff --git a/docs/CNAME b/frontend/docs/docs/CNAME similarity index 100% rename from docs/CNAME rename to frontend/docs/docs/CNAME diff --git a/docs/assets/brand/browsertrix-icon-white.svg b/frontend/docs/docs/assets/brand/browsertrix-icon-white.svg similarity index 100% rename from docs/assets/brand/browsertrix-icon-white.svg rename to frontend/docs/docs/assets/brand/browsertrix-icon-white.svg diff --git a/docs/assets/brand/favicon.svg b/frontend/docs/docs/assets/brand/favicon.svg similarity index 100% rename from docs/assets/brand/favicon.svg rename to frontend/docs/docs/assets/brand/favicon.svg diff --git a/docs/assets/fonts/Inter-Italic.var.woff2 b/frontend/docs/docs/assets/fonts/Inter-Italic.var.woff2 similarity index 100% rename from docs/assets/fonts/Inter-Italic.var.woff2 rename to frontend/docs/docs/assets/fonts/Inter-Italic.var.woff2 diff --git a/docs/assets/fonts/Inter.var.woff2 b/frontend/docs/docs/assets/fonts/Inter.var.woff2 similarity index 100% rename from docs/assets/fonts/Inter.var.woff2 rename to frontend/docs/docs/assets/fonts/Inter.var.woff2 diff --git a/docs/assets/fonts/Recursive_VF_1.084.woff2 b/frontend/docs/docs/assets/fonts/Recursive_VF_1.084.woff2 similarity index 100% rename from docs/assets/fonts/Recursive_VF_1.084.woff2 rename to frontend/docs/docs/assets/fonts/Recursive_VF_1.084.woff2 diff --git a/docs/deploy/admin/org-import-export.md b/frontend/docs/docs/deploy/admin/org-import-export.md similarity index 100% rename from docs/deploy/admin/org-import-export.md rename to frontend/docs/docs/deploy/admin/org-import-export.md diff --git a/docs/deploy/ansible/digitalocean.md b/frontend/docs/docs/deploy/ansible/digitalocean.md similarity index 100% rename from docs/deploy/ansible/digitalocean.md rename to frontend/docs/docs/deploy/ansible/digitalocean.md diff --git a/docs/deploy/ansible/k3s.md b/frontend/docs/docs/deploy/ansible/k3s.md similarity index 100% rename from docs/deploy/ansible/k3s.md rename to frontend/docs/docs/deploy/ansible/k3s.md diff --git a/docs/deploy/ansible/microk8s.md b/frontend/docs/docs/deploy/ansible/microk8s.md similarity index 100% rename from docs/deploy/ansible/microk8s.md rename to frontend/docs/docs/deploy/ansible/microk8s.md diff --git a/docs/deploy/customization.md b/frontend/docs/docs/deploy/customization.md similarity index 100% rename from docs/deploy/customization.md rename to frontend/docs/docs/deploy/customization.md diff --git a/docs/deploy/index.md b/frontend/docs/docs/deploy/index.md similarity index 100% rename from docs/deploy/index.md rename to frontend/docs/docs/deploy/index.md diff --git a/docs/deploy/local.md b/frontend/docs/docs/deploy/local.md similarity index 100% rename from docs/deploy/local.md rename to frontend/docs/docs/deploy/local.md diff --git a/docs/deploy/proxies.md b/frontend/docs/docs/deploy/proxies.md similarity index 100% rename from docs/deploy/proxies.md rename to frontend/docs/docs/deploy/proxies.md diff --git a/docs/deploy/remote.md b/frontend/docs/docs/deploy/remote.md similarity index 100% rename from docs/deploy/remote.md rename to frontend/docs/docs/deploy/remote.md diff --git a/docs/develop/docs.md b/frontend/docs/docs/develop/docs.md similarity index 100% rename from docs/develop/docs.md rename to frontend/docs/docs/develop/docs.md diff --git a/docs/develop/frontend-dev.md b/frontend/docs/docs/develop/frontend-dev.md similarity index 100% rename from docs/develop/frontend-dev.md rename to frontend/docs/docs/develop/frontend-dev.md diff --git a/docs/develop/index.md b/frontend/docs/docs/develop/index.md similarity index 100% rename from docs/develop/index.md rename to frontend/docs/docs/develop/index.md diff --git a/docs/develop/local-dev-setup.md b/frontend/docs/docs/develop/local-dev-setup.md similarity index 100% rename from docs/develop/local-dev-setup.md rename to frontend/docs/docs/develop/local-dev-setup.md diff --git a/docs/helm-repo/.gitignore b/frontend/docs/docs/helm-repo/.gitignore similarity index 100% rename from docs/helm-repo/.gitignore rename to frontend/docs/docs/helm-repo/.gitignore diff --git a/docs/index.md b/frontend/docs/docs/index.md similarity index 100% rename from docs/index.md rename to frontend/docs/docs/index.md diff --git a/docs/js/insertversion.js b/frontend/docs/docs/js/insertversion.js similarity index 97% rename from docs/js/insertversion.js rename to frontend/docs/docs/js/insertversion.js index c9a8f2e4..610fd590 100644 --- a/docs/js/insertversion.js +++ b/frontend/docs/docs/js/insertversion.js @@ -25,9 +25,7 @@ function parseVersion(string) { node.nodeValue = node.nodeValue.replaceAll("VERSION", version); } }); - } catch (e) { - - } + } catch (e) {} } } diff --git a/docs/overrides/.icons/bootstrap/bug-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/bug-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/bug-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/bug-fill.svg diff --git a/docs/overrides/.icons/bootstrap/chat-left-text-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/chat-left-text-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/chat-left-text-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/chat-left-text-fill.svg diff --git a/docs/overrides/.icons/bootstrap/check-circle-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/check-circle-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/check-circle-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/check-circle-fill.svg diff --git a/docs/overrides/.icons/bootstrap/dash-square-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/dash-square-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/dash-square-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/dash-square-fill.svg diff --git a/docs/overrides/.icons/bootstrap/exclamation-circle-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/exclamation-circle-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/exclamation-circle-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/exclamation-circle-fill.svg diff --git a/docs/overrides/.icons/bootstrap/exclamation-diamond-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/exclamation-diamond-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/exclamation-diamond-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/exclamation-diamond-fill.svg diff --git a/docs/overrides/.icons/bootstrap/exclamation-square-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/exclamation-square-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/exclamation-square-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/exclamation-square-fill.svg diff --git a/docs/overrides/.icons/bootstrap/exclamation-triangle-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/exclamation-triangle-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/exclamation-triangle-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/exclamation-triangle-fill.svg diff --git a/docs/overrides/.icons/bootstrap/exclamation-triangle.svg b/frontend/docs/docs/overrides/.icons/bootstrap/exclamation-triangle.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/exclamation-triangle.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/exclamation-triangle.svg diff --git a/docs/overrides/.icons/bootstrap/eye.svg b/frontend/docs/docs/overrides/.icons/bootstrap/eye.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/eye.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/eye.svg diff --git a/docs/overrides/.icons/bootstrap/file-earmark-text-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/file-earmark-text-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/file-earmark-text-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/file-earmark-text-fill.svg diff --git a/docs/overrides/.icons/bootstrap/github.svg b/frontend/docs/docs/overrides/.icons/bootstrap/github.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/github.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/github.svg diff --git a/docs/overrides/.icons/bootstrap/globe.svg b/frontend/docs/docs/overrides/.icons/bootstrap/globe.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/globe.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/globe.svg diff --git a/docs/overrides/.icons/bootstrap/hourglass-split.svg b/frontend/docs/docs/overrides/.icons/bootstrap/hourglass-split.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/hourglass-split.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/hourglass-split.svg diff --git a/docs/overrides/.icons/bootstrap/info-circle-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/info-circle-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/info-circle-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/info-circle-fill.svg diff --git a/docs/overrides/.icons/bootstrap/mastodon.svg b/frontend/docs/docs/overrides/.icons/bootstrap/mastodon.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/mastodon.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/mastodon.svg diff --git a/docs/overrides/.icons/bootstrap/mortarboard-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/mortarboard-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/mortarboard-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/mortarboard-fill.svg diff --git a/docs/overrides/.icons/bootstrap/motherboard-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/motherboard-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/motherboard-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/motherboard-fill.svg diff --git a/docs/overrides/.icons/bootstrap/pencil-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/pencil-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/pencil-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/pencil-fill.svg diff --git a/docs/overrides/.icons/bootstrap/pencil.svg b/frontend/docs/docs/overrides/.icons/bootstrap/pencil.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/pencil.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/pencil.svg diff --git a/docs/overrides/.icons/bootstrap/question-circle-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/question-circle-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/question-circle-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/question-circle-fill.svg diff --git a/docs/overrides/.icons/bootstrap/quote.svg b/frontend/docs/docs/overrides/.icons/bootstrap/quote.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/quote.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/quote.svg diff --git a/docs/overrides/.icons/bootstrap/upload.svg b/frontend/docs/docs/overrides/.icons/bootstrap/upload.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/upload.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/upload.svg diff --git a/docs/overrides/.icons/bootstrap/x-octagon-fill.svg b/frontend/docs/docs/overrides/.icons/bootstrap/x-octagon-fill.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/x-octagon-fill.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/x-octagon-fill.svg diff --git a/docs/overrides/.icons/bootstrap/youtube.svg b/frontend/docs/docs/overrides/.icons/bootstrap/youtube.svg similarity index 100% rename from docs/overrides/.icons/bootstrap/youtube.svg rename to frontend/docs/docs/overrides/.icons/bootstrap/youtube.svg diff --git a/docs/overrides/.icons/btrix/status-dot.svg b/frontend/docs/docs/overrides/.icons/btrix/status-dot.svg similarity index 100% rename from docs/overrides/.icons/btrix/status-dot.svg rename to frontend/docs/docs/overrides/.icons/btrix/status-dot.svg diff --git a/frontend/docs/docs/overrides/main.html b/frontend/docs/docs/overrides/main.html new file mode 100644 index 00000000..aa8dd1e1 --- /dev/null +++ b/frontend/docs/docs/overrides/main.html @@ -0,0 +1,2 @@ +{% extends "base.html" %} {% block icons %} {% set icon_path = +"overrides/.icons/bootstrap/" %} {{ super() }} {% endblock %} diff --git a/frontend/docs/docs/stylesheets/extra.css b/frontend/docs/docs/stylesheets/extra.css new file mode 100644 index 00000000..4978c791 --- /dev/null +++ b/frontend/docs/docs/stylesheets/extra.css @@ -0,0 +1,204 @@ +/* Font style definitions */ + +@font-face { + font-family: "Recursive"; + font-style: oblique 0deg 15deg; + font-weight: 300 1000; + src: url("../assets/fonts/Recursive_VF_1.084.woff2") format("woff2"); + font-feature-settings: "ss12"; +} + +@font-face { + font-family: "Inter"; + font-weight: 100 900; + font-display: swap; + font-style: normal; + src: url("../assets/fonts/Inter.var.woff2") format("woff2"); + font-feature-settings: "ss03"; +} + +@font-face { + font-family: "Inter"; + font-weight: 100 900; + font-display: swap; + font-style: italic; + src: url("../assets/fonts/Inter-Italic.var.woff2") format("woff2"); + font-feature-settings: "ss03"; +} + +@font-face { + font-family: "Konsole"; + font-weight: 100 900; + font-display: swap; + font-style: normal; + src: url("https://wr-static.sfo3.cdn.digitaloceanspaces.com/fonts/konsole/Konsolev1.1-VF.woff2") + format("woff2"); +} + +:root { + --md-display-font: "Konsole", "Helvetica", sans-serif; + --md-code-font: "Recursive", monospace; + --md-text-font: "Inter", "Helvetica", "Arial", sans-serif; + --wr-blue-primary: #088eaf; + --wr-orange-primary: #bb4a00; +} + +[data-md-color-scheme="webrecorder"] { + --md-primary-fg-color: #4d7c0f; + --md-primary-fg-color--light: #057894; + --md-primary-fg-color--dark: #035b71; + --md-typeset-color: black; + --md-accent-fg-color: #057894; + --md-typeset-a-color: #035b71; + --md-code-bg-color: #f9fafb; +} + +/* Nav changes */ + +.md-header__title, +.md-nav__title { + font-family: var(--md-display-font); + text-transform: uppercase; + font-variation-settings: + "wght" 750, + "wdth" 87; + margin-left: 0 !important; +} + +.md-header__title--active { + font-family: var(--md-display-font); + text-transform: none; + font-variation-settings: + "wght" 550, + "wdth" 90; +} + +.md-header__button { + margin-right: 0 !important; +} + +/* Custom menu item hover */ + +.md-tabs__link { + font-family: var(--md-code-font); + font-weight: 400; + opacity: 0.9; + transition: + 0.4s cubic-bezier(0.1, 0.7, 0.1, 1), + opacity 0.25s; +} + +.md-tabs__link:hover { + font-weight: 600; +} + +/* Custom body typography rules */ + +.md-typeset a { + text-decoration: underline; +} + +.headerlink { + text-decoration: none !important; +} + +code, +pre, +kbd { + font-variation-settings: "MONO" 1; + font-feature-settings: "ss01", "ss02", "ss08"; +} + +code { + border-width: 1px; + border-color: #d1d5db; + border-style: solid; +} + +.md-typeset h1, +h2, +h3, +h4, +h5 { + color: black; +} + +.md-typeset h1, +h2, +h3 { + font-weight: 650 !important; + font-variation-settings: "OPSZ" 35; +} + +/* Custom badge classes, applies custom overrides to inline-code blocks */ + +.badge-blue { + background-color: var(--wr-blue-primary) !important; + border-color: var(--wr-blue-primary) !important; + color: white !important; + font-family: var(--md-text-font); + font-weight: 600; +} + +.badge-green { + background-color: hsl(142 76% 36%) !important; + border-color: hsl(142 76% 36%) !important; + color: white !important; + font-family: var(--md-text-font); + font-weight: 600; +} + +.badge-orange { + background-color: var(--wr-orange-primary) !important; + border-color: var(--wr-orange-primary) !important; + color: white !important; + font-family: var(--md-text-font); + font-weight: 600; +} + +/* Status Styling */ + +.status-success { + font-family: var(--md-code-font); + font-weight: 500; + white-space: nowrap; + & svg { + color: hsl(142.1 76.2% 36.3%); + } +} + +.status-neutral { + font-family: var(--md-code-font); + font-weight: 500; + white-space: nowrap; + & svg { + color: hsl(32.1 94.6% 43.7%); + } +} + +.status-warning { + font-family: var(--md-code-font); + font-weight: 500; + white-space: nowrap; + & svg { + color: hsl(21, 90%, 48%); + } +} + +.status-danger { + font-family: var(--md-code-font); + font-weight: 500; + white-space: nowrap; + & svg { + color: hsl(0 72.2% 50.6%); + } +} + +.status-waiting { + font-family: var(--md-code-font); + font-weight: 500; + white-space: nowrap; + & svg { + color: hsl(271.5 81.3% 55.9%); + } +} diff --git a/docs/user-guide/archived-items.md b/frontend/docs/docs/user-guide/archived-items.md similarity index 100% rename from docs/user-guide/archived-items.md rename to frontend/docs/docs/user-guide/archived-items.md diff --git a/docs/user-guide/browser-profiles.md b/frontend/docs/docs/user-guide/browser-profiles.md similarity index 100% rename from docs/user-guide/browser-profiles.md rename to frontend/docs/docs/user-guide/browser-profiles.md diff --git a/docs/user-guide/collection.md b/frontend/docs/docs/user-guide/collection.md similarity index 100% rename from docs/user-guide/collection.md rename to frontend/docs/docs/user-guide/collection.md diff --git a/docs/user-guide/collections.md b/frontend/docs/docs/user-guide/collections.md similarity index 100% rename from docs/user-guide/collections.md rename to frontend/docs/docs/user-guide/collections.md diff --git a/docs/user-guide/contribute.md b/frontend/docs/docs/user-guide/contribute.md similarity index 100% rename from docs/user-guide/contribute.md rename to frontend/docs/docs/user-guide/contribute.md diff --git a/docs/user-guide/crawl-workflows.md b/frontend/docs/docs/user-guide/crawl-workflows.md similarity index 100% rename from docs/user-guide/crawl-workflows.md rename to frontend/docs/docs/user-guide/crawl-workflows.md diff --git a/docs/user-guide/getting-started.md b/frontend/docs/docs/user-guide/getting-started.md similarity index 100% rename from docs/user-guide/getting-started.md rename to frontend/docs/docs/user-guide/getting-started.md diff --git a/docs/user-guide/index.md b/frontend/docs/docs/user-guide/index.md similarity index 100% rename from docs/user-guide/index.md rename to frontend/docs/docs/user-guide/index.md diff --git a/docs/user-guide/join.md b/frontend/docs/docs/user-guide/join.md similarity index 100% rename from docs/user-guide/join.md rename to frontend/docs/docs/user-guide/join.md diff --git a/docs/user-guide/org-members.md b/frontend/docs/docs/user-guide/org-members.md similarity index 100% rename from docs/user-guide/org-members.md rename to frontend/docs/docs/user-guide/org-members.md diff --git a/docs/user-guide/org-settings.md b/frontend/docs/docs/user-guide/org-settings.md similarity index 100% rename from docs/user-guide/org-settings.md rename to frontend/docs/docs/user-guide/org-settings.md diff --git a/docs/user-guide/org.md b/frontend/docs/docs/user-guide/org.md similarity index 100% rename from docs/user-guide/org.md rename to frontend/docs/docs/user-guide/org.md diff --git a/docs/user-guide/overview.md b/frontend/docs/docs/user-guide/overview.md similarity index 100% rename from docs/user-guide/overview.md rename to frontend/docs/docs/user-guide/overview.md diff --git a/docs/user-guide/review.md b/frontend/docs/docs/user-guide/review.md similarity index 100% rename from docs/user-guide/review.md rename to frontend/docs/docs/user-guide/review.md diff --git a/docs/user-guide/running-crawl.md b/frontend/docs/docs/user-guide/running-crawl.md similarity index 100% rename from docs/user-guide/running-crawl.md rename to frontend/docs/docs/user-guide/running-crawl.md diff --git a/docs/user-guide/signup.md b/frontend/docs/docs/user-guide/signup.md similarity index 100% rename from docs/user-guide/signup.md rename to frontend/docs/docs/user-guide/signup.md diff --git a/docs/user-guide/user-settings.md b/frontend/docs/docs/user-guide/user-settings.md similarity index 100% rename from docs/user-guide/user-settings.md rename to frontend/docs/docs/user-guide/user-settings.md diff --git a/docs/user-guide/workflow-setup.md b/frontend/docs/docs/user-guide/workflow-setup.md similarity index 100% rename from docs/user-guide/workflow-setup.md rename to frontend/docs/docs/user-guide/workflow-setup.md diff --git a/mkdocs.yml b/frontend/docs/mkdocs.yml similarity index 98% rename from mkdocs.yml rename to frontend/docs/mkdocs.yml index a930b276..36270c10 100644 --- a/mkdocs.yml +++ b/frontend/docs/mkdocs.yml @@ -1,7 +1,7 @@ site_name: Browsertrix Docs repo_url: https://github.com/webrecorder/browsertrix-cloud/ repo_name: Browsertrix -edit_uri: edit/main/docs/ +edit_uri: edit/main/frontend/docs/ extra_css: - stylesheets/extra.css extra_javascript: diff --git a/frontend/frontend.conf.template b/frontend/frontend.conf.template index 08f33d60..c1780dc4 100644 --- a/frontend/frontend.conf.template +++ b/frontend/frontend.conf.template @@ -40,6 +40,17 @@ server { try_files $uri /index.html; } + location ~* /docs/(.*)$ { + set $docs_url "${DOCS_URL}"; + + if ($docs_url != "") { + return 307 $docs_url$1; + } + + root /usr/share/nginx/html; + index index.html index.htm; + } + # serve replay service worker, RWP_BASE_URL set in Dockerfile location /replay/sw.js { add_header Content-Type application/javascript; diff --git a/frontend/src/features/crawl-workflows/workflow-editor.ts b/frontend/src/features/crawl-workflows/workflow-editor.ts index 6e9fc1ef..114f20e2 100644 --- a/frontend/src/features/crawl-workflows/workflow-editor.ts +++ b/frontend/src/features/crawl-workflows/workflow-editor.ts @@ -1365,7 +1365,7 @@ https://archiveweb.page/images/${"logo.svg"}`} `Increase the number of open browser windows during a crawl. This will speed up your crawl by effectively running more crawlers at the same time.`, )} ${msg("See caveats")} - + ${msg("Open in new window")} @@ -845,21 +853,12 @@ export class App extends LiteElement { const iframe = this.userGuideDrawer.querySelector("iframe"); if (iframe) { - const oneLoad = () => { - iframe.classList.remove(tw`opacity-0`); - iframe.removeEventListener("load", oneLoad); - }; - if (pathName) { - if (iframe.src.slice(this.docsUrl.length) !== pathName) { - iframe.classList.add(tw`opacity-0`); - iframe.addEventListener("load", oneLoad); - iframe.src = `${this.docsUrl}${pathName}`; - } + this.fullDocsUrl = this.docsUrl + pathName; + iframe.src = this.fullDocsUrl; } else { - iframe.classList.add(tw`opacity-0`); - iframe.addEventListener("load", oneLoad); - iframe.src = this.docsUrl; + this.fullDocsUrl = this.docsUrl; + iframe.src = this.fullDocsUrl; } void this.userGuideDrawer.show(); diff --git a/frontend/src/pages/invite/ui/inviteMessage.ts b/frontend/src/pages/invite/ui/inviteMessage.ts index e6da2109..e185bde2 100644 --- a/frontend/src/pages/invite/ui/inviteMessage.ts +++ b/frontend/src/pages/invite/ui/inviteMessage.ts @@ -86,7 +86,7 @@ export const renderInviteMessage = ( html`Refer to our user guide on org settings ${msg("browser profile best practices")}("btrix-user-guide-show", { detail: { - path: `/user-guide/workflow-setup/#${this.userGuideHashLink}`, + path: `user-guide/workflow-setup/#${this.userGuideHashLink}`, }, bubbles: true, }), diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index 1fd00e6e..42a856c6 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -31,7 +31,9 @@ const WEBSOCKET_HOST = const DOCS_URL = process.env.DOCS_URL ? new URL(process.env.DOCS_URL) - : new URL("https://docs.browsertrix.com/"); + : isDevServer + ? "https://docs.browsertrix.com/" + : "/docs/"; // Get git info for release version info diff --git a/frontend/xliff/es.xlf b/frontend/xliff/es.xlf index 5b94f86f..42e084cb 100644 --- a/frontend/xliff/es.xlf +++ b/frontend/xliff/es.xlf @@ -2150,13 +2150,6 @@ Workflows that use this browser profile will behave as if they have logged into the same websites and have the same web cookies. - - - It is highly recommended to create dedicated accounts to use when - crawling. For details, refer to - . - - browser profile best practices @@ -3199,11 +3192,6 @@ An org, or organization, is your workspace for web archiving. If you’re archiving collaboratively, an org workspace can be shared between team members. - - Refer to our user guide on - org settings - for details. - Your org dashboard will be ///orgs/ @@ -3780,6 +3768,18 @@ Using proxy: + + + It is highly recommended to create dedicated accounts to use when + crawling. For details, refer to + . + + + + Refer to our user guide on + org settings + for details. +