Skip to content

Commit

Permalink
Update website (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelprazak authored Feb 19, 2024
1 parent b81a468 commit 724f707
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const fs = require('fs');

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const codeblockVersion = require('./src/remark/codeblockVersion');

const organizationName = 'virtuslab';
const projectName = 'besom';

const besomVersion = fs.readFileSync('../version.txt').toString().trim()

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Besom - Pulumi Scala',
Expand Down Expand Up @@ -37,7 +41,7 @@ const config = {
},

customFields: {
besomVersion: '0.2.1' // TODO process.env.BESOM_VERSION
besomVersion: besomVersion
},

presets: [
Expand All @@ -47,7 +51,7 @@ const config = {
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
remarkPlugins: [codeblockVersion]
remarkPlugins: [codeblockVersion(besomVersion)]
},
blog: {
showReadingTime: true,
Expand Down
4 changes: 2 additions & 2 deletions website/src/remark/codeblockVersion.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const visit = require('unist-util-visit');

const codeblockVersion = () => async (ast) => {
const codeblockVersion = (besomVersion) => () => async (ast) => {
visit(ast, 'code', (node) => {
node.value = node.value.replace('$version', '0.2.1') // TODO read from env: process.env.BESOM_VERSION
node.value = node.value.replace('$version', besomVersion)
})
}

Expand Down

0 comments on commit 724f707

Please sign in to comment.