Giter VIP home page Giter VIP logo

notigocms's Introduction

CRON Update Job Forks Stargazers Issues LinkedIn


NotiGoCMS

A Notion.so Based Hugo Blog Content Management System !
View Demo · Report Bug · Request Feature · Send a Pull Request

Table of Contents

About The Project

![Product Name Screen Shot][product-screenshot]

This program is responsible for fetching your Notion pages and converting them into markdown files along with their static contents Converted markdown files and their static contents are then pushed to your original Hugo blog git repo Then, you only need to trigger "hugo" command to rebuild the required html files (If netlify is being used, this is done automatically)

kjk/notionapi is being used as api to fetch Notion data and kjk/blog is being referenced for conversion

Built With

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

  • Go
  • Hugo based blog in GitHub repo
  • A Notion.so page which lists the articles for your blog

Installation & Usage

  1. Clone the repo
git clone https://github.com/lvntbkdmr/NotiGoCMS.git
  1. Edit config.toml file accordingly
[notion]
startPage = "1087c264ef6b450ca5c7d3c034b399d7"
#It will be get from your notion page link. For example my articles list page => https://www.notion.so/lvntbkdmr/Articles-1087c264ef6b450ca5c7d3c034b399d7 so my startPage should be equal to 1087c264ef6b450ca5c7d3c034b399d7.

[cms]
cacheDir = "cache" # This is the cache folder to keep your content cached inside the repo
postsDir = "blog/content/posts" # Your Hugo blog will be added as a sub-module in this repo, this is the relative path for your posts directory in your blog
imgDir = "blog/static/img" # This is the relative path to store your static images fetched from Notion servers
  1. Edit setup_env.sh
1. Edit git configurations
2. Replace https://github.com/lvntbkdmr/blog with your Hugo blog repo link
  1. Set your environment's GH_TOKEN_OVERRIDE => Generated from GitHub -> Your Profile -> Developer Settings -> Personal Access Tokens
Note that on GitHub Action environment, you can also use default GITHUB_ACTION env variable, 
but it does not have write access permission for forked repos as this project forkes blog 
module and pushes back the changes. In that case, you have to define a new env. variable 
in GitHub other than GITHUB_ACTION (thats why I named as GH_TOKEN_OVERRIDE) in order to 
use GitHub action jobs for "automatic" updates for your blog as I did in here.
Ref. = https://github.com/ad-m/github-push-action/issues/40
  1. Set your environment's NOTION_TOKEN =>
To access non-public pages you need to find out authentication token.
Auth token is the value of token_v2 cookie.
In Chrome: open developer tools (Menu More Tools\Developer Tools), navigate to Application tab, 
look under Storage \ Cookies and copy the value of token_v2 cookie. You can do similar things 
in other browsers.
  1. Build the project
go build -o NotiGoCMS
  1. Run shell script
sh setup_env.sh

Additional

You can also automate the fetching and updating process through CI tools such as GitHub Actions. I personally follow that approach, my crob job description can be found on .github/workflows/

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are extremely appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

TODO

Contact

Levent BEKDEMİR - [email protected]

Project Link: https://github.com/lvntbkdmr/NotiGoCMS

Acknowledgements

notigocms's People

Contributors

lvntbkdmr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.