This guide will help you use GitHub Codespaces to preview changes to the InnerSource Commons website without needing to set up a local development environment.
GitHub Codespaces is a cloud-based development environment that allows you to work on projects directly from your browser. It's perfect for contributors who don't want to set up a local development environment.
Go to the InnerSource Commons website repository on GitHub.
- Click the green "Code" button near the top right of the repository page
- Select the "Codespaces" tab
- Click "Create codespace on master"
The Codespace will take a minute or two to set up. You'll see a loading screen while it prepares the environment.
Once the Codespace is loaded:
- Click the "Run and Debug" icon in the left sidebar (it looks like a play button with a bug)
- At the top of the Run and Debug panel, click on the dropdown and select "Hugo Server"
- Click the green play button to start the Hugo server
When the Hugo server starts:
- A notification will appear in the bottom right corner saying "Your application running on port 1313 is available"
- Click "Open in Browser" to view the website in a new tab
- Navigate to the
contentfolder to find the files you want to edit - Make your changes to the files
- Save your changes (Ctrl+S or Cmd+S)
- The website preview will automatically update with your changes
- Click the branch name in the bottom left corner of the Codespace
- Select "Create new branch..." from the dropdown menu
- Enter a name for your branch and press Enter
- Click the "Source Control" icon in the left sidebar (it looks like a branch)
- Review your changes
- Enter a commit message in the text box
- Click the checkmark icon to commit your changes
- After committing your changes, click the "..." menu in the Source Control panel
- Select "Push" to push your changes to GitHub
- When prompted, click "Create Pull Request"
- Fill out the pull request form and click "Create"
If you encounter any issues:
- Hugo server not starting: Try restarting the Codespace by clicking on the menu in the bottom left corner and selecting "Codespaces: Stop Current Codespace" and then restarting it.
- Changes not showing: Make sure you've saved your files and that the Hugo server is running.
- Port not forwarding: Click the "Ports" tab at the bottom of the Codespace and make sure port 1313 is forwarded.
- Container in recovery mode: If you see a message about the container running in recovery mode, click the "Rebuild Container" button in the notification or run the "Codespaces: Rebuild Container" command from the command palette (F1).
If you're stuck, you can:
- Check the Hugo documentation
- Ask for help in the InnerSource Commons community channels
- Create an issue on the GitHub repository
