From e8392bc75a21183524276a4e0926053add040b60 Mon Sep 17 00:00:00 2001 From: orkunkl Date: Mon, 11 Jan 2021 12:55:03 +0300 Subject: [PATCH 1/2] Rename logos --- .vuepress/config.js | 28 +++++++++++++------ ... Favicon.svg => CosmWasm_Favicon_Full.svg} | 0 .../{CosmWasm Logo.svg => CosmWasm_Logo.svg} | 0 3 files changed, 19 insertions(+), 9 deletions(-) rename .vuepress/public/logo/SVG/{CosmWasm Favicon.svg => CosmWasm_Favicon_Full.svg} (100%) rename .vuepress/public/logo/SVG/{CosmWasm Logo.svg => CosmWasm_Logo.svg} (100%) diff --git a/.vuepress/config.js b/.vuepress/config.js index 969b18a153..e29a195c30 100644 --- a/.vuepress/config.js +++ b/.vuepress/config.js @@ -1,13 +1,14 @@ module.exports = { theme: "cosmos", title: "CosmWasm Documentation", + base: process.env.VUEPRESS_BASE || "/", locales: { "/": { lang: "en-US" }, }, head: [ - ['link', { rel: 'icon', href: '/logo/SVG/CosmWasm Favicon.svg' }] + ['link', { rel: 'icon', href: '/logo/SVG/CosmWasm_Favicon_Full.svg' }] ], themeConfig: { custom: true, @@ -16,13 +17,23 @@ module.exports = { docsRepo: "CosmWasm/docs", docsDir: "/", logo: { - src: "/logo/SVG/CosmWasm Logo.svg", + src: "/logo/SVG/CosmWasm_Logo.svg", }, algolia: { id: "BH4D9OD16A", key: "abeca9781b806ca955a7e0f1ee95d003", index: "cosmwasm_docs" }, + versions: [ + { + "label": "v0.13", + "key": "v0.13" + }, + { + "label": "v0.12", + "key": "v0.12" + } + ], topbar: { banner: false }, @@ -234,13 +245,12 @@ module.exports = { ] } }, - plugins: [ - "sitemap", - { - hostname: "https://docs.cosmwasm.com" - }, - "check-md", { + plugins: { + "check-md": { pattern: "**/*.md" }, - ] + 'sitemap': { + hostname: 'https://docs.cosmwasm.com' + }, + } } diff --git a/.vuepress/public/logo/SVG/CosmWasm Favicon.svg b/.vuepress/public/logo/SVG/CosmWasm_Favicon_Full.svg similarity index 100% rename from .vuepress/public/logo/SVG/CosmWasm Favicon.svg rename to .vuepress/public/logo/SVG/CosmWasm_Favicon_Full.svg diff --git a/.vuepress/public/logo/SVG/CosmWasm Logo.svg b/.vuepress/public/logo/SVG/CosmWasm_Logo.svg similarity index 100% rename from .vuepress/public/logo/SVG/CosmWasm Logo.svg rename to .vuepress/public/logo/SVG/CosmWasm_Logo.svg From f5298a88566d6cb5035c935926007265c5554fd0 Mon Sep 17 00:00:00 2001 From: orkunkl Date: Mon, 11 Jan 2021 12:55:14 +0300 Subject: [PATCH 2/2] Implement versioning --- .github/workflows/main.yml | 23 ++++++++++++++--------- package.json | 3 ++- versions | 2 ++ 3 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 versions diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6ea4dcd4d1..5b45b3a7ae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,21 +8,26 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v2.3.4 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly. + uses: actions/checkout@v2.3.4 with: persist-credentials: false - - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. + - name: Install and Build 🔧 run: | - npm install - npm run check-links - npm run build - cd .vuepress/dist - echo 'docs.cosmwasm.com' > CNAME + npm run check-links; + echo 'docs.cosmwasm.com' > CNAME; + mkdir -p ~/output/public; + cp -r .vuepress/public/* ~/output; + while read -r branch path_prefix; do \ + (git checkout $${branch} && npm install && VUEPRESS_BASE="/$${path_prefix}/" npm run build); \ + mkdir -p ~/output/$${path_prefix}; \ + cp -r .vuepress/dist/* ~/output/$${path_prefix}/; \ + cp ~/output/$${path_prefix}/index.html ~/output; \ + done < versions; - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@3.7.1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: gh-pages # The branch the action should deploy to. - FOLDER: .vuepress/dist + BRANCH: gh-pages + FOLDER: ~/output/ diff --git a/package.json b/package.json index 8a420cfc70..112f50b04f 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ }, "homepage": "https://github.com/CosmWasm/docs", "dependencies": { - "vuepress-theme-cosmos": "1.0.173" + "vuepress-plugin-sitemap": "^2.3.1", + "vuepress-theme-cosmos": "1.0.179" }, "devDependencies": { "filehound": "^1.17.4", diff --git a/versions b/versions new file mode 100644 index 0000000000..6de8f4aa56 --- /dev/null +++ b/versions @@ -0,0 +1,2 @@ +v0.12 v0.12 +master master \ No newline at end of file