static-blog-generator v3.0.1
SBG (Static Blog Generator) NodeJS Project
NodeJS Static Blog Generator Inspired Idea From HexoJS. Because of HexoJS doesn't support 1000 posts on 8GB RAM device, i creating this project.
Project Walkthrough
- I switched platforms from blogger to github page.
- Using HexoJS for first time, and creating my own platform converter
Blogger to HexoJS
https://github.com/dimaslanjaka/hexo-blogger-xml - After a few months, my posts have reached 800. hexojs is starting to become unfriendly, to the point that all my articles are corrupted (not rendered perfectly). And some posts got reduced from page rank.
- And i got confused, then iam creating this project
project information
Name | URL | Coverage | CI |
---|---|---|---|
Stable | Download | - | - |
Development | GitHub |
Project active and used at https://github.com/dimaslanjaka/static-blog-generator-hexo as Post Processor and GitHub Site Deployer. Site result at https://github.com/dimaslanjaka/dimaslanjaka.github.io
features
- nodejs (12.x - 17.x supported)
- typescript (pure typescript commonjs with esmodule interop project)
- ejs engine (template renderer)
- markdown engine (using markdown-it support footnotes, sup, sub, etc)
- vscode ide integrated settings (development using vscode recommended)
- cache strategies (dont process any unmodified files to save memory usages)
- github pages deployer (merged instead clean old files to syncronize with cache strategy)
- 1000+ posts supported
- cross-platform supported
Requirements
- linux recommended (used default c++)
- windows need msvs [read gist]
- android termux need c++
pkg install clang -y
# or
pkg install g++
Project Installation
Install using npm
recommended.
# install global packages
npm i -g npm gulp-cli typescript ts-node
# clone
git clone https://github.com/dimaslanjaka/static-blog-generator.git foldername
# cd
cd foldername
# fetch all submodules
git submodule update --recursive --remote
# delete posts (don't copy my articles)
rm -rf src-posts/*
# create required folder
mkdir tmp themes
# install dependencies
npm install
installing development
npm i -D https://github.com/dimaslanjaka/static-blog-generator/raw/master/release/development.tgz
project structure
folder name | description |
---|---|
src-posts | contains all original posts with markdown formats (ejs shortcodes supported) |
source | (config.source_dir in _config.yml) contains all pages that should be on public directory (config.public_dir in _config.yml) |
node_modules/.cache/dimaslanjaka | database caches |
Project Configuration
command line
See Documentation static-blog-generator CLI
Github Action
~important: always run gulp clean
to prevent deleted files on origin repository https://github.com/JamesIves/github-pages-deploy-action/discussions/1070~
PHP Local Server
- https://askubuntu.com/questions/64095/change-xampps-htdocs-web-root-folder-to-another-one
- https://stackoverflow.com/questions/7337724/how-to-check-whether-mod-rewrite-is-enable-on-server
- https://stackoverflow.com/questions/10878284/virtual-hosts-xampp-linux-ubuntu-not-working
References
Troubleshoot
- css and js files not found
bypass using
.nojekyll
It is now possible to completely bypass Jekyll processing on GitHub Pages by creating a file named.nojekyll
in the root of your pages repo and pushing it to GitHub. This should only be necessary if your site uses files or directories that start with underscores since Jekyll considers these to be special resources and does not copy them to the final site.
todo
- admin panel
- download external images to local
- GUI
- template
- archives generator
- multiple type of sitemap (google news, sitemap text, sitemap html, sitemap xml)
contacts
- dimaslanjaka@gmail.com
- whatsapp +6285655667573
incoming terms
- nodejs static blog generator
- nodejs termux static blog generator
- nodejs simple static blog generator