https://github.com/synx-ai/gh-pages-template
π Template to automatically publish readme.md files as documentation in GitHub Pages.
https://github.com/synx-ai/gh-pages-template
docgen gh-pages markdown mdx react snowpack
Last synced: 3 months ago
JSON representation
π Template to automatically publish readme.md files as documentation in GitHub Pages.
- Host: GitHub
- URL: https://github.com/synx-ai/gh-pages-template
- Owner: synx-ai
- License: mit
- Created: 2021-03-08T08:27:08.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-25T08:33:44.000Z (over 3 years ago)
- Last Synced: 2024-12-25T20:26:58.879Z (4 months ago)
- Topics: docgen, gh-pages, markdown, mdx, react, snowpack
- Language: SCSS
- Homepage: https://synx-ai.github.io/gh-pages-template
- Size: 335 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Readme to GitHub pages template
Templete to use [Snowpack](https://www.snowpack.dev/) to build a React, TypeScript and SASS static website and publish it as a GitHub page from a `readme.md` file.
##Β Quick Start
You don't need to use directly this repository but to create a GitHub Workflow that uses it, like the following:
```yaml
name: Publish Website to GitHub Pageson:
push:
branches: # triggers on any push to master
- masterjobs:
build-deploy:
runs-on: ubuntu-latest
env:
template-dir: ./gh-pages-templatesteps:
# copy your repo to actions
- uses: actions/checkout@master# clone this repo to a subdir
- uses: actions/checkout@master
with:
repository: synx-ai/gh-pages-template
path: ${{env.template-dir}}# clone the "README.md" file, you may edit this
# please note that only markdown and mdx files are supported and
# filenames are case sensitive.
- name: 𧬠Readme.md cloning
uses: canastro/copy-file-action@master
with:
source: "README.md"
target: "gh-pages-template/src/README.md"- name: βοΈ Install dependencies
working-directory: ${{env.template-dir}}
run: yarn install- name: π§ͺ Test
working-directory: ${{env.template-dir}}
run: yarn test- name: π Build
working-directory: ${{env.template-dir}}
run: yarn build# this will deploy to gh-pages branch, remember to enable it in repo settings
- name: π Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
```**And that's it!** Page should be available.
## Configuration
All info needed is extracted from `package.json`, if you repo den't have one, be sure to create a `gh-pages.config.json` containing the following fields:
```javascript
// gh-pages.config.json
{
"name": "This should be the title.",
"description": "Explain to world how awesome your project is.",
"baseUrl": "/subdir/",
"repository": {
"url": "https://github.com/synx-ai/awesome-repo"
}
}
```## Customize the template
Clone this repo and freely edit `public` and `src`.
### Available Scripts
#### yarn start
Runs the app in the development mode.
Open http://localhost:8080 to view it in the browser.The page will reload if you make edits.
You will also see any lint errors in the console.#### yarn build
Builds a static copy of your site to the `../docs` folder.
Your app is ready to be deployed!