DI
dimaslanjaka/hexo-webpack
generate static site jekyll/hexo/huge markdown posts using webpack and react
Hexo with webpack
generate static site jekyll/hexo/huge markdown posts using webpack
Advantages
- reduce site size (useful for github pages with limit 1GB only)
- SEO improvement by setting html metadata then add
<script>tag to main bundle.js
Features
- markdown string to react jsx element converter
- html string to react jsx element converter
Structure folders and files
.cachewebpack cache directory and post map json fromgulp mapsourceall page assets and markdowns (ex: source/about.md -> http://example.com/about)publicall static assets (no markdown should be processed)srcall layout react, scss, csssrc-postssource markdown postsource/_postsauto generated post fromsrc-postsusingsbg post copytmptemp foldertmp/metaall parsed metadata posttmp/staticall SEO optimized static htmlall generated html should be processed with
gulp build-htmllater_config.jsonauto generated file from_config.ymlwith additional propertiesroutes.jsonauto generated file from all mapped posts and pages
Installation
- install
yarn install
echo {} > _config.json
echo [] > routes.json
mkdir -p tmp
mkdir -p tmp/meta
mkdir -p tmp/static
mkdir -p src/posts- copy source post
npx sbg post copy- run standalone scripts
npx sbg post standalone- mapping source posts
gulp map- generate routes
you can override options by cli arguments see: sample complex
gulp routesite production build
yarn run buildwatch production build
terminal 1
listening dist folder at
http://localhost:4000
gulp serveterminal 2
watching
src,public,sourcefolders then run build production
gulp build-watchQ&A
Why webpack error file not found
you can noticing webpack to rebuild by
gulp noticeRoadMap
| Status | Goal | Date |
|---|---|---|
| ☑ | sync configuration setup webpack, typescript, babel, react | 09/2023 |
| ☑ | create markdown to JSX react converter | 09/2023 |
| ☑ | create SEO static html for posts | 09/2023 |
| ☑ | mapping and populate markdown posts | 09/2023 |
| ☐ | mapping and populate markdown pages from source folder |
- |
| ☐ | complete layout using flowbite-react |
- |
| ☐ | generate yoast seo sitemaps | - |
| ☐ | generate atom/feeds | - |
| ☐ | localization (multi languages) | - |
On this page
Languages
TypeScript77.0%JavaScript17.9%SCSS4.8%Shell0.2%HTML0.1%
Contributors
MIT License
Created October 15, 2023
Updated March 26, 2024