docs: automated announcement bar (#2231)

This commit is contained in:
Shahed Nasser
2022-09-20 10:21:24 +03:00
committed by GitHub
parent 8eac3bacc5
commit 31fb4c3d3f
7 changed files with 283 additions and 12 deletions
+1
View File
@@ -0,0 +1 @@
{"id":"release-v1-4-1","content":"New Release! Version v1.4.1 of Medusa is out now! Read all about it <a href='https://github.com/medusajs/medusa/releases/tag/v1.4.1'>here</a>.","backgroundColor":"#7C53FF","textColor":"#fff","isCloseable":false}
+11 -10
View File
@@ -1,12 +1,15 @@
const path = require("path")
const fs = require("fs")
const docsPath = path.join(__dirname, "../../docs/content")
const apisPath = path.join(__dirname, "../../docs/api")
const algoliaAppId = process.env.ALGOLIA_APP_ID || "temp"
const algoliaApiKey = process.env.ALGOLIA_API_KEY || "temp"
const announcementBar = JSON.parse(fs.readFileSync('./announcement.json'))
/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
const config = {
title: "Medusa",
tagline: "Explore and learn how to use Medusa",
url: "https://docs.medusajs.com",
@@ -32,14 +35,6 @@ module.exports = {
]
],
themeConfig: {
announcementBar: {
id: 'release-1-4-1',
content:
'New Release! Version 1.4.1 of Medusa is out now! Read all about it <a href="https://github.com/medusajs/medusa/releases/tag/v1.4.1">here</a>.',
backgroundColor: '#7C53FF',
textColor: '#fff',
isCloseable: false,
},
colorMode: {
defaultMode: 'light',
disableSwitch: false,
@@ -226,4 +221,10 @@ module.exports = {
},
],
],
}
}
if (Object.keys(announcementBar).length) {
config.themeConfig.announcementBar = announcementBar
}
module.exports = config