Giter VIP home page Giter VIP logo

notion-blog-actions's Introduction

notion blog action

将 notion database 中的文章转换为 markdown 文件,提供给 hexo、hugo 等静态博客使用

  • 使用 notion 导出接口,支持图片、表格、callout 等格式
  • 支持迁移图片到置顶文件夹

说明

database template: https://mohuishou.notion.site/3999b0ae72364a4b99a87f7d9d0a52be?v=1df90fd8110541679dc48866b80031ee

notion

通过 notion 导出 markdown 文件 api 下载 md 文件

migrate

迁移导出 md 文件中的图片资源到指定文件夹,支持属性字段含有图片的情况

使用示例

on: [repository_dispatch, watch]

name: notion

jobs:
  notion:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
      with:
        submodules: false

    - uses: mohuishou/notion-blog-actions/notion@main
      with:
        token: ${{ secrets.NOTION_TOKEN }}
        token_v2: ${{ secrets.NOTION_TOKEN_V2 }}
        space_id: "输入你的空间 id"
        database_id: "输入你的 database id"
        output: "./tmp/"

    - name: "migrate image"
      uses: mohuishou/notion-blog-actions/migrate@main
      with:
        input: "./tmp/*.md"

    - name: "cp md files"
      run: |
        cp -f tmp/*.md source/_posts/notion/
        rm -rf tmp

    - name: git setting
      run: |
        git config --global user.email "[email protected]"
        git config --global user.name "mohuishou"
      
    - name: update blog
      run: |
        git add source
        git commit -m "feat: auto update by notion sync"
        git push

notion-blog-actions's People

Contributors

mohuishou avatar peiel avatar

Forkers

felix2chow

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.