Skip to content

Commit

Permalink
Merge pull request #149 from w3c/docusaurus-env
Browse files Browse the repository at this point in the history
Environment Variables for Tutorial Website
  • Loading branch information
egekorkan authored Apr 5, 2024
2 parents 2664885 + bc0d45b commit b589f2f
Show file tree
Hide file tree
Showing 8 changed files with 9,190 additions and 72 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/whatiswot-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
env:
baseurl: "/wot-cg/tutorials/whatiswot/"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
Tutorials/whatiswot/website/deploy
.idea/
Tutorials/whatiswot/website/.env
4 changes: 2 additions & 2 deletions Tutorials/whatiswot/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# What is WoT? - Tutorial series

In this folder, you can find all the resources for the `What is WoT?` tutorial series.
These include the videos, slidesets for the animation, video scripts and organization information.
These include the videos, slide sets for the animation, video scripts, and organization information.

The videos are going to be published to YouTube and the website is available at https://w3c.github.io/wot-cg/tutorials/whatiswot/
The videos are going to be published on YouTube and the website is available at <https://w3c.github.io/wot-cg/tutorials/whatiswot/>
8 changes: 8 additions & 0 deletions Tutorials/whatiswot/website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# What is WoT Tutorial Website

## How to build

- Install dependencies `npm install`
- Set your environment variable for the base URL by creating a file called `.env` with the contents of `baseurl="/"`. This environment variable is set differently by GitHub actions and Netlify.
- Run `npm run start` during development to create a live version of the website
- Run `npm run build` to create the static files to be used in production environments
5 changes: 4 additions & 1 deletion Tutorials/whatiswot/website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");
require("dotenv").config();

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand All @@ -15,7 +16,9 @@ const config = {
url: "https://w3c.github.io",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment , it is often '/<projectName>/'
baseUrl: "/wot-cg/tutorials/whatiswot/",

// @ts-ignore
baseUrl: process.env.baseurl,

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand Down
Loading

0 comments on commit b589f2f

Please sign in to comment.