diff --git a/.github/workflows/docusaurus-deploy.yml b/.github/workflows/docusaurus-deploy.yml index 2293b24..ab47395 100644 --- a/.github/workflows/docusaurus-deploy.yml +++ b/.github/workflows/docusaurus-deploy.yml @@ -3,7 +3,7 @@ name: Deploy to GitHub Pages on: push: branches: - - docusaurus-migration + - main # Review gh actions docs if you want to further define triggers, paths, etc # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on diff --git a/.github/workflows/docusaurus-test-deploy.yml b/.github/workflows/docusaurus-test-deploy.yml index 2ee37bd..d7e6071 100644 --- a/.github/workflows/docusaurus-test-deploy.yml +++ b/.github/workflows/docusaurus-test-deploy.yml @@ -1,12 +1,9 @@ name: Test deployment on: - push: - branches: - - docusaurus-migration pull_request: branches: - - docusaurus-migration + - main # Review gh actions docs if you want to further define triggers, paths, etc # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml index aa6de62..14995b7 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/jekyll-gh-pages.yml @@ -4,16 +4,16 @@ # documentation. # Sample workflow for building and deploying a Jekyll site to GitHub Pages -name: Deploy Jekyll site to Pages +name: Deploy Jekyll site to Pages - Manual (DISABLED - Migrated to Docusaurus) on: - # Runs on pushes targeting the default branch - # push: - # branches: ["main"] + # DISABLED - This workflow has been replaced by docusaurus-deploy.yml + # To re-enable, uncomment the trigger below + # workflow_dispatch: - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + # Temporary: Set to an impossible event to effectively disable + push: + branches: ["never-will-exist-branch-jekyll-gh-pages-disabled"] # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml index 41bacd2..bd5d9fa 100644 --- a/.github/workflows/jekyll.yml +++ b/.github/workflows/jekyll.yml @@ -4,15 +4,19 @@ # documentation. # Sample workflow for building and deploying a Jekyll site to GitHub Pages -name: Deploy Jekyll site to Pages +name: Deploy Jekyll site to Pages (DISABLED - Migrated to Docusaurus) on: - # Runs on pushes targeting the default branch + # DISABLED - This workflow has been replaced by docusaurus-deploy.yml + # To re-enable, uncomment the triggers below + # push: + # branches: ["main"] + + # workflow_dispatch: + + # Temporary: Set to an impossible branch to effectively disable push: - branches: ["main"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + branches: ["never-will-exist-branch-jekyll-disabled"] # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: diff --git a/docusaurus/openchoreo/docusaurus.config.ts b/docusaurus/openchoreo/docusaurus.config.ts index 339f7ab..cda0edc 100644 --- a/docusaurus/openchoreo/docusaurus.config.ts +++ b/docusaurus/openchoreo/docusaurus.config.ts @@ -18,7 +18,7 @@ const config: Config = { url: 'https://openchoreo.dev', // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - baseUrl: '/openchoreo.github.io/', // TODO: Update this once merged to upstream + baseUrl: '/', // Set true for GitHub pages deployment. trailingSlash: true, @@ -49,7 +49,7 @@ const config: Config = { // Please change this to your repo. // Remove this to remove the "edit this page" links. editUrl: - 'https://github.com/openchoreo/openchoreo.github.io/tree/main/', + 'https://github.com/openchoreo/openchoreo.github.io/tree/main/docusaurus/openchoreo/', }, blog: { showReadingTime: true, @@ -60,7 +60,7 @@ const config: Config = { // Please change this to your repo. // Remove this to remove the "edit this page" links. editUrl: - 'https://github.com/openchoreo/openchoreo.github.io/tree/main/', + 'https://github.com/openchoreo/openchoreo.github.io/tree/main/docusaurus/openchoreo/', // Useful options to enforce blogging best practices onInlineTags: 'warn', onInlineAuthors: 'warn', diff --git a/docusaurus/openchoreo/src/components/common/GitHubStars/index.tsx b/docusaurus/openchoreo/src/components/common/GitHubStars/index.tsx index ee0c874..faeb09b 100644 --- a/docusaurus/openchoreo/src/components/common/GitHubStars/index.tsx +++ b/docusaurus/openchoreo/src/components/common/GitHubStars/index.tsx @@ -1,14 +1,59 @@ import React, {useEffect, useState} from 'react'; import styles from './styles.module.css'; +const CACHE_KEY = 'openchoreo_github_stars'; + +type CacheData = { value: number; timestamp: number }; + export default function GitHubStars() { - const [stars, setStars] = useState(null); + const [stars, setStars] = useState(null); useEffect(() => { - fetch('https://api.github.com/repos/openchoreo/openchoreo') - .then(res => res.json()) - .then(data => setStars(data.stargazers_count)) - .catch(err => console.error('Failed to fetch stars:', err)); + const controller = new AbortController(); + + const getCache = (): CacheData | null => { + try { + const cached = localStorage.getItem(CACHE_KEY); + return cached ? JSON.parse(cached) : null; + } catch { + return null; + } + }; + + const saveCache = (value: number) => { + try { + localStorage.setItem(CACHE_KEY, JSON.stringify({ + value, + timestamp: Date.now() + })); + } catch { + // Ignore localStorage errors + } + }; + + const cache = getCache(); + + // If we have ANY cached value, show it immediately + if (cache?.value != null) { + setStars(cache.value); + } + + // Fetch fresh data regardless of cache age + fetch('https://api.github.com/repos/openchoreo/openchoreo', { + signal: controller.signal + }) + .then(res => res.ok ? res.json() : null) + .then(data => { + if (data?.stargazers_count != null) { + setStars(data.stargazers_count); + saveCache(data.stargazers_count); + } + }) + .catch(() => { + // Silent fail - we already showed cached value if available + }); + + return () => controller.abort(); }, []); return ( @@ -22,7 +67,7 @@ export default function GitHubStars() { - {stars !== null && Stars: {stars.toLocaleString()}} + {stars && Stars: {stars.toLocaleString()}} ); } diff --git a/docusaurus/openchoreo/static/img/openchoreo-logo.png b/docusaurus/openchoreo/static/img/openchoreo-logo.png new file mode 100644 index 0000000..c5fccc6 Binary files /dev/null and b/docusaurus/openchoreo/static/img/openchoreo-logo.png differ diff --git a/img/logos/op-Logos-01.webp b/img/logos/op-Logos-01.webp deleted file mode 100644 index 37d11cc..0000000 Binary files a/img/logos/op-Logos-01.webp and /dev/null differ diff --git a/img/logos/op-Logos-02.webp b/img/logos/op-Logos-02.webp deleted file mode 100644 index d287faa..0000000 Binary files a/img/logos/op-Logos-02.webp and /dev/null differ diff --git a/img/logos/op-Logos-03.webp b/img/logos/op-Logos-03.webp deleted file mode 100644 index d678f04..0000000 Binary files a/img/logos/op-Logos-03.webp and /dev/null differ diff --git a/img/logos/op-Logos-04.webp b/img/logos/op-Logos-04.webp deleted file mode 100644 index 4a3436b..0000000 Binary files a/img/logos/op-Logos-04.webp and /dev/null differ diff --git a/img/logos/op-Logos-05.webp b/img/logos/op-Logos-05.webp deleted file mode 100644 index b123732..0000000 Binary files a/img/logos/op-Logos-05.webp and /dev/null differ diff --git a/img/logos/op-Logos-06.webp b/img/logos/op-Logos-06.webp deleted file mode 100644 index 5036fb5..0000000 Binary files a/img/logos/op-Logos-06.webp and /dev/null differ diff --git a/img/logos/op-Logos-07.webp b/img/logos/op-Logos-07.webp deleted file mode 100644 index 2114e8f..0000000 Binary files a/img/logos/op-Logos-07.webp and /dev/null differ diff --git a/img/logos/op-Logos-08.webp b/img/logos/op-Logos-08.webp deleted file mode 100644 index 39d5b1e..0000000 Binary files a/img/logos/op-Logos-08.webp and /dev/null differ diff --git a/img/logos/op-Logos-09.webp b/img/logos/op-Logos-09.webp deleted file mode 100644 index 3a21ab1..0000000 Binary files a/img/logos/op-Logos-09.webp and /dev/null differ diff --git a/img/logos/op-Logos-10.webp b/img/logos/op-Logos-10.webp deleted file mode 100644 index 154dabb..0000000 Binary files a/img/logos/op-Logos-10.webp and /dev/null differ diff --git a/img/logos/op-Logos-11.webp b/img/logos/op-Logos-11.webp deleted file mode 100644 index 5bfebc2..0000000 Binary files a/img/logos/op-Logos-11.webp and /dev/null differ diff --git a/img/logos/op-Logos-12.webp b/img/logos/op-Logos-12.webp deleted file mode 100644 index 4803688..0000000 Binary files a/img/logos/op-Logos-12.webp and /dev/null differ diff --git a/img/logos/op-Logos-13.webp b/img/logos/op-Logos-13.webp deleted file mode 100644 index eee4448..0000000 Binary files a/img/logos/op-Logos-13.webp and /dev/null differ