{"id":13601585,"url":"https://github.com/dragonman225/notablog","last_synced_at":"2025-05-16T01:06:49.942Z","repository":{"id":37502375,"uuid":"198864465","full_name":"dragonman225/notablog","owner":"dragonman225","description":"Tell stories of your work with Notion","archived":false,"fork":false,"pushed_at":"2023-09-20T20:11:12.000Z","size":2162,"stargazers_count":683,"open_issues_count":22,"forks_count":82,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-09T17:55:33.152Z","etag":null,"topics":["blog","blog-engine","cms","nodejs","notablog","notion","static-site-generator"],"latest_commit_sha":null,"homepage":"https://dragonman225.js.org/notablog.html","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dragonman225.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-07-25T16:15:56.000Z","updated_at":"2025-05-06T10:49:47.000Z","dependencies_parsed_at":"2022-07-16T09:46:14.292Z","dependency_job_id":"08447ab1-599a-4b89-84b8-b95b837717fd","html_url":"https://github.com/dragonman225/notablog","commit_stats":{"total_commits":169,"total_committers":4,"mean_commits":42.25,"dds":0.08284023668639051,"last_synced_commit":"703191c3909d95cc04f76006ae238a1fda8f9e42"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragonman225%2Fnotablog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragonman225%2Fnotablog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragonman225%2Fnotablog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragonman225%2Fnotablog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dragonman225","download_url":"https://codeload.github.com/dragonman225/notablog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448579,"owners_count":22072764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blog","blog-engine","cms","nodejs","notablog","notion","static-site-generator"],"created_at":"2024-08-01T18:01:04.950Z","updated_at":"2025-05-16T01:06:44.933Z","avatar_url":"https://github.com/dragonman225.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","HarmonyOS","Notion as Blog CMS","Tools"],"sub_categories":["Windows Manager","Web Services"],"readme":"# Notablog\n\n![version](https://img.shields.io/npm/v/notablog.svg?style=flat-square\u0026color=007acc\u0026label=version) ![license](https://img.shields.io/github/license/dragonman225/notablog.svg?style=flat-square\u0026label=license\u0026color=08CE5D)\n\nGenerate a minimalistic blog from a [Notion](https://www.notion.so/) table, so you can tell stories of your work with Notion.\n\nBelow are some screenshots of [Alexander Wang (@dragonman225)'s blog](https://dragonman225.js.org/). 🙂\n\n|            Mobile             |            Desktop             |\n| :---------------------------: | :----------------------------: |\n| ![](assets/v0.6.0_mobile.jpg) | ![](assets/v0.6.0_desktop.jpg) |\n\n| Management Interface on Notion.so |\n| :-------------------------------: |\n|   ![](assets/v0.6.0_manage.jpg)   |\n\n## Table of Contents\n\n- [Getting Started](#Getting-Started)\n- [Blog Management Interface](#Blog-Management-Interface)\n- [API Reference](#API-Reference)\n- [Notes](#Notes)\n\n## Getting Started\n\n\u003e Make sure you have Node.js **v15.0.0** or higher. Check with command `node -v`.\n\n\u003e For existing users who want to upgrade from v0.3.x, please go through all below steps (do a clean install), except that you can continue to use your Notion table.\n\n1. Install Notablog.\n\n   ```bash\n   npm i -g notablog\n   ```\n\n2. Clone the [`notablog-starter`](https://github.com/dragonman225/notablog-starter) repository.\n   ```bash\n   git clone https://github.com/dragonman225/notablog-starter.git\n   ```\n3. Duplicate this [Notion table template](https://www.notion.so/b6fcf809ca5047b89f423948dce013a0?v=03ddc4d6130a47f8b68e74c9d0061de2).\n\n4. Make the table you've duplicated **public** and **copy its URL** for the next step.\n\n5. Go into `notablog-starter/` directory, open `config.json`. Replace the value of `url` with the URL of the table you've duplicated.\n\n6. Inside `notablog-starter/` directory, run command:\n\n   ```bash\n   notablog generate .\n   ```\n\n7. After it finishes, go to `notablog-starter/public/` directory, open `index.html` with a browser to preview your site.\n\n- Optionally, you could change the `previewBrowser` field in `config.json` to the path of a browser executable you have on your computer and issue the following command anywhere to preview.\n\n  ```bash\n  notablog preview \u003cpath_to_the_notablog-starter\u003e\n  ```\n\n### Congratulations! Your website is ready now!\n\n- You can copy files in `notablog-starter/public/` directory to a server or upload them to any static hosting service to share your content with the world.\n\n- Whenever you want to update your site, go into `notablog-starter/` directory and issue command `notablog generate .`, or issue the command from outside `notablog-starter/` with the pattern `notablog generate \u003cpath_to_the_notablog-starter\u003e`.\n\n- Some options for static hosting services:\n\n  - [Github Pages](https://pages.github.com/)\n  - [Netlify](https://www.netlify.com/)\n  - [surge.sh](https://surge.sh)\n\n- Some options for self-hosting:\n\n  - [nginx](https://www.nginx.com/)\n  - [lighttpd](https://www.lighttpd.net/)\n  - [Apache httpd](https://httpd.apache.org/)\n\n## Blog Management Interface\n\nThis is the documentation of [Notion table template](https://www.notion.so/b6fcf809ca5047b89f423948dce013a0?v=03ddc4d6130a47f8b68e74c9d0061de2)\n\n|  Column Name  | Property Type  |                                                                      Description                                                                       |\n| :-----------: | :------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------: |\n|    `title`    |    `Title`     |                                                                    The page title.                                                                     |\n|    `tags`     | `Multi-Select` |                                                              Topics related to the page.                                                               |\n|   `publish`   |   `Checkbox`   |                                                        Determine if a page should be rendered.                                                         |\n|   `inMenu`    |   `Checkbox`   |                                                Determine if a page should appear in the navigation bar.                                                |\n|   `inList`    |   `Checkbox`   |                                                 Determine if a page should appear in the article list.                                                 |\n|  `template`   |    `Select`    |                           Specify which template to use for the page. Available template names depend on the theme you use.                            |\n|     `url`     |     `Text`     | A string to be used as the filename and the URL of the generated page. It should not contain `/` and `\\`. If it's empty, the `id` of the page is used. |\n| `description` |     `Text`     |                                                      Short intro of the page. Styles are working.                                                      |\n|    `date`     |     `Date`     |                      User customizable date, convenient for importing posts from other platforms or adjusting the order of posts.                      |\n\n- **Tip**: Check `publish` but leave `inMenu` and `inList` unchecked to make a page seem like _hidden_ because people can only view it when they know its URL.\n\n## API Reference\n\n### Introduction\n\nNotablog is a command-line tool that works on a [`notablog-starter`](https://github.com/dragonman225/notablog-starter) to generate sites. `notablog-starter` contains user config and customizable themes, and is used to store cached data and generated site. The design is inspired by [hexo](https://github.com/hexojs/hexo), a popular static site generator.\n\n### Folder Structure of `notablog-starter`\n\n```\nnotablog-starter\n├── config.json\n├── public\n├── cache\n└── themes\n    ├── pure\n    └── pure-ejs\n```\n\n- `config.json` - User configuration.\n\n  |     Field      |  Type            |                         Description                          |\n  | :------------: | :--------------: | :----------------------------------------------------------: |\n  |      url       | string           |     The URL of a Notion table compatible with Notablog.      |\n  |     theme      | string           | The theme to use. It should be one of the folder names in `themes/`. |\n  | previewBrowser | string           |      The path to the browser executable for previewing.      |\n  |    autoSlug    | boolean          |      Generate URL slugs for pages without custom ones.       |\n  |    locales     | string/string[]  | The locales which are used to generate string of a date (passed as first argument to Date.prototype.toLocaleDateString()) |\n\n- `public/` - Contains generated static assets.\n\n- `cache/` - Stores cached NAST representation of Notion pages. When running `notablog generate ...`, if a page is not updated since last run, Notablog use the cached data to render.\n\n- `themes/` - Stores themes.\n\n### Theme\n\nA theme contains layout templates, CSS files, fonts, and other assets that shapes the style and look of a blog.\n\n#### Folder Structure\n\n```\n\u003cname\u003e\n├── layouts\n├── assets\n└── manifest.json\n```\n\n- `\u003cname\u003e` - Theme folder name, also the name to be used in `notablog-starter/config.json`.\n- `layouts/` - Contains page templates. It is required to have one index layout (`index.html`), one post layout (`post.html`), and one tag layout (`tag.html`). You can have more templates, and a user can use them by specifying the template's filename in `template` column on Notion table.\n- `assets/` - Other assets. Anything in this folder will be copied to `notablog-starter/public/` when running `notablog generate ...`.\n- `manifest.json` - Theme configuration.\n\n  |      Field      |  Type  |                                              Description                                               |\n  | :-------------: | :----: | :----------------------------------------------------------------------------------------------------: |\n  | notablogVersion | string |                                      Supported Notablog version.                                       |\n  | templateEngine  | string | The template engine to use, depending on the template language you use. Currently only \"ejs\" is valid. |\n\n#### Template Language\n\n- Currently only [EJS](https://ejs.co/), but it's possible to support more since there's an interface designed for extension. Open an issue if you would like to contribute.\n\n- Template `index.html` gets the following object:\n\n  ```typescript\n  {\n    siteMeta: SiteContext\n  }\n  ```\n\n- Template `tag.html` gets the following object:\n\n  ```typescript\n  {\n    siteMeta: SiteContext\n    tagName: string\n    pages: PageMetadata[]\n  }\n  ```\n\n- Template `post.html` or others gets the following object:\n\n  ```typescript\n  {\n    siteMeta: SiteContext\n    post: PageMetadata \u0026 { contentHTML: string } // All properties of PageMetadata plus contentHTML.\n  }\n  ```\n\n\u003e It is highly recommended to take a look at [the default theme \"pure-ejs\"](https://github.com/dragonman225/notablog-starter/tree/master/themes/pure-ejs) if you want to make your own!\n\n## Notes\n\n### Code Structure\n\nGenerated by `dependency-cruiser` NPM package.\n\n![](assets/deps_graph.svg)\n\n### Project Status\n\nSee https://dragonman225.js.org/notablog-stat.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragonman225%2Fnotablog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdragonman225%2Fnotablog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragonman225%2Fnotablog/lists"}