aschmelyun/cleaver-directory
Composer 安装命令:
composer create-project aschmelyun/cleaver-directory
包简介
A blazing-fast static site generator for local directories built with PHP and Laravel's Blade
README 文档
README
🔥 A blazing-fast static site generator for local directories built with PHP and Laravel's Blade, leveraging JSON or Markdown files for super-extensible content.
composer create-project aschmelyun/cleaver-directory your-site-name
Why I built this
During the COVID-19 outbreak, I really wanted to utilize my skills and provide my community with something that could be used for a positive purpose. I decided that a directory showcasing local restaurants that are still open, serving take-out and curbside pickup, would be the perfect use of my time.
I decided to use my previously-built static site generator Cleaver as the base for this project, modifying and adding functionality, a base layout, and example content.
This way, developers of any experience can clone this project for their area, use Markdown to easily add restaurants or businesses, and deploy the whole thing on a service like Netlify for absolutely no cost.
Requirements
- PHP 7.1 or higher
- Fairly recent version of node + npm
Installation
After creating your project with Composer, cd inside your project's root directory and install node dependencies:
npm install
From there you can build the demo site using the included example content, which outputs to a dist/ folder in your project root:
npm run dev
How the directory is structured
Just like with the main Cleaver generator, Cleaver Directory uses a resources/content directory to hold Markdown or JSON files that makeup your site.
By default, there's a nested folder called listings, and this is where you should add in your shops, restaurants, and other businesses in your directory. When rendering a site, the framework will look for content that uses the layout.listing view, and passes this array of listings to the index view.
Individual listing pages are built from the content files in that listings directory. Inside each one, the following variables are required in addition to the view and path on all Cleaver content pages:
- title
- address
- city
- state
- lat
- long
See an example content page here, and further documentation on the main Cleaver documentation page.
You can also have plain content pages (see submit.md as an example), that you can use for informational pages, contact areas, FAQ, and more.
Modifying your assets
Cleaver uses SCSS for styling, and there's a basic skeleton structure set up in the resources/assets/sass directory. Tailwind is imported by default so you can jump right in to rapid development and prototyping.
There's a bootstrapped JavaScript file that imports lodash, jQuery, and Vue dependencies through npm to use with your project. That can be modified by editing the resources/assets/js/app.js file.
Building the site
To compile the SCSS/JS assets and build the static site files, you can run npm run dev from the root. Additionally, using npm run watch starts up a local node server that you can use to view your compiled project, and will watch the entire resources/ directory for changes to any assets, views, or content files.
If you would like to build your site without compiling the assets, run the php cleaver command from the project root.
Publishing your site
Once you're ready to publish your site, simply run the command:
npm run production
Which will minify your assets and build the site again with the new versioned files.
You can then publish your entire project to a host of your choice as long as the web root is pointed to the /dist folder. Additionally, you're free to just publish the built files in the dist folder by themselves.
Contact Info
Have an issue? Submit it here! Want to get in touch or recommend a feature? Feel free to reach out to me on Twitter for any other questions or comments.
License
The MIT License (MIT). See LICENSE.md for more details.
aschmelyun/cleaver-directory 适用场景与选型建议
aschmelyun/cleaver-directory 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 48, 最近一次更新时间为 2020 年 03 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「generator」 「json」 「markdown」 「static」 「site」 「directory」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aschmelyun/cleaver-directory 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aschmelyun/cleaver-directory 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aschmelyun/cleaver-directory 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Kinikit - PHP Application development framework MVC component
ext-json wrapper with sane defaults
A package to cast json fields, each sub-keys is castable
Adds more BBCode
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 48
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-03-30