forked fromregisphilibert/hugoGetApi
- Notifications
You must be signed in to change notification settings - Fork2
Use Hugo Generate JSON API
NotificationsYou must be signed in to change notification settings
soulteary/hugo-api-maker
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
使用 Hugo 的自定义输出功能,可以让 Hugo 摇身一变为JSON API Maker
,快速生成你想要的 API。
接口模板定义可以在layouts
中找到,接口路由重写规则可以在layouts/_default/index.redirect
中找到。
切换到目录中,执行hugo
即可。
| EN +------------------+----+ Pages | 32 Paginator pages | 0 Non-page files | 0 Static files | 1 Processed images | 0 Aliases | 0 Sitemaps | 1 Cleaned | 0 Total in 13 ms
输出结果在public
中。
publicpublic/pagepublic/page/aboutpublic/page/about/index.jsonpublic/page/index.jsonpublic/playerspublic/players/zoe-flanderspublic/players/zoe-flanders/index.json...
但是输出内容夹杂大量无用空白,使用CI
或者手动执行node cli
,即可去除无用空白。
Source code forBuild a JSON API With Hugo's Custom Output Formats
About
Use Hugo Generate JSON API
Topics
Resources
Stars
Watchers
Forks
Packages0
No packages published
Languages
- JavaScript93.8%
- Shell6.2%