Coder Social home page Coder Social logo

mayneyao / gine-blog Goto Github PK

View Code? Open in Web Editor NEW
179.0 9.0 21.0 7.22 MB

Blog = Gatsby + React + Material-UI + Notion + Netlify

Home Page: https://gine.me

License: MIT License

JavaScript 97.62% CSS 2.38%
gatsby material-design notion blog jamstack serverless gatsby-blog gine-blog

gine-blog's Introduction

gine-blog's People

Contributors

dependabot[bot] avatar mayneyao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gine-blog's Issues

求助,以及一些使用反馈

最重要的求助:
我的博客在不翻墙的情况下,访问速度极慢,请问我该怎么做,才能加快在国内访问博客的速度?我在网上没找到合适的方法

使用反馈:总体是很满意的,说一些小问题。
(1)格言 个性化 无效
我已经改成自己的notion链接了,
// 格言 aphorisms: { open: true, // 默认关闭 需要api sourceType: 'notion', url: 'https://www.notion.so/heloook/f38854123bac4aebb2955195c9317fcb?v=d2f3e81650284812a59defdfa282e661', // notion 表格地址 // 返回格式参见上面链接的内容 },
但是还是显示以前的:
image
(2)博客侧边栏现在是自动隐藏,能不能加上 固定显示侧边栏的配置选项,我比较习惯固定住侧边栏的样子。大神有时间的话可以考虑把这个问题优化一下子。达到像hexo那种样子就比较完善了。
(3)有个问题对我没什么影响,但我还是指出来吧。这个问题是notion本身带来的问题。就是,如果我在博客文章中留下了某个notion笔记的链接,那么就可以点击到“文章”页,如果我有一些未发布的博客,此时那些未发布的博客就会暴露出来了。因为notion的子页无法单独设置文章的共享性,“文章”页共享了,那么未发布的草稿肯定也被看到了。

最关键的是最上面的求助,我现在完全不知道该怎么解决。。。

开启openGithubCache后build失败

本地环境变量已配置
image

执行yarn build时提示
error We encountered an error while trying to load your site's gatsby-config.

Error: 因为您开启了github仓库缓存notion文章,请配置环境变量 GitHubToken

  • gatsby-config.js:103 Object.
    E:/Blog/gine-blog/gatsby-config.js:103:11

  • v8-compile-cache.js:178 Module._compile
    [gine-blog]/[v8-compile-cache]/v8-compile-cache.js:178:30

  • loader.js:789 Object.Module._extensions..js
    internal/modules/cjs/loader.js:789:10

  • loader.js:653 Module.load
    internal/modules/cjs/loader.js:653:32

  • loader.js:593 tryModuleLoad
    internal/modules/cjs/loader.js:593:12

  • loader.js:585 Function.Module._load
    internal/modules/cjs/loader.js:585:3

  • loader.js:692 Module.require
    internal/modules/cjs/loader.js:692:17

  • v8-compile-cache.js:159 require
    [gine-blog]/[v8-compile-cache]/v8-compile-cache.js:159:20

  • get-config-file.js:26 getConfigFile
    [gine-blog]/[gatsby]/dist/bootstrap/get-config-file.js:26:20

  • index.js:96 module.exports
    [gine-blog]/[gatsby]/dist/bootstrap/index.js:96:36

  • develop.js:362 module.exports
    [gine-blog]/[gatsby]/dist/commands/develop.js:362:13

  • next_tick.js:68 process._tickCallback
    internal/process/next_tick.js:68:7

⠋ open and validate gatsby-configs
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this comm
and.

yarn build 报错,请问怎么办?

$ yarn build
yarn run v1.17.3
$ gatsby build
success open and validate gatsby-configs - 0.074 s
success load plugins - 0.341 s
success onPreInit - 0.077 s
success delete html and css files from previous builds - 0.072 s
success initialize cache - 0.066 s
success copy gatsby files - 0.150 s
success onPreBootstrap - 0.060 s
从本地获取文章缓存: Copy of gine-blog 使用文档
success source and transform nodes - 7.948 s
success Add explicit types - 0.058 s
success Add inferred types - 0.195 s
success Processing types - 0.107 s
success building schema - 0.465 s
格言保存成功
success createPages - 0.144 s
success createPagesStatefully - 0.108 s
success onPreExtractQueries - 0.062 s
success update schema - 0.084 s
warn The GraphQL query in the non-page component
"E:/gine-blog-master/src/components/bangumi/index.js" will not be run.
Exported queries are only executed for Page components. It's possible you're
trying to create pages in your gatsby-node.js and that's failing for some
reason.

If the failing component(s) is a regular component and not intended to be a page
component, you generally want to use a (https://gatsbyjs.org/docs/static-query)
instead of exporting a page query.

If you're more experienced with GraphQL, you can also export GraphQL
fragments from components and compose the fragments in the Page component
query and pass data down into the child component — http://graphql.org/learn/queries/#fragments
success extract queries from components - 0.288 s
success write out requires - 0.064 s
success write out redirect data - 0.056 s
success onPostBootstrap - 0.063 s

info bootstrap finished - 14.346 s

success run static queries - 0.069 s
success Building production JavaScript and CSS bundles - 28.135 s
success Rewriting compilation hashes - 0.231 s
success run page queries - 0.096 s — 6/6 173.69 queries/second

ERROR #95313

Building static HTML failed for path "/"

See our docs page for more info on this error: https://gatsby.dev/debug-html

TypeError: Object(...) is not a function

  • render-page.js:55970 createPageContext
    E:/gine-blog-master/public/render-page.js:55970:107

  • render-page.js:55972 getPageContext
    E:/gine-blog-master/public/render-page.js:55972:29

  • render-page.js:708 Object.replaceRenderer
    E:/gine-blog-master/public/render-page.js:708:22

  • render-page.js:120
    E:/gine-blog-master/public/render-page.js:120:107

  • Array.map

  • render-page.js:120 ./.cache/api-runner-ssr.js.module.exports
    E:/gine-blog-master/public/render-page.js:120:21

  • render-page.js:562 Module../.cache/static-entry.js.webpack_exports.defau lt
    E:/gine-blog-master/public/render-page.js:562:1

  • render-html.js:35
    [gine-blog-master]/[gatsby]/dist/utils/worker/render-html.js:35:36

  • debuggability.js:313 Promise._execute
    [gine-blog-master]/[bluebird]/js/release/debuggability.js:313:9

  • promise.js:488 Promise._resolveFromExecutor
    [gine-blog-master]/[bluebird]/js/release/promise.js:488:18

  • promise.js:79 new Promise
    [gine-blog-master]/[bluebird]/js/release/promise.js:79:10

  • render-html.js:31
    [gine-blog-master]/[gatsby]/dist/utils/worker/render-html.js:31:37

  • util.js:16 tryCatcher
    [gine-blog-master]/[bluebird]/js/release/util.js:16:23

  • map.js:61 MappingPromiseArray._promiseFulfilled
    [gine-blog-master]/[bluebird]/js/release/map.js:61:38

  • promise_array.js:114 MappingPromiseArray.PromiseArray._iterate
    [gine-blog-master]/[bluebird]/js/release/promise_array.js:114:31

  • promise_array.js:78 MappingPromiseArray.init
    [gine-blog-master]/[bluebird]/js/release/promise_array.js:78:10

⠏ Building static HTML for pages
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

图片居中的问题

首先非常感谢这个项目,使用真的很方便
部署后在notion中设置居中的图片在网页里不居中,看着挺难受的,不知能否解决?

感谢大家的使用和反馈,近期打算重构项目并完善文档。

近日收到的反馈增多,大多数是在部署和配置方面出现问题。接下来重构项目会让部署和配置变得简单。

下面是一些改进的方向

  • 项目拆分为 gine-blog 和 gatsby-source-notion-database
  • gatsby theme 是 Gatsby 社区推出的新特性,gine-blog 会变成 theme 插件,你可以以安装 npm 包的形式安装 gine-blog。并且可以重载主题,满足自定义的需求。同时可以享受此博客的底层数据功能和一些新特性。
  • gatsby-source-notion-database 是 Gatsby 插件,会把 notion database 中的数据转化为 Gatsby 中可用的数据源。
  • 与 notion 深度耦合。开始造轮子时,希望轮子能够通用一些,适配不同的数据源。个人使用一段时间后,逐渐认可 notion all-in-one 的理念。接下来不会再考虑其它数据源的适配。基础配置项会从 notion 表格中获取。
  • 完善中文文档,添加英文文档(尽量)

大家有什么需求和建议可以在此 issue 中回复

开启PWA后编译不通过

错误信息

8:58:48 PM: yarn run v1.17.3
8:58:48 PM: $ gatsby build
8:58:51 PM: error We encountered an error while trying to load your site's gatsby-config. Please fix the error and try again.
8:58:51 PM:
8:58:51 PM: TypeError: Cannot read property 'runtimeCaching' of undefined

导致错误的提交记录

54ab729
似乎是想配置SW,但是最终的master中没有相关的代码,导致出错
把SW相关的下列代码注释可编译通过。不过不知道这样PWA还有没有生效。

    // sw 重载
    let swConf = config.pwa.swConf

    // 对基于 nelify functions 动态页面,缓存其请求
    swConf.runtimeCaching.push({
        // Add runtime caching of various other page resources
        urlPattern: /^https?:.*\/.netlify\/functions\/notion/,
        handler: `staleWhileRevalidate`,
    })

    conf.plugins.push({
        resolve: `gatsby-plugin-offline`,
        options: swConf,
    })

配置moments的问题

moments: {
    open: true,
    url: “”
}

配置文件中的双引号,是不是要改成单引号。我试了如果是双引号不显示,单引号就没有问题

执行yarn && yarn develop报错400

clone代码到本地后,直接执行yarn && yarn develop后,
命令行报错:Error: Request failed with status code 400

具体log:

$ yarn && yarn develop
yarn install v1.17.3
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.65s.
yarn run v1.17.3
$ gatsby develop
success open and validate gatsby-configs - 0.010 s
success load plugins - 0.142 s
success onPreInit - 0.014 s
success initialize cache - 0.006 s
success copy gatsby files - 0.020 s
success onPreBootstrap - 0.005 s
>>>开始同步文章:gine-blog 使用文档 from notion

error gatsby-node.js returned an error


  Error: Request failed with status code 400
  
  - createError.js:16 createError
    [gine-blog]/[axios]/lib/core/createError.js:16:15
  
  - settle.js:18 settle
    [gine-blog]/[axios]/lib/core/settle.js:18:12
  
  - http.js:202 IncomingMessage.handleStreamEnd
    [gine-blog]/[axios]/lib/adapters/http.js:202:11
  
  - next_tick.js:63 process._tickCallback
    internal/process/next_tick.js:63:19
  

success source and transform nodes - 37.851 s
success building schema - 0.224 s
success createPages - 0.039 s
success createPagesStatefully - 0.081 s
success onPreExtractQueries - 0.002 s
success update schema - 0.033 s
warn The GraphQL query in the non-page component "/home/deepin/GitProjects/gine-blog/src/components/bangumi/index.js" will not be  Exported queries are only executed for Page components. It's possible you're  trying to create pages in your gatsby-node.js and that's failing for some  reason.

If the failing component(s) is a regular component and not intended to be a page component, you generally want to use a <StaticQuery> (https://gatsbyjs.org/docs/static-query) instead of exporting a page query.

If you're more experienced with GraphQL, you can also export GraphQL fragments from components and compose the fragments in the Page component query and pass data down into the child component — http://graphql.org/learn/queries/#fragments
success extract queries from components - 0.189 s
success write out requires - 0.007 s
success write out redirect data - 0.003 s
success onPostBootstrap - 0.002 s
⠀
info bootstrap finished - 40.312 s
⠀
success run static queries - 0.003 s
success run page queries - 0.071 s — 14/14 211.30 queries/second
 DONE  Compiled successfully in 5517ms       00:18:06
⠀
You can now view gatsby in the browser.
⠀
  http://localhost:8000/
⠀
View GraphiQL, an in-browser IDE, to explore your site's data and schema
⠀
  http://localhost:8000/___graphql
⠀
Note that the development build is not optimized.
To create a production build, use npm run build

info ℹ 「wdm」:
info ℹ 「wdm」: Compiled successfully.     

Notion中的Toggle List未支持

如果使用Toggle List,文章中仅仅会显示折叠时的小标题和三角,三角确实可点击但没有任何响应,源码中也没有折叠钓的内容。

书单链接在config.js中修改后,无法生效

书单链接在config.js里修改后无法生效
应该是下面的文件中的第196行所导致
src/notion/syncBlog.js
let url = 'https://www.notion.so/98717bf8ad57434eafd9a65277403c33?v=fa4f00bb9b5b492fb23157f8d5df471f'
可以修改成
let url = config.book.url
PS:怎么才能在大陆稳定访问?我经常连netlify都打不开

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.