├── .github ├── FUNDING.yml ├── dependabot.yml └── workflows │ ├── cd.yml │ └── ci.yml ├── .gitignore ├── .gitmodules ├── .prettierrc ├── LICENSE ├── README.md ├── archetypes ├── default.md └── posts.md ├── config ├── DoIt │ ├── config.toml │ ├── languages.toml │ ├── markup.toml │ ├── mediaTypes.toml │ ├── outputFormats.toml │ ├── outputs.toml │ ├── pagination.toml │ ├── params.toml │ ├── privacy.toml │ ├── sitemap.toml │ └── taxonomies.toml └── _default │ ├── config.toml │ ├── markup.toml │ ├── params.toml │ └── permalinks.toml ├── content ├── .gitkeep ├── About-45eb121158b9489480ec000fd25c812b.md └── posts │ └── Markdown-33dbd8d965f74930a804b8b50f375cbb.md ├── data └── .gitkeep ├── functions ├── api.ts └── tsconfig.json ├── layouts ├── .gitkeep └── shortcodes │ ├── math.html │ └── notion-unsupported-block.html ├── notion-hugo.config.ts ├── package-lock.json ├── package.json ├── src ├── config.ts ├── file.ts ├── helpers.ts ├── index.ts ├── markdown │ ├── md.ts │ ├── notion-to-md.ts │ ├── notion.ts │ └── types.ts ├── render.ts └── sh.ts ├── static └── .gitkeep └── tsconfig.json /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: ["HEIGE-PCloud"] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "npm" 4 | directory: "/" # Location of package manifests 5 | schedule: 6 | interval: "monthly" 7 | 8 | - package-ecosystem: "gitsubmodule" 9 | directory: "/" 10 | schedule: 11 | interval: "monthly" 12 | 13 | - package-ecosystem: "github-actions" 14 | directory: "/" 15 | schedule: 16 | interval: "monthly" 17 | -------------------------------------------------------------------------------- /.github/workflows/cd.yml: -------------------------------------------------------------------------------- 1 | name: CD 2 | 3 | on: 4 | push: 5 | branches: 6 | - 'main' 7 | 8 | schedule: 9 | - cron: '0 0 * * *' # run everyday at 00:00 UTC https://crontab.guru/every-day-at-midnight 10 | workflow_dispatch: 11 | repository_dispatch: 12 | 13 | # Allow one concurrent deployment 14 | concurrency: 15 | group: "deploy" 16 | cancel-in-progress: false 17 | 18 | # Default to bash 19 | defaults: 20 | run: 21 | shell: bash 22 | 23 | env: 24 | NODE_VERSION: 23.x 25 | 26 | jobs: 27 | build: 28 | runs-on: ubuntu-latest 29 | permissions: 30 | contents: write 31 | # env: 32 | # CLOUDFLARE_PAGES_DEPLOY_HOOK: ${{ secrets.CLOUDFLARE_PAGES_DEPLOY_HOOK }} 33 | 34 | steps: 35 | - uses: actions/checkout@v4 36 | with: 37 | submodules: true # Fetch Hugo themes (true OR recursive) 38 | fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod 39 | 40 | - name: Setup Node 41 | uses: actions/setup-node@v4 42 | with: 43 | node-version: ${{ env.NODE_VERSION }} 44 | 45 | - name: Sync content with Notion 46 | env: 47 | NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} 48 | run: | 49 | npm install 50 | npm start 51 | 52 | - name: Commit updated content 53 | uses: stefanzweifel/git-auto-commit-action@v5 54 | with: 55 | commit_message: Sync content with Notion 56 | 57 | # - name: Trigger Cloudflare Pages build 58 | # if: startsWith(env.CLOUDFLARE_PAGES_DEPLOY_HOOK, 'https://api.cloudflare.com/client/v4/pages/webhooks/deploy_hooks/') && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') 59 | # run: curl -X POST ${{ secrets.CLOUDFLARE_PAGES_DEPLOY_HOOK }} 60 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | 9 | env: 10 | NODE_VERSION: 23.x 11 | 12 | jobs: 13 | typecheck: 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/setup-node@v4 18 | with: 19 | node-version: ${{ env.NODE_VERSION }} 20 | - uses: actions/checkout@v4 21 | - run: | 22 | npm install 23 | npm run typecheck 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .env 4 | resources 5 | .hugo_build.lock 6 | public -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "themes/DoIt"] 2 | path = themes/DoIt 3 | url = https://github.com/HEIGE-PCloud/DoIt.git 4 | [submodule "themes/ananke"] 5 | path = themes/ananke 6 | url = https://github.com/theNewDynamic/gohugo-theme-ananke.git 7 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Notion-Hugo 2 | 3 |  4 | 5 | Notion-Hugo allows you to use [Notion](https://www.notion.so/) as your CMS and deploy your pages as a static website with [Hugo](https://gohugo.io/). So you have the full power of Notion for creating new content, with Hugo and its wonderful [ecosystem of themes](https://themes.gohugo.io/) take care of the rest for you. 6 | 7 | Notion-Hugo deploys your website to Cloudflare Pages, which has a generous free tier and is easy to set up. Notion-Hugo also uses [Functions](https://developers.cloudflare.com/pages/functions/) and [KV](https://developers.cloudflare.com/kv/) to power your website. Register a [Cloudflare account](https://dash.cloudflare.com/sign-up) and be ready to go. 8 | 9 | ## Get Started 10 | 11 | ### Create a new GitHub repository from this template 12 | 13 | Click the green **Use this template** button in the upper-right corner to create your repo from this template. Choose **public** for the repository visibility. 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ### Create a Notion integration 22 | 23 | Visit [my integrations](https://www.notion.so/my-integrations) and login with your Notion account. 24 | 25 | Click on **Create new integration** to create a new internal integration. 26 | 27 | 28 | 29 | In the capabilities section, select **Read Content** and **Read user information including email address**. The **Read Content** permission is necessary for Notion-Hugo to pull your Notion content, and the **Read user information including email address** permission is used to fill front matters with author information. Notion-Hugo does not collect any of your information. 30 | 31 | 32 | 33 | Click the submit button to finish creating the Notion integration. 34 | 35 | ### Setup secrets for GitHub Action 36 | 37 | Copy the Internal Integration Token. 38 | 39 | 40 | 41 | Navigate to the GitHub repo you just created, click on **Settings** -> **Secrets** -> **Actions**. 42 | 43 | Click the **New Repository Secret** button on the top right. 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Add a new secret with name `NOTION_TOKEN`, paste the copied token into the secret field. Click the green **Add secret** button to save the change. 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | ### Duplicate the Notion Template 61 | 62 | Duplicate this [Notion Template](https://pcloud.notion.site/Notion-DoIt-04bcc51cfe4c49938229c35e4f0a6fb6 63 | ) into your own workspace. 64 | 65 | ### Add connection to the Notion Page 66 | 67 | Visit the page you just duplicated, click the ellipsis button on the top right and add the integration you just created as a connection. 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | ### Configure you Hugo site 76 | 77 | On the page you just shared with the integration, click on the **share** button again, then click the **Copy link** button on the bottom right to copy the link to this page. 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | Now navigate back to your GitHub repository, open the `notion-hugo.config.ts` file, click to edit the file. 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | Replace the `page_url` with the link you just copied. 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | Click the commit changes button at the bottom to save the file. 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | ### Deploy to Cloudflare Pages 110 | 111 | Navigate to the [Cloudflare Pages](https://dash.cloudflare.com/pages) dashboard, click the **Workers & Pages** tab on the left, then click the **Create** button, then select the **Pages** tab, and click the **Connect to Git** button. Choose Notion-Hugo from the repository list, then click the **Begin Setup** button. 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | Fill in the build settings as follows: 120 | 121 | - Build command: `npm install; npm start; hugo` 122 | - Build output directory: `public` 123 | - Environment variables: 124 | - `HUGO_VERSION`: `0.140.0` (fill in the latest version of Hugo here) 125 | - `NODE_VERSION`: `22.12.0` (fill in the latest version of Node.js here) 126 | - `NOTION_TOKEN`: `secret_token` (fill in the token you copied from the Notion integration) 127 | 128 | Click the **Save and Deploy** button to deploy your website. 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | Now we need to add a KV namespace for the Cloudflare Functions. Navigate to the **Storage & Database** tab on the left, then click the **KV** tab, then click the **+ Create** button to create a new namespace. You can name it whatever you like. 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | Now, navigate to **Workers & Pages** > **your_project** > **Settings** > **Bindings**, add a new **KV Namespace** binding, with **Variable name** set to `KV` and the **KV namespace** set to the namespace you just created. Click the **Save** button to save the changes. 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | Finally, we need to configure the baseURL. Visit the **Deployments** tab to check the domain of your website (in this case, it is `https://notion-hugo-example.pages.dev`). 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | Navigate back to your GitHub repository, change the `base_url` in [`notion-hugo.config.ts`](https://github.com/HEIGE-PCloud/Notion-Hugo/blob/main/notion-hugo.config.ts) to the domain of your website. Also update the `baseURL` in [`config/_default/config.toml`](https://github.com/HEIGE-PCloud/Notion-Hugo/blob/main/config/_default/config.toml) to this value. Click the commit changes button at the bottom to save the file. 161 | 162 | Congratulations! Your website is now live at the domain you just configured. 163 | 164 | ### Next steps 165 | 166 | Pick a [Hugo theme](https://themes.gohugo.io/) you like, and add it to your repository. You can customize the theme to your liking. 167 | 168 | Use a custom domain for your website. You can add a custom domain in the Cloudflare Pages dashboard. See the [Cloudflare documentation](https://developers.cloudflare.com/pages/configuration/custom-domains/) for more information. The baseURL needs to be updated after changing the domain. 169 | 170 | ## FAQ 171 | 172 | ### Does Notion-Hugo sync with my Notion? 173 | 174 | Yes. By default Notion-Hugo syncs with your Notion every midnight. Any updated content will be committed to the repository. You can change the schedule in the `.github/workflows/cd.yml` file. 175 | 176 | ```yaml 177 | name: CD 178 | on: 179 | schedule: 180 | - cron: '0 0 * * *' 181 | ``` 182 | 183 | ### How do I manually sync with Notion? 184 | 185 | You can trigger the CD workflow manually by navigating to the **Actions** tab in your repository, then click the **CD** workflow, then click the **Run workflow** button to trigger the workflow. 186 | -------------------------------------------------------------------------------- /archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | draft: true 5 | --- 6 | 7 | -------------------------------------------------------------------------------- /archetypes/posts.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HEIGE-PCloud/Notion-Hugo/4d2b60ae67ccab46a0e82c4e7c6c41381dbe08bc/archetypes/posts.md -------------------------------------------------------------------------------- /config/DoIt/config.toml: -------------------------------------------------------------------------------- 1 | baseURL = "https://hugodoit.pages.dev" 2 | # [en, zh-cn, fr, pl, ...] determines default content language 3 | # [en, zh-cn, fr, pl, ...] 设置默认的语言 4 | defaultContentLanguage = "en" 5 | # theme 6 | # 主题 7 | theme = "DoIt" 8 | 9 | # website title 10 | # 网站标题 11 | title = "DoIt" 12 | 13 | # whether to use robots.txt 14 | # 是否使用 robots.txt 15 | enableRobotsTXT = true 16 | # whether to use git commit log 17 | # 是否使用 git 信息 18 | enableGitInfo = true 19 | # whether to use emoji code 20 | # 是否使用 emoji 代码 21 | enableEmoji = true 22 | 23 | -------------------------------------------------------------------------------- /config/DoIt/languages.toml: -------------------------------------------------------------------------------- 1 | [en] 2 | weight = 1 3 | # language code 4 | languageCode = "en" 5 | # language name 6 | languageName = "English" 7 | # whether to include Chinese/Japanese/Korean 8 | hasCJKLanguage = false 9 | # copyright description used only for seo schema 10 | copyright = "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License." 11 | # Menu config 12 | [en.menu] 13 | [[en.menu.main]] 14 | identifier = "posts" 15 | # you can add extra information before the name (HTML format is supported), such as icons 16 | pre = "" 17 | # you can add extra information after the name (HTML format is supported), such as icons 18 | post = "" 19 | name = "Posts" 20 | url = "/posts/" 21 | # title will be shown when you hover on this menu link. 22 | title = "" 23 | weight = 1 24 | [[en.menu.main]] 25 | identifier = "tags" 26 | pre = "" 27 | post = "" 28 | name = "Tags" 29 | url = "/tags/" 30 | title = "" 31 | weight = 2 32 | [[en.menu.main]] 33 | identifier = "categories" 34 | pre = "" 35 | post = "" 36 | name = "Categories" 37 | url = "/categories/" 38 | title = "" 39 | weight = 3 40 | [[en.menu.main]] 41 | identifier = "series" 42 | pre = "" 43 | post = "" 44 | name = "Series" 45 | url = "/series/" 46 | title = "" 47 | weight = 4 48 | [[en.menu.main]] 49 | identifier = "authors" 50 | pre = "" 51 | post = "" 52 | name = "Authors" 53 | url = "/authors/" 54 | title = "" 55 | weight = 5 56 | [[en.menu.main]] 57 | identifier = "showcase" 58 | pre = "" 59 | post = "" 60 | name = "Showcase" 61 | url = "/showcase/" 62 | title = "" 63 | weight = 6 64 | [[en.menu.main]] 65 | identifier = "documentation" 66 | pre = "" 67 | post = "" 68 | name = "Docs" 69 | url = "/categories/documentation/" 70 | title = "" 71 | weight = 7 72 | [[en.menu.main]] 73 | identifier = "about" 74 | pre = "" 75 | post = "" 76 | name = "About" 77 | url = "/about/" 78 | title = "" 79 | weight = 8 80 | [[en.menu.main]] 81 | identifier = "github" 82 | pre = "" 83 | post = "" 84 | name = "" 85 | url = "https://github.com/HEIGE-PCloud/DoIt" 86 | title = "GitHub" 87 | weight = 9 88 | [en.params] 89 | # site description 90 | description = "The official documentation for the Hugo DoIt theme" 91 | # site keywords 92 | keywords = ["Theme", "Hugo"] 93 | # App icon config 94 | [en.params.app] 95 | # optional site title override for the app when added to an iOS home screen or Android launcher 96 | title = "DoIt" 97 | # whether to omit favicon resource links 98 | noFavicon = false 99 | # modern SVG favicon to use in place of older style .png and .ico files 100 | svgFavicon = "" 101 | # Safari mask icon color 102 | iconColor = "#5bbad5" 103 | # Windows v8-10 tile color 104 | tileColor = "#da532c" 105 | # Search config 106 | [en.params.search] 107 | enable = true 108 | # type of search engine ("lunr", "algolia", "fuse") 109 | type = "algolia" 110 | # max index length of the chunked content 111 | contentLength = 4000 112 | # placeholder of the search bar 113 | placeholder = "" 114 | # max number of results length 115 | maxResultLength = 10 116 | # snippet length of the result 117 | snippetLength = 300 118 | # HTML tag name of the highlight part in results 119 | highlightTag = "em" 120 | # whether to use the absolute URL based on the baseURL in search index 121 | absoluteURL = false 122 | [en.params.search.algolia] 123 | index = "en_index" 124 | appID = "5YGRNRQK1G" 125 | searchKey = "0ff6874805de24b84aa1d5ebccad56cd" 126 | [en.params.search.fuse] 127 | # https://fusejs.io/api/options.html 128 | isCaseSensitive = false 129 | minMatchCharLength = 2 130 | findAllMatches = false 131 | location = 0 132 | threshold = 0.1 133 | distance = 100 134 | ignoreLocation = true 135 | useExtendedSearch = false 136 | ignoreFieldNorm = false 137 | # Home page config 138 | [en.params.home] 139 | # amount of RSS pages 140 | rss = 10 141 | # Home page profile 142 | [en.params.home.profile] 143 | enable = true 144 | # Gravatar Email for preferred avatar in home page 145 | gravatarEmail = "" 146 | # URL of avatar shown in home page 147 | avatarURL = "/images/avatar.webp" 148 | # title shown in home page (HTML format is supported) 149 | title = "" 150 | # subtitle shown in home page 151 | subtitle = "A Clean, Elegant but Advanced Hugo Theme" 152 | # whether to use typeit animation for subtitle 153 | typeit = true 154 | # whether to show social links 155 | social = true 156 | # disclaimer (HTML format is supported) 157 | disclaimer = "" 158 | # Home page posts 159 | [en.params.home.posts] 160 | enable = true 161 | # special amount of posts in each home posts page 162 | paginate = 7 163 | # Social config in home page 164 | [en.params.social] 165 | GitHub = "xxxx" 166 | Linkedin = "" 167 | Twitter = "xxxx" 168 | Instagram = "" 169 | Facebook = "xxxx" 170 | Telegram = "xxxx" 171 | Medium = "" 172 | Gitlab = "" 173 | Youtubelegacy = "xxxx" 174 | Youtubecustom = "" 175 | Youtubechannel = "" 176 | Tumblr = "" 177 | Quora = "" 178 | Keybase = "" 179 | Pinterest = "" 180 | Reddit = "" 181 | Codepen = "" 182 | FreeCodeCamp = "" 183 | Bitbucket = "" 184 | Stackoverflow = "" 185 | Weibo = "" 186 | Odnoklassniki = "" 187 | VK = "" 188 | Flickr = "" 189 | Xing = "" 190 | Snapchat = "" 191 | Soundcloud = "" 192 | Spotify = "" 193 | Bandcamp = "" 194 | Paypal = "" 195 | Fivehundredpx = "" 196 | Mix = "" 197 | Goodreads = "" 198 | Lastfm = "" 199 | Foursquare = "" 200 | Hackernews = "" 201 | Kickstarter = "" 202 | Patreon = "" 203 | Steam = "" 204 | Twitch = "" 205 | Strava = "" 206 | Skype = "" 207 | Whatsapp = "" 208 | Zhihu = "" 209 | Douban = "" 210 | Angellist = "" 211 | Slidershare = "" 212 | Jsfiddle = "" 213 | Deviantart = "" 214 | Behance = "" 215 | Dribbble = "" 216 | Wordpress = "" 217 | Vine = "" 218 | Googlescholar = "" 219 | Researchgate = "" 220 | Thingiverse = "" 221 | Devto = "" 222 | Gitea = "" 223 | XMPP = "" 224 | Matrix = "" 225 | Bilibili = "" 226 | ORCID = "" 227 | QQ = "" 228 | QQGroup = "" 229 | Liberapay = "xxx" 230 | Ko-Fi = "xxx" 231 | BuyMeACoffee = "" 232 | Linktree = "" 233 | Email = "xxxx@xxxx.com" 234 | RSS = true 235 | [en.params.social.Mastodon] 236 | id = "@xxxx" 237 | prefix = "https://mastodon.technology/" 238 | [en.params.social.Diaspora] 239 | id = "@xxxx" 240 | prefix = "https://yyyy/" 241 | # Sponsor config 242 | [en.params.sponsor] 243 | enable = false 244 | bio = "If you find this post helpful, please consider sponsoring." 245 | link = "https://github.com/sponsors/HEIGE-PCloud" 246 | # custom = "" 247 | 248 | 249 | [zh-cn] 250 | weight = 2 251 | # 网站语言, 仅在这里 CN 大写 252 | languageCode = "zh-CN" 253 | # 语言名称 254 | languageName = "简体中文" 255 | # 是否包括中日韩文字 256 | hasCJKLanguage = true 257 | # 版权描述,仅仅用于 SEO 258 | copyright = "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License." 259 | # 菜单配置 260 | [zh-cn.menu] 261 | [[zh-cn.menu.main]] 262 | identifier = "posts" 263 | # 你可以在名称 (允许 HTML 格式) 之前添加其他信息, 例如图标 264 | pre = "" 265 | # 你可以在名称 (允许 HTML 格式) 之后添加其他信息, 例如图标 266 | post = "" 267 | name = "所有文章" 268 | url = "/posts/" 269 | title = "" 270 | weight = 1 271 | [[zh-cn.menu.main]] 272 | identifier = "tags" 273 | pre = "" 274 | post = "" 275 | name = "标签" 276 | url = "/tags/" 277 | title = "" 278 | weight = 2 279 | [[zh-cn.menu.main]] 280 | identifier = "categories" 281 | pre = "" 282 | post = "" 283 | name = "分类" 284 | url = "/categories/" 285 | title = "" 286 | weight = 3 287 | [[zh-cn.menu.main]] 288 | identifier = "series" 289 | pre = "" 290 | post = "" 291 | name = "系列" 292 | url = "/series/" 293 | title = "" 294 | weight = 4 295 | [[zh-cn.menu.main]] 296 | identifier = "authors" 297 | pre = "" 298 | post = "" 299 | name = "作者" 300 | url = "/authors/" 301 | title = "" 302 | weight = 5 303 | [[zh-cn.menu.main]] 304 | identifier = "showcase" 305 | pre = "" 306 | post = "" 307 | name = "作品" 308 | url = "/showcase/" 309 | title = "" 310 | weight = 6 311 | [[zh-cn.menu.main]] 312 | identifier = "documentation" 313 | pre = "" 314 | name = "文档" 315 | url = "/categories/documentation/" 316 | title = "" 317 | weight = 7 318 | [[zh-cn.menu.main]] 319 | identifier = "about" 320 | pre = "" 321 | post = "" 322 | name = "关于" 323 | url = "/about/" 324 | title = "" 325 | weight = 8 326 | [[zh-cn.menu.main]] 327 | identifier = "github" 328 | pre = "" 329 | post = "" 330 | name = "" 331 | url = "https://github.com/HEIGE-PCloud/DoIt" 332 | title = "GitHub" 333 | weight = 9 334 | [zh-cn.params] 335 | # 网站描述 336 | description = "Hugo DoIt 主题官方文档" 337 | # 网站关键词 338 | keywords = ["Theme", "Hugo"] 339 | # 应用图标配置 340 | [zh-cn.params.app] 341 | # 当添加到 iOS 主屏幕或者 Android 启动器时的标题, 覆盖默认标题 342 | title = "DoIt" 343 | # 是否隐藏网站图标资源链接 344 | noFavicon = false 345 | # 更现代的 SVG 网站图标, 可替代旧的 .png 和 .ico 文件 346 | svgFavicon = "" 347 | # Safari 图标颜色 348 | iconColor = "#5bbad5" 349 | # Windows v8-10 磁贴颜色 350 | tileColor = "#da532c" 351 | # 搜索配置 352 | [zh-cn.params.search] 353 | enable = true 354 | # 搜索引擎的类型 ("lunr", "algolia", "fuse") 355 | type = "algolia" 356 | # 文章内容最长索引长度 357 | contentLength = 4000 358 | # 搜索框的占位提示语 359 | placeholder = "" 360 | # 最大结果数目 361 | maxResultLength = 10 362 | # 结果内容片段长度 363 | snippetLength = 50 364 | # 搜索结果中高亮部分的 HTML 标签 365 | highlightTag = "em" 366 | # 是否在搜索索引中使用基于 baseURL 的绝对路径 367 | absoluteURL = false 368 | [zh-cn.params.search.algolia] 369 | index = "zh_cn_index" 370 | appID = "5YGRNRQK1G" 371 | searchKey = "0ff6874805de24b84aa1d5ebccad56cd" 372 | [zh-cn.params.search.fuse] 373 | # https://fusejs.io/api/options.html 374 | isCaseSensitive = false 375 | minMatchCharLength = 2 376 | findAllMatches = false 377 | location = 0 378 | threshold = 0.1 379 | distance = 100 380 | ignoreLocation = true 381 | useExtendedSearch = false 382 | ignoreFieldNorm = false 383 | # 主页信息设置 384 | [zh-cn.params.home] 385 | # RSS 文章数目 386 | rss = 10 387 | # 主页个人信息 388 | [zh-cn.params.home.profile] 389 | enable = true 390 | # Gravatar 邮箱,用于优先在主页显示的头像 391 | gravatarEmail = "" 392 | # 主页显示头像的 URL 393 | avatarURL = "/images/avatar.webp" 394 | # 主页显示的网站标题 (支持 HTML 格式) 395 | title = "" 396 | # 主页显示的网站副标题 397 | subtitle = "一个简洁、优雅且高效的 Hugo 主题" 398 | # 是否为副标题显示打字机动画 399 | typeit = true 400 | # 是否显示社交账号 401 | social = true 402 | # 免责声明 (支持 HTML 格式) 403 | disclaimer = "" 404 | # 主页文章列表 405 | [zh-cn.params.home.posts] 406 | enable = true 407 | # 主页每页显示文章数量 408 | paginate = 7 409 | # 主页的社交信息设置 410 | [zh-cn.params.social] 411 | GitHub = "xxxx" 412 | Linkedin = "" 413 | Twitter = "" 414 | Instagram = "" 415 | Facebook = "" 416 | Telegram = "" 417 | Medium = "" 418 | Gitlab = "" 419 | Youtubelegacy = "" 420 | Youtubecustom = "" 421 | Youtubechannel = "" 422 | Tumblr = "" 423 | Quora = "" 424 | Keybase = "" 425 | Pinterest = "" 426 | Reddit = "" 427 | Codepen = "" 428 | FreeCodeCamp = "" 429 | Bitbucket = "" 430 | Stackoverflow = "" 431 | Weibo = "xxxx" 432 | Odnoklassniki = "" 433 | VK = "" 434 | Flickr = "" 435 | Xing = "" 436 | Snapchat = "" 437 | Soundcloud = "" 438 | Spotify = "" 439 | Bandcamp = "" 440 | Paypal = "" 441 | Fivehundredpx = "" 442 | Mix = "" 443 | Goodreads = "" 444 | Lastfm = "" 445 | Foursquare = "" 446 | Hackernews = "" 447 | Kickstarter = "" 448 | Patreon = "" 449 | Steam = "xxxx" 450 | Twitch = "" 451 | Strava = "" 452 | Skype = "" 453 | Whatsapp = "" 454 | Zhihu = "xxxx" 455 | Douban = "xxxx" 456 | Angellist = "" 457 | Slidershare = "" 458 | Jsfiddle = "" 459 | Deviantart = "" 460 | Behance = "" 461 | Dribbble = "" 462 | Wordpress = "" 463 | Vine = "" 464 | Googlescholar = "" 465 | Researchgate = "" 466 | Mastodon = "" 467 | Thingiverse = "" 468 | Devto = "xxxx" 469 | Gitea = "" 470 | XMPP = "" 471 | Matrix = "" 472 | Bilibili = "xxxx" 473 | ORCID = "" 474 | Liberapay = "" 475 | Ko-Fi = "" 476 | BuyMeACoffee = "" 477 | Linktree = "" 478 | QQ = "" 479 | QQGroup = "" 480 | Email = "xxxx@xxxx.com" 481 | RSS = true 482 | # 赞助设置 483 | [zh-cn.params.sponsor] 484 | enable = false 485 | bio = "如果你觉得这篇文章对你有所帮助,欢迎赞赏~" 486 | link = "https://github.com/sponsors/HEIGE-PCloud" 487 | # custom = "" 488 | 489 | 490 | -------------------------------------------------------------------------------- /config/DoIt/markup.toml: -------------------------------------------------------------------------------- 1 | # Markup related configuration in Hugo 2 | # Hugo 解析文档的配置 3 | # Syntax Highlighting (https://gohugo.io/content-management/syntax-highlighting) 4 | # 语法高亮设置 (https://gohugo.io/content-management/syntax-highlighting) 5 | [highlight] 6 | codeFences = true 7 | guessSyntax = true 8 | lineNos = true 9 | lineNumbersInTable = true 10 | # false is a necessary configuration (https://github.com/dillonzq/LoveIt/issues/158) 11 | # false 是必要的设置 (https://github.com/dillonzq/LoveIt/issues/158) 12 | noClasses = false 13 | # Goldmark is from Hugo 0.60 the default library used for Markdown 14 | # Goldmark 是 Hugo 0.60 以来的默认 Markdown 解析库 15 | [goldmark] 16 | [goldmark.extensions] 17 | definitionList = true 18 | footnote = true 19 | linkify = true 20 | strikethrough = true 21 | table = true 22 | taskList = true 23 | typographer = true 24 | [goldmark.renderer] 25 | # whether to use HTML tags directly in the document 26 | # 是否在文档中直接使用 HTML 标签 27 | unsafe = true 28 | # Table Of Contents settings 29 | # 目录设置 30 | [tableOfContents] 31 | startLevel = 2 32 | endLevel = 6 33 | 34 | -------------------------------------------------------------------------------- /config/DoIt/mediaTypes.toml: -------------------------------------------------------------------------------- 1 | # Options to make output .md files 2 | # 用于输出 Markdown 格式文档的设置 3 | ["text/plain"] 4 | suffixes = ["md"] 5 | -------------------------------------------------------------------------------- /config/DoIt/outputFormats.toml: -------------------------------------------------------------------------------- 1 | # Options to make output .md files 2 | # 用于输出 Markdown 格式文档的设置 3 | [MarkDown] 4 | mediaType = "text/plain" 5 | isPlainText = true 6 | isHTML = false 7 | -------------------------------------------------------------------------------- /config/DoIt/outputs.toml: -------------------------------------------------------------------------------- 1 | # Options to make hugo output files 2 | # 用于 Hugo 输出文档的设置 3 | home = ["HTML", "RSS", "JSON"] 4 | page = ["HTML", "MarkDown"] 5 | section = ["HTML", "RSS"] 6 | taxonomy = ["HTML", "RSS"] 7 | -------------------------------------------------------------------------------- /config/DoIt/pagination.toml: -------------------------------------------------------------------------------- 1 | # The number of pages per pager 2 | pagerSize = 12 -------------------------------------------------------------------------------- /config/DoIt/params.toml: -------------------------------------------------------------------------------- 1 | # website title 2 | # 网站标题 3 | title = "Hugo DoIt Theme Documentation" 4 | # DoIt theme version 5 | # DoIt 主题版本 6 | version = "0.3.X" 7 | # site default theme ("light", "dark", "black", "auto") 8 | # 网站默认主题 ("light", "dark", "black", "auto") 9 | defaultTheme = "auto" 10 | # public git repo url only then enableGitInfo is true 11 | # 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效 12 | gitRepo = "https://github.com/HEIGE-PCloud/DoIt" 13 | # which hash function used for SRI, when empty, no SRI is used ("sha256", "sha384", "sha512", "md5") 14 | # 哪种哈希函数用来 SRI, 为空时表示不使用 SRI ("sha256", "sha384", "sha512", "md5") 15 | fingerprint = "" 16 | # date format 17 | # 日期格式 18 | dateFormat = "2006-01-02" 19 | # website images for Open Graph and Twitter Cards 20 | # 网站图片, 用于 Open Graph 和 Twitter Cards 21 | images = ["/images/avatar.webp"] 22 | # enable PWA 23 | # 开启 PWA 支持 24 | enablePWA = false 25 | # license information 26 | # 许可协议信息 (支持 HTML 格式) 27 | license = 'CC BY-NC 4.0' 28 | # [Experimental] Bundle js 29 | bundle = false 30 | [author] 31 | name = "PCloud" 32 | email = "heige.pcloud@outlook.com" 33 | link = "https://github.com/HEIGE-PCloud" 34 | avatar = "/images/avatar.webp" 35 | gravatarEmail = "" 36 | # Header config 37 | # 页面头部导航栏配置 38 | [header] 39 | # desktop header mode ("fixed", "normal", "auto") 40 | # 桌面端导航栏模式 ("fixed", "normal", "auto") 41 | desktopMode = "fixed" 42 | # mobile header mode ("fixed", "normal", "auto") 43 | # 移动端导航栏模式 ("fixed", "normal", "auto") 44 | mobileMode = "auto" 45 | # theme change mode ("switch", "select") 46 | # 主题切换模式 ("switch", "select") 47 | themeChangeMode = "select" 48 | # Header title config 49 | # 页面头部导航栏标题配置 50 | [header.title] 51 | # URL of the LOGO 52 | # LOGO 的 URL 53 | logo = "" 54 | # title name 55 | # 标题名称 56 | name = "DoIt" 57 | # you can add extra information before the name (HTML format is supported), such as icons 58 | # 你可以在名称 (允许 HTML 格式) 之前添加其他信息, 例如图标 59 | pre = "" 60 | # you can add extra information after the name (HTML format is supported), such as icons 61 | # 你可以在名称 (允许 HTML 格式) 之后添加其他信息, 例如图标 62 | post = "" 63 | # whether to use typeit animation for title name 64 | # 是否为标题显示打字机动画 65 | typeit = true 66 | 67 | # Footer config 68 | # 页面底部信息配置 69 | [footer] 70 | enable = true 71 | # Custom content (HTML format is supported) 72 | # 自定义内容 (支持 HTML 格式) 73 | custom = '' 74 | # whether to show Hugo and theme info 75 | # 是否显示 Hugo 和主题信息 76 | hugo = true 77 | # Hosted on (HTML format is supported) 78 | # 托管服务信息 (支持 HTML 格式) 79 | # GitHub Pages 80 | hostedOn = '' 81 | # whether to show copyright info 82 | # 是否显示版权信息 83 | copyright = true 84 | # whether to show the author 85 | # 是否显示作者 86 | author = true 87 | # site creation time 88 | # 网站创立年份 89 | since = 2019 90 | # ICP info only in China (HTML format is supported) 91 | # ICP 备案信息,仅在中国使用 (支持 HTML 格式) 92 | icp = "" 93 | # license info (HTML format is supported) 94 | # 许可协议信息 (支持 HTML 格式) 95 | license = 'CC BY-NC 4.0' 96 | 97 | # Section (all posts) page config 98 | # Section (所有文章) 页面配置 99 | [section] 100 | # special amount of posts in each section page 101 | # section 页面每页显示文章数量 102 | paginate = 20 103 | # date format (month and day) 104 | # 日期格式 (月和日) 105 | dateFormat = "01-02" 106 | # amount of RSS pages 107 | # RSS 文章数目 108 | rss = 10 109 | # recently updated posts settings 110 | # 最近更新文章设置 111 | [section.recentlyUpdated] 112 | days = 30 113 | enable = true 114 | maxCount = 10 115 | rss = true 116 | 117 | # List (category or tag) page config 118 | # List (目录或标签) 页面配置 119 | [list] 120 | # special amount of posts in each list page 121 | # list 页面每页显示文章数量 122 | paginate = 20 123 | # date format (month and day) 124 | # 日期格式 (月和日) 125 | dateFormat = "01-02" 126 | # amount of RSS pages 127 | # RSS 文章数目 128 | rss = 10 129 | 130 | # Page config 131 | # 文章页面配置 132 | [page] 133 | # whether to hide a page from home page 134 | # 是否在主页隐藏一篇文章 135 | hiddenFromHomePage = false 136 | # whether to hide a page from search results 137 | # 是否在搜索结果中隐藏一篇文章 138 | hiddenFromSearch = false 139 | # whether to enable twemoji 140 | # 是否使用 twemoji 141 | twemoji = false 142 | # whether to enable lightgallery 143 | # 是否使用 lightgallery 144 | lightgallery = false 145 | # whether to enable the ruby extended syntax 146 | # 是否使用 ruby 扩展语法 147 | ruby = true 148 | # whether to enable the fraction extended syntax 149 | # 是否使用 fraction 扩展语法 150 | fraction = true 151 | # whether to show link to Raw Markdown content of the content 152 | # 是否显示原始 Markdown 文档内容的链接 153 | linkToMarkdown = true 154 | # configure the link to view source the post 155 | # 配置文章原始文件的链接 156 | linkToSource = "https://github.com/HEIGE-PCloud/DoIt/blob/main/exampleSite/content/{path}" 157 | # "https://github.com/user/repo/blob/main/{path}" 158 | # configure the link to edit the post 159 | # 配置编辑文章的链接 160 | linkToEdit = "https://github.com/HEIGE-PCloud/DoIt/edit/main/exampleSite/content/{path}" 161 | # https://github.com/user/repo/edit/main/{path} 162 | # https://gitlab.com/user/repo/-/edit/main/{path} 163 | # https://bitbucket.org/user/repo/src/main/{path}?mode=edit 164 | # configure the link to report issue for the post 165 | # 配置提交错误的链接 166 | linkToReport = "https://github.com/HEIGE-PCloud/DoIt/issues/new?title=[bug]%20{title}&body=|Field|Value|%0A|-|-|%0A|Title|{title}|%0A|Url|{url}|%0A|Filename|https://github.com/HEIGE-PCloud/DoIt/blob/main/exampleSite/content/{path}|" 167 | # https://github.com/user/repo/issues/new?title=[bug]%20{title}&body=|Field|Value|%0A|-|-|%0A|Title|{title}|%0A|Url|{url}|%0A|Filename|https://github.com/user/repo/blob/main/{path}|" 168 | # https://gitlab.com/user/repo/-/issues/new?issue[title]=[bug]%20{title}&issue[description]=|Field|Value|%0A|-|-|%0A|Title|{title}|%0A|Url|{url}|%0A|Filename|https://gitlab.com/user/repo/-/edit/main/{path}| 169 | # whether to show the full text content in RSS 170 | # 是否在 RSS 中显示全文内容 171 | rssFullText = false 172 | # Page style ("normal", "wide") 173 | # 页面样式 ("normal", "wide") 174 | pageStyle = "normal" 175 | # whether to enable series navigation 176 | # 是否使用系列导航 177 | seriesNavigation = true 178 | # Display a message at the beginning of an article to warn the reader that its content might be outdated. 179 | # 在文章开头显示提示信息,提醒读者文章内容可能过时。 180 | [page.outdatedArticleReminder] 181 | enable = false 182 | # Display the reminder if the last modified time is more than 90 days ago. 183 | # 如果文章最后更新于这天数之前,显示提醒 184 | reminder = 90 185 | # Display warning if the last modified time is more than 180 days ago. 186 | # 如果文章最后更新于这天数之前,显示警告 187 | warning = 180 188 | # Table of the contents config 189 | # 目录配置 190 | [page.toc] 191 | # whether to enable the table of the contents 192 | # 是否使用目录 193 | enable = true 194 | # whether to keep the static table of the contents in front of the post 195 | # 是否保持使用文章前面的静态目录 196 | keepStatic = false 197 | # whether to make the table of the contents in the sidebar automatically collapsed 198 | # 是否使侧边目录自动折叠展开 199 | auto = true 200 | # Code config 201 | # 代码配置 202 | [page.code] 203 | # whether to show the copy button of the code block 204 | # 是否显示代码块的复制按钮 205 | copy = true 206 | # the maximum number of lines of displayed code by default 207 | # 默认展开显示的代码行数 208 | maxShownLines = 10 209 | # Table config 210 | # 表格配置 211 | [page.table] 212 | # whether to enable sorting in the tables 213 | # 是否开启表格排序 214 | sort = true 215 | [page.header] 216 | # whether to enable auto header numbering 217 | # 是否开启标题自动编号 218 | [page.header.number] 219 | enable = true 220 | [page.header.number.format] 221 | h2 = "{h2} {title}" 222 | h3 = "{h2}.{h3} {title}" 223 | h4 = "{h2}.{h3}.{h4} {title}" 224 | h5 = "{h2}.{h3}.{h4}.{h5} {title}" 225 | h6 = "{h2}.{h3}.{h4}.{h5}.{h6} {title}" 226 | # KaTeX mathematical formulas config (KaTeX https://katex.org/) 227 | # KaTeX 数学公式配置 (KaTeX https://katex.org/) 228 | [page.math] 229 | enable = true 230 | # default block delimiter is $$ ... $$ and \\[ ... \\] 231 | # 默认块定界符是 $$ ... $$ 和 \\[ ... \\] 232 | blockLeftDelimiter = "" 233 | blockRightDelimiter = "" 234 | # default inline delimiter is $ ... $ and \\( ... \\) 235 | # 默认行内定界符是 $ ... $ 和 \\( ... \\) 236 | inlineLeftDelimiter = "" 237 | inlineRightDelimiter = "" 238 | # KaTeX extension copy_tex 239 | # KaTeX 插件 copy_tex 240 | copyTex = true 241 | # KaTeX extension mhchem 242 | # KaTeX 插件 mhchem 243 | mhchem = true 244 | # Mapbox GL JS config (Mapbox GL JS https://docs.mapbox.com/mapbox-gl-js) 245 | # Mapbox GL JS 配置 (Mapbox GL JS https://docs.mapbox.com/mapbox-gl-js) 246 | [page.mapbox] 247 | # access token of Mapbox GL JS 248 | # Mapbox GL JS 的 access token 249 | accessToken = "pk.eyJ1IjoiZGlsbG9uenEiLCJhIjoiY2s2czd2M2x3MDA0NjNmcGxmcjVrZmc2cyJ9.aSjv2BNuZUfARvxRYjSVZQ" 250 | # style for the light theme 251 | # 浅色主题的地图样式 252 | lightStyle = "mapbox://styles/mapbox/light-v10?optimize=true" 253 | # style for the dark theme 254 | # 深色主题的地图样式 255 | darkStyle = "mapbox://styles/mapbox/dark-v10?optimize=true" 256 | # whether to add NavigationControl (https://docs.mapbox.com/mapbox-gl-js/api/#navigationcontrol) 257 | # 是否添加 NavigationControl (https://docs.mapbox.com/mapbox-gl-js/api/#navigationcontrol) 258 | navigation = true 259 | # whether to add GeolocateControl (https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol) 260 | # 是否添加 GeolocateControl (https://docs.mapbox.com/mapbox-gl-js/api/#geolocatecontrol) 261 | geolocate = true 262 | # whether to add ScaleControl (https://docs.mapbox.com/mapbox-gl-js/api/#scalecontrol) 263 | # 是否添加 ScaleControl (https://docs.mapbox.com/mapbox-gl-js/api/#scalecontrol) 264 | scale = true 265 | # whether to add FullscreenControl (https://docs.mapbox.com/mapbox-gl-js/api/#fullscreencontrol) 266 | # 是否添加 FullscreenControl (https://docs.mapbox.com/mapbox-gl-js/api/#fullscreencontrol) 267 | fullscreen = true 268 | # Social share links in post page 269 | # 文章页面的分享信息设置 270 | [page.share] 271 | Baidu = false 272 | Blogger = false 273 | Buffer = false 274 | Digg = false 275 | Evernote = false 276 | Facebook = true 277 | Flipboard = false 278 | HackerNews = true 279 | Instapaper = false 280 | Line = true 281 | Linkedin = false 282 | Mix = false 283 | Myspace = false 284 | Odnoklassniki = false 285 | Pinterest = false 286 | Pocket = false 287 | Reddit = false 288 | Renren = false 289 | Skype = false 290 | Stumbleupon = false 291 | Telegram = true 292 | Trello = false 293 | Tumblr = false 294 | Twitter = true 295 | VK = false 296 | Weibo = true 297 | Whatsapp = false 298 | Xing = false 299 | enable = true 300 | # Comment config 301 | # 评论系统设置 302 | [page.comment] 303 | enable = true 304 | # Disqus comment config (https://disqus.com/) 305 | # Disqus 评论系统设置 (https://disqus.com/) 306 | [page.comment.disqus] 307 | enable = false 308 | # Disqus shortname to use Disqus in posts 309 | # Disqus 的 shortname,用来在文章中启用 Disqus 评论系统 310 | shortname = "" 311 | # Gitalk comment config (https://github.com/gitalk/gitalk) 312 | # Gitalk 评论系统设置 (https://github.com/gitalk/gitalk) 313 | [page.comment.gitalk] 314 | clientId = "" 315 | clientSecret = "" 316 | enable = false 317 | owner = "" 318 | repo = "" 319 | # Valine comment config (https://github.com/xCss/Valine) 320 | # Valine 评论系统设置 (https://github.com/xCss/Valine) 321 | [page.comment.valine] 322 | appId = "" 323 | appKey = "" 324 | avatar = "mp" 325 | enable = false 326 | enableQQ = false 327 | highlight = true 328 | lang = "en" 329 | meta = "" 330 | pageSize = 10 331 | placeholder = "" 332 | recordIP = false 333 | serverURLs = "" 334 | visitor = true 335 | # emoji data file name, default is "google.yml" 336 | # ("apple.yml", "google.yml", "facebook.yml", "twitter.yml") 337 | # located in "themes/DoIt/assets/data/emoji/" directory 338 | # you can store your own data files in the same path under your project: 339 | # "assets/data/emoji/" 340 | # emoji 数据文件名称, 默认是 "google.yml" 341 | # ("apple.yml", "google.yml", "facebook.yml", "twitter.yml") 342 | # 位于 "themes/DoIt/assets/data/emoji/" 目录 343 | # 可以在你的项目下相同路径存放你自己的数据文件: 344 | # "assets/data/emoji/" 345 | emoji = "" 346 | # Waline comment config (https://waline.js.org) 347 | # Waline 评论系统设置 (https://waline.js.org) 348 | [page.comment.waline] 349 | comment = true 350 | enable = false 351 | pageview = true 352 | serverURL = "https://do-it-waline-comment.vercel.app" 353 | # emoji = ['https://cdn.jsdelivr.net/gh/walinejs/emojis/weibo'] 354 | # meta = ['nick', 'mail', 'link'] 355 | # requiredMeta = [] 356 | # login = 'enable' 357 | # wordLimit = 0 358 | # pageSize = 10 359 | # imageUploader = false 360 | # highlighter = false 361 | # texRenderer = false 362 | # Facebook comment config (https://developers.facebook.com/docs/plugins/comments) 363 | # Facebook 评论系统设置 (https://developers.facebook.com/docs/plugins/comments) 364 | [page.comment.facebook] 365 | appId = "" 366 | enable = false 367 | languageCode = "" 368 | numPosts = 10 369 | width = "100%" 370 | # Telegram comments config (https://comments.app/) 371 | # Telegram comments 评论系统设置 (https://comments.app/) 372 | [page.comment.telegram] 373 | color = "" 374 | colorful = true 375 | dark = false 376 | dislikes = false 377 | enable = false 378 | height = "" 379 | limit = 5 380 | outlined = false 381 | siteID = "" 382 | # Commento comment config (https://commento.io/) 383 | # Commento comment 评论系统设置 (https://commento.io/) 384 | [page.comment.commento] 385 | enable = false 386 | # Utterances comment config (https://utteranc.es/) 387 | # Utterances comment 评论系统设置 (https://utteranc.es/) 388 | [page.comment.utterances] 389 | enable = false 390 | # owner/repo 391 | darkTheme = "github-dark" 392 | issueTerm = "pathname" 393 | label = "" 394 | lightTheme = "github-light" 395 | repo = "" 396 | # Twikoo comment config (https://twikoo.js.org/) 397 | # Twikoo comment 评论系统设置 (https://twikoo.js.org/) 398 | [page.comment.twikoo] 399 | commentCount = true 400 | enable = true 401 | envId = "https://doit-docs-comment-twikoo.vercel.app/" 402 | path = "" 403 | region = "" 404 | visitor = true 405 | # Vssue comment config (https://vssue.js.org//) 406 | # Vssue comment 评论系统设置 (https://vssue.js.org//) 407 | [page.comment.vssue] 408 | clientId = "" 409 | clientSecret = "" 410 | enable = false 411 | owner = "" 412 | platform = "" # ("bitbucket", "gitea", "gitee", "github", "gitlab") 413 | repo = "" 414 | # Remark42 comment config (https://remark42.com/) 415 | # Remark42 comment 评论系统设置 (https://remark42.com/) 416 | [page.comment.remark42] 417 | enable = false 418 | host = "" 419 | max_shown_comments = 15 420 | show_email_subscription = true 421 | simple_view = false 422 | site_id = "" 423 | # giscus comment config (https://giscus.app/) 424 | # giscus comment 评论系统设置 (https://giscus.app/) 425 | [page.comment.giscus] 426 | enable = false 427 | # owner/repo 428 | darkTheme = "dark" 429 | dataCategory = "" 430 | dataCategoryId = "" 431 | dataEmitMetadata = "0" 432 | dataInputPosition = "bottom" 433 | dataLang = "en" 434 | dataMapping = "pathname" 435 | dataReactionsEnabled = "1" 436 | dataRepo = "" 437 | dataRepoId = "" 438 | dataStrict = "0" 439 | lightTheme = "light" 440 | # Third-party library config 441 | # 第三方库配置 442 | [page.library] 443 | [page.library.css] 444 | # someCSS = "some.css" 445 | # [page.library.css.someOtherCSS] 446 | # src = "someOther.css" 447 | # defer = true 448 | # attr = "customAttribute" 449 | # located in "assets/" 位于 "assets/" 450 | # Or 或者 451 | # someCSS = "https://cdn.example.com/some.css" 452 | [page.library.js] 453 | # someJavaScript = "some.js" 454 | # [page.library.js.someOtherJavaScript] 455 | # src = "someOther.js" 456 | # defer = false 457 | # async = true 458 | # attr = "customAttribute" 459 | # located in "assets/" 位于 "assets/" 460 | # Or 或者 461 | # someJavascript = "https://cdn.example.com/some.js" 462 | # Page SEO config 463 | # 页面 SEO 配置 464 | [page.seo] 465 | # image URL 466 | # 图片 URL 467 | images = [] 468 | # Publisher info 469 | # 出版者信息 470 | [page.seo.publisher] 471 | logoUrl = "/images/avatar.webp" 472 | name = "xxxx" 473 | # Related content config 474 | # 相关文章推荐配置 475 | [page.related] 476 | count = 5 477 | enable = true 478 | 479 | # Sponsor config 480 | # 赞助设置 481 | [sponsor] 482 | bio = "If you find this post helpful, please consider sponsoring." 483 | enable = false 484 | link = "https://github.com/sponsors/HEIGE-PCloud" 485 | # custom = "" 486 | 487 | # TypeIt config 488 | # TypeIt 配置 489 | [typeit] 490 | # typing speed between each step (measured in milliseconds) 491 | # 每一步的打字速度 (单位是毫秒) 492 | speed = 100 493 | # blinking speed of the cursor (measured in milliseconds) 494 | # 光标的闪烁速度 (单位是毫秒) 495 | cursorSpeed = 1000 496 | # character used for the cursor (HTML format is supported) 497 | # 光标的字符 (支持 HTML 格式) 498 | cursorChar = "|" 499 | # cursor duration after typing finishing (measured in milliseconds, "-1" means unlimited) 500 | # 打字结束之后光标的持续时间 (单位是毫秒, "-1" 代表无限大) 501 | duration = -1 502 | 503 | # Site verification code for Google/Bing/Yandex/Pinterest/Baidu 504 | # 网站验证代码,用于 Google/Bing/Yandex/Pinterest/Baidu 505 | [verification] 506 | baidu = "" 507 | bing = "" 508 | google = "MQ8DNu27ayX6B_4ObiEDK09vGr1fdy7kOAnbd09hJk4" 509 | pinterest = "" 510 | so = "" 511 | sogou = "" 512 | yandex = "" 513 | 514 | # Site SEO config 515 | # 网站 SEO 配置 516 | [seo] 517 | # image URL 518 | # 图片 URL 519 | image = "/images/Apple-Devices-Preview.png" 520 | # thumbnail URL 521 | # 缩略图 URL 522 | thumbnailUrl = "/images/screenshot.png" 523 | 524 | # Analytics config 525 | # 网站分析配置 526 | [analytics] 527 | enable = false 528 | # Google Analytics 529 | [analytics.google] 530 | id = "" 531 | # whether to anonymize IP 532 | # 是否匿名化用户 IP 533 | anonymizeIP = true 534 | # Fathom Analytics 535 | [analytics.fathom] 536 | id = "" 537 | # server url for your tracker if you're self hosting 538 | # 自行托管追踪器时的主机路径 539 | server = "" 540 | # Baidu Analytics 541 | [analytics.baidu] 542 | id = "" 543 | # Umami Analytics 544 | [analytics.umami] 545 | data_domains = "" 546 | data_website_id = "" 547 | src = "" 548 | # Plausible Analytics 549 | [analytics.plausible] 550 | data_domain = "" 551 | src = "" 552 | # Cloudflare Analytics 553 | [analytics.cloudflare] 554 | token = "" 555 | 556 | # Cookie consent config 557 | # Cookie 许可配置 558 | [cookieconsent] 559 | enable = false 560 | # text strings used for Cookie consent banner 561 | # 用于 Cookie 许可横幅的文本字符串 562 | [cookieconsent.content] 563 | dismiss = "" 564 | link = "" 565 | message = "" 566 | 567 | # CDN config for third-party library files 568 | # 第三方库文件的 CDN 设置 569 | [cdn] 570 | # CDN data file name, disabled by default 571 | # ("jsdelivr.yml") 572 | # located in "themes/DoIt/assets/data/cdn/" directory 573 | # you can store your own data files in the same path under your project: 574 | # "assets/data/cdn/" 575 | # CDN 数据文件名称, 默认不启用 576 | # ("jsdelivr.yml") 577 | # 位于 "themes/DoIt/assets/data/cdn/" 目录 578 | # 可以在你的项目下相同路径存放你自己的数据文件: 579 | # "assets/data/cdn/" 580 | data = "" 581 | 582 | # Compatibility config 583 | # 兼容性设置 584 | [compatibility] 585 | # whether to use Polyfill.io to be compatible with older browsers 586 | # 是否使用 Polyfill.io 来兼容旧式浏览器 587 | polyfill = false 588 | # whether to use object-fit-images to be compatible with older browsers 589 | # 是否使用 object-fit-images 来兼容旧式浏览器 590 | objectFit = false 591 | -------------------------------------------------------------------------------- /config/DoIt/privacy.toml: -------------------------------------------------------------------------------- 1 | # Privacy config (https://gohugo.io/about/hugo-and-gdpr/) 2 | # 隐私信息配置 (https://gohugo.io/about/hugo-and-gdpr/) 3 | # privacy of the Google Analytics (replaced by params.analytics.google) 4 | # Google Analytics 相关隐私 (被 params.analytics.google 替代) 5 | [googleAnalytics] 6 | # ... 7 | [twitter] 8 | enableDNT = true 9 | [youtube] 10 | privacyEnhanced = true 11 | -------------------------------------------------------------------------------- /config/DoIt/sitemap.toml: -------------------------------------------------------------------------------- 1 | # Sitemap config 2 | # 网站地图配置 3 | changefreq = "weekly" 4 | filename = "sitemap.xml" 5 | priority = 0.5 6 | -------------------------------------------------------------------------------- /config/DoIt/taxonomies.toml: -------------------------------------------------------------------------------- 1 | # Options for taxonomies 2 | # 用于分类的设置 3 | author = "authors" 4 | category = "categories" 5 | tag = "tags" 6 | series = "series" 7 | -------------------------------------------------------------------------------- /config/_default/config.toml: -------------------------------------------------------------------------------- 1 | baseURL = "https://example.org/" 2 | languageCode = "en-us" 3 | title = "My New Hugo Site" 4 | theme = "DoIt" 5 | -------------------------------------------------------------------------------- /config/_default/markup.toml: -------------------------------------------------------------------------------- 1 | defaultMarkdownHandler = 'goldmark' 2 | [asciidocExt] 3 | backend = 'html5' 4 | extensions = [] 5 | failureLevel = 'fatal' 6 | noHeaderOrFooter = true 7 | preserveTOC = false 8 | safeMode = 'unsafe' 9 | sectionNumbers = false 10 | trace = false 11 | verbose = false 12 | workingFolderCurrent = false 13 | [asciidocExt.attributes] 14 | [goldmark] 15 | [goldmark.extensions] 16 | definitionList = true 17 | footnote = true 18 | linkify = true 19 | linkifyProtocol = 'https' 20 | strikethrough = true 21 | table = true 22 | taskList = true 23 | typographer = true 24 | [goldmark.extensions.passthrough] 25 | enable = true 26 | [goldmark.extensions.passthrough.delimiters] 27 | block = [['\[', '\]']] 28 | inline = [['\(', '\)']] 29 | [goldmark.parser] 30 | autoHeadingID = true 31 | autoHeadingIDType = 'github' 32 | [goldmark.parser.attribute] 33 | block = false 34 | title = true 35 | [goldmark.renderer] 36 | hardWraps = false 37 | unsafe = true 38 | xhtml = false 39 | [highlight] 40 | anchorLineNos = false 41 | codeFences = true 42 | guessSyntax = true 43 | hl_Lines = '' 44 | hl_inline = false 45 | lineAnchors = '' 46 | lineNoStart = 1 47 | lineNos = true 48 | lineNumbersInTable = true 49 | noClasses = false 50 | noHl = false 51 | style = 'monokai' 52 | tabWidth = 4 53 | [tableOfContents] 54 | endLevel = 3 55 | ordered = false 56 | startLevel = 2 57 | -------------------------------------------------------------------------------- /config/_default/params.toml: -------------------------------------------------------------------------------- 1 | version = "0.3.X" 2 | [page] 3 | [page.math] 4 | enable = true 5 | blockLeftDelimiter = "\\[" 6 | blockRightDelimiter = "\\]" 7 | inlineLeftDelimiter = "\\(" 8 | inlineRightDelimiter = "\\)" 9 | copyTex = true 10 | mhchem = true 11 | -------------------------------------------------------------------------------- /config/_default/permalinks.toml: -------------------------------------------------------------------------------- 1 | # These permalinks settings are used to make post links cleaner 2 | # https://gohugo.io/content-management/urls/#permalinks-configuration-example 3 | '/' = ":title" 4 | posts = ":sections/:title" 5 | -------------------------------------------------------------------------------- /content/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HEIGE-PCloud/Notion-Hugo/4d2b60ae67ccab46a0e82c4e7c6c41381dbe08bc/content/.gitkeep -------------------------------------------------------------------------------- /content/About-45eb121158b9489480ec000fd25c812b.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "About" 3 | date: "2022-09-01T10:33:00.000Z" 4 | lastmod: "2024-12-20T16:27:00.000Z" 5 | draft: false 6 | authors: 7 | - "PCloud" 8 | NOTION_METADATA: 9 | object: "page" 10 | id: "45eb1211-58b9-4894-80ec-000fd25c812b" 11 | created_time: "2022-09-01T10:33:00.000Z" 12 | last_edited_time: "2024-12-20T16:27:00.000Z" 13 | created_by: 14 | object: "user" 15 | id: "657d1c71-eca5-475d-b9d3-3669efd38ab9" 16 | last_edited_by: 17 | object: "user" 18 | id: "657d1c71-eca5-475d-b9d3-3669efd38ab9" 19 | cover: null 20 | icon: null 21 | parent: 22 | type: "page_id" 23 | page_id: "04bcc51c-fe4c-4993-8229-c35e4f0a6fb6" 24 | archived: false 25 | in_trash: false 26 | properties: 27 | title: 28 | id: "title" 29 | type: "title" 30 | title: 31 | - type: "text" 32 | text: 33 | content: "About" 34 | link: null 35 | annotations: 36 | bold: false 37 | italic: false 38 | strikethrough: false 39 | underline: false 40 | code: false 41 | color: "default" 42 | plain_text: "About" 43 | href: null 44 | url: "https://www.notion.so/About-45eb121158b9489480ec000fd25c812b" 45 | public_url: "https://pcloud.notion.site/About-45eb121158b9489480ec000fd25c812b" 46 | request_id: "4e8e9b11-e0c2-40ca-a464-50593d7eecf3" 47 | MANAGED_BY_NOTION_HUGO: true 48 | 49 | --- 50 | 51 | 52 | > :(far fa-edit fa-fw): DoIt is a clean, elegant but advanced blog theme for Hugo developed by HEIGE-PCloud. 53 | > It is based on the [LoveIt Theme](https://github.com/dillonzq/LoveIt), [LeaveIt Theme](https://github.com/liuzc/LeaveIt) and [KeepIt Theme](https://github.com/Fastbyte01/KeepIt). 54 | 55 | 56 | ## Features 57 | 58 | 59 | ### Performance and SEO 60 | 61 | - 🚀 Optimized for **performance**: [99]/[100] on mobile and [100]/[100] on desktop in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights) 62 | - 🔍 Optimized SEO performance with a correct **SEO SCHEMA** based on JSON-LD 63 | - 📈 [**Google Analytics**](https://analytics.google.com/analytics) supported 64 | - 📈 [**Fathom Analytics**](https://usefathom.com/) supported 65 | - 📈 [**Baidu Analytics**](https://tongji.baidu.com/) supported 66 | - 📈 [**Umami Analytics**](https://umami.is/) supported 67 | - 📈 [**Plausible Analytics**](https://plausible.io/) supported 68 | - :(fas fa-search fa-fw): Search engine **verification** supported (Google, Bind, Yandex and Baidu) 69 | - :(fas fa-tachometer-alt fa-fw): **CDN** for third-party libraries supported 70 | - :(fas fa-cloud-download-alt fa-fw): Automatically converted images with **Lazy Load** by [lazysizes](https://github.com/aFarkas/lazysizes) 71 | 72 | ### Appearance and Layout 73 | 74 | - [:(fas fa-desktop):]/[:(fas fa-mobile):] **Responsive** layout 75 | - [:(fas fa-sun):]/[:(fas fa-moon):] **[Light]/[Dark]** mode 76 | - :(fas fa-layer-group fa-fw): Globally consistent **design language** 77 | - :(fas fa-ellipsis-h fa-fw): **Pagination** supported 78 | - :(far fa-list-alt fa-fw): Easy-to-use and self-expanding **table of contents** 79 | - :(fas fa-language fa-fw): **Multilanguage** supported and i18n ready 80 | - :(fab fa-css3-alt fa-fw): Beautiful **CSS animation** 81 | 82 | ### Social and Comment Systems 83 | 84 | - :(far fa-user fa-fw): **Gravatar** supported by [Gravatar](https://gravatar.com/) 85 | - :(fas fa-user-circle fa-fw): Local **Avatar** supported 86 | - :(far fa-id-card fa-fw): Up to **64** social links supported 87 | - :(fas fa-share-square fa-fw): Up to **28** share sites supported 88 | - :(far fa-comment fa-fw): **Disqus** comment system supported by [Disqus](https://disqus.com/) 89 | - :(far fa-comment-dots fa-fw): **Gitalk** comment system supported by [Gitalk](https://github.com/gitalk/gitalk) 90 | - :(far fa-comment-alt fa-fw): **Valine** comment system supported by [Valine](https://valine.js.org/) 91 | - :(far fa-comment-alt fa-fw): **Waline** comment system supported by [Waline](https://waline.js.org/) 92 | - :(far fa-comments fa-fw): **Facebook comments** system supported by [Facebook](https://developers.facebook.com/docs/plugins/comments/) 93 | - :(fas fa-comment fa-fw): **Telegram comments** system supported by [Comments](https://comments.app/) 94 | - :(fas fa-comment-dots fa-fw): **Commento** comment system supported by [Commento](https://commento.io/) 95 | - :(fas fa-comment-alt fa-fw): **Utterances** comment system supported by [Utterances](https://utteranc.es/) 96 | - :(fas fa-comment-alt fa-fw): **Twikoo** comment system supported by [Twikoo](https://twikoo.js.org/) 97 | - :(fas fa-comment-alt fa-fw): **Vssue** comment system supported by [Vssue](https://vssue.js.org/) 98 | - :(fas fa-comment-alt fa-fw): **Remark42** comment system supported by [Remark42](https://remark42.com/) 99 | - :(fas fa-gem fa-fw): **giscus** comment system supported by [giscus](https://giscus.app/) 100 | 101 | ### Extended Features 102 | 103 | - :(fas fa-search fa-fw): **Search** supported by [Lunr.js](https://lunrjs.com/) or [algolia](https://www.algolia.com/) or [Fuse.js](https://fusejs.io/) 104 | - :(far fa-grin-tongue-wink fa-fw): **Twemoji** supported 105 | - :(fas fa-code fa-fw): Automatically **highlighting** code 106 | - :(far fa-copy fa-fw): **Copy code** to clipboard with one click 107 | - :(far fa-images fa-fw): **Images gallery** supported by [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js) 108 | - :(fab fa-font-awesome fa-fw): Extended Markdown syntax for [**Font Awesome**](https://fontawesome.com/)** icons** 109 | - :(far fa-sticky-note fa-fw): Extended Markdown syntax for **ruby annotation** 110 | - :(fas fa-percentage fa-fw): Extended Markdown syntax for **fraction** 111 | - :(fas fa-square-root-alt fa-fw): **Mathematical formula** supported by [$ $](https://katex.org/) 112 | - :(fas fa-project-diagram fa-fw): **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid) 113 | - :(fas fa-chart-pie fa-fw): **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/) 114 | - :(fas fa-map-marked-alt fa-fw): **Mapbox** shortcode supported by [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js) 115 | - :(fas fa-music fa-fw): **Music player** shortcode supported by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS) 116 | - :(fas fa-video fa-fw): **Bilibili player** shortcode 117 | - :(far fa-bell fa-fw): Kinds of **admonitions** shortcode 118 | - :(fas fa-align-left fa-fw): **Custom style** shortcode 119 | - :(fab fa-js-square fa-fw): **Custom script** shortcode 120 | - :(fas fa-i-cursor fa-fw): **Animated typing** supported by [TypeIt](https://typeitjs.com/) 121 | - :(fas fa-cookie-bite fa-fw): **Cookie consent banner** supported by [cookieconsent](https://github.com/osano/cookieconsent) 122 | - … 123 | 124 | ## License 125 | 126 | 127 | DoIt is licensed under the **MIT** license. 128 | 129 | 130 | Check the [LICENSE file](https://github.com/HEIGE-PCloud/DoIt/blob/main/LICENSE) for details. 131 | 132 | 133 | Thanks to the authors of following resources included in the theme: 134 | 135 | - [normalize.css](https://github.com/necolas/normalize.css) 136 | - [Font Awesome](https://fontawesome.com/) 137 | - [Simple Icons](https://github.com/simple-icons/simple-icons) 138 | - [Animate.css](https://daneden.github.io/animate.css/) 139 | - [autocomplete.js](https://github.com/algolia/autocomplete.js) 140 | - [Lunr.js](https://lunrjs.com/) 141 | - [algoliasearch](https://github.com/algolia/algoliasearch-client-javascript) 142 | - [Fuse.js](https://fusejs.io/) 143 | - [lazysizes](https://github.com/aFarkas/lazysizes) 144 | - [object-fit-images](https://github.com/fregante/object-fit-images) 145 | - [Twemoji](https://github.com/twitter/twemoji) 146 | - [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js) 147 | - [clipboard.js](https://github.com/zenorocha/clipboard.js) 148 | - [Sharer.js](https://github.com/ellisonleao/sharer.js) 149 | - [TypeIt](https://typeitjs.com/) 150 | - \(\KaTeX\) 151 | - [mermaid](https://github.com/knsv/mermaid) 152 | - [ECharts](https://echarts.apache.org/) 153 | - [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js) 154 | - [APlayer](https://github.com/MoePlayer/APlayer) 155 | - [MetingJS](https://github.com/metowolf/MetingJS) 156 | - [Gitalk](https://github.com/gitalk/gitalk) 157 | - [Valine](https://valine.js.org/) 158 | - [Waline](https://waline.js.org/) 159 | - [Twikoo](https://twikoo.js.org/) 160 | - [Vssue](https://vssue.js.org/) 161 | - [cookieconsent](https://github.com/osano/cookieconsent) 162 | - [Pjax](https://github.com/PaperStrike/Pjax) 163 | - [Topbar](https://github.com/buunguyen/topbar) 164 | - [Remark42](https://remark42.com/) 165 | 166 | [Test Child Page](0e4a8fe1-2140-46ca-b1ef-3d658785f211) 167 | 168 | 169 | ## How I am feeling today 170 | 171 | 172 | ... 173 | 174 | 175 | ## What’s on my mind 176 | 177 | - ... 178 | - ... 179 | - ... 180 | 181 | ## Positive affirmation 182 | 183 | 184 | > ☀️ ... 185 | 186 | 187 | @2024-05-30 -> 2024-05-31 188 | 189 | -------------------------------------------------------------------------------- /content/posts/Markdown-33dbd8d965f74930a804b8b50f375cbb.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Markdown" 3 | date: "2022-09-02T18:27:00.000Z" 4 | lastmod: "2024-12-20T17:56:00.000Z" 5 | draft: false 6 | featuredImage: "https://www.notion.so/images/page-cover/woodcuts_1.jpg" 7 | series: [] 8 | authors: 9 | - "PCloud" 10 | custom-front-matter: "hello" 11 | tags: [] 12 | categories: [] 13 | NOTION_METADATA: 14 | object: "page" 15 | id: "33dbd8d9-65f7-4930-a804-b8b50f375cbb" 16 | created_time: "2022-09-02T18:27:00.000Z" 17 | last_edited_time: "2024-12-20T17:56:00.000Z" 18 | created_by: 19 | object: "user" 20 | id: "657d1c71-eca5-475d-b9d3-3669efd38ab9" 21 | last_edited_by: 22 | object: "user" 23 | id: "657d1c71-eca5-475d-b9d3-3669efd38ab9" 24 | cover: 25 | type: "external" 26 | external: 27 | url: "https://www.notion.so/images/page-cover/woodcuts_1.jpg" 28 | icon: null 29 | parent: 30 | type: "database_id" 31 | database_id: "b7b1816c-05ec-4643-91c8-c111fa242985" 32 | archived: false 33 | in_trash: false 34 | properties: 35 | series: 36 | id: "B%3C%3FS" 37 | type: "multi_select" 38 | multi_select: [] 39 | draft: 40 | id: "JiWU" 41 | type: "checkbox" 42 | checkbox: false 43 | authors: 44 | id: "bK%3B%5B" 45 | type: "people" 46 | people: 47 | - object: "user" 48 | id: "657d1c71-eca5-475d-b9d3-3669efd38ab9" 49 | name: "PCloud" 50 | avatar_url: "https://s3-us-west-2.amazonaws.com/public.notion-static.com/1a0f7d\ 51 | 04-9a04-49c9-9ac2-670b2bf4e33c/IMG_0309.jpg" 52 | type: "person" 53 | person: {} 54 | custom-front-matter: 55 | id: "c~kA" 56 | type: "rich_text" 57 | rich_text: 58 | - type: "text" 59 | text: 60 | content: "hello" 61 | link: null 62 | annotations: 63 | bold: false 64 | italic: false 65 | strikethrough: false 66 | underline: false 67 | code: false 68 | color: "default" 69 | plain_text: "hello" 70 | href: null 71 | tags: 72 | id: "jw%7CC" 73 | type: "multi_select" 74 | multi_select: [] 75 | categories: 76 | id: "nbY%3F" 77 | type: "multi_select" 78 | multi_select: [] 79 | Last edited time: 80 | id: "vbGE" 81 | type: "last_edited_time" 82 | last_edited_time: "2024-12-20T17:56:00.000Z" 83 | summary: 84 | id: "x%3AlD" 85 | type: "rich_text" 86 | rich_text: [] 87 | Name: 88 | id: "title" 89 | type: "title" 90 | title: 91 | - type: "text" 92 | text: 93 | content: "Markdown" 94 | link: null 95 | annotations: 96 | bold: false 97 | italic: false 98 | strikethrough: false 99 | underline: false 100 | code: false 101 | color: "default" 102 | plain_text: "Markdown" 103 | href: null 104 | url: "https://www.notion.so/Markdown-33dbd8d965f74930a804b8b50f375cbb" 105 | public_url: "https://pcloud.notion.site/Markdown-33dbd8d965f74930a804b8b50f375cbb" 106 | MANAGED_BY_NOTION_HUGO: true 107 | 108 | --- 109 | 110 | 111 | # Heading 1 112 | 113 | 114 | Link to [GitHub](https://github.com/) 115 | 116 | 117 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut sagittis commodo mauris, id semper ipsum condimentum sed. Nunc quam velit, malesuada et finibus a, laoreet vitae lacus. Morbi in augue sodales, semper tellus sed, scelerisque lacus. Pellentesque eu turpis non eros tristique malesuada. Quisque et magna eget lectus aliquet tempus. Donec ut nisl quis mauris tristique tincidunt. Sed eleifend facilisis enim, et gravida orci. Morbi erat ligula, commodo ut sapien non, blandit lacinia sem. 118 | 119 | 120 | --- 121 | 122 | 123 | ## Heading 2 124 | 125 | 126 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut sagittis commodo mauris, id semper ipsum condimentum sed. Nunc quam velit, malesuada et finibus a, laoreet vitae lacus. Morbi in augue sodales, semper tellus sed, scelerisque lacus. Pellentesque eu turpis non eros tristique malesuada. Quisque et magna eget lectus aliquet tempus. Donec ut nisl quis mauris tristique tincidunt. Sed eleifend facilisis enim, et gravida orci. Morbi erat ligula, commodo ut sapien non, blandit lacinia sem. 127 | 128 | 129 | --- 130 | 131 | 132 | ### Heading 3 133 | 134 | 135 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut sagittis commodo mauris, id semper ipsum condimentum sed. Nunc quam velit, malesuada et finibus a, laoreet vitae lacus. Morbi in augue sodales, semper tellus sed, scelerisque lacus. Pellentesque eu turpis non eros tristique malesuada. Quisque et magna eget lectus aliquet tempus. Donec ut nisl quis mauris tristique tincidunt. Sed eleifend facilisis enim, et gravida orci. Morbi erat ligula, commodo ut sapien non, blandit lacinia sem. 136 | 137 | 138 | --- 139 | 140 | - [ ] To-do 1 141 | - [ ] To-do 2 142 | - [ ] To-do 3 143 | - [x] To-do completed 1 144 | - [x] To-do completed 2 145 | - [x] To-do completed 3 146 | 147 | --- 148 | 149 | 1. Ordered list 1 150 | 1. Ordered list 2 151 | 1. Ordered list 3 152 | 153 | --- 154 | 155 | - Unordered list 1 156 | - Unordered list 2 157 | - Unordered list 3 158 | 159 | --- 160 | 161 | 162 | | 11 | 12 | 13 | 163 | | -- | -- | -- | 164 | | 21 | 22 | 23 | 165 | | 31 | 32 | 33 | 166 | 167 | 168 | --- 169 | 170 | 171 | 172 | Toggle list 173 | 174 | 175 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut sagittis commodo mauris, id semper ipsum condimentum sed. Nunc quam velit, malesuada et finibus a, laoreet vitae lacus. Morbi in augue sodales, semper tellus sed, scelerisque lacus. Pellentesque eu turpis non eros tristique malesuada. Quisque et magna eget lectus aliquet tempus. Donec ut nisl quis mauris tristique tincidunt. Sed eleifend facilisis enim, et gravida orci. Morbi erat ligula, commodo ut sapien non, blandit lacinia sem. 176 | 177 | 1. Ordered list 1 178 | 1. Ordered list 2 179 | 1. Ordered list 3 180 | 181 | | 11 | 12 | 13 | 182 | | -- | -- | -- | 183 | | 21 | 22 | 23 | 184 | | 31 | 32 | 33 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | --- 192 | 193 | 194 | > Quote 1 195 | > Quote 2 196 | 197 | 198 | --- 199 | 200 | 201 | > 💡 Callout 202 | > Callout content 203 | > 204 | > > 💡 Inner Callout 205 | 206 | 207 | --- 208 | 209 | 210 | ## Mentions 211 | 212 | 213 | @2022-09-03T00:00:00.000+01:00 -> 2022-09-21T02:00:00.000+01:00 214 | 215 | 216 | Hello @PCloud! 217 | 218 | 219 | [Markdown]({{% relref "Markdown-33dbd8d965f74930a804b8b50f375cbb.md" %}}) 220 | 221 | 222 | --- 223 | 224 | 225 | ## Image 226 | 227 | 228 | ### Internal 229 | 230 | 231 |  232 | 233 | 234 | ### External 235 | 236 | 237 |  238 | 239 | 240 | --- 241 | 242 | 243 | ## Bookmark 244 | 245 | 246 | [DoIt](https://notion.hugodoit.com) 247 | 248 | 249 | --- 250 | 251 | 252 | ## Video 253 | 254 | 255 | File 256 | 257 | 258 | 259 | 260 | 261 | Your browser does not support HTML5 video. Here is a 262 | link to the video instead. 263 | 264 | 265 | 266 | 267 | YouTube 268 | 269 | 270 | 271 | 272 | 273 | --- 274 | 275 | 276 | ## Audio 277 | 278 | 279 | 280 | 281 | 282 | --- 283 | 284 | 285 | ## Code 286 | 287 | 288 | ```c 289 | #include 290 | 291 | int main() { 292 | printf("Hello world!") 293 | } 294 | ``` 295 | 296 | 297 | --- 298 | 299 | 300 | ## PDF 301 | 302 | 303 | 304 | 305 | 306 | ## File 307 | 308 | 309 | [Living-Guide.pdf](https://notion-hugo.pages.dev/api?block_id=72338466-bf1f-4670-926b-4a0796a7b4df) 310 | 311 | 312 | --- 313 | 314 | 315 | ```mermaid 316 | graph TD 317 | Mermaid --> Diagram 318 | ``` 319 | 320 | 321 | ## Embed 322 | 323 | 324 | [https://twitter.com/NoContextBrits/status/1561790234811146243](https://twitter.com/NoContextBrits/status/1561790234811146243) 325 | 326 | 327 | [https://github.com/](https://github.com/) 328 | 329 | 330 | ## Maths 331 | 332 | 333 | Inline maths equation: \(c = \pm\sqrt{a^2 + b^2}\) 334 | 335 | 336 | Block maths equation: 337 | 338 | 339 | \[c = \pm\sqrt{a^2 + b^2}\] 340 | 341 | -------------------------------------------------------------------------------- /data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HEIGE-PCloud/Notion-Hugo/4d2b60ae67ccab46a0e82c4e7c6c41381dbe08bc/data/.gitkeep -------------------------------------------------------------------------------- /functions/api.ts: -------------------------------------------------------------------------------- 1 | import { Client, isFullBlock, isFullPage } from "@notionhq/client"; 2 | import { BlockObjectResponse } from "@notionhq/client/build/src/api-endpoints"; 3 | interface Env { 4 | KV: KVNamespace; 5 | NOTION_TOKEN?: string; 6 | CF_PAGES_URL: string; 7 | } 8 | 9 | type CacheEntry = { 10 | url: string; // An authenticated S3 URL to the file. The URL is valid for one hour. If the link expires, then you can send an API request to get an updated URL. 11 | expiry_time: string; // The date and time when the link expires, formatted as an ISO 8601 date time string. 12 | }; 13 | 14 | function getFile( 15 | block: BlockObjectResponse, 16 | ): { url: string; expiry_time: string } | null { 17 | return block[block.type].file; 18 | } 19 | 20 | async function getCachedData( 21 | cache: KVNamespace, 22 | key: string, 23 | ): Promise { 24 | const cache_entry = await cache.get(key, { type: "json" }); 25 | if (cache_entry === null) { 26 | return null; 27 | } 28 | const expiry_time = new Date(cache_entry.expiry_time); 29 | if (expiry_time < new Date()) { 30 | return null; 31 | } 32 | return cache_entry; 33 | } 34 | 35 | async function setCachedData( 36 | cache: KVNamespace, 37 | key: string, 38 | data: CacheEntry, 39 | ): Promise { 40 | await cache.put(key, JSON.stringify(data), { expirationTtl: 3600 }); 41 | } 42 | 43 | export const onRequest: PagesFunction = async (context) => { 44 | const url = new URL(context.request.url); 45 | 46 | const blockId = url.searchParams.get("block_id"); 47 | const pageId = url.searchParams.get("page_id"); 48 | if (!blockId && !pageId) { 49 | return new Response("block_id or page_id is required", { status: 400 }); 50 | } 51 | 52 | const NOTION_TOKEN = context.env.NOTION_TOKEN; 53 | if (!NOTION_TOKEN) { 54 | return new Response("NOTION_TOKEN is not set as an environment variable", { 55 | status: 400, 56 | }); 57 | } 58 | 59 | const notion = new Client({ auth: context.env.NOTION_TOKEN }); 60 | 61 | const cacheData = await getCachedData(context.env.KV, pageId ?? blockId); 62 | if (cacheData) { 63 | return Response.redirect(cacheData.url, 302); 64 | } 65 | 66 | if (blockId) { 67 | const block = await notion.blocks.retrieve({ block_id: blockId }); 68 | 69 | if (!isFullBlock(block)) { 70 | return new Response("Failed to retreve block", { status: 400 }); 71 | } 72 | 73 | const file = getFile(block); 74 | if (!file) { 75 | return new Response("No file url found", { 76 | status: 400, 77 | }); 78 | } 79 | 80 | await setCachedData(context.env.KV, blockId, file); 81 | return Response.redirect(file.url, 302); 82 | } else { 83 | const page = await notion.pages.retrieve({ page_id: pageId }); 84 | 85 | if (!isFullPage(page)) { 86 | return new Response("Failed to retrieve page", { status: 400 }); 87 | } 88 | 89 | if (!page.cover) { 90 | return new Response("No cover found", { status: 400 }); 91 | } 92 | 93 | if (page.cover.type === "external") { 94 | return new Response("External cover is not supported", { status: 400 }); 95 | } 96 | 97 | await setCachedData(context.env.KV, pageId, page.cover.file); 98 | return Response.redirect(page.cover.file.url, 302); 99 | } 100 | }; 101 | -------------------------------------------------------------------------------- /functions/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "esnext", 5 | "lib": ["esnext"], 6 | "types": ["@cloudflare/workers-types"], 7 | "moduleResolution": "node" 8 | } 9 | } -------------------------------------------------------------------------------- /layouts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HEIGE-PCloud/Notion-Hugo/4d2b60ae67ccab46a0e82c4e7c6c41381dbe08bc/layouts/.gitkeep -------------------------------------------------------------------------------- /layouts/shortcodes/math.html: -------------------------------------------------------------------------------- 1 | {{ .Inner }} -------------------------------------------------------------------------------- /layouts/shortcodes/notion-unsupported-block.html: -------------------------------------------------------------------------------- 1 | {{- warnf "Unsupported Notion block type: %s. This block will be ignored. Source %s" (.Get "type") .Position -}} -------------------------------------------------------------------------------- /notion-hugo.config.ts: -------------------------------------------------------------------------------- 1 | import { UserConfig } from "./src/config" 2 | 3 | const userConfig: UserConfig = { 4 | base_url: "https://notion-hugo.pages.dev", 5 | mount: { 6 | manual: false, 7 | page_url: 'https://pcloud.notion.site/Notion-DoIt-04bcc51cfe4c49938229c35e4f0a6fb6', 8 | pages: [ 9 | // { 10 | // page_id: '', 11 | // target_folder: 'path/relative/to/content/folder' 12 | // } 13 | { 14 | page_id: '45eb121158b9489480ec000fd25c812b', 15 | target_folder: '.' 16 | } 17 | ], 18 | databases: [ 19 | // { 20 | // database_id: '', 21 | // target_folder: 'path/relative/to/content/folder' 22 | // } 23 | { 24 | database_id: 'b7b1816c05ec464391c8c111fa242985', 25 | target_folder: '.' 26 | } 27 | ], 28 | } 29 | } 30 | 31 | export default userConfig; -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "notion-doit", 3 | "version": "0.0.1", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "notion-doit", 9 | "version": "0.0.1", 10 | "license": "GPL-3.0-only", 11 | "dependencies": { 12 | "@notionhq/client": "^3.1.3", 13 | "dotenv": "^16.5.0", 14 | "front-matter": "^4.0.2", 15 | "fs-extra": "^11.3.0", 16 | "markdown-table": "^3.0.4", 17 | "tsx": "^4.19.4", 18 | "yaml": "^2.8.0" 19 | }, 20 | "devDependencies": { 21 | "@cloudflare/workers-types": "^4.20250601.0", 22 | "@types/fs-extra": "^11.0.4", 23 | "@types/node": "^22.15.29", 24 | "prettier": "^3.5.3", 25 | "typescript": "^5.8.3" 26 | }, 27 | "engines": { 28 | "node": ">=16", 29 | "npm": ">=8" 30 | } 31 | }, 32 | "node_modules/@cloudflare/workers-types": { 33 | "version": "4.20250601.0", 34 | "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250601.0.tgz", 35 | "integrity": "sha512-foAgsuo+u+swy5I+xzPwo4MquPhLZW0fuLLsl4uZlZv2k10WziSvZ4wTIkK/AADFtCVRjLNduTT8E/b7DDoInA==", 36 | "dev": true, 37 | "license": "MIT OR Apache-2.0" 38 | }, 39 | "node_modules/@esbuild/aix-ppc64": { 40 | "version": "0.25.0", 41 | "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz", 42 | "integrity": "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==", 43 | "cpu": [ 44 | "ppc64" 45 | ], 46 | "license": "MIT", 47 | "optional": true, 48 | "os": [ 49 | "aix" 50 | ], 51 | "engines": { 52 | "node": ">=18" 53 | } 54 | }, 55 | "node_modules/@esbuild/android-arm": { 56 | "version": "0.25.0", 57 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.0.tgz", 58 | "integrity": "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==", 59 | "cpu": [ 60 | "arm" 61 | ], 62 | "license": "MIT", 63 | "optional": true, 64 | "os": [ 65 | "android" 66 | ], 67 | "engines": { 68 | "node": ">=18" 69 | } 70 | }, 71 | "node_modules/@esbuild/android-arm64": { 72 | "version": "0.25.0", 73 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.0.tgz", 74 | "integrity": "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==", 75 | "cpu": [ 76 | "arm64" 77 | ], 78 | "license": "MIT", 79 | "optional": true, 80 | "os": [ 81 | "android" 82 | ], 83 | "engines": { 84 | "node": ">=18" 85 | } 86 | }, 87 | "node_modules/@esbuild/android-x64": { 88 | "version": "0.25.0", 89 | "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.0.tgz", 90 | "integrity": "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==", 91 | "cpu": [ 92 | "x64" 93 | ], 94 | "license": "MIT", 95 | "optional": true, 96 | "os": [ 97 | "android" 98 | ], 99 | "engines": { 100 | "node": ">=18" 101 | } 102 | }, 103 | "node_modules/@esbuild/darwin-arm64": { 104 | "version": "0.25.0", 105 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.0.tgz", 106 | "integrity": "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==", 107 | "cpu": [ 108 | "arm64" 109 | ], 110 | "license": "MIT", 111 | "optional": true, 112 | "os": [ 113 | "darwin" 114 | ], 115 | "engines": { 116 | "node": ">=18" 117 | } 118 | }, 119 | "node_modules/@esbuild/darwin-x64": { 120 | "version": "0.25.0", 121 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.0.tgz", 122 | "integrity": "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==", 123 | "cpu": [ 124 | "x64" 125 | ], 126 | "license": "MIT", 127 | "optional": true, 128 | "os": [ 129 | "darwin" 130 | ], 131 | "engines": { 132 | "node": ">=18" 133 | } 134 | }, 135 | "node_modules/@esbuild/freebsd-arm64": { 136 | "version": "0.25.0", 137 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.0.tgz", 138 | "integrity": "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==", 139 | "cpu": [ 140 | "arm64" 141 | ], 142 | "license": "MIT", 143 | "optional": true, 144 | "os": [ 145 | "freebsd" 146 | ], 147 | "engines": { 148 | "node": ">=18" 149 | } 150 | }, 151 | "node_modules/@esbuild/freebsd-x64": { 152 | "version": "0.25.0", 153 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.0.tgz", 154 | "integrity": "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==", 155 | "cpu": [ 156 | "x64" 157 | ], 158 | "license": "MIT", 159 | "optional": true, 160 | "os": [ 161 | "freebsd" 162 | ], 163 | "engines": { 164 | "node": ">=18" 165 | } 166 | }, 167 | "node_modules/@esbuild/linux-arm": { 168 | "version": "0.25.0", 169 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.0.tgz", 170 | "integrity": "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==", 171 | "cpu": [ 172 | "arm" 173 | ], 174 | "license": "MIT", 175 | "optional": true, 176 | "os": [ 177 | "linux" 178 | ], 179 | "engines": { 180 | "node": ">=18" 181 | } 182 | }, 183 | "node_modules/@esbuild/linux-arm64": { 184 | "version": "0.25.0", 185 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.0.tgz", 186 | "integrity": "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==", 187 | "cpu": [ 188 | "arm64" 189 | ], 190 | "license": "MIT", 191 | "optional": true, 192 | "os": [ 193 | "linux" 194 | ], 195 | "engines": { 196 | "node": ">=18" 197 | } 198 | }, 199 | "node_modules/@esbuild/linux-ia32": { 200 | "version": "0.25.0", 201 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.0.tgz", 202 | "integrity": "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==", 203 | "cpu": [ 204 | "ia32" 205 | ], 206 | "license": "MIT", 207 | "optional": true, 208 | "os": [ 209 | "linux" 210 | ], 211 | "engines": { 212 | "node": ">=18" 213 | } 214 | }, 215 | "node_modules/@esbuild/linux-loong64": { 216 | "version": "0.25.0", 217 | "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.0.tgz", 218 | "integrity": "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==", 219 | "cpu": [ 220 | "loong64" 221 | ], 222 | "license": "MIT", 223 | "optional": true, 224 | "os": [ 225 | "linux" 226 | ], 227 | "engines": { 228 | "node": ">=18" 229 | } 230 | }, 231 | "node_modules/@esbuild/linux-mips64el": { 232 | "version": "0.25.0", 233 | "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.0.tgz", 234 | "integrity": "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==", 235 | "cpu": [ 236 | "mips64el" 237 | ], 238 | "license": "MIT", 239 | "optional": true, 240 | "os": [ 241 | "linux" 242 | ], 243 | "engines": { 244 | "node": ">=18" 245 | } 246 | }, 247 | "node_modules/@esbuild/linux-ppc64": { 248 | "version": "0.25.0", 249 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.0.tgz", 250 | "integrity": "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==", 251 | "cpu": [ 252 | "ppc64" 253 | ], 254 | "license": "MIT", 255 | "optional": true, 256 | "os": [ 257 | "linux" 258 | ], 259 | "engines": { 260 | "node": ">=18" 261 | } 262 | }, 263 | "node_modules/@esbuild/linux-riscv64": { 264 | "version": "0.25.0", 265 | "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.0.tgz", 266 | "integrity": "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==", 267 | "cpu": [ 268 | "riscv64" 269 | ], 270 | "license": "MIT", 271 | "optional": true, 272 | "os": [ 273 | "linux" 274 | ], 275 | "engines": { 276 | "node": ">=18" 277 | } 278 | }, 279 | "node_modules/@esbuild/linux-s390x": { 280 | "version": "0.25.0", 281 | "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.0.tgz", 282 | "integrity": "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==", 283 | "cpu": [ 284 | "s390x" 285 | ], 286 | "license": "MIT", 287 | "optional": true, 288 | "os": [ 289 | "linux" 290 | ], 291 | "engines": { 292 | "node": ">=18" 293 | } 294 | }, 295 | "node_modules/@esbuild/linux-x64": { 296 | "version": "0.25.0", 297 | "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.0.tgz", 298 | "integrity": "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==", 299 | "cpu": [ 300 | "x64" 301 | ], 302 | "license": "MIT", 303 | "optional": true, 304 | "os": [ 305 | "linux" 306 | ], 307 | "engines": { 308 | "node": ">=18" 309 | } 310 | }, 311 | "node_modules/@esbuild/netbsd-arm64": { 312 | "version": "0.25.0", 313 | "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.0.tgz", 314 | "integrity": "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==", 315 | "cpu": [ 316 | "arm64" 317 | ], 318 | "license": "MIT", 319 | "optional": true, 320 | "os": [ 321 | "netbsd" 322 | ], 323 | "engines": { 324 | "node": ">=18" 325 | } 326 | }, 327 | "node_modules/@esbuild/netbsd-x64": { 328 | "version": "0.25.0", 329 | "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.0.tgz", 330 | "integrity": "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==", 331 | "cpu": [ 332 | "x64" 333 | ], 334 | "license": "MIT", 335 | "optional": true, 336 | "os": [ 337 | "netbsd" 338 | ], 339 | "engines": { 340 | "node": ">=18" 341 | } 342 | }, 343 | "node_modules/@esbuild/openbsd-arm64": { 344 | "version": "0.25.0", 345 | "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.0.tgz", 346 | "integrity": "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==", 347 | "cpu": [ 348 | "arm64" 349 | ], 350 | "license": "MIT", 351 | "optional": true, 352 | "os": [ 353 | "openbsd" 354 | ], 355 | "engines": { 356 | "node": ">=18" 357 | } 358 | }, 359 | "node_modules/@esbuild/openbsd-x64": { 360 | "version": "0.25.0", 361 | "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.0.tgz", 362 | "integrity": "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==", 363 | "cpu": [ 364 | "x64" 365 | ], 366 | "license": "MIT", 367 | "optional": true, 368 | "os": [ 369 | "openbsd" 370 | ], 371 | "engines": { 372 | "node": ">=18" 373 | } 374 | }, 375 | "node_modules/@esbuild/sunos-x64": { 376 | "version": "0.25.0", 377 | "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.0.tgz", 378 | "integrity": "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==", 379 | "cpu": [ 380 | "x64" 381 | ], 382 | "license": "MIT", 383 | "optional": true, 384 | "os": [ 385 | "sunos" 386 | ], 387 | "engines": { 388 | "node": ">=18" 389 | } 390 | }, 391 | "node_modules/@esbuild/win32-arm64": { 392 | "version": "0.25.0", 393 | "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.0.tgz", 394 | "integrity": "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==", 395 | "cpu": [ 396 | "arm64" 397 | ], 398 | "license": "MIT", 399 | "optional": true, 400 | "os": [ 401 | "win32" 402 | ], 403 | "engines": { 404 | "node": ">=18" 405 | } 406 | }, 407 | "node_modules/@esbuild/win32-ia32": { 408 | "version": "0.25.0", 409 | "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.0.tgz", 410 | "integrity": "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==", 411 | "cpu": [ 412 | "ia32" 413 | ], 414 | "license": "MIT", 415 | "optional": true, 416 | "os": [ 417 | "win32" 418 | ], 419 | "engines": { 420 | "node": ">=18" 421 | } 422 | }, 423 | "node_modules/@esbuild/win32-x64": { 424 | "version": "0.25.0", 425 | "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.0.tgz", 426 | "integrity": "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==", 427 | "cpu": [ 428 | "x64" 429 | ], 430 | "license": "MIT", 431 | "optional": true, 432 | "os": [ 433 | "win32" 434 | ], 435 | "engines": { 436 | "node": ">=18" 437 | } 438 | }, 439 | "node_modules/@notionhq/client": { 440 | "version": "3.1.3", 441 | "resolved": "https://registry.npmjs.org/@notionhq/client/-/client-3.1.3.tgz", 442 | "integrity": "sha512-M2gVWoo1dIvBeX/Yc4fvQCVh2g3HQjOxKBWX472Qzma2VNMJV3cPLi0J0A4dmOlkcfNQLVXmhuh54zGHpptZ7g==", 443 | "license": "MIT", 444 | "engines": { 445 | "node": ">=18" 446 | } 447 | }, 448 | "node_modules/@types/fs-extra": { 449 | "version": "11.0.4", 450 | "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz", 451 | "integrity": "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==", 452 | "dev": true, 453 | "dependencies": { 454 | "@types/jsonfile": "*", 455 | "@types/node": "*" 456 | } 457 | }, 458 | "node_modules/@types/jsonfile": { 459 | "version": "6.1.1", 460 | "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.1.tgz", 461 | "integrity": "sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==", 462 | "dev": true, 463 | "dependencies": { 464 | "@types/node": "*" 465 | } 466 | }, 467 | "node_modules/@types/node": { 468 | "version": "22.15.29", 469 | "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.29.tgz", 470 | "integrity": "sha512-LNdjOkUDlU1RZb8e1kOIUpN1qQUlzGkEtbVNo53vbrwDg5om6oduhm4SiUaPW5ASTXhAiP0jInWG8Qx9fVlOeQ==", 471 | "dev": true, 472 | "license": "MIT", 473 | "dependencies": { 474 | "undici-types": "~6.21.0" 475 | } 476 | }, 477 | "node_modules/argparse": { 478 | "version": "1.0.10", 479 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 480 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 481 | "dependencies": { 482 | "sprintf-js": "~1.0.2" 483 | } 484 | }, 485 | "node_modules/dotenv": { 486 | "version": "16.5.0", 487 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz", 488 | "integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==", 489 | "license": "BSD-2-Clause", 490 | "engines": { 491 | "node": ">=12" 492 | }, 493 | "funding": { 494 | "url": "https://dotenvx.com" 495 | } 496 | }, 497 | "node_modules/esbuild": { 498 | "version": "0.25.0", 499 | "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz", 500 | "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==", 501 | "hasInstallScript": true, 502 | "license": "MIT", 503 | "bin": { 504 | "esbuild": "bin/esbuild" 505 | }, 506 | "engines": { 507 | "node": ">=18" 508 | }, 509 | "optionalDependencies": { 510 | "@esbuild/aix-ppc64": "0.25.0", 511 | "@esbuild/android-arm": "0.25.0", 512 | "@esbuild/android-arm64": "0.25.0", 513 | "@esbuild/android-x64": "0.25.0", 514 | "@esbuild/darwin-arm64": "0.25.0", 515 | "@esbuild/darwin-x64": "0.25.0", 516 | "@esbuild/freebsd-arm64": "0.25.0", 517 | "@esbuild/freebsd-x64": "0.25.0", 518 | "@esbuild/linux-arm": "0.25.0", 519 | "@esbuild/linux-arm64": "0.25.0", 520 | "@esbuild/linux-ia32": "0.25.0", 521 | "@esbuild/linux-loong64": "0.25.0", 522 | "@esbuild/linux-mips64el": "0.25.0", 523 | "@esbuild/linux-ppc64": "0.25.0", 524 | "@esbuild/linux-riscv64": "0.25.0", 525 | "@esbuild/linux-s390x": "0.25.0", 526 | "@esbuild/linux-x64": "0.25.0", 527 | "@esbuild/netbsd-arm64": "0.25.0", 528 | "@esbuild/netbsd-x64": "0.25.0", 529 | "@esbuild/openbsd-arm64": "0.25.0", 530 | "@esbuild/openbsd-x64": "0.25.0", 531 | "@esbuild/sunos-x64": "0.25.0", 532 | "@esbuild/win32-arm64": "0.25.0", 533 | "@esbuild/win32-ia32": "0.25.0", 534 | "@esbuild/win32-x64": "0.25.0" 535 | } 536 | }, 537 | "node_modules/esprima": { 538 | "version": "4.0.1", 539 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 540 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", 541 | "bin": { 542 | "esparse": "bin/esparse.js", 543 | "esvalidate": "bin/esvalidate.js" 544 | }, 545 | "engines": { 546 | "node": ">=4" 547 | } 548 | }, 549 | "node_modules/front-matter": { 550 | "version": "4.0.2", 551 | "resolved": "https://registry.npmjs.org/front-matter/-/front-matter-4.0.2.tgz", 552 | "integrity": "sha512-I8ZuJ/qG92NWX8i5x1Y8qyj3vizhXS31OxjKDu3LKP+7/qBgfIKValiZIEwoVoJKUHlhWtYrktkxV1XsX+pPlg==", 553 | "dependencies": { 554 | "js-yaml": "^3.13.1" 555 | } 556 | }, 557 | "node_modules/fs-extra": { 558 | "version": "11.3.0", 559 | "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz", 560 | "integrity": "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==", 561 | "license": "MIT", 562 | "dependencies": { 563 | "graceful-fs": "^4.2.0", 564 | "jsonfile": "^6.0.1", 565 | "universalify": "^2.0.0" 566 | }, 567 | "engines": { 568 | "node": ">=14.14" 569 | } 570 | }, 571 | "node_modules/fsevents": { 572 | "version": "2.3.3", 573 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", 574 | "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", 575 | "hasInstallScript": true, 576 | "license": "MIT", 577 | "optional": true, 578 | "os": [ 579 | "darwin" 580 | ], 581 | "engines": { 582 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 583 | } 584 | }, 585 | "node_modules/get-tsconfig": { 586 | "version": "4.8.1", 587 | "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.1.tgz", 588 | "integrity": "sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==", 589 | "license": "MIT", 590 | "dependencies": { 591 | "resolve-pkg-maps": "^1.0.0" 592 | }, 593 | "funding": { 594 | "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" 595 | } 596 | }, 597 | "node_modules/graceful-fs": { 598 | "version": "4.2.10", 599 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", 600 | "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" 601 | }, 602 | "node_modules/js-yaml": { 603 | "version": "3.14.1", 604 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", 605 | "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", 606 | "dependencies": { 607 | "argparse": "^1.0.7", 608 | "esprima": "^4.0.0" 609 | }, 610 | "bin": { 611 | "js-yaml": "bin/js-yaml.js" 612 | } 613 | }, 614 | "node_modules/jsonfile": { 615 | "version": "6.1.0", 616 | "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", 617 | "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", 618 | "dependencies": { 619 | "universalify": "^2.0.0" 620 | }, 621 | "optionalDependencies": { 622 | "graceful-fs": "^4.1.6" 623 | } 624 | }, 625 | "node_modules/markdown-table": { 626 | "version": "3.0.4", 627 | "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", 628 | "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==", 629 | "funding": { 630 | "type": "github", 631 | "url": "https://github.com/sponsors/wooorm" 632 | } 633 | }, 634 | "node_modules/prettier": { 635 | "version": "3.5.3", 636 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", 637 | "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", 638 | "dev": true, 639 | "license": "MIT", 640 | "bin": { 641 | "prettier": "bin/prettier.cjs" 642 | }, 643 | "engines": { 644 | "node": ">=14" 645 | }, 646 | "funding": { 647 | "url": "https://github.com/prettier/prettier?sponsor=1" 648 | } 649 | }, 650 | "node_modules/resolve-pkg-maps": { 651 | "version": "1.0.0", 652 | "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", 653 | "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", 654 | "license": "MIT", 655 | "funding": { 656 | "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" 657 | } 658 | }, 659 | "node_modules/sprintf-js": { 660 | "version": "1.0.3", 661 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 662 | "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" 663 | }, 664 | "node_modules/tsx": { 665 | "version": "4.19.4", 666 | "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.4.tgz", 667 | "integrity": "sha512-gK5GVzDkJK1SI1zwHf32Mqxf2tSJkNx+eYcNly5+nHvWqXUJYUkWBQtKauoESz3ymezAI++ZwT855x5p5eop+Q==", 668 | "license": "MIT", 669 | "dependencies": { 670 | "esbuild": "~0.25.0", 671 | "get-tsconfig": "^4.7.5" 672 | }, 673 | "bin": { 674 | "tsx": "dist/cli.mjs" 675 | }, 676 | "engines": { 677 | "node": ">=18.0.0" 678 | }, 679 | "optionalDependencies": { 680 | "fsevents": "~2.3.3" 681 | } 682 | }, 683 | "node_modules/typescript": { 684 | "version": "5.8.3", 685 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", 686 | "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", 687 | "dev": true, 688 | "license": "Apache-2.0", 689 | "bin": { 690 | "tsc": "bin/tsc", 691 | "tsserver": "bin/tsserver" 692 | }, 693 | "engines": { 694 | "node": ">=14.17" 695 | } 696 | }, 697 | "node_modules/undici-types": { 698 | "version": "6.21.0", 699 | "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", 700 | "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", 701 | "dev": true, 702 | "license": "MIT" 703 | }, 704 | "node_modules/universalify": { 705 | "version": "2.0.0", 706 | "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", 707 | "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", 708 | "engines": { 709 | "node": ">= 10.0.0" 710 | } 711 | }, 712 | "node_modules/yaml": { 713 | "version": "2.8.0", 714 | "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", 715 | "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", 716 | "license": "ISC", 717 | "bin": { 718 | "yaml": "bin.mjs" 719 | }, 720 | "engines": { 721 | "node": ">= 14.6" 722 | } 723 | } 724 | }, 725 | "dependencies": { 726 | "@cloudflare/workers-types": { 727 | "version": "4.20250601.0", 728 | "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250601.0.tgz", 729 | "integrity": "sha512-foAgsuo+u+swy5I+xzPwo4MquPhLZW0fuLLsl4uZlZv2k10WziSvZ4wTIkK/AADFtCVRjLNduTT8E/b7DDoInA==", 730 | "dev": true 731 | }, 732 | "@esbuild/aix-ppc64": { 733 | "version": "0.25.0", 734 | "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz", 735 | "integrity": "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==", 736 | "optional": true 737 | }, 738 | "@esbuild/android-arm": { 739 | "version": "0.25.0", 740 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.0.tgz", 741 | "integrity": "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==", 742 | "optional": true 743 | }, 744 | "@esbuild/android-arm64": { 745 | "version": "0.25.0", 746 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.0.tgz", 747 | "integrity": "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==", 748 | "optional": true 749 | }, 750 | "@esbuild/android-x64": { 751 | "version": "0.25.0", 752 | "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.0.tgz", 753 | "integrity": "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==", 754 | "optional": true 755 | }, 756 | "@esbuild/darwin-arm64": { 757 | "version": "0.25.0", 758 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.0.tgz", 759 | "integrity": "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==", 760 | "optional": true 761 | }, 762 | "@esbuild/darwin-x64": { 763 | "version": "0.25.0", 764 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.0.tgz", 765 | "integrity": "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==", 766 | "optional": true 767 | }, 768 | "@esbuild/freebsd-arm64": { 769 | "version": "0.25.0", 770 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.0.tgz", 771 | "integrity": "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==", 772 | "optional": true 773 | }, 774 | "@esbuild/freebsd-x64": { 775 | "version": "0.25.0", 776 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.0.tgz", 777 | "integrity": "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==", 778 | "optional": true 779 | }, 780 | "@esbuild/linux-arm": { 781 | "version": "0.25.0", 782 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.0.tgz", 783 | "integrity": "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==", 784 | "optional": true 785 | }, 786 | "@esbuild/linux-arm64": { 787 | "version": "0.25.0", 788 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.0.tgz", 789 | "integrity": "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==", 790 | "optional": true 791 | }, 792 | "@esbuild/linux-ia32": { 793 | "version": "0.25.0", 794 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.0.tgz", 795 | "integrity": "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==", 796 | "optional": true 797 | }, 798 | "@esbuild/linux-loong64": { 799 | "version": "0.25.0", 800 | "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.0.tgz", 801 | "integrity": "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==", 802 | "optional": true 803 | }, 804 | "@esbuild/linux-mips64el": { 805 | "version": "0.25.0", 806 | "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.0.tgz", 807 | "integrity": "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==", 808 | "optional": true 809 | }, 810 | "@esbuild/linux-ppc64": { 811 | "version": "0.25.0", 812 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.0.tgz", 813 | "integrity": "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==", 814 | "optional": true 815 | }, 816 | "@esbuild/linux-riscv64": { 817 | "version": "0.25.0", 818 | "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.0.tgz", 819 | "integrity": "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==", 820 | "optional": true 821 | }, 822 | "@esbuild/linux-s390x": { 823 | "version": "0.25.0", 824 | "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.0.tgz", 825 | "integrity": "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==", 826 | "optional": true 827 | }, 828 | "@esbuild/linux-x64": { 829 | "version": "0.25.0", 830 | "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.0.tgz", 831 | "integrity": "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==", 832 | "optional": true 833 | }, 834 | "@esbuild/netbsd-arm64": { 835 | "version": "0.25.0", 836 | "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.0.tgz", 837 | "integrity": "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==", 838 | "optional": true 839 | }, 840 | "@esbuild/netbsd-x64": { 841 | "version": "0.25.0", 842 | "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.0.tgz", 843 | "integrity": "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==", 844 | "optional": true 845 | }, 846 | "@esbuild/openbsd-arm64": { 847 | "version": "0.25.0", 848 | "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.0.tgz", 849 | "integrity": "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==", 850 | "optional": true 851 | }, 852 | "@esbuild/openbsd-x64": { 853 | "version": "0.25.0", 854 | "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.0.tgz", 855 | "integrity": "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==", 856 | "optional": true 857 | }, 858 | "@esbuild/sunos-x64": { 859 | "version": "0.25.0", 860 | "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.0.tgz", 861 | "integrity": "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==", 862 | "optional": true 863 | }, 864 | "@esbuild/win32-arm64": { 865 | "version": "0.25.0", 866 | "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.0.tgz", 867 | "integrity": "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==", 868 | "optional": true 869 | }, 870 | "@esbuild/win32-ia32": { 871 | "version": "0.25.0", 872 | "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.0.tgz", 873 | "integrity": "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==", 874 | "optional": true 875 | }, 876 | "@esbuild/win32-x64": { 877 | "version": "0.25.0", 878 | "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.0.tgz", 879 | "integrity": "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==", 880 | "optional": true 881 | }, 882 | "@notionhq/client": { 883 | "version": "3.1.3", 884 | "resolved": "https://registry.npmjs.org/@notionhq/client/-/client-3.1.3.tgz", 885 | "integrity": "sha512-M2gVWoo1dIvBeX/Yc4fvQCVh2g3HQjOxKBWX472Qzma2VNMJV3cPLi0J0A4dmOlkcfNQLVXmhuh54zGHpptZ7g==" 886 | }, 887 | "@types/fs-extra": { 888 | "version": "11.0.4", 889 | "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz", 890 | "integrity": "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==", 891 | "dev": true, 892 | "requires": { 893 | "@types/jsonfile": "*", 894 | "@types/node": "*" 895 | } 896 | }, 897 | "@types/jsonfile": { 898 | "version": "6.1.1", 899 | "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.1.tgz", 900 | "integrity": "sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==", 901 | "dev": true, 902 | "requires": { 903 | "@types/node": "*" 904 | } 905 | }, 906 | "@types/node": { 907 | "version": "22.15.29", 908 | "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.29.tgz", 909 | "integrity": "sha512-LNdjOkUDlU1RZb8e1kOIUpN1qQUlzGkEtbVNo53vbrwDg5om6oduhm4SiUaPW5ASTXhAiP0jInWG8Qx9fVlOeQ==", 910 | "dev": true, 911 | "requires": { 912 | "undici-types": "~6.21.0" 913 | } 914 | }, 915 | "argparse": { 916 | "version": "1.0.10", 917 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 918 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 919 | "requires": { 920 | "sprintf-js": "~1.0.2" 921 | } 922 | }, 923 | "dotenv": { 924 | "version": "16.5.0", 925 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz", 926 | "integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==" 927 | }, 928 | "esbuild": { 929 | "version": "0.25.0", 930 | "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz", 931 | "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==", 932 | "requires": { 933 | "@esbuild/aix-ppc64": "0.25.0", 934 | "@esbuild/android-arm": "0.25.0", 935 | "@esbuild/android-arm64": "0.25.0", 936 | "@esbuild/android-x64": "0.25.0", 937 | "@esbuild/darwin-arm64": "0.25.0", 938 | "@esbuild/darwin-x64": "0.25.0", 939 | "@esbuild/freebsd-arm64": "0.25.0", 940 | "@esbuild/freebsd-x64": "0.25.0", 941 | "@esbuild/linux-arm": "0.25.0", 942 | "@esbuild/linux-arm64": "0.25.0", 943 | "@esbuild/linux-ia32": "0.25.0", 944 | "@esbuild/linux-loong64": "0.25.0", 945 | "@esbuild/linux-mips64el": "0.25.0", 946 | "@esbuild/linux-ppc64": "0.25.0", 947 | "@esbuild/linux-riscv64": "0.25.0", 948 | "@esbuild/linux-s390x": "0.25.0", 949 | "@esbuild/linux-x64": "0.25.0", 950 | "@esbuild/netbsd-arm64": "0.25.0", 951 | "@esbuild/netbsd-x64": "0.25.0", 952 | "@esbuild/openbsd-arm64": "0.25.0", 953 | "@esbuild/openbsd-x64": "0.25.0", 954 | "@esbuild/sunos-x64": "0.25.0", 955 | "@esbuild/win32-arm64": "0.25.0", 956 | "@esbuild/win32-ia32": "0.25.0", 957 | "@esbuild/win32-x64": "0.25.0" 958 | } 959 | }, 960 | "esprima": { 961 | "version": "4.0.1", 962 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 963 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" 964 | }, 965 | "front-matter": { 966 | "version": "4.0.2", 967 | "resolved": "https://registry.npmjs.org/front-matter/-/front-matter-4.0.2.tgz", 968 | "integrity": "sha512-I8ZuJ/qG92NWX8i5x1Y8qyj3vizhXS31OxjKDu3LKP+7/qBgfIKValiZIEwoVoJKUHlhWtYrktkxV1XsX+pPlg==", 969 | "requires": { 970 | "js-yaml": "^3.13.1" 971 | } 972 | }, 973 | "fs-extra": { 974 | "version": "11.3.0", 975 | "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz", 976 | "integrity": "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==", 977 | "requires": { 978 | "graceful-fs": "^4.2.0", 979 | "jsonfile": "^6.0.1", 980 | "universalify": "^2.0.0" 981 | } 982 | }, 983 | "fsevents": { 984 | "version": "2.3.3", 985 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", 986 | "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", 987 | "optional": true 988 | }, 989 | "get-tsconfig": { 990 | "version": "4.8.1", 991 | "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.1.tgz", 992 | "integrity": "sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==", 993 | "requires": { 994 | "resolve-pkg-maps": "^1.0.0" 995 | } 996 | }, 997 | "graceful-fs": { 998 | "version": "4.2.10", 999 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", 1000 | "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" 1001 | }, 1002 | "js-yaml": { 1003 | "version": "3.14.1", 1004 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", 1005 | "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", 1006 | "requires": { 1007 | "argparse": "^1.0.7", 1008 | "esprima": "^4.0.0" 1009 | } 1010 | }, 1011 | "jsonfile": { 1012 | "version": "6.1.0", 1013 | "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", 1014 | "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", 1015 | "requires": { 1016 | "graceful-fs": "^4.1.6", 1017 | "universalify": "^2.0.0" 1018 | } 1019 | }, 1020 | "markdown-table": { 1021 | "version": "3.0.4", 1022 | "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", 1023 | "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==" 1024 | }, 1025 | "prettier": { 1026 | "version": "3.5.3", 1027 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", 1028 | "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", 1029 | "dev": true 1030 | }, 1031 | "resolve-pkg-maps": { 1032 | "version": "1.0.0", 1033 | "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", 1034 | "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==" 1035 | }, 1036 | "sprintf-js": { 1037 | "version": "1.0.3", 1038 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 1039 | "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" 1040 | }, 1041 | "tsx": { 1042 | "version": "4.19.4", 1043 | "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.4.tgz", 1044 | "integrity": "sha512-gK5GVzDkJK1SI1zwHf32Mqxf2tSJkNx+eYcNly5+nHvWqXUJYUkWBQtKauoESz3ymezAI++ZwT855x5p5eop+Q==", 1045 | "requires": { 1046 | "esbuild": "~0.25.0", 1047 | "fsevents": "~2.3.3", 1048 | "get-tsconfig": "^4.7.5" 1049 | } 1050 | }, 1051 | "typescript": { 1052 | "version": "5.8.3", 1053 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", 1054 | "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", 1055 | "dev": true 1056 | }, 1057 | "undici-types": { 1058 | "version": "6.21.0", 1059 | "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", 1060 | "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", 1061 | "dev": true 1062 | }, 1063 | "universalify": { 1064 | "version": "2.0.0", 1065 | "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", 1066 | "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" 1067 | }, 1068 | "yaml": { 1069 | "version": "2.8.0", 1070 | "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", 1071 | "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==" 1072 | } 1073 | } 1074 | } 1075 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "notion-doit", 3 | "version": "0.0.1", 4 | "description": "Use Notion as the CMS for your Hugo DoIt site", 5 | "main": "src/index.ts", 6 | "private": true, 7 | "license": "GPL-3.0-only", 8 | "homepage": "https://github.com/Hugo-DoIt/Notion-DoIt", 9 | "bugs": { 10 | "url": "https://github.com/Hugo-DoIt/Notion-DoIt/issues" 11 | }, 12 | "engines": { 13 | "node": ">=16", 14 | "npm": ">=8" 15 | }, 16 | "scripts": { 17 | "start": "tsx src/index.ts", 18 | "server": "hugo server -D --disableFastRender --noHTTPCache", 19 | "typecheck": "tsc --noEmit", 20 | "build": "tsc", 21 | "format": "prettier --write src/**/*.ts" 22 | }, 23 | "keywords": [ 24 | "Notion", 25 | "Hugo", 26 | "theme", 27 | "DoIt" 28 | ], 29 | "author": "HEIGE-PCloud", 30 | "dependencies": { 31 | "@notionhq/client": "^3.1.3", 32 | "dotenv": "^16.5.0", 33 | "front-matter": "^4.0.2", 34 | "fs-extra": "^11.3.0", 35 | "markdown-table": "^3.0.4", 36 | "tsx": "^4.19.4", 37 | "yaml": "^2.8.0" 38 | }, 39 | "devDependencies": { 40 | "@cloudflare/workers-types": "^4.20250601.0", 41 | "@types/fs-extra": "^11.0.4", 42 | "@types/node": "^22.15.29", 43 | "prettier": "^3.5.3", 44 | "typescript": "^5.8.3" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/config.ts: -------------------------------------------------------------------------------- 1 | import { Client, isFullBlock, iteratePaginatedAPI } from "@notionhq/client"; 2 | 3 | declare global { 4 | var blockIdToApiUrl: (block_id: string) => string; 5 | var pageIdToApiUrl: (page_id: string) => string; 6 | } 7 | 8 | import userDefinedConfig from "../notion-hugo.config"; 9 | 10 | export type PageMount = { 11 | page_id: string; 12 | target_folder: string; 13 | }; 14 | 15 | export type DatabaseMount = { 16 | database_id: string; 17 | target_folder: string; 18 | }; 19 | 20 | export type Mount = { 21 | databases: DatabaseMount[]; 22 | pages: PageMount[]; 23 | }; 24 | 25 | export type Config = { 26 | mount: Mount; 27 | }; 28 | 29 | export async function loadConfig(): Promise { 30 | const userConfig = userDefinedConfig as UserConfig; 31 | const config: Config = { 32 | mount: { 33 | databases: [], 34 | pages: [], 35 | }, 36 | }; 37 | global.blockIdToApiUrl = function (block_id: string) { 38 | return `${userConfig.base_url}/api?block_id=${block_id}`; 39 | } 40 | global.pageIdToApiUrl = function (page_id: string) { 41 | return `${userConfig.base_url}/api?page_id=${page_id}`; 42 | } 43 | 44 | // configure mount settings 45 | if (userConfig.mount.manual) { 46 | if (userConfig.mount.databases) 47 | config.mount.databases = userConfig.mount.databases; 48 | if (userConfig.mount.pages) config.mount.pages = userConfig.mount.pages; 49 | } else { 50 | if (userConfig.mount.page_url === undefined) 51 | throw Error( 52 | `[Error] When mount.manual is false, a page_url must be set.`, 53 | ); 54 | const url = new URL(userConfig.mount.page_url); 55 | const len = url.pathname.length; 56 | if (len < 32) throw Error(`[Error] The page_url ${url.href} is invalid`); 57 | const pageId = url.pathname.slice(len - 32, len); 58 | const notion = new Client({ 59 | auth: process.env.NOTION_TOKEN, 60 | }); 61 | 62 | for await (const block of iteratePaginatedAPI(notion.blocks.children.list, { 63 | block_id: pageId, 64 | })) { 65 | if (!isFullBlock(block)) continue; 66 | if (block.type === "child_database") { 67 | config.mount.databases.push({ 68 | database_id: block.id, 69 | target_folder: block.child_database.title, 70 | }); 71 | } 72 | if (block.type === "child_page") { 73 | config.mount.pages.push({ 74 | page_id: block.id, 75 | target_folder: ".", 76 | }); 77 | } 78 | } 79 | } 80 | 81 | return config; 82 | } 83 | 84 | export type UserMount = { 85 | manual: boolean; 86 | page_url?: string; 87 | databases?: DatabaseMount[]; 88 | pages?: PageMount[]; 89 | }; 90 | 91 | export type UserConfig = { 92 | mount: UserMount; 93 | base_url: string; 94 | }; 95 | 96 | export function defineConfig(config: UserConfig) { 97 | return config; 98 | } 99 | -------------------------------------------------------------------------------- /src/file.ts: -------------------------------------------------------------------------------- 1 | import { PageObjectResponse } from "@notionhq/client/build/src/api-endpoints"; 2 | import fs from "fs"; 3 | import path from "path"; 4 | import fm from "front-matter"; 5 | 6 | type ContentFile = { 7 | filename: string; 8 | // relative path to the project folder 9 | filepath: string; 10 | metadata: PageObjectResponse; 11 | managed: boolean; 12 | }; 13 | 14 | function isMarkdownFile(filename: string): boolean { 15 | return filename.endsWith(".md"); 16 | } 17 | 18 | export function getContentFile(filepath: string): ContentFile | undefined { 19 | if (!fs.existsSync(filepath)) { 20 | return undefined; 21 | } 22 | const filedata = fm(fs.readFileSync(filepath, "utf-8")); 23 | const metadata = (filedata.attributes as any).NOTION_METADATA; 24 | if (metadata) { 25 | return { 26 | filename: path.basename(filepath), 27 | filepath, 28 | metadata, 29 | managed: (filedata.attributes as any).MANAGED_BY_NOTION_HUGO ?? false, 30 | }; 31 | } else { 32 | console.warn( 33 | `[Warn] ${filepath} does not have NOTION_METADATA in its front matter`, 34 | ); 35 | return undefined; 36 | } 37 | } 38 | 39 | export function getAllContentFiles(dirPath: string): ContentFile[] { 40 | const fileArray: ContentFile[] = []; 41 | const queue: string[] = [dirPath]; 42 | while (queue.length !== 0) { 43 | const filepath = queue.shift(); 44 | if (filepath === undefined) continue; 45 | if (fs.statSync(filepath).isDirectory()) { 46 | const files = fs.readdirSync(filepath); 47 | for (const file of files) { 48 | queue.push(path.join(filepath, file)); 49 | } 50 | continue; 51 | } 52 | if (!isMarkdownFile(filepath)) continue; 53 | const filedata = fm(fs.readFileSync(filepath, "utf-8")); 54 | const metadata = (filedata.attributes as any).NOTION_METADATA; 55 | if (metadata) { 56 | fileArray.push({ 57 | filename: path.basename(filepath), 58 | filepath, 59 | metadata, 60 | managed: (filedata.attributes as any).MANAGED_BY_NOTION_HUGO ?? false, 61 | }); 62 | } else { 63 | console.warn( 64 | `[Warn] ${filepath} does not have NOTION_METADATA in its front matter, it will not be managed.`, 65 | ); 66 | } 67 | } 68 | return fileArray; 69 | } 70 | -------------------------------------------------------------------------------- /src/helpers.ts: -------------------------------------------------------------------------------- 1 | import { Client, isFullPage } from "@notionhq/client"; 2 | import { PageObjectResponse } from "@notionhq/client/build/src/api-endpoints"; 3 | 4 | export function getPageTitle(page: PageObjectResponse): string { 5 | const title = page.properties.Name ?? page.properties.title; 6 | if (title.type === "title") { 7 | return title.title.map((text) => text.plain_text).join(""); 8 | } 9 | throw Error( 10 | `page.properties.Name has type ${title.type} instead of title. The underlying Notion API might has changed, please report an issue to the author.`, 11 | ); 12 | } 13 | 14 | export async function getCoverLink( 15 | page_id: string, 16 | notion: Client, 17 | ): Promise { 18 | const page = await notion.pages.retrieve({ page_id }); 19 | if (!isFullPage(page) || page.cover === null) { 20 | return null; 21 | } 22 | return page.cover.type === "external" 23 | ? page.cover.external.url 24 | : pageIdToApiUrl(page_id); 25 | } 26 | 27 | export function getFileName(title: string, page_id: string): string { 28 | return ( 29 | title.replaceAll(" ", "-").replace(/--+/g, "-") + 30 | "-" + 31 | page_id.replaceAll("-", "") + 32 | ".md" 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { Client, isFullPage, iteratePaginatedAPI } from "@notionhq/client"; 2 | import dotenv from "dotenv"; 3 | import fs from "fs-extra"; 4 | import { savePage } from "./render"; 5 | import { loadConfig } from "./config"; 6 | import { getAllContentFiles } from "./file"; 7 | import { isFullPageOrDatabase } from "@notionhq/client/build/src/helpers"; 8 | import { getFileName, getPageTitle } from "./helpers"; 9 | 10 | dotenv.config(); 11 | 12 | async function main() { 13 | if (process.env.NOTION_TOKEN === "") 14 | throw Error("The NOTION_TOKEN environment vairable is not set."); 15 | const config = await loadConfig(); 16 | console.info("[Info] Config loaded "); 17 | 18 | const notion = new Client({ 19 | auth: process.env.NOTION_TOKEN, 20 | }); 21 | 22 | const pages: string[] = []; 23 | 24 | console.info("[Info] Start processing mounted databases"); 25 | // process mounted databases 26 | for (const mount of config.mount.databases) { 27 | fs.ensureDirSync(`content/${mount.target_folder}`); 28 | for await (const page of iteratePaginatedAPI(notion.databases.query, { 29 | database_id: mount.database_id, 30 | })) { 31 | if (!isFullPageOrDatabase(page) || page.object !== "page") { 32 | continue; 33 | } 34 | console.info(`[Info] Start processing page ${page.id}`); 35 | pages.push(getFileName(getPageTitle(page), page.id)); 36 | await savePage(page, notion, mount); 37 | } 38 | } 39 | 40 | // process mounted pages 41 | for (const mount of config.mount.pages) { 42 | const page = await notion.pages.retrieve({ page_id: mount.page_id }); 43 | if (!isFullPage(page)) { 44 | continue; 45 | } 46 | pages.push(getFileName(getPageTitle(page), page.id)); 47 | await savePage(page, notion, mount); 48 | } 49 | 50 | // remove posts that exist locally but not in Notion Database 51 | const contentFiles = getAllContentFiles("content"); 52 | for (const file of contentFiles) { 53 | if (!pages.includes(file.filename) && file.managed) { 54 | console.info(`[Info] Removing unsynced file ${file.filepath}`); 55 | fs.removeSync(file.filepath); 56 | } 57 | } 58 | } 59 | 60 | main() 61 | .then(() => process.exit(0)) 62 | .catch((err) => { 63 | console.error(err); 64 | process.exit(1); 65 | }); 66 | -------------------------------------------------------------------------------- /src/markdown/md.ts: -------------------------------------------------------------------------------- 1 | import { markdownTable } from "markdown-table"; 2 | import { 3 | AudioBlockObjectResponse, 4 | EquationRichTextItemResponse, 5 | MentionRichTextItemResponse, 6 | PdfBlockObjectResponse, 7 | RichTextItemResponse, 8 | TextRichTextItemResponse, 9 | VideoBlockObjectResponse, 10 | } from "@notionhq/client/build/src/api-endpoints"; 11 | import { CalloutIcon } from "./types"; 12 | import { getPageRelrefFromId } from "./notion"; 13 | import { Client } from "@notionhq/client"; 14 | export const inlineCode = (text: string) => { 15 | return `\`${text}\``; 16 | }; 17 | 18 | export const bold = (text: string) => { 19 | return `**${text}**`; 20 | }; 21 | 22 | export const italic = (text: string) => { 23 | return `_${text}_`; 24 | }; 25 | 26 | export const strikethrough = (text: string) => { 27 | return `~~${text}~~`; 28 | }; 29 | 30 | export const underline = (text: string) => { 31 | return `${text}`; 32 | }; 33 | 34 | export const link = (text: string, href: string) => { 35 | return `[${text}](${href})`; 36 | }; 37 | 38 | export const codeBlock = (text: string, language?: string) => { 39 | if (language === "plain text") language = "text"; 40 | 41 | return `\`\`\`${language} 42 | ${text} 43 | \`\`\``; 44 | }; 45 | 46 | export const heading1 = (text: string) => { 47 | return `# ${text}`; 48 | }; 49 | 50 | export const heading2 = (text: string) => { 51 | return `## ${text}`; 52 | }; 53 | 54 | export const heading3 = (text: string) => { 55 | return `### ${text}`; 56 | }; 57 | 58 | export const quote = (text: string) => { 59 | // the replace is done to handle multiple lines 60 | return `> ${text.replace(/\n/g, " \n> ")}`; 61 | }; 62 | 63 | export const callout = (text: string, icon?: CalloutIcon) => { 64 | let emoji: string | undefined; 65 | if (icon?.type === "emoji") { 66 | emoji = icon.emoji; 67 | } 68 | 69 | // the replace is done to handle multiple lines 70 | return `> ${emoji ? emoji + " " : ""}${text.replace(/\n/g, " \n> ")}`; 71 | }; 72 | 73 | export const bullet = (text: string, count?: number) => { 74 | let renderText = text.trim(); 75 | return count ? `${count}. ${renderText}` : `- ${renderText}`; 76 | }; 77 | 78 | export const todo = (text: string, checked: boolean) => { 79 | return checked ? `- [x] ${text}` : `- [ ] ${text}`; 80 | }; 81 | 82 | export const image = (alt: string, href: string) => { 83 | return ``; 84 | }; 85 | 86 | export const addTabSpace = (text: string, n = 0) => { 87 | const tab = " "; 88 | for (let i = 0; i < n; i++) { 89 | if (text.includes("\n")) { 90 | const multiLineText = text.split(/(?<=\n)/).join(tab); 91 | text = tab + multiLineText; 92 | } else text = tab + text; 93 | } 94 | return text; 95 | }; 96 | 97 | export const divider = () => { 98 | return "---"; 99 | }; 100 | 101 | export const toggle = (summary?: string, children?: string) => { 102 | if (!summary) return children || ""; 103 | return ` 104 | ${summary} 105 | 106 | ${children || ""} 107 | 108 | `; 109 | }; 110 | 111 | export const table = (cells: string[][]) => { 112 | return markdownTable(cells); 113 | }; 114 | 115 | export const plainText = (textArray: RichTextItemResponse[]) => { 116 | return textArray.map((text) => text.plain_text).join(""); 117 | }; 118 | 119 | /** 120 | * Block equation 121 | * Format: \[ expression \] 122 | * @param expression 123 | * @returns 124 | */ 125 | export const equation = (expression: string) => { 126 | return `\\[${expression}\\]`; 127 | }; 128 | 129 | function textRichText(text: TextRichTextItemResponse): string { 130 | const annotations = text.annotations; 131 | let content = text.text.content; 132 | if (annotations.bold) { 133 | content = bold(content); 134 | } 135 | if (annotations.code) { 136 | content = inlineCode(content); 137 | } 138 | if (annotations.italic) { 139 | content = italic(content); 140 | } 141 | if (annotations.strikethrough) { 142 | content = strikethrough(content); 143 | } 144 | if (annotations.underline) { 145 | content = underline(content); 146 | } 147 | if (text.href) { 148 | content = link(content, text.href); 149 | } 150 | return content; 151 | } 152 | 153 | /** 154 | * Inline equation 155 | * Format: \( expression \) 156 | * @param text 157 | * @returns 158 | */ 159 | function equationRichText(text: EquationRichTextItemResponse): string { 160 | return `\\(${text.equation.expression}\\)`; 161 | } 162 | 163 | async function mentionRichText( 164 | text: MentionRichTextItemResponse, 165 | notion: Client, 166 | ): Promise { 167 | const mention = text.mention; 168 | switch (mention.type) { 169 | case "page": { 170 | const pageId = mention.page.id; 171 | const { title, relref } = await getPageRelrefFromId(pageId, notion); 172 | return link(title, relref); 173 | } 174 | case "user": { 175 | const userId = mention.user.id; 176 | try { 177 | const user = await notion.users.retrieve({ user_id: userId }); 178 | if (user.name) { 179 | return `@${user.name}`; 180 | } 181 | } catch (error) { 182 | console.warn(`Failed to retrieve user with id ${userId}`); 183 | } 184 | return ""; 185 | } 186 | case "date": { 187 | const date = mention.date; 188 | const dateEnd = date.end ? ` -> ${date.end}` : ""; 189 | const timeZone = date.time_zone ? ` (${date.time_zone})` : ""; 190 | return `@${date.start}${dateEnd}${timeZone}`; 191 | } 192 | case "link_preview": { 193 | const linkPreview = mention.link_preview; 194 | return link(linkPreview.url, linkPreview.url); 195 | } 196 | case "template_mention": { 197 | // https://developers.notion.com/reference/rich-text#template-mention-type-object 198 | // Hide the template button 199 | return ""; 200 | } 201 | case "database": { 202 | console.warn("[Warn] Database mention is not supported"); 203 | return ""; 204 | } 205 | } 206 | return ""; 207 | } 208 | 209 | export async function richText( 210 | textArray: RichTextItemResponse[], 211 | notion: Client, 212 | ) { 213 | return ( 214 | await Promise.all( 215 | textArray.map(async (text) => { 216 | if (text.type === "text") { 217 | return textRichText(text); 218 | } else if (text.type === "equation") { 219 | return equationRichText(text); 220 | } else if (text.type === "mention") { 221 | return await mentionRichText(text, notion); 222 | } 223 | }), 224 | ) 225 | ).join(""); 226 | } 227 | 228 | export const video = (block: VideoBlockObjectResponse) => { 229 | const videoBlock = block.video; 230 | if (videoBlock.type === "file") { 231 | return htmlVideo(blockIdToApiUrl(block.id)); 232 | } 233 | const url = videoBlock.external.url; 234 | if (url.startsWith("https://www.youtube.com/")) { 235 | /* 236 | YouTube video links that include embed or watch. 237 | E.g. https://www.youtube.com/watch?v=[id], https://www.youtube.com/embed/[id] 238 | */ 239 | // get last 11 characters of the url as the video id 240 | const videoId = url.slice(-11); 241 | return ``; 242 | } 243 | return htmlVideo(url); 244 | }; 245 | 246 | function htmlVideo(url: string) { 247 | return ` 248 | 249 | 250 | Your browser does not support HTML5 video. Here is a 251 | link to the video instead. 252 | 253 | `; 254 | } 255 | 256 | export const pdf = (block: PdfBlockObjectResponse) => { 257 | const pdfBlock = block.pdf; 258 | const url = 259 | pdfBlock.type === "file" 260 | ? blockIdToApiUrl(block.id) 261 | : pdfBlock.external.url; 262 | return ``; 263 | }; 264 | 265 | export const audio = (block: AudioBlockObjectResponse) => { 266 | const audioBlock = block.audio; 267 | const url = 268 | audioBlock.type === "file" 269 | ? blockIdToApiUrl(block.id) 270 | : audioBlock.external.url; 271 | return ``; 272 | }; 273 | -------------------------------------------------------------------------------- /src/markdown/notion-to-md.ts: -------------------------------------------------------------------------------- 1 | import { Client, isFullBlock } from "@notionhq/client"; 2 | import { 3 | GetBlockResponse, 4 | RichTextItemResponse, 5 | } from "@notionhq/client/build/src/api-endpoints"; 6 | import { CustomTransformer, MdBlock, NotionToMarkdownOptions } from "./types"; 7 | import * as md from "./md"; 8 | import { getBlockChildren, getPageRelrefFromId } from "./notion"; 9 | import { plainText } from "./md"; 10 | 11 | /** 12 | * Converts a Notion page to Markdown. 13 | */ 14 | export class NotionToMarkdown { 15 | private notionClient: Client; 16 | private customTransformers: Record; 17 | private richText: (textArray: RichTextItemResponse[]) => Promise; 18 | private unsupportedTransformer: (type: string) => string = () => ""; 19 | constructor(options: NotionToMarkdownOptions) { 20 | this.notionClient = options.notionClient; 21 | this.customTransformers = {}; 22 | this.richText = (textArray: RichTextItemResponse[]) => 23 | md.richText(textArray, this.notionClient); 24 | } 25 | setCustomTransformer( 26 | type: string, 27 | transformer: CustomTransformer 28 | ): NotionToMarkdown { 29 | this.customTransformers[type] = transformer; 30 | 31 | return this; 32 | } 33 | setCustomRichTextTransformer( 34 | transformer: ( 35 | textArray: RichTextItemResponse[], 36 | notion: Client 37 | ) => Promise 38 | ) { 39 | this.richText = (textArray: RichTextItemResponse[]) => 40 | transformer(textArray, this.notionClient); 41 | return this; 42 | } 43 | setUnsupportedTransformer(transformer: (type: string) => string) { 44 | this.unsupportedTransformer = transformer; 45 | return this; 46 | } 47 | /** 48 | * Converts Markdown Blocks to string 49 | * @param {MdBlock[]} mdBlocks - Array of markdown blocks 50 | * @param {number} nestingLevel - Defines max depth of nesting 51 | * @returns {string} - Returns markdown string 52 | */ 53 | toMarkdownString(mdBlocks: MdBlock[] = [], nestingLevel: number = 0): string { 54 | let mdString = ""; 55 | mdBlocks.forEach((mdBlocks) => { 56 | // process parent blocks 57 | if (mdBlocks.parent) { 58 | if ( 59 | mdBlocks.type !== "to_do" && 60 | mdBlocks.type !== "bulleted_list_item" && 61 | mdBlocks.type !== "numbered_list_item" 62 | ) { 63 | // add extra line breaks non list blocks 64 | mdString += `\n${md.addTabSpace(mdBlocks.parent, nestingLevel)}\n\n`; 65 | } else { 66 | mdString += `${md.addTabSpace(mdBlocks.parent, nestingLevel)}\n`; 67 | } 68 | } 69 | 70 | // process child blocks 71 | if (mdBlocks.children && mdBlocks.children.length > 0) { 72 | if (mdBlocks.type === "synced_block") { 73 | mdString += this.toMarkdownString(mdBlocks.children, nestingLevel); 74 | } else { 75 | mdString += this.toMarkdownString( 76 | mdBlocks.children, 77 | nestingLevel + 1 78 | ); 79 | } 80 | } 81 | }); 82 | return mdString; 83 | } 84 | 85 | /** 86 | * Retrieves Notion Blocks based on ID and converts them to Markdown Blocks 87 | * @param {string} id - notion page id (not database id) 88 | * @param {number} totalPage - Retrieve block children request number, page_size Maximum = totalPage * 100 (Default=null) 89 | * @returns {Promise} - List of markdown blocks 90 | */ 91 | async pageToMarkdown( 92 | id: string, 93 | totalPage: number | null = null 94 | ): Promise { 95 | if (!this.notionClient) { 96 | throw new Error( 97 | "notion client is not provided, for more details check out https://github.com/souvikinator/notion-to-md" 98 | ); 99 | } 100 | 101 | const blocks = await getBlockChildren(this.notionClient, id, totalPage); 102 | 103 | const parsedData = await this.blocksToMarkdown(blocks); 104 | return parsedData; 105 | } 106 | 107 | /** 108 | * Converts list of Notion Blocks to Markdown Blocks 109 | * @param {ListBlockChildrenResponseResults | undefined} blocks - List of notion blocks 110 | * @param {number} totalPage - Retrieve block children request number, page_size Maximum = totalPage * 100 111 | * @param {MdBlock[]} mdBlocks - Defines max depth of nesting 112 | * @returns {Promise} - Array of markdown blocks with their children 113 | */ 114 | async blocksToMarkdown( 115 | blocks?: GetBlockResponse[], 116 | totalPage: number | null = null, 117 | mdBlocks: MdBlock[] = [] 118 | ): Promise { 119 | if (!this.notionClient) { 120 | throw new Error( 121 | "notion client is not provided, for more details check out https://github.com/souvikinator/notion-to-md" 122 | ); 123 | } 124 | 125 | if (!blocks) return mdBlocks; 126 | 127 | for (const block of blocks) { 128 | if (!isFullBlock(block)) continue; 129 | let expiry_time: string | undefined = undefined; 130 | if (block.type === "pdf" && block.pdf.type === "file") { 131 | expiry_time = block.pdf.file.expiry_time; 132 | } 133 | if (block.type === "image" && block.image.type === "file") { 134 | expiry_time = block.image.file.expiry_time; 135 | } 136 | if (block.type === "video" && block.video.type === "file") { 137 | expiry_time = block.video.file.expiry_time; 138 | } 139 | if (block.type === "file" && block.file.type === "file") { 140 | expiry_time = block.file.file.expiry_time; 141 | } 142 | 143 | if ( 144 | block.has_children && 145 | block.type !== "column_list" && 146 | block.type !== "toggle" && 147 | block.type !== "callout" && 148 | block.type !== "quote" 149 | ) { 150 | let child_blocks = await getBlockChildren( 151 | this.notionClient, 152 | block.id, 153 | totalPage 154 | ); 155 | 156 | mdBlocks.push({ 157 | type: block.type, 158 | parent: await this.blockToMarkdown(block), 159 | children: [], 160 | expiry_time, 161 | }); 162 | 163 | await this.blocksToMarkdown( 164 | child_blocks, 165 | totalPage, 166 | mdBlocks[mdBlocks.length - 1].children 167 | ); 168 | continue; 169 | } 170 | let tmp = await this.blockToMarkdown(block); 171 | mdBlocks.push({ 172 | type: block.type, 173 | parent: tmp, 174 | children: [], 175 | expiry_time, 176 | }); 177 | } 178 | return mdBlocks; 179 | } 180 | 181 | 182 | /** 183 | * Converts a Notion Block to a Markdown Block 184 | * @param block - single notion block 185 | * @returns corresponding markdown string of the passed block 186 | */ 187 | async blockToMarkdown(block: GetBlockResponse): Promise { 188 | if (typeof block !== "object" || !("type" in block)) return ""; 189 | const { type } = block; 190 | if (type in this.customTransformers && !!this.customTransformers[type]) 191 | return await this.customTransformers[type](block); 192 | switch (type) { 193 | case "image": { 194 | const image = block.image; 195 | if (image.type === "external") { 196 | return md.image(plainText(image.caption), image.external.url); 197 | } 198 | return md.image(plainText(image.caption), blockIdToApiUrl(block.id)); 199 | } 200 | case "divider": { 201 | return md.divider(); 202 | } 203 | 204 | case "equation": { 205 | return md.equation(block.equation.expression); 206 | } 207 | 208 | case "video": 209 | return md.video(block); 210 | case "pdf": 211 | return md.pdf(block); 212 | case "file": { 213 | const file = block.file; 214 | const link = 215 | file.type === "external" ? file.external.url : blockIdToApiUrl(block.id); 216 | return md.link(file.name, link); 217 | } 218 | case "bookmark": { 219 | const bookmark = block.bookmark; 220 | const caption = 221 | bookmark.caption.length > 0 222 | ? await this.richText(bookmark.caption) 223 | : bookmark.url; 224 | return md.link(caption, bookmark.url); 225 | } 226 | 227 | case "link_to_page": { 228 | const linkToPage = block.link_to_page; 229 | if (linkToPage.type === "page_id") { 230 | const { title, relref } = await getPageRelrefFromId( 231 | linkToPage.page_id, 232 | this.notionClient 233 | ); 234 | return md.link(title, relref); 235 | } else if (linkToPage.type === "comment_id") { 236 | console.warn("Unsupported link_to_page type: comment_id"); 237 | return ""; 238 | } else if (linkToPage.type === "database_id") { 239 | console.warn("Unsupported link_to_page type: database_id"); 240 | return ""; 241 | } 242 | break; 243 | } 244 | case "embed": { 245 | const embed = block.embed; 246 | const title = embed.caption.length > 0 ? plainText(embed.caption) : embed.url; 247 | return md.link(title, embed.url); 248 | } 249 | case "link_preview": { 250 | const linkPreview = block.link_preview; 251 | return md.link(linkPreview.url, linkPreview.url); 252 | } 253 | case "child_page": 254 | case "child_database": 255 | { 256 | let blockContent; 257 | let title: string = type; 258 | if (type === "child_page") { 259 | blockContent = { url: block.id }; 260 | title = block.child_page.title; 261 | } 262 | 263 | if (type === "child_database") { 264 | blockContent = { url: block.id }; 265 | title = block.child_database.title || "child_database"; 266 | } 267 | 268 | if (blockContent) return md.link(title, blockContent.url); 269 | } 270 | break; 271 | 272 | case "table": { 273 | const { id, has_children } = block; 274 | let tableArr: string[][] = []; 275 | if (has_children) { 276 | const tableRows = await getBlockChildren(this.notionClient, id, 100); 277 | // console.log(">>", tableRows); 278 | let rowsPromise = tableRows?.map(async (row) => { 279 | const { type } = row as any; 280 | const cells = (row as any)[type]["cells"]; 281 | 282 | /** 283 | * this is more like a hack since matching the type text was 284 | * difficult. So converting each cell to paragraph type to 285 | * reuse the blockToMarkdown function 286 | */ 287 | let cellStringPromise = cells.map( 288 | async (cell: any) => 289 | await this.blockToMarkdown({ 290 | type: "paragraph", 291 | paragraph: { rich_text: cell }, 292 | } as GetBlockResponse) 293 | ); 294 | 295 | const cellStringArr = await Promise.all(cellStringPromise); 296 | // console.log("~~", cellStringArr); 297 | tableArr.push(cellStringArr); 298 | // console.log(tableArr); 299 | }); 300 | await Promise.all(rowsPromise || []); 301 | } 302 | return md.table(tableArr); 303 | } 304 | 305 | case "column_list": { 306 | const { id, has_children } = block; 307 | 308 | if (!has_children) return ""; 309 | 310 | const column_list_children = await getBlockChildren( 311 | this.notionClient, 312 | id, 313 | 100 314 | ); 315 | 316 | let column_list_promise = column_list_children.map( 317 | async (column) => await this.blockToMarkdown(column) 318 | ); 319 | 320 | let column_list: string[] = await Promise.all(column_list_promise); 321 | 322 | return column_list.join("\n\n"); 323 | } 324 | 325 | case "column": { 326 | const { id, has_children } = block; 327 | if (!has_children) return ""; 328 | 329 | const column_children = await getBlockChildren( 330 | this.notionClient, 331 | id, 332 | 100 333 | ); 334 | 335 | const column_children_promise = column_children.map( 336 | async (column_child) => await this.blockToMarkdown(column_child) 337 | ); 338 | 339 | let column: string[] = await Promise.all(column_children_promise); 340 | return column.join("\n\n"); 341 | } 342 | 343 | case "toggle": { 344 | const { id, has_children } = block; 345 | 346 | const toggle_summary = block.toggle.rich_text[0]?.plain_text; 347 | 348 | // empty toggle 349 | if (!has_children) { 350 | return md.toggle(toggle_summary); 351 | } 352 | 353 | const toggle_children_object = await getBlockChildren( 354 | this.notionClient, 355 | id, 356 | 100 357 | ); 358 | 359 | // parse children blocks to md object 360 | const toggle_children = await this.blocksToMarkdown( 361 | toggle_children_object 362 | ); 363 | 364 | // convert children md object to md string 365 | const toggle_children_md_string = 366 | this.toMarkdownString(toggle_children); 367 | 368 | return md.toggle(toggle_summary, toggle_children_md_string); 369 | } 370 | 371 | case "paragraph": 372 | return await this.richText(block.paragraph.rich_text); 373 | case "heading_1": 374 | return md.heading1(await this.richText(block.heading_1.rich_text)); 375 | case "heading_2": 376 | return md.heading2(await this.richText(block.heading_2.rich_text)); 377 | case "heading_3": 378 | return md.heading3(await this.richText(block.heading_3.rich_text)); 379 | case "bulleted_list_item": 380 | return md.bullet( 381 | await this.richText(block.bulleted_list_item.rich_text) 382 | ); 383 | case "numbered_list_item": 384 | return md.bullet( 385 | await this.richText(block.numbered_list_item.rich_text), 386 | 1 387 | ); 388 | case "to_do": 389 | return md.todo( 390 | await this.richText(block.to_do.rich_text), 391 | block.to_do.checked 392 | ); 393 | case "code": 394 | return md.codeBlock( 395 | plainText(block.code.rich_text), 396 | block.code.language 397 | ); 398 | case "callout": 399 | const { id, has_children } = block; 400 | const callout_text = await this.richText(block.callout.rich_text); 401 | if (!has_children) return md.callout(callout_text, block.callout.icon); 402 | 403 | let callout_string = ""; 404 | 405 | const callout_children_object = await getBlockChildren( 406 | this.notionClient, 407 | id, 408 | 100 409 | ); 410 | 411 | // parse children blocks to md object 412 | const callout_children = await this.blocksToMarkdown( 413 | callout_children_object 414 | ); 415 | 416 | callout_string += `${callout_text}\n`; 417 | callout_children.map((child) => { 418 | callout_string += `${child.parent}\n\n`; 419 | }); 420 | 421 | return md.callout(callout_string.trim(), block.callout.icon); 422 | case "quote": 423 | const quote_text = await this.richText(block.quote.rich_text); 424 | if (!block.has_children) return md.quote(quote_text); 425 | let quote_string = ""; 426 | const quote_children_object = await getBlockChildren( 427 | this.notionClient, 428 | block.id, 429 | 100 430 | ); 431 | const quote_children = await this.blocksToMarkdown( 432 | quote_children_object 433 | ); 434 | 435 | quote_string += `${quote_text}\n`; 436 | quote_children.map((child) => { 437 | quote_string += `${child.parent}\n\n`; 438 | }); 439 | 440 | return md.quote(quote_string.trim()); 441 | 442 | case "audio": 443 | return md.audio(block); 444 | case "template": 445 | case "synced_block": 446 | case "child_page": 447 | case "child_database": 448 | case "column": 449 | case "link_preview": 450 | case "column_list": 451 | case "link_to_page": 452 | case "breadcrumb": 453 | case "unsupported": 454 | case "table_of_contents": 455 | return this.unsupportedTransformer(type); 456 | } 457 | return ""; 458 | } 459 | } 460 | -------------------------------------------------------------------------------- /src/markdown/notion.ts: -------------------------------------------------------------------------------- 1 | import { Client, isFullPage } from "@notionhq/client"; 2 | import { 3 | GetBlockResponse, 4 | ListBlockChildrenResponse, 5 | PageObjectResponse, 6 | } from "@notionhq/client/build/src/api-endpoints"; 7 | import { plainText } from "./md"; 8 | 9 | export const getBlockChildren = async ( 10 | notionClient: Client, 11 | block_id: string, 12 | totalPage: number | null 13 | ) => { 14 | try { 15 | let results: GetBlockResponse[] = []; 16 | let pageCount = 0; 17 | let start_cursor = undefined; 18 | 19 | do { 20 | const response: ListBlockChildrenResponse = 21 | await notionClient.blocks.children.list({ 22 | start_cursor, 23 | block_id, 24 | }); 25 | results.push(...response.results); 26 | 27 | start_cursor = response.next_cursor; 28 | pageCount += 1; 29 | } while ( 30 | start_cursor != null && 31 | (totalPage == null || pageCount < totalPage) 32 | ); 33 | 34 | return results; 35 | } catch (e) { 36 | console.log(e); 37 | return []; 38 | } 39 | }; 40 | 41 | export function getPageTitle(page: PageObjectResponse): string { 42 | const title = page.properties.Name ?? page.properties.title; 43 | if (title.type === "title") { 44 | return plainText(title.title); 45 | } 46 | throw Error( 47 | `page.properties.Name has type ${title.type} instead of title. The underlying Notion API might has changed, please report an issue to the author.` 48 | ); 49 | } 50 | 51 | export function getFileName(title: any, page_id: any): string { 52 | return ( 53 | title.replaceAll(" ", "-").replace(/--+/g, "-") + 54 | "-" + 55 | page_id.replaceAll("-", "") + 56 | ".md" 57 | ); 58 | } 59 | 60 | export const getPageRelrefFromId = async ( 61 | pageId: string, 62 | notion: Client 63 | ): Promise<{ 64 | title: string; 65 | relref: string; 66 | }> => { 67 | const page = await notion.pages.retrieve({ page_id: pageId }); // throw if failed 68 | if (!isFullPage(page)) { 69 | throw Error( 70 | `The pages.retrieve endpoint failed to return a full page for ${pageId}.` 71 | ); 72 | } 73 | const title = getPageTitle(page); 74 | const fileName = getFileName(title, page.id); 75 | const relref = `{{% relref "${fileName}" %}}`; 76 | return { title, relref }; 77 | }; 78 | -------------------------------------------------------------------------------- /src/markdown/types.ts: -------------------------------------------------------------------------------- 1 | import { GetBlockResponse } from "@notionhq/client/build/src/api-endpoints"; 2 | import { Client } from "@notionhq/client"; 3 | 4 | export interface NotionToMarkdownOptions { 5 | notionClient: Client; 6 | } 7 | 8 | export type MdBlock = { 9 | type?: string; 10 | parent: string; 11 | children: MdBlock[]; 12 | expiry_time?: string; 13 | }; 14 | 15 | export type CustomEmojiResponse = { 16 | id: string; 17 | name: string; 18 | url: string; 19 | }; 20 | 21 | export type CalloutIcon = 22 | | { type: "emoji"; emoji: string } 23 | | { type: "external"; external: { url: string } } 24 | | { type: "file"; file: { url: string; expiry_time: string } } 25 | | { type: "custom_emoji"; custom_emoji: CustomEmojiResponse; } 26 | | null; 27 | 28 | export type CustomTransformer = ( 29 | block: GetBlockResponse 30 | ) => string | Promise; 31 | -------------------------------------------------------------------------------- /src/render.ts: -------------------------------------------------------------------------------- 1 | import fs from "fs-extra"; 2 | import { Client, isFullUser, iteratePaginatedAPI } from "@notionhq/client"; 3 | import { PageObjectResponse } from "@notionhq/client/build/src/api-endpoints"; 4 | import { NotionToMarkdown } from "./markdown/notion-to-md"; 5 | import YAML from "yaml"; 6 | import { sh } from "./sh"; 7 | import { DatabaseMount, PageMount } from "./config"; 8 | import { getPageTitle, getCoverLink, getFileName } from "./helpers"; 9 | import path from "path"; 10 | import { getContentFile } from "./file"; 11 | 12 | export async function renderPage(page: PageObjectResponse, notion: Client) { 13 | // load formatter config 14 | const n2m = new NotionToMarkdown({ notionClient: notion }); 15 | n2m.setUnsupportedTransformer((type) => { 16 | return `{{< notion-unsupported-block type=${type} >}}`; 17 | }); 18 | let frontInjectString = ""; 19 | const mdblocks = await n2m.pageToMarkdown(page.id); 20 | const mdString = n2m.toMarkdownString(mdblocks); 21 | page.properties.Name; 22 | const title = getPageTitle(page); 23 | const frontMatter: Record< 24 | string, 25 | string | string[] | number | boolean | PageObjectResponse 26 | > = { 27 | title, 28 | date: page.created_time, 29 | lastmod: page.last_edited_time, 30 | draft: false, 31 | }; 32 | 33 | // set featuredImage 34 | const featuredImageLink = await getCoverLink(page.id, notion); 35 | if (featuredImageLink) { 36 | frontMatter.featuredImage = featuredImageLink; 37 | } 38 | 39 | // map page properties to front matter 40 | for (const property in page.properties) { 41 | const id = page.properties[property].id; 42 | const response = await notion.pages.properties.retrieve({ 43 | page_id: page.id, 44 | property_id: id, 45 | }); 46 | if (response.object === "property_item") { 47 | switch (response.type) { 48 | case "checkbox": 49 | frontMatter[property] = response.checkbox; 50 | break; 51 | case "select": 52 | if (response.select) frontMatter[property] = response.select.name; 53 | break; 54 | case "multi_select": 55 | frontMatter[property] = response.multi_select.map( 56 | (select) => select.name, 57 | ); 58 | break; 59 | case "email": 60 | if (response.email) frontMatter[property] = response.email; 61 | break; 62 | case "url": 63 | if (response.url) frontMatter[property] = response.url; 64 | break; 65 | case "date": 66 | if (response.date) frontMatter[property] = response.date.start; 67 | break; 68 | case "number": 69 | if (response.number) frontMatter[property] = response.number; 70 | break; 71 | case "phone_number": 72 | if (response.phone_number) 73 | frontMatter[property] = response.phone_number; 74 | break; 75 | case "status": 76 | if (response.status) frontMatter[property] = response.status.name; 77 | // ignore these properties 78 | case "last_edited_by": 79 | case "last_edited_time": 80 | case "rollup": 81 | case "files": 82 | case "formula": 83 | case "created_by": 84 | case "created_time": 85 | break; 86 | default: 87 | break; 88 | } 89 | } else { 90 | for await (const result of iteratePaginatedAPI( 91 | // @ts-ignore 92 | notion.pages.properties.retrieve, 93 | { 94 | page_id: page.id, 95 | property_id: id, 96 | }, 97 | )) { 98 | switch (result.type) { 99 | case "people": 100 | frontMatter[property] = frontMatter[property] || []; 101 | if (isFullUser(result.people)) { 102 | const fm = frontMatter[property]; 103 | if (Array.isArray(fm) && result.people.name) { 104 | fm.push(result.people.name); 105 | } 106 | } 107 | break; 108 | case "rich_text": 109 | frontMatter[property] = frontMatter[property] || ""; 110 | frontMatter[property] += result.rich_text.plain_text; 111 | // ignore these 112 | case "relation": 113 | case "title": 114 | default: 115 | break; 116 | } 117 | } 118 | } 119 | } 120 | 121 | // set default author 122 | if (frontMatter.authors == null) { 123 | try { 124 | const response = await notion.users.retrieve({ 125 | user_id: page.last_edited_by.id, 126 | }); 127 | if (response.name) { 128 | frontMatter.authors = [response.name]; 129 | } 130 | } catch (error) { 131 | console.warn(`[Warning] Failed to get author name for ${page.id}`); 132 | } 133 | } 134 | 135 | // save metadata 136 | frontMatter.NOTION_METADATA = page; 137 | frontMatter.MANAGED_BY_NOTION_HUGO = true; 138 | 139 | return { 140 | title, 141 | pageString: 142 | "---\n" + 143 | YAML.stringify(frontMatter, { 144 | defaultStringType: "QUOTE_DOUBLE", 145 | defaultKeyType: "PLAIN", 146 | }) + 147 | "\n---\n" + 148 | frontInjectString + 149 | "\n" + 150 | mdString, 151 | }; 152 | } 153 | 154 | export async function savePage( 155 | page: PageObjectResponse, 156 | notion: Client, 157 | mount: DatabaseMount | PageMount, 158 | ) { 159 | const postpath = path.join( 160 | "content", 161 | mount.target_folder, 162 | getFileName(getPageTitle(page), page.id), 163 | ); 164 | const post = getContentFile(postpath); 165 | if (post && post.metadata.last_edited_time === page.last_edited_time) { 166 | console.info(`[Info] The post ${postpath} is up-to-date, skipped.`); 167 | return; 168 | } 169 | // otherwise update the page 170 | console.info(`[Info] Updating ${postpath}`); 171 | 172 | const { title, pageString } = await renderPage(page, notion); 173 | const fileName = getFileName(title, page.id); 174 | await sh(`hugo new "${mount.target_folder}/${fileName}"`, false); 175 | fs.writeFileSync(`content/${mount.target_folder}/${fileName}`, pageString); 176 | } 177 | -------------------------------------------------------------------------------- /src/sh.ts: -------------------------------------------------------------------------------- 1 | import { exec } from "child_process"; 2 | 3 | /** 4 | * Execute simple shell command (async wrapper). 5 | * @param {String} cmd 6 | * @return {Object} { stdout: String, stderr: String } 7 | */ 8 | 9 | export async function sh( 10 | cmd: string, 11 | panic: boolean = true 12 | ): Promise<{ stdout: string; stderr: string }> { 13 | return new Promise(function (resolve, reject) { 14 | exec(cmd, (err, stdout, stderr) => { 15 | if (err && panic) { 16 | reject(err); 17 | } else { 18 | resolve({ stdout, stderr }); 19 | } 20 | }); 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HEIGE-PCloud/Notion-Hugo/4d2b60ae67ccab46a0e82c4e7c6c41381dbe08bc/static/.gitkeep -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Visit https://aka.ms/tsconfig to read more about this file */ 4 | 5 | /* Projects */ 6 | // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ 7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ 8 | // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ 9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ 10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ 11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ 12 | 13 | /* Language and Environment */ 14 | "target": "esnext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ 16 | // "jsx": "preserve", /* Specify what JSX code is generated. */ 17 | // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ 18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ 19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ 20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ 21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ 22 | // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ 23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ 24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ 25 | // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ 26 | 27 | /* Modules */ 28 | "module": "commonjs", /* Specify what module code is generated. */ 29 | // "rootDir": "./", /* Specify the root folder within your source files. */ 30 | // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ 31 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ 32 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ 33 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ 34 | // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ 35 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */ 36 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 37 | // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ 38 | // "resolveJsonModule": true, /* Enable importing .json files. */ 39 | // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ 40 | 41 | /* JavaScript Support */ 42 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ 43 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ 44 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ 45 | 46 | /* Emit */ 47 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ 48 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */ 49 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ 50 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ 51 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ 52 | "outDir": "./dist", /* Specify an output folder for all emitted files. */ 53 | // "removeComments": true, /* Disable emitting comments. */ 54 | // "noEmit": true, /* Disable emitting files from a compilation. */ 55 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ 56 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ 57 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ 58 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ 59 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 60 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ 61 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ 62 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ 63 | // "newLine": "crlf", /* Set the newline character for emitting files. */ 64 | // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ 65 | // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ 66 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ 67 | // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ 68 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ 69 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ 70 | 71 | /* Interop Constraints */ 72 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ 73 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ 74 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ 75 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ 76 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 77 | 78 | /* Type Checking */ 79 | "strict": true, /* Enable all strict type-checking options. */ 80 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ 81 | // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ 82 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ 83 | // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ 84 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ 85 | // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ 86 | // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ 87 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ 88 | // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ 89 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ 90 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ 91 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ 92 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ 93 | // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ 94 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ 95 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ 96 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ 97 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ 98 | 99 | /* Completeness */ 100 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ 101 | "skipLibCheck": true /* Skip type checking all .d.ts files. */ 102 | }, 103 | "include": [ 104 | "src/**/*" 105 | ], 106 | "exclude": [ 107 | "functions/**/*" 108 | ] 109 | } 110 | --------------------------------------------------------------------------------
261 | Your browser does not support HTML5 video. Here is a 262 | link to the video instead. 263 |
250 | Your browser does not support HTML5 video. Here is a 251 | link to the video instead. 252 |