Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brittonhayes/notes
a collection of my notes about things
https://github.com/brittonhayes/notes
hugo notes notion
Last synced: about 1 month ago
JSON representation
a collection of my notes about things
- Host: GitHub
- URL: https://github.com/brittonhayes/notes
- Owner: brittonhayes
- License: gpl-3.0
- Archived: true
- Created: 2024-06-25T05:23:30.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-01T04:40:45.000Z (3 months ago)
- Last Synced: 2024-09-25T19:54:06.986Z (about 1 month ago)
- Topics: hugo, notes, notion
- Language: TypeScript
- Homepage: https://brittonhayes.github.io/notes/
- Size: 93.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Notion-Hugo
![image](https://user-images.githubusercontent.com/52968553/188502839-1de28ae0-6111-4387-99fe-fbc7d87dbc4c.png)
Notion-Hugo allows you to use [Notion](https://www.notion.so/) as your CMS and deploy your pages as a static website with [Hugo](https://gohugo.io/). So you have the full power of Notion for creating new content, with Hugo and its wonderful [ecosystem of themes](https://themes.gohugo.io/) take care of the rest for you.
## Get Started
### Create a new GitHub repository from this template
Click the green "Use this template" button in the upper-right corner to create your repo from this template. Choose "public" for the repository visibility.
### Create a Notion integration
Visit [my integrations](https://www.notion.so/my-integrations) and login with your Notion account.
Click on "Create new integration" to create a new internal integration.
In the capabilities section, select "Read Content" and "Read user information including email address". The "Read Content" permission is necessary for Notion-Hugo to pull your Notion content, and the "Read user information including email address" permission is used to fill front matters with author information. Notion-Hugo does not collect any of your information.
Click the submit button to finish creating the Notion integration.
### Setup secrets for GitHub Action
Copy the Internal Integration Token.
Navigate to the GitHub repo you just created, click on Settings -> Secrets -> Actions.
Click the "New Repository Secret" button on the top right.
Add a new secret with name `NOTION_TOKEN`, paste the copied token into the secret field. Click the green "Add secret" button to save the change.
### Duplicate the Notion Template
Duplicate this [Notion Template](https://pcloud.notion.site/Notion-DoIt-04bcc51cfe4c49938229c35e4f0a6fb6
) into your own workspace.### Add connection to the Notion Page
Visit the page you just duplicated, click the ellipsis button on the top right and add the integration you just created as a connection.
### Configure you Hugo site
On the page you just shared with the integration, click on the "share" button again, then click the "copy link" button on the bottom right to copy the link to this page.
Now navigate back to your GitHub repository, open the `notion-hugo.config.ts` file, click to edit the file.
Replace the `page_url` with the link you just copied.
Click the commit changes button at the bottom to save the file.
Navigate to Settings -> Pages to enable GitHub Pages for your repository.
There is one final step to make your website work correctly. Copy the url of your new website, then go to file `config/_default/config.toml` and change the `baseURL` from `https://example.org/` to the url you just copied. Commit the changes and wait for your website to be deployed.
Now, visit your website and you will see your content from Notion is rendered into static webpages successfully.
## Next Step
Visit the [wiki](https://github.com/HEIGE-PCloud/Notion-Hugo/wiki) to learn more about how to
- Pick a different Hugo theme
- Deploy to other platforms
- Configure Notion-DoIt## FAQ
### Will the notion-hugo blog be synced with me Notion?
Yes. By default, the notion-hugo blog will be re-generated every 1 hour through `CD` action in Github Actions. You can change this in `.github/workflows/cd.yml` using `cron` option:
```
name: CDon:
...schedule:
- cron: '0 * * * *' # run every hour
```Be aware that Github will allow you to re-run the job no more often than once per 5 minutes.
### What if I want to re-deploy immediately as Notion database updates?
This repo at the moment supports only cron option.
But, as an idea or direction - you could look for ways to listen for updates in Notion database and trigger Github Action when Notion database is updated. Usually webhooks are used for that purpose - but at the moment Notion has no official webhook support. So you would need to find a work around.
## License
This project is open sourced under the [GNU GPL license v3](https://www.gnu.org/licenses/gpl-3.0.html), you may use the project under the terms if you are creating an open source project under a license compatible with it.
Consider purchasing a [commercial license](https://buy.stripe.com/aEU4ixg529wA1Fu144) if your project is not compatible with GPLv3.