Coder Social home page Coder Social logo

dragonman225 / notablog Goto Github PK

View Code? Open in Web Editor NEW
661.0 16.0 79.0 2.11 MB

Tell stories of your work with Notion

Home Page: https://dragonman225.js.org/notablog.html

License: MIT License

JavaScript 11.59% TypeScript 88.32% Shell 0.09%
notion blog nodejs blog-engine notablog static-site-generator cms

notablog's People

Contributors

dragonman225 avatar ifedaka avatar kixpanganiban 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

notablog's Issues

Pure theme

I noticed that the pure theme got removed that mimicked the default notion looks.

I would really appreciate if it could be added back.

Automatic URL based on slug of title instead of page id

It would be nice if we could have the option to automatically generate the page URL using its title's slug instead of its Notion page id. For example, with a title of How to setup Notablog, we could get mydomain.com/how-to-setup-notablog.html

APIError: Server says "ValidationError: Invalid input."

Issue

Hi, I meet some issue recently. I am not familiar to nodejs. I dont know if I do something wrong.

Terminal Output

PS D:\a_Git_Project\test\notablog-starter> notablog generate .

I/notablog(20211006T114938.547): Copy theme assets
I/notablog(20211006T114938.556): Fetch site metadata
E/notablog-cli(20211006T114940.131): APIError: Server says "ValidationError: Invalid input."
    at Object.queryCollection (C:\Users\a3918\AppData\Roaming\npm\node_modules\notablog\node_modules\notionapi-agent\dist\index.js:136:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async transformCollection (C:\Users\a3918\AppData\Roaming\npm\node_modules\notablog\node_modules\nast-util-from-notionapi\dist\index.js:443:25)
    at async Promise.all (index 0)
    at async makeBlockArrayIntoTree (C:\Users\a3918\AppData\Roaming\npm\node_modules\notablog\node_modules\nast-util-from-notionapi\dist\index.js:1114:24)
    at async parseTable (C:\Users\a3918\AppData\Roaming\npm\node_modules\notablog\dist\index.js:445:29)
    at async generate (C:\Users\a3918\AppData\Roaming\npm\node_modules\notablog\dist\index.js:903:25)
    at async cmdGenerate (C:\Users\a3918\AppData\Roaming\npm\node_modules\notablog\bin\cli.js:37:5)

PS D:\a_Git_Project\test\notablog-starter>

Links within siteMeta.description to internal pages are not transformed

I'm trying out (and loving) notablog. Thanks for this project!

I tried putting a link in the table description that becomes siteMeta.description, and found that the link isn't being transformed or transformed correctly. Instead the link just contains the full-length page id, whether or not the linked page as a url slug provided.

Note: adding a link this way is an attempting at working around not being able to designate a page as the home page, which I can see was requested and closed in #6.

Unsupported block type: transclusion_container

E/notablog-cli(20221207T233746.912): TypeError: Cannot read properties of undefined (reading '0')
at new NTable (C:\Users\Admin\AppData\Roaming\npm\node_modules\notablog\dist\index.js:336:51)
at parseTable (C:\Users\Admin\AppData\Roaming\npm\node_modules\notablog\dist\index.js:422:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async generate (C:\Users\Admin\AppData\Roaming\npm\node_modules\notablog\dist\index.js:900:25)
at async cmdGenerate (C:\Users\Admin\AppData\Roaming\npm\node_modules\notablog\bin\cli.js:37:5)

Social links

Could it be possible to add social links (Twitter, Linkedin, GitHub) as parameters in the config file so they can be shown as buttons when the blog is rendered?

Support for synced blocks

Hi,

I noticed that synced blocks are not copied into the blog. Does the notionblog-api package handle these blocks? I noticed that notion-utils.ts handles the rendering part, but couldn't pinpoint which part of the code handles the blocks.

If you could give me some pointers to which part of the code I should look into, that'd be great. Thanks!

RSS support ?

Consider generating an rss xml file after generating site?

notablog generate . command not found

After successfully installed notablog from npm and cloned the git repository, the command "notablog generate ." doesn't work and the terminal filed a command not found.

How to Set A Default Page or Route

Hi, the default page now looks like the following

image

Is there any way to set the default page to something like "About"? In general, is there anywhere we can customize the "Home" page?

Thanks a lot.

Internal link issue

When I use @ to create an internal link to another page in Notion, the generated site doesn't seem to generate a link to a page in my site (xxx.github.io/xxxx) but a link to original Notion page (notion.so/xxxx). How should I solve this problem?

I've tried to put the linked page into the notablog database, but it doesn't seem to work.

Support for simple table

Hi,
Notion recently released the long-awaited simple table block, but it was not rendered successfully using notablog, so I had to switch back to database xD.

Hope to support this feature.

How to use utterances in generated blog?

First of all, thanks for your project. Your code is precise and well written. I really like your code and learned a lot from it.

I saw your personal blog and find utterances component in your page. That is the mainly reason I use notablog instead of other Notion blog CMS tools like notion-blog to build my new version of GitHub Page.

When I try to put it to prod, however, I find no utterances relative items in folder. I also read source code in your GitHub Page repo and find utterances config file, css files and relevant setting.

So, how do you implement it? Is there any way to generate utterances using notablog cli?

TypeError: Cannot convert undefined or null to object

I am not able to run the generate command. Below is the error message I get.

Geonsoos-MacBook-Pro:notablog-starter geonsookim$ notablog generate .
I/notablog(20200929T234902.788): Copy theme assets
I/notablog(20200929T234902.815): Fetch Site Metadata
E/notablog-cli(20200929T234903.438): TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at parseTable (/usr/local/lib/node_modules/notablog/src/parse-table.js:26:35)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async generate (/usr/local/lib/node_modules/notablog/src/generate.js:86:20)
    at async cmdGenerate (/usr/local/lib/node_modules/notablog/bin/cli.js:34:5)

Not quite sure what causes this error. I attach the code for notablog-starter/config.json.

{
  "url": "https://www.notion.so/Ian_Kim-f4525e36d64047e6b51d714f6c93a8e6",
  "theme": "pure",
  "previewBrowser": "/usr/bin/chromium"
}

npm run build error

Hi, I was trying to see if I can build notablog by running npm run build or npm run dev, but here is the error I have

(base) [costa@costa-pc notablog]$ npm run build

> [email protected] build /home/costa/Documents/work/go/src/github.com/111/notablog
> npm run build:module && npm run build:doc


> [email protected] build:module /home/costa/Documents/work/go/src/github.com/111/notablog
> rm -rf dist && rollup -c && tsc --emitDeclarationOnly


src/index.ts → dist/index.js, dist/index.esm.js...
[!] Error: 'getConfig' is not exported by src/util.ts, imported by src/generate.ts
https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module
src/generate.ts (10:14)
 8: import { renderIndex } from './render-index'
 9: import { renderPost } from './render-post'
10: import { log, getConfig } from './util'
                  ^
11: 
12: type GenerateOptions = {
Error: 'getConfig' is not exported by src/util.ts, imported by src/generate.ts
    at error (/home/costa/Documents/work/go/src/github.com/111/notablog/node_modules/rollup/dist/shared/rollup.js:10120:30)
    at Module.error (/home/costa/Documents/work/go/src/github.com/111/notablog/node_modules/rollup/dist/shared/rollup.js:14470:16)
    at handleMissingExport (/home/costa/Documents/work/go/src/github.com/111/notablog/node_modules/rollup/dist/shared/rollup.js:14371:28)
    at Module.traceVariable (/home/costa/Documents/work/go/src/github.com/111/notablog/node_modules/rollup/dist/shared/rollup.js:14835:24)
    at ModuleScope.findVariable (/home/costa/Documents/work/go/src/github.com/111/notablog/node_modules/rollup/dist/shared/rollup.js:13415:39)
    at FunctionScope.findVariable (/home/costa/Documents/work/go/src/github.com/111/notablog/node_modules/rollup/dist/shared/rollup.js:8664:38)
    at ChildScope.findVariable (/home/costa/Documents/work/go/src/github.com/111/notablog/node_modules/rollup/dist/shared/rollup.js:8664:38)
    at Identifier$1.bind (/home/costa/Documents/work/go/src/github.com/111/notablog/node_modules/rollup/dist/shared/rollup.js:9123:40)
    at CallExpression$1.bind (/home/costa/Documents/work/go/src/github.com/111/notablog/node_modules/rollup/dist/shared/rollup.js:8749:23)
    at CallExpression$1.bind (/home/costa/Documents/work/go/src/github.com/111/notablog/node_modules/rollup/dist/shared/rollup.js:11440:15)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:module: `rm -rf dist && rollup -c && tsc --emitDeclarationOnly`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build:module script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/costa/.npm/_logs/2020-03-27T18_13_16_407Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `npm run build:module && npm run build:doc`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/costa/.npm/_logs/2020-03-27T18_13_16_417Z-debug.log

I was wondering If you could offer some insights. Would love to contribute.

Support for letting `index.html` be a post, and the links to blog entries be on a separate page.

By default, the list of blog entries is displayed on the index.html page. However, I wonder if I can change this behavior so that the list can be displayed on a different page, such as blog.html.

I would also like to be able to set the index.html page as a blog post. This would greatly allow me to use the home page for information only, and leave the links to blog posts in a separate page.

I am also curious if it's possible to extend the customization options of Notablog beyond the existing templates like index, tags, and posts. The idea is to let Notablog generate a corresponding page under the /public path based on this template that I add. This would provide a convenient way to create custom pages with personalized layouts.

Thank you very much for your attention to these requests.

Quick Question On Update

Hello, quick question, is there any way that it can update the site automatically once you update notion? Is that already an existing feature?

Notablog failed to generate the desired html file

The command notablog generate . successfully generate the desired html file of the template table you provided.
But when I changed the url in config.json and ran the command, the terminal reports "TypeError: Cannot read property '0' of undefined ... "

Thanks in advance for helping me out in this !!

Column Layout Broken and Gallery Incomlete

Hi, thanks for the amazing work. The generated site looks really amazing. I have two issues to report.

  1. The column layout seems to be broken. Please see the first screenshot as what is in https://dragonman225.js.org/block-test.html, and the second screenshot as what I generated today.

image
image

image

  1. The gallery is missing things like tags and properties.

What is actually there:
image

What is being rendered:
image

Looking forward to hearing from you. Thanks for the great work again.

How to change font size?

In my perspective, the font is little bit larger than I used to see in many blogs or notion itself, how can I change the font size? Many thanks!!

errors happened when I generate blogs

When I embed a block in my blog like this:
企业微信截图_16842281722413

### errors happened when I generate blogs as follows:
E/notablog-cli(20230516T165551.826): Error: Collection block df1ba7ae-c89d-4ab0-a826-458be76fa516 has no collection id
at transformCollection (C:\Users\xxx\AppData\Roaming\npm\node_modules\notablog\node_modules\nast-util-from-notionapi\dist\index.js:440:15)
at transformBlock (C:\Users\xxx\AppData\Roaming\npm\node_modules\notablog\node_modules\nast-util-from-notionapi\dist\index.js:908:24)
at C:\Users\xxx\AppData\Roaming\npm\node_modules\notablog\node_modules\nast-util-from-notionapi\dist\index.js:1120:16
at Array.map ()
at makeBlockArrayIntoTree (C:\Users\xxx\AppData\Roaming\npm\node_modules\notablog\node_modules\nast-util-from-notionapi\dist\index.js:1118:10)
at Object.getOnePageAsTree (C:\Users\xxx\AppData\Roaming\npm\node_modules\notablog\node_modules\nast-util-from-notionapi\dist\index.js:1040:12)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async renderPost (C:\Users\xxx\AppData\Roaming\npm\node_modules\notablog\dist\index.js:818:16)

Code highlight and page width problem

Hi, I very appreciate for your work
I have been use notablog to build my blog, but I meet two problem
code highlight
seems like notablog do not support shell and go code highlight?
the next two image is notion code block:
image

image

the next two image is notablog effect, seems like the code highlight doesn't work? :
image

image

I have been check this issue #25, but I don't know how to fix it.
Please spare a moment to support it if you can, thanks a lot.

page width
the page rendering works great, but I want to make the page wider, how to set it?

like this code block, the block is too short to show all annotation, I want to make this code block wider, it will make reader feel more comfortable.
image


Thank you for your work again

Self-hosted images

This is a feature request: I'd like to be able to have the generator request and save the images so they can be hosted with the blog. Then I believe the whole site can be served without making any requests to notion's servers. This has a few benefits:

  • Images aren't broken if notion changes the image urls
  • The site can be viewed locally without an internet connection
  • The source Notion table can be un-shared after generation, protecting potentially sensitive info such as unpublished drafts

New images aren't properly linked

All my old articles are translated to HTML pages just fine. However, when I upload a new picture, I only get a broken link, and the alt text is displayed.

All the old pictures started with a https://www.notion.so/signed/ URL and work quite well:
https://sold-out.io/phx/static/articles/555088-063.html

All the new ones point the <img>s point straight to Amazon servers, and they're not displayed on page. New article for reference:
https://sold-out.io/phx/static/articles/FN6882-100.html

Really wished it could get a fix. We rely on notablog for our whole blogging infrastructure.

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.