hexo-generator-shorturl-static
v1.0.1
Published
Hexo generator for creating short URL redirects
Maintainers
Readme
hexo-generator-shorturl-static
Hexo generator that creates short URL redirects using MD5 hashes.
Installation
npm install hexo-generator-shorturl-staticUsage
The generator automatically creates /l/index.html with hash-to-URL mappings for all pages and posts.
Short URLs work like: yoursite.com/l/#abc12345
Configuration
Optionally configure in _config.yml:
shorturl_static:
enable: true # Enable/disable generator (default: true)
not_found_page: /404.html # Optional 404 redirect pageTo disable the generator:
shorturl_static:
enable: falseHow it works
- Generates 8-character MD5 hashes from page URLs
- Creates a redirect page at
/l/index.html - JavaScript redirects hash fragments to full URLs
- Works as a complete static page without server-side support
- Requires JavaScript to function - redirects will not work if JavaScript is disabled
Testing
npm test