HydePHP guide
Reviewedbyfl
HydePHP turns Markdown and Blade into a plain HTML site. Learn here how to install it, deploy it and point the root path at the compiled output.
This is work in progress. The software template has not been exercised on a real app yet.
What running Hyde here means
Hyde is a static site generator, not a CMS. php hyde build reads Markdown and Blade and writes plain HTML into a folder called _site. Nothing PHP answers a request afterwards — PHP only runs during the build.
That shapes the whole setup. The build happens as a build command during deployment, and the root path points at _site rather than at the project folder. The PHP component still has to be booked, because the build needs it.
Versions
Hyde 2 is the current major and needs PHP 8.2 or newer, so set the PHP version accordingly. Hyde 1 is still installable and has the same build command and the same output folder.
Get ready
Have a local PHP development environment with PHP 8.2 or newer and Composer, plus a git repo to deploy from.
Create an app at fortrabbit
Create a new app and pick HydePHP as software. The software template behind the preset sets the root path, the build commands and the SITE_URL variable described below, so there is less to configure afterwards.
Install locally
$ composer create-project hyde/hyde my-site
$ cd my-site
$ php hyde build
The build writes _site. Serve it with any static server, or run php hyde serve for the realtime compiler while writing.
Keep the compiled site out of the repo
_site is rebuilt on every deployment, so it belongs neither in git nor in the deploy package. Add it to .gitignore in the project root:
# .gitignore
# Composer, installed by the build command
/vendor
# Written by `hyde build` on every deployment
/_site
Deploy
Connect the repo as described in the git deployment intro, then push. Two build commands run in order:
$ composer install --no-dev --prefer-dist --no-interaction --no-ansi --no-progress
$ php hyde build
The root path is _site, so the compiled HTML is what visitors reach.
Set the site URL
Hyde writes relative permalinks unless it knows the address the site is served from, and it skips the sitemap and the RSS feed entirely. Set SITE_URL as an environment variable, including the protocol:
SITE_URL=https://www.my-site.tld
The software template presets this to the environment's main domain. Change it once a custom domain is the primary one, otherwise links keep pointing at the frbit.app address.
SITE_NAME is optional and names the site in the RSS feed and the meta tags.
Writing content
Markdown files in _pages, _posts and _docs become pages; Blade views in resources/views provide the layout. All of it is code as far as the platform is concerned — it is committed, pushed, and compiled during deployment. There is no admin panel and nothing writes to the environment at runtime, so no rsync step and no writable folders to exclude.
What a static site does not need
No MySQL component, since Hyde stores nothing. No jobs and no key-value store either. A Hyde app books PHP for the build plus storage and traffic, which is the leanest combination the platform offers.