aschmelyun / cleaver
A blazing-fast static site generator using Laravel's Blade templating engine
Fund package maintenance!
aschmelyun
Installs: 955
Dependents: 0
Suggesters: 0
Security: 0
Stars: 295
Watchers: 6
Forks: 22
Open Issues: 33
Type:project
Requires
- php: >=7.2.5
- ext-json: *
- aschmelyun/laravel-blade: ^8.0
- codedungeon/php-cli-colors: ~1.0
- erusev/parsedown-extra: ^0.8.1
- kitetail/zttp: ^0.6.0
- symfony/console: ^5.1
- symfony/filesystem: ^5.1
- symfony/finder: ^5.1
- tightenco/collect: ^5.4
Requires (Dev)
- phpunit/phpunit: ~9.5.0
- dev-main
- v1.6.4
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.7
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.0
- dev-dependabot/npm_and_yarn/webpack-5.76.1
- dev-dependabot/npm_and_yarn/minimist-1.2.8
- dev-dependabot/npm_and_yarn/json5-1.0.2
- dev-dependabot/npm_and_yarn/express-4.18.2
- dev-dependabot/npm_and_yarn/engine.io-and-browser-sync-6.2.1
- dev-dependabot/npm_and_yarn/loader-utils-1.4.2
- dev-dependabot/npm_and_yarn/socket.io-parser-3.3.3
- dev-dependabot/npm_and_yarn/terser-4.8.1
- dev-dependabot/composer/guzzlehttp/guzzle-6.5.8
- dev-dependabot/composer/guzzlehttp/psr7-1.8.5
- dev-dependabot/npm_and_yarn/follow-redirects-1.14.8
- dev-feature/1.5
- dev-feature/1.4
- dev-feature/new-demo-page
This package is auto-updated.
Last update: 2024-10-31 00:24:08 UTC
README
🔥 A blazing-fast static site generator that uses Laravel's Blade templating engine and leverages JSON or Markdown files for super-extensible content.
composer create-project aschmelyun/cleaver your-site-name
Requirements
- PHP 7.3 or higher
- Fairly recent versions 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 site using the included demo content, which outputs to a dist/
folder in your project root:
npm run dev
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 build
command from the project root.
Commands and arguments
If you build the site by calling php cleaver build
directly, here's a list of the current commands and accompanying arguments you can use:
php cleaver build {page}
builds the current site, rendering your content in theresources/content
directory and outputting HTML organized in a directory tree to/dist
. You can choose to render a single page or just a specific path in your content by including apage
argument. (e.g.php cleaver build posts/my-cool-post.md
)
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.
Roadmap
Cleaver is still very much in development, and while it's designed to remain as simple as possible there's a few features that could make for a better overall experience. Here's what's on the path ahead:
- Ability to use folders in content directory
- Add collection containing all content into each view
- A better cli interface and style during site builds
- Ability to add in and use HTML in JSON content files
- More detailed build errors if something goes wrong
- Create and import site scaffolds from the command line
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.