From 8b97e7122df14183b8e5f9113bbfa8a9c9c62dfb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Jul 2026 19:30:31 +0000 Subject: [PATCH 1/3] Initial plan From 1733161c900733763c2cd1ff1ca198d3189718a5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Jul 2026 19:33:44 +0000 Subject: [PATCH 2/3] docs: add HydePHP 2 migration plan --- README.md | 5 ++ _data/menu.yml | 1 + docs/guides/hydephp-migration-plan.md | 83 +++++++++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 docs/guides/hydephp-migration-plan.md diff --git a/README.md b/README.md index d30dc17..6779d5d 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,11 @@ This repository contains the source code for the [JsonMapper.net](https://jsonmapper.net) website. For the JsonMapper package, see the [JsonMapper/JsonMapper](https://github.com/JsonMapper/JsonMapper) repository. +## Migration Planning + +The migration plan for moving this site from Jekyll to HydePHP 2 is documented in +[`/docs/guides/hydephp-migration-plan.md`](/docs/guides/hydephp-migration-plan.md). + ## Local Development Requirements: diff --git a/_data/menu.yml b/_data/menu.yml index 8c0f3af..9ce237e 100644 --- a/_data/menu.yml +++ b/_data/menu.yml @@ -9,6 +9,7 @@ Usage: Guides: Getting started: '/docs/guides/getting-started' Creating middleware: '/docs/guides/creating-middleware' + HydePHP migration plan: '/docs/guides/hydephp-migration-plan' Laravel Usage: '/docs/guides/laravel-usage' Symfony Usage: '/docs/guides/symfony-usage' diff --git a/docs/guides/hydephp-migration-plan.md b/docs/guides/hydephp-migration-plan.md new file mode 100644 index 0000000..ae28689 --- /dev/null +++ b/docs/guides/hydephp-migration-plan.md @@ -0,0 +1,83 @@ +--- +title: HydePHP 2 Migration Plan +--- + +This document outlines a full migration plan from the current Jekyll site to HydePHP 2 while preserving all existing content, URLs, and assets. + +## Goals + +- Replace Jekyll with HydePHP 2 as the static site generator. +- Keep all existing page URLs and information architecture stable. +- Preserve generated CSS/JS behavior and current design. +- Keep deployment to GitHub Pages simple and reproducible. + +## Current State Inventory + +1. **Content** + - Homepage: `/index.md` + - Documentation pages under `/docs/**` +2. **Templates** + - Shared layout in `/_layouts/default.html` +3. **Navigation/Data** + - Menu structure in `/_data/menu.yml` + - Asset manifest in `/_data/manifest.yml` +4. **Assets** + - Source assets in `/assets` + - Generated assets in `/dist` + - Static images/icons in `/images` and repository root +5. **Build** + - Jekyll for page generation + - Webpack/Tailwind pipeline from `package.json` + +## Migration Phases + +### Phase 1: Bootstrap HydePHP 2 + +1. Add HydePHP 2 project files (`composer.json`, Hyde config, and required directories). +2. Keep Node/Tailwind tooling initially to reduce change risk. +3. Add local development commands for Hyde serve/build workflows. + +### Phase 2: Move Templates and Data + +1. Port `/_layouts/default.html` into a Blade layout (for example `resources/views/layouts/app.blade.php`). +2. Convert Liquid syntax to Blade equivalents: + - `{{ content }}` -> Blade content slot/yield + - Menu loops -> Blade loops over data collections + - Relative URL helpers -> Hyde/Laravel URL helpers +3. Move menu/manifest data into Hyde-supported data files or config-accessible structures. + +### Phase 3: Move Markdown Content + +1. Migrate root and `/docs/**` markdown pages into Hyde content directories. +2. Preserve front matter (`title`, `permalink`) and ensure route/path parity. +3. Validate all internal links after migration. + +### Phase 4: Assets and Frontend Build + +1. Keep current webpack build temporarily and point Hyde templates to generated files. +2. Confirm `dist` manifest usage still resolves CSS/JS correctly. +3. Optionally evaluate replacing webpack with a Hyde-native/Vite approach after parity is reached. + +### Phase 5: CI/Deployment Cutover + +1. Replace Jekyll build steps with: + - `composer install --no-dev --prefer-dist` + - `npm ci` + - `npm run prod` + - `php hyde build` +2. Publish Hyde output directory to GitHub Pages. +3. Remove Jekyll-specific configuration (`_config.yml`, Jekyll-only directories) only after successful cutover. + +## Validation Checklist + +- [ ] All existing routes resolve with the same public URLs. +- [ ] Navigation renders identically on desktop/mobile. +- [ ] Dark/light styles and code block styles match current behavior. +- [ ] Social/SEO meta tags are preserved. +- [ ] Generated site builds cleanly in CI and deploys to GitHub Pages. + +## Risk Controls + +- Migrate in small PRs by phase instead of a single large rewrite. +- Keep Jekyll branch/tag available until Hyde production validation completes. +- Run side-by-side local builds (Jekyll vs Hyde) to compare rendered output during migration. From 51d80cf0086bccbcedd618c473d01892d19d5a56 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 29 Jul 2026 07:49:41 +0000 Subject: [PATCH 3/3] feat: migrate site from Jekyll to HydePHP 2 --- .env.example | 8 + README.md | 57 +-- _config.yml | 16 - _data/manifest.yml | 9 - _data/menu.yml | 33 -- .../index.md => _docs/advanced/abstracts.md | 0 .../advanced/casting-values.md | 0 .../index.md => _docs/advanced/interfaces.md | 0 .../index.md => _docs/advanced/performance.md | 0 .../index.md => _docs/architecture.md | 0 .../guides/creating-middleware.md | 0 .../guides/getting-started.md | 0 .../index.md => _docs/guides/laravel-usage.md | 8 +- .../index.md => _docs/guides/symfony-usage.md | 8 +- _docs/index.md | 7 + .../middleware/attributes.md | 0 .../middleware/case-conversion.md | 0 .../middleware/constructor.md | 0 .../index.md => _docs/middleware/debugging.md | 2 +- .../middleware/doc-block-annotations.md | 4 +- .../middleware/final-callback.md | 0 .../middleware/laravel-eloquent.md | 0 .../middleware/namespace-resolver.md | 2 +- .../index.md => _docs/middleware/rename.md | 0 .../middleware/typed-properties.md | 2 +- .../middleware/value-transformation.md | 0 .../index.md => _docs/usage/installation.md | 2 +- .../setup/index.md => _docs/usage/setup.md | 0 _layouts/default.html | 134 ----- CNAME => _media/CNAME | 0 .../android-chrome-192x192.png | Bin .../android-chrome-512x512.png | Bin .../apple-touch-icon.png | Bin favicon-16x16.png => _media/favicon-16x16.png | Bin favicon-32x32.png => _media/favicon-32x32.png | Bin favicon.ico => _media/favicon.ico | Bin .../images}/jetbrains-variant-3.png | Bin .../images}/jsonmapper-light.png | Bin .../images}/jsonmapper-og-facebook.png | Bin .../images}/jsonmapper-og-twitter.png | Bin {images => _media/images}/jsonmapper.png | Bin site.webmanifest => _media/site.webmanifest | 0 index.md => _pages/index.md | 0 _posts/.gitkeep | 0 app/Providers/AppServiceProvider.php | 24 + app/bootstrap.php | 73 +++ app/config.php | 115 +++++ composer.json | 62 +++ config/docs.php | 171 +++++++ config/hyde.php | 472 ++++++++++++++++++ config/markdown.php | 116 +++++ docs/guides/hydephp-migration-plan.md | 83 --- hyde | 53 ++ resources/views/.gitkeep | 0 sitemap.xml | 56 --- 55 files changed, 1125 insertions(+), 392 deletions(-) create mode 100644 .env.example delete mode 100644 _config.yml delete mode 100644 _data/manifest.yml delete mode 100644 _data/menu.yml rename docs/advanced/abstracts/index.md => _docs/advanced/abstracts.md (100%) rename docs/advanced/casting-values/index.md => _docs/advanced/casting-values.md (100%) rename docs/advanced/interfaces/index.md => _docs/advanced/interfaces.md (100%) rename docs/advanced/performance/index.md => _docs/advanced/performance.md (100%) rename docs/architecture/index.md => _docs/architecture.md (100%) rename docs/guides/creating-middleware/index.md => _docs/guides/creating-middleware.md (100%) rename docs/guides/getting-started/index.md => _docs/guides/getting-started.md (100%) rename docs/guides/laravel-usage/index.md => _docs/guides/laravel-usage.md (89%) rename docs/guides/symfony-usage/index.md => _docs/guides/symfony-usage.md (78%) create mode 100644 _docs/index.md rename docs/middleware/attributes/index.md => _docs/middleware/attributes.md (100%) rename docs/middleware/case-conversion/index.md => _docs/middleware/case-conversion.md (100%) rename docs/middleware/constructor/index.md => _docs/middleware/constructor.md (100%) rename docs/middleware/debugging/index.md => _docs/middleware/debugging.md (94%) rename docs/middleware/doc-block-annotations/index.md => _docs/middleware/doc-block-annotations.md (96%) rename docs/middleware/final-callback/index.md => _docs/middleware/final-callback.md (100%) rename docs/middleware/laravel-eloquent/index.md => _docs/middleware/laravel-eloquent.md (100%) rename docs/middleware/namespace-resolver/index.md => _docs/middleware/namespace-resolver.md (93%) rename docs/middleware/rename/index.md => _docs/middleware/rename.md (100%) rename docs/middleware/typed-properties/index.md => _docs/middleware/typed-properties.md (98%) rename docs/middleware/value-transformation/index.md => _docs/middleware/value-transformation.md (100%) rename docs/usage/installation/index.md => _docs/usage/installation.md (84%) rename docs/usage/setup/index.md => _docs/usage/setup.md (100%) delete mode 100644 _layouts/default.html rename CNAME => _media/CNAME (100%) rename android-chrome-192x192.png => _media/android-chrome-192x192.png (100%) rename android-chrome-512x512.png => _media/android-chrome-512x512.png (100%) rename apple-touch-icon.png => _media/apple-touch-icon.png (100%) rename favicon-16x16.png => _media/favicon-16x16.png (100%) rename favicon-32x32.png => _media/favicon-32x32.png (100%) rename favicon.ico => _media/favicon.ico (100%) rename {images => _media/images}/jetbrains-variant-3.png (100%) rename {images => _media/images}/jsonmapper-light.png (100%) rename {images => _media/images}/jsonmapper-og-facebook.png (100%) rename {images => _media/images}/jsonmapper-og-twitter.png (100%) rename {images => _media/images}/jsonmapper.png (100%) rename site.webmanifest => _media/site.webmanifest (100%) rename index.md => _pages/index.md (100%) create mode 100644 _posts/.gitkeep create mode 100644 app/Providers/AppServiceProvider.php create mode 100644 app/bootstrap.php create mode 100644 app/config.php create mode 100644 composer.json create mode 100644 config/docs.php create mode 100644 config/hyde.php create mode 100644 config/markdown.php delete mode 100644 docs/guides/hydephp-migration-plan.md create mode 100755 hyde create mode 100644 resources/views/.gitkeep delete mode 100644 sitemap.xml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..93d0480 --- /dev/null +++ b/.env.example @@ -0,0 +1,8 @@ +# If you have a domain, you should set the URL here so that permalinks can be generated. +# SITE_URL=https://example.org + +# If you want to use Torchlight.dev, enter your API token here to automatically enable it +# TORCHLIGHT_TOKEN=torch_ + +# If you want to change the default port of the realtime compiler server, you can do so here +# SERVER_PORT=8080 diff --git a/README.md b/README.md index 6779d5d..9cc32f1 100644 --- a/README.md +++ b/README.md @@ -3,64 +3,27 @@ This repository contains the source code for the [JsonMapper.net](https://jsonmapper.net) website. For the JsonMapper package, see the [JsonMapper/JsonMapper](https://github.com/JsonMapper/JsonMapper) repository. -## Migration Planning - -The migration plan for moving this site from Jekyll to HydePHP 2 is documented in -[`/docs/guides/hydephp-migration-plan.md`](/docs/guides/hydephp-migration-plan.md). - ## Local Development Requirements: -- [Node.js](https://nodejs.org/) -- [Jekyll](https://jekyllrb.com/) +- [PHP 8.2+](https://www.php.net/) +- [Composer](https://getcomposer.org/) -Jekyll is used to generate the pages, -and webpack is used to bundle the styles. +This site now uses [HydePHP 2](https://hydephp.com/) as its static site generator. -To get the site up and running locally, run: +To run the site locally: ```shell -# Install all packages. -npm i - -# Bundle the CSS in watch mode. -npm start - -# Start Jekyll to serve everything. -# The -l flag will automatically reload the browser after changes. -jekyll serve -l - -# Alternatively, you can run Jekyll in Docker: -docker run --rm -v "$PWD:/srv/jekyll" -p '4000:4000' -it jekyll/jekyll:3 jekyll serve -l - -# Run a production build: -npm run prod -``` - -You can now view the site on: http://localhost:4000 - -Because the site uses Tailwind, -you also need to run the CSS bundler when changing classes used in the HTML, -as unused classes will be pruned from the generated stylesheet. - -### Troubleshooting - -Note that if you use Node.js v17 or higher you will get an `ERR_OSSL_EVP_UNSUPPORTED` error like: - -``` -node:internal/crypto/hash:71 - this[kHandle] = new _Hash(algorithm, xofLen); - ^ +# Install PHP dependencies +composer install -Error: error:0308010C:digital envelope routines::unsupported -[...] +# Start the Hyde development server +php hyde serve ``` -To fix this, you can either use Node.js v16, -or tell Node.js to use the legacy OpenSSL provider: +To create a production build: ```shell -export NODE_OPTIONS=--openssl-legacy-provider -npm start +php hyde build ``` diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 5f487b4..0000000 --- a/_config.yml +++ /dev/null @@ -1,16 +0,0 @@ -defaults: - - scope: - path: "" - values: - layout: "default" - - scope: - path: "assets/images" - values: - image: true - -exclude: - - "*.config.js" - - "package*.json" - - assets - - node_modules - - .idea diff --git a/_data/manifest.yml b/_data/manifest.yml deleted file mode 100644 index fddd5e2..0000000 --- a/_data/manifest.yml +++ /dev/null @@ -1,9 +0,0 @@ -{ - "style.css": "./dist/style.85d6c0d198753c92aa37.css", - "style.js": "./dist/style.85d6c0d198753c92aa37.js", - "monokai.css": "./dist/monokai.85d6c0d198753c92aa37.css", - "monokai.js": "./dist/monokai.85d6c0d198753c92aa37.js", - "xcode.css": "./dist/xcode.85d6c0d198753c92aa37.css", - "xcode.js": "./dist/xcode.85d6c0d198753c92aa37.js", - "code-copy.js": "./dist/code-copy.85d6c0d198753c92aa37.js" -} \ No newline at end of file diff --git a/_data/menu.yml b/_data/menu.yml deleted file mode 100644 index 9ce237e..0000000 --- a/_data/menu.yml +++ /dev/null @@ -1,33 +0,0 @@ -General: - Introduction: '/' - Architecture: '/docs/architecture' - -Usage: - Installation: '/docs/usage/installation' - Setup: '/docs/usage/setup' - -Guides: - Getting started: '/docs/guides/getting-started' - Creating middleware: '/docs/guides/creating-middleware' - HydePHP migration plan: '/docs/guides/hydephp-migration-plan' - Laravel Usage: '/docs/guides/laravel-usage' - Symfony Usage: '/docs/guides/symfony-usage' - -Middleware: - Typed properties: '/docs/middleware/typed-properties' - DocBlock annotations: '/docs/middleware/doc-block-annotations' - Namespace resolver: '/docs/middleware/namespace-resolver' - Constructor support: '/docs/middleware/constructor' - Case conversion: '/docs/middleware/case-conversion' - Debugging: '/docs/middleware/debugging' - Final callback: '/docs/middleware/final-callback' - Rename: '/docs/middleware/rename' - Value transformation: '/docs/middleware/value-transformation' - PHP Attributes: '/docs/middleware/attributes' - Laravel Eloquent: '/docs/middleware/laravel-eloquent' - -Advanced Usage: - Performance: '/docs/advanced/performance' - Casting values: '/docs/advanced/casting-values' - Interfaces: '/docs/advanced/interfaces' - Abstract classes: '/docs/advanced/abstracts' diff --git a/docs/advanced/abstracts/index.md b/_docs/advanced/abstracts.md similarity index 100% rename from docs/advanced/abstracts/index.md rename to _docs/advanced/abstracts.md diff --git a/docs/advanced/casting-values/index.md b/_docs/advanced/casting-values.md similarity index 100% rename from docs/advanced/casting-values/index.md rename to _docs/advanced/casting-values.md diff --git a/docs/advanced/interfaces/index.md b/_docs/advanced/interfaces.md similarity index 100% rename from docs/advanced/interfaces/index.md rename to _docs/advanced/interfaces.md diff --git a/docs/advanced/performance/index.md b/_docs/advanced/performance.md similarity index 100% rename from docs/advanced/performance/index.md rename to _docs/advanced/performance.md diff --git a/docs/architecture/index.md b/_docs/architecture.md similarity index 100% rename from docs/architecture/index.md rename to _docs/architecture.md diff --git a/docs/guides/creating-middleware/index.md b/_docs/guides/creating-middleware.md similarity index 100% rename from docs/guides/creating-middleware/index.md rename to _docs/guides/creating-middleware.md diff --git a/docs/guides/getting-started/index.md b/_docs/guides/getting-started.md similarity index 100% rename from docs/guides/getting-started/index.md rename to _docs/guides/getting-started.md diff --git a/docs/guides/laravel-usage/index.md b/_docs/guides/laravel-usage.md similarity index 89% rename from docs/guides/laravel-usage/index.md rename to _docs/guides/laravel-usage.md index c2e24e0..4353de7 100644 --- a/docs/guides/laravel-usage/index.md +++ b/_docs/guides/laravel-usage.md @@ -3,15 +3,15 @@ permalink: /docs/guides/laravel-usage/ title: Laravel usage --- -In order to use JsonMapper with your [Laravel](https://laravel.com){:target="_blank"} application you only need -JsonMapper's [LaravelPackage](https://github.com/JsonMapper/LaravelPackage){:target="_blank"}. +In order to use JsonMapper with your [Laravel](https://laravel.com) application you only need +JsonMapper's [LaravelPackage](https://github.com/JsonMapper/LaravelPackage). ## Installation -The installation of JsonMapper Laravel package can easily be done with [Composer](https://getcomposer.org){:target="_blank"} +The installation of JsonMapper Laravel package can easily be done with [Composer](https://getcomposer.org) ```bash $ composer require json-mapper/laravel-package ``` -This package makes use of [Laravels package auto-discovery mechanism](https://medium.com/@taylorotwell/package-auto-discovery-in-laravel-5-5-ea9e3ab20518){:target="_blank"}. +This package makes use of [Laravels package auto-discovery mechanism](https://medium.com/@taylorotwell/package-auto-discovery-in-laravel-5-5-ea9e3ab20518). * The example shown above assumes that `composer` is on your `$PATH`. diff --git a/docs/guides/symfony-usage/index.md b/_docs/guides/symfony-usage.md similarity index 78% rename from docs/guides/symfony-usage/index.md rename to _docs/guides/symfony-usage.md index 0f27b39..c88319d 100644 --- a/docs/guides/symfony-usage/index.md +++ b/_docs/guides/symfony-usage.md @@ -3,18 +3,18 @@ permalink: /docs/guides/symfony-usage/ title: Symfony usage --- -In order to use JsonMapper with your [Symfony](https://symfony.com){:target="_blank"} application you only need -JsonMapper's [SymfonyBundle](https://github.com/JsonMapper/SymfonyBundle){:target="_blank"}. +In order to use JsonMapper with your [Symfony](https://symfony.com) application you only need +JsonMapper's [SymfonyBundle](https://github.com/JsonMapper/SymfonyBundle). ## Installation -The installation of JsonMapper Symfony package can easily be done with [Composer](https://getcomposer.org){:target="_blank"} +The installation of JsonMapper Symfony package can easily be done with [Composer](https://getcomposer.org) ```bash $ composer require json-mapper/symfony-bundle ``` The example shown above assumes that `composer` is on your `$PATH`. ## Configuration -If your application does not use [Symfony Flex](https://symfony.com/doc/current/setup/flex.html){:target="_blank"}, you need to manually enable the bundle in your `config/bundles.php` file: +If your application does not use [Symfony Flex](https://symfony.com/doc/current/setup/flex.html), you need to manually enable the bundle in your `config/bundles.php` file: ```php default(); diff --git a/docs/middleware/doc-block-annotations/index.md b/_docs/middleware/doc-block-annotations.md similarity index 96% rename from docs/middleware/doc-block-annotations/index.md rename to _docs/middleware/doc-block-annotations.md index 9d4ef95..55c6ba1 100644 --- a/docs/middleware/doc-block-annotations/index.md +++ b/_docs/middleware/doc-block-annotations.md @@ -3,8 +3,8 @@ permalink: /docs/middleware/doc-block-annotations/ title: DocBlock annotations --- -The DocBlock annotations middleware will scan the target object using [Reflection](https://www.php.net/manual/en/intro.reflection.php){:target="_blank"} -for properties and their [DocBlock](https://docs.phpdoc.org/guide/references/phpdoc/index.html){:target="_blank"} annotations. +The DocBlock annotations middleware will scan the target object using [Reflection](https://www.php.net/manual/en/intro.reflection.php) +for properties and their [DocBlock](https://docs.phpdoc.org/guide/references/phpdoc/index.html) annotations. Using the annotations it will determine the property type and amend these results to the property map. The property map is utilised by the PropertyMapper when applying the data from the JSON object to the target object. diff --git a/docs/middleware/final-callback/index.md b/_docs/middleware/final-callback.md similarity index 100% rename from docs/middleware/final-callback/index.md rename to _docs/middleware/final-callback.md diff --git a/docs/middleware/laravel-eloquent/index.md b/_docs/middleware/laravel-eloquent.md similarity index 100% rename from docs/middleware/laravel-eloquent/index.md rename to _docs/middleware/laravel-eloquent.md diff --git a/docs/middleware/namespace-resolver/index.md b/_docs/middleware/namespace-resolver.md similarity index 93% rename from docs/middleware/namespace-resolver/index.md rename to _docs/middleware/namespace-resolver.md index 894817f..61798c2 100644 --- a/docs/middleware/namespace-resolver/index.md +++ b/_docs/middleware/namespace-resolver.md @@ -3,7 +3,7 @@ permalink: /docs/middleware/namespace-resolver/ title: Namespace resolver --- -The namespace resolver middleware will tokenize the target object using [nikic/php-parser](https://github.com/nikic/PHP-Parser){:target="_blank"} +The namespace resolver middleware will tokenize the target object using [nikic/php-parser](https://github.com/nikic/PHP-Parser) in order to get the namespaces that are imported. These imports will be applied to the object properties found in the property map. _This middleware is part of both the default and best fit factory methods as it provides elementary functionality to JsonMapper_ diff --git a/docs/middleware/rename/index.md b/_docs/middleware/rename.md similarity index 100% rename from docs/middleware/rename/index.md rename to _docs/middleware/rename.md diff --git a/docs/middleware/typed-properties/index.md b/_docs/middleware/typed-properties.md similarity index 98% rename from docs/middleware/typed-properties/index.md rename to _docs/middleware/typed-properties.md index 581c503..9a6c5d7 100644 --- a/docs/middleware/typed-properties/index.md +++ b/_docs/middleware/typed-properties.md @@ -3,7 +3,7 @@ permalink: /docs/middleware/typed-properties/ title: Typed properties --- -The typed properties middleware will scan the target object using [Reflection](https://www.php.net/manual/en/intro.reflection.php){:target="_blank"} +The typed properties middleware will scan the target object using [Reflection](https://www.php.net/manual/en/intro.reflection.php) for properties. Using the reflection information it will determine the property type and amend these results to the property map. The property map is utilised by the PropertyMapper when applying the data from the JSON object to the target object. diff --git a/docs/middleware/value-transformation/index.md b/_docs/middleware/value-transformation.md similarity index 100% rename from docs/middleware/value-transformation/index.md rename to _docs/middleware/value-transformation.md diff --git a/docs/usage/installation/index.md b/_docs/usage/installation.md similarity index 84% rename from docs/usage/installation/index.md rename to _docs/usage/installation.md index 37992ee..84a7ce3 100644 --- a/docs/usage/installation/index.md +++ b/_docs/usage/installation.md @@ -3,7 +3,7 @@ permalink: /docs/usage/installation title: Installation --- -The installation of JsonMapper can easily be done with [Composer](https://getcomposer.org){:target="_blank"} +The installation of JsonMapper can easily be done with [Composer](https://getcomposer.org) ```bash $ composer require json-mapper/json-mapper ``` diff --git a/docs/usage/setup/index.md b/_docs/usage/setup.md similarity index 100% rename from docs/usage/setup/index.md rename to _docs/usage/setup.md diff --git a/_layouts/default.html b/_layouts/default.html deleted file mode 100644 index 7fd661f..0000000 --- a/_layouts/default.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - JsonMapper - - - - JsonMapper - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- - JsonMapper - - -
- -
- -
-
- -
-
-
- -
-

{{ page.title }}

- {{ content }} -
-
-
- -
- - - - diff --git a/CNAME b/_media/CNAME similarity index 100% rename from CNAME rename to _media/CNAME diff --git a/android-chrome-192x192.png b/_media/android-chrome-192x192.png similarity index 100% rename from android-chrome-192x192.png rename to _media/android-chrome-192x192.png diff --git a/android-chrome-512x512.png b/_media/android-chrome-512x512.png similarity index 100% rename from android-chrome-512x512.png rename to _media/android-chrome-512x512.png diff --git a/apple-touch-icon.png b/_media/apple-touch-icon.png similarity index 100% rename from apple-touch-icon.png rename to _media/apple-touch-icon.png diff --git a/favicon-16x16.png b/_media/favicon-16x16.png similarity index 100% rename from favicon-16x16.png rename to _media/favicon-16x16.png diff --git a/favicon-32x32.png b/_media/favicon-32x32.png similarity index 100% rename from favicon-32x32.png rename to _media/favicon-32x32.png diff --git a/favicon.ico b/_media/favicon.ico similarity index 100% rename from favicon.ico rename to _media/favicon.ico diff --git a/images/jetbrains-variant-3.png b/_media/images/jetbrains-variant-3.png similarity index 100% rename from images/jetbrains-variant-3.png rename to _media/images/jetbrains-variant-3.png diff --git a/images/jsonmapper-light.png b/_media/images/jsonmapper-light.png similarity index 100% rename from images/jsonmapper-light.png rename to _media/images/jsonmapper-light.png diff --git a/images/jsonmapper-og-facebook.png b/_media/images/jsonmapper-og-facebook.png similarity index 100% rename from images/jsonmapper-og-facebook.png rename to _media/images/jsonmapper-og-facebook.png diff --git a/images/jsonmapper-og-twitter.png b/_media/images/jsonmapper-og-twitter.png similarity index 100% rename from images/jsonmapper-og-twitter.png rename to _media/images/jsonmapper-og-twitter.png diff --git a/images/jsonmapper.png b/_media/images/jsonmapper.png similarity index 100% rename from images/jsonmapper.png rename to _media/images/jsonmapper.png diff --git a/site.webmanifest b/_media/site.webmanifest similarity index 100% rename from site.webmanifest rename to _media/site.webmanifest diff --git a/index.md b/_pages/index.md similarity index 100% rename from index.md rename to _pages/index.md diff --git a/_posts/.gitkeep b/_posts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php new file mode 100644 index 0000000..452e6b6 --- /dev/null +++ b/app/Providers/AppServiceProvider.php @@ -0,0 +1,24 @@ +singleton( + Illuminate\Contracts\Console\Kernel::class, + \Hyde\Foundation\ConsoleKernel::class +); + +$app->singleton( + Illuminate\Contracts\Debug\ExceptionHandler::class, + Illuminate\Foundation\Exceptions\Handler::class +); + +/* +|-------------------------------------------------------------------------- +| Set Important Hyde Configurations +|-------------------------------------------------------------------------- +| +| Now, we create a new instance of the HydeKernel, which encapsulates +| our Hyde project and provides helpful methods for interacting with it. +| Then, we bind the kernel into the application service container. +| +*/ + +$hyde = new \Hyde\Foundation\HydeKernel( + dirname(__DIR__) +); + +$app->singleton( + \Hyde\Foundation\HydeKernel::class, function (): \Hyde\Foundation\HydeKernel { + return \Hyde\Foundation\HydeKernel::getInstance(); + } +); + +\Hyde\Foundation\HydeKernel::setInstance($hyde); + +/* +|-------------------------------------------------------------------------- +| Return The Application +|-------------------------------------------------------------------------- +| +| This script returns the application instance. The instance is given to +| the calling script so we can separate the building of the instances +| from the actual running of the application and sending responses. +| +*/ + +return $app; diff --git a/app/config.php b/app/config.php new file mode 100644 index 0000000..314a7b4 --- /dev/null +++ b/app/config.php @@ -0,0 +1,115 @@ + 'JsonMapper', + + /* + |-------------------------------------------------------------------------- + | Application Version + |-------------------------------------------------------------------------- + | + | This value determines the "version" your application is currently running + | in. You may want to follow the "Semantic Versioning" - Given a version + | number MAJOR.MINOR.PATCH when an update happens: https://semver.org. + | + */ + + 'version' => Hyde\Hyde::version(), + + /* + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services the application utilizes. This can be overridden using + | the global command line "--env" option when calling commands. + | + | When using Hyde this setting should always be set to `production`. + | However, when developing the Hyde Core, set it to `development` + | in your .env to unlock the development commands. + | + */ + + 'env' => env('ENV', 'production'), + + /* + |-------------------------------------------------------------------------- + | Autoloaded Service Providers + |-------------------------------------------------------------------------- + | + | The service providers listed here will be automatically loaded on the + | request to your application. Feel free to add your own services to + | this array to grant expanded functionality to your applications. + | + */ + + 'providers' => [ + App\Providers\AppServiceProvider::class, + Hyde\Foundation\Providers\ConfigurationServiceProvider::class, + Hyde\Framework\HydeServiceProvider::class, + Hyde\Foundation\Providers\ViewServiceProvider::class, + Hyde\Foundation\Providers\NavigationServiceProvider::class, + Hyde\Console\ConsoleServiceProvider::class, + ], + + /* + |-------------------------------------------------------------------------- + | Class Aliases + |-------------------------------------------------------------------------- + | + | This array of class aliases will be registered when this application + | is started. However, feel free to register as many as you wish as + | the aliases are "lazy" loaded so they don't hinder performance. + | + */ + + 'aliases' => [ + 'Hyde' => Hyde\Hyde::class, + 'Site' => \Hyde\Facades\Site::class, + 'Meta' => \Hyde\Facades\Meta::class, + 'Vite' => \Hyde\Facades\Vite::class, + 'Asset' => \Hyde\Facades\Asset::class, + 'Author' => \Hyde\Facades\Author::class, + 'HydeFront' => \Hyde\Facades\HydeFront::class, + 'Features' => \Hyde\Facades\Features::class, + 'Config' => \Hyde\Facades\Config::class, + 'Filesystem' => \Hyde\Facades\Filesystem::class, + 'Navigation' => \Hyde\Facades\Navigation::class, + 'Routes' => \Hyde\Foundation\Facades\Routes::class, + 'HtmlPage' => \Hyde\Pages\HtmlPage::class, + 'BladePage' => \Hyde\Pages\BladePage::class, + 'MarkdownPage' => \Hyde\Pages\MarkdownPage::class, + 'MarkdownPost' => \Hyde\Pages\MarkdownPost::class, + 'DocumentationPage' => \Hyde\Pages\DocumentationPage::class, + 'MediaFile' => \Hyde\Support\Filesystem\MediaFile::class, + 'DataCollection' => \Hyde\Support\DataCollection::class, + 'Includes' => \Hyde\Support\Includes::class, + 'Feature' => \Hyde\Enums\Feature::class, + ], + +]; diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..f09f0c5 --- /dev/null +++ b/composer.json @@ -0,0 +1,62 @@ +{ + "name": "jsonmapper/jsonmapper.github.io", + "description": "Source code for JsonMapper.net built with HydePHP.", + "keywords": [ + "framework", + "hyde", + "hyde framework", + "hydephp", + "static site generator", + "static site framework", + "ssg" + ], + "homepage": "https://jsonmapper.net", + "type": "project", + "license": "MIT", + "support": { + "issues": "https://github.com/JsonMapper/jsonmapper.github.io/issues", + "source": "https://github.com/JsonMapper/jsonmapper.github.io" + }, + "authors": [ + { + "name": "JsonMapper Contributors" + } + ], + "require": { + "php": "^8.2", + "hyde/framework": "^2.0", + "laravel-zero/framework": "^11.0" + }, + "require-dev": { + "hyde/realtime-compiler": "^4.5" + }, + "autoload": { + "psr-4": { + "App\\": "app/" + } + }, + "autoload-dev": { + "psr-4": { + "Hyde\\Testing\\": "tests/" + } + }, + "scripts": { + "post-autoload-dump": [ + "@php -r \"@unlink('./app/storage/framework/cache/packages.php');\"", + "@php hyde package:discover --ansi" + ] + }, + "config": { + "preferred-install": "dist", + "sort-packages": true, + "optimize-autoloader": true, + "allow-plugins": { + "pestphp/pest-plugin": true + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "bin": [ + "hyde" + ] +} diff --git a/config/docs.php b/config/docs.php new file mode 100644 index 0000000..ea61a2d --- /dev/null +++ b/config/docs.php @@ -0,0 +1,171 @@ + [ + // The title in the sidebar header + 'header' => env('SITE_NAME', 'JsonMapper').' Docs', + + // When using a grouped sidebar, should the groups be collapsible? + 'collapsible' => true, + + // A string of Markdown to show in the footer. Set to `false` to disable. + 'footer' => '[Back to home page](../)', + + /* + |-------------------------------------------------------------------------- + | Sidebar Page Order + |-------------------------------------------------------------------------- + | + | In the generated Documentation pages the navigation links in the sidebar + | default to sort alphabetically. You can reorder the page identifiers + | in the list below, and the links will get sorted in that order. + | + | The items will get a priority of 500 plus the order its found in the list. + | Pages without a priority will fall back to the default priority of 999. + | + | You can also set explicit priorities in front matter or by specifying + | a value to the array key in the list to override the inferred value. + | + */ + + 'order' => [ + 'index', + 'architecture', + 'usage/installation', + 'usage/setup', + 'guides/getting-started', + 'guides/creating-middleware', + 'guides/laravel-usage', + 'guides/symfony-usage', + 'middleware/typed-properties', + 'middleware/doc-block-annotations', + 'middleware/namespace-resolver', + 'middleware/constructor', + 'middleware/case-conversion', + 'middleware/debugging', + 'middleware/final-callback', + 'middleware/rename', + 'middleware/value-transformation', + 'middleware/attributes', + 'middleware/laravel-eloquent', + 'advanced/performance', + 'advanced/casting-values', + 'advanced/interfaces', + 'advanced/abstracts', + ], + + /* + |-------------------------------------------------------------------------- + | Sidebar Labels + |-------------------------------------------------------------------------- + | + | Define custom labels for sidebar items. The array key should be the + | page identifier, and the value should be the display label. + | + */ + + 'labels' => [ + \Hyde\Pages\DocumentationPage::homeRouteName() => 'Docs', + ], + + /* + |-------------------------------------------------------------------------- + | Table of Contents Settings + |-------------------------------------------------------------------------- + | + | The Hyde Documentation Module comes with a fancy Sidebar that, by default, + | has a Table of Contents included. Here, you can configure its behavior, + | content, look and feel. You can also disable the feature completely. + | + */ + + 'table_of_contents' => [ + 'enabled' => true, + 'min_heading_level' => 2, + 'max_heading_level' => 4, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Collaborative Source Editing Location + |-------------------------------------------------------------------------- + | + | @see https://hydephp.com/docs/2.x/documentation-pages#automatic-edit-page-button + | + | By adding a base URL here, Hyde will use it to create "edit source" links + | to your documentation pages. Hyde expects this to be a GitHub path, but + | it will probably work with other methods as well, if not, send a PR! + | + | You can also change the link text with the `edit_source_link_text` setting. + | + | Example: https://github.com/hydephp/docs/blob/master + | Do not specify the filename or extension, Hyde will do that for you. + | Setting this to null will disable the feature. + | + */ + + // 'source_file_location_base' => 'https://github.com///<[blob/edit]>/', + 'edit_source_link_text' => 'Edit Source', + 'edit_source_link_position' => 'footer', // 'header', 'footer', or 'both' + + /* + |-------------------------------------------------------------------------- + | Search Customization + |-------------------------------------------------------------------------- + | + | Hyde comes with an easy to use search feature for documentation pages. + | @see https://hydephp.com/docs/2.x/documentation-pages#search-feature + | + */ + + // Should a docs/search.html page be generated? + 'create_search_page' => true, + + // Are there any pages you don't want to show in the search results? + 'exclude_from_search' => [ + 'changelog', + ], + + /* + |-------------------------------------------------------------------------- + | Flattened Output Paths + |-------------------------------------------------------------------------- + | + | If this setting is set to true, Hyde will output all documentation pages + | into the same configured documentation output directory. This means + | that you can use the automatic directory based grouping feature, + | but still have a "flat" output structure. Note that this means + | that you can't have two documentation pages with the same + | filename or navigation menu label as they will overwrite each other. + | + | If you set this to false, Hyde will match the directory structure + | of the source files (just like all other pages). + | + */ + + 'flattened_output_paths' => false, +]; diff --git a/config/hyde.php b/config/hyde.php new file mode 100644 index 0000000..7f65d69 --- /dev/null +++ b/config/hyde.php @@ -0,0 +1,472 @@ + env('SITE_NAME', 'JsonMapper'), + + /* + |-------------------------------------------------------------------------- + | Site Base URL + |-------------------------------------------------------------------------- + | + | Setting a base URL is highly recommended, and is required to use some + | HydePHP features, like automatic sitemaps and RSS feeds. + | + | If you are serving your site from a subdirectory, + | you will need to include that in the path. + | + */ + + 'url' => env('SITE_URL', 'https://jsonmapper.net'), + + /* + |-------------------------------------------------------------------------- + | Site Language + |-------------------------------------------------------------------------- + | + | This value sets the language of your site and is used for the + | element in the app layout. Default is 'en'. + | + */ + + 'language' => 'en', + + /* + |-------------------------------------------------------------------------- + | Pretty URLs + |-------------------------------------------------------------------------- + | + | When the setting is enabled, generated links in the compiled HTML site + | are without the .html extension, in other words, "pretty" URLs. + | + | This setting can also be enabled on a per-compile basis by supplying + | the `--pretty-urls` option when you run the build command. + | + */ + + 'pretty_urls' => true, + + /* + |-------------------------------------------------------------------------- + | Sitemap Generation + |-------------------------------------------------------------------------- + | + | When the setting is enabled, a sitemap.xml file will automatically be + | generated when you compile your static site. + | + | This feature requires that a site base URL has been set. + | + */ + + 'generate_sitemap' => true, + + /* + |-------------------------------------------------------------------------- + | RSS Feed Generation + |-------------------------------------------------------------------------- + | + | When enabled, an RSS feed with your Markdown blog posts will be + | generated when you compile your static site. + | + | This feature requires that a site base URL has been set. + | + */ + + 'rss' => [ + // Should the RSS feed be generated? + 'enabled' => true, + + // What filename should the RSS file use? + 'filename' => 'feed.xml', + + // The channel description. + 'description' => env('SITE_NAME', 'JsonMapper').' RSS Feed', + ], + + /* + |-------------------------------------------------------------------------- + | Source Root Directory + |-------------------------------------------------------------------------- + | + | HydePHP will by default look for the underscored source directories in the + | root of your project. For example, you might want everything in a 'src' + | subdirectory. That's easy enough, just set the value below to "src"! + | + */ + + 'source_root' => '', + + /* + |-------------------------------------------------------------------------- + | Site Output Directory + |-------------------------------------------------------------------------- + | + | This setting specifies the output path for your site, useful to, for + | example, store the site in the docs/ directory for GitHub Pages. + | The path is relative to the root of your project. + | + */ + + 'output_directory' => '_site', + + /* + |-------------------------------------------------------------------------- + | Source Directories + |-------------------------------------------------------------------------- + | + | The directories you place your content in are important. The directory + | will be used to determine the proper page type and the templates used. + | If you are not happy with these defaults, you can change them here. + | Note that these are relative to the `source_root` setting above. + | + */ + + 'source_directories' => [ + \Hyde\Pages\HtmlPage::class => '_pages', + \Hyde\Pages\BladePage::class => '_pages', + \Hyde\Pages\MarkdownPage::class => '_pages', + \Hyde\Pages\MarkdownPost::class => '_posts', + \Hyde\Pages\DocumentationPage::class => '_docs', + ], + + /* + |-------------------------------------------------------------------------- + | Output Directories + |-------------------------------------------------------------------------- + | + | Like the source directories, the output directories are also important + | as they determine the final output path for each page type in your + | compiled static site. This change also affects the route keys. + | + | Note that these are relative to the site's `output_directory` setting. + | Setting the value to '' will output the page to the root of the site. + | + */ + + 'output_directories' => [ + \Hyde\Pages\HtmlPage::class => '', + \Hyde\Pages\BladePage::class => '', + \Hyde\Pages\MarkdownPage::class => '', + \Hyde\Pages\MarkdownPost::class => 'posts', + \Hyde\Pages\DocumentationPage::class => 'docs', + ], + + /* + |-------------------------------------------------------------------------- + | Media Directory + |-------------------------------------------------------------------------- + | + | This setting specifies the directory where your media files are stored. + | Note that this affects both the source and output directories. + | The path is relative to the root of your project. + | + */ + + 'media_directory' => '_media', + + /* + |-------------------------------------------------------------------------- + | Global Site Meta Tags + |-------------------------------------------------------------------------- + | + | While you can add any number of meta tags in the meta.blade.php component + | using standard HTML, you can also use the Meta helper. To add a regular + | meta tag, use Meta::name() helper. To add an Open Graph property, use + | Meta::property() helper which also adds the `og:` prefix for you. + | + | Please note that some pages like blog posts contain dynamic meta tags + | which may override these globals when present in the front matter. + | + */ + + 'meta' => [ + // Meta::name('author', 'Mr. Hyde'), + // Meta::name('twitter:creator', '@HydeFramework'), + // Meta::name('description', 'My Hyde Blog'), + // Meta::name('keywords', 'Static Sites, Blogs, Documentation'), + Meta::name('generator', 'HydePHP v'.Hyde\Hyde::version()), + Meta::property('site_name', env('SITE_NAME', 'HydePHP')), + ], + + /* + |-------------------------------------------------------------------------- + | Custom head and script HTML hooks + |-------------------------------------------------------------------------- + | + | While the best way to add custom `` and `` code is to use the + | Blade components, you can also add them here. This is useful for adding + | scripts like analytics codes, chat widgets, or even custom styles. + | + */ + + // Add any extra HTML to include in the tag + 'head' => '', + + // Add any extra HTML to include before the closing tag + 'scripts' => '', + + /* + |-------------------------------------------------------------------------- + | Features + |-------------------------------------------------------------------------- + | + | Some of Hyde's features are optional. Feel free to disable the features + | you don't need by removing or commenting them out from this array. + | + */ + + 'features' => [ + // Page Modules + Feature::HtmlPages, + Feature::BladePages, + Feature::MarkdownPages, + Feature::DocumentationPages, + + // Frontend Features + Feature::Darkmode, + Feature::DocumentationSearch, + + // Integrations + // Feature::Torchlight, + ], + + /* + |-------------------------------------------------------------------------- + | Blog Post Authors + |-------------------------------------------------------------------------- + | + | Hyde has support for adding authors in front matter, for example to + | automatically add a link to your website or social media profiles. + | However, it's tedious to have to add those to each and every + | post you make, and keeping them updated is even harder. + | + | To solve this problem, you can add predefined authors with this setting. + | When writing posts just specify the author's username (the array key). + | Hyde will pull the matching data from here and fill in the blanks. + | + */ + + 'authors' => [], + + /* + |-------------------------------------------------------------------------- + | Footer Text + |-------------------------------------------------------------------------- + | + | Here you can customize the footer Markdown text for your site. + | + | If you don't want to write Markdown here, you can use a Markdown include. + | You can also customize the Blade view if you want a more complex footer. + | You can disable it completely by changing the setting to `false`. + | + | To read about the many configuration options here, visit: + | https://hydephp.com/docs/2.x/customization#footer + | + */ + + 'footer' => 'Documentation for [JsonMapper](https://github.com/JsonMapper/JsonMapper).', + + /* + |-------------------------------------------------------------------------- + | Navigation Menu Configuration + |-------------------------------------------------------------------------- + | + | If you are looking to customize the main navigation menu, this is the place! + | + | All these settings uses Route Keys to identify the page you want to configure. + | A route key is simply the URL path to the page, without the file extension. + | So `_site/posts/hello-world.html` has the route key 'posts/hello-world'. + | + */ + + 'navigation' => [ + // This configuration sets the priorities used to determine the order of the menu. + // The default values have been added below for reference and easy editing. + // The array key is the page's route key, the value is the priority. + // Lower values show up first in the menu. The default is 999. + 'order' => [ + 'index' => 0, + 'docs/index' => 10, + ], + + // In case you want to customize the labels for the menu items, you can do so here. + // Simply add the route key as the array key, and the label as the value. + 'labels' => [ + 'index' => 'Home', + 'docs/index' => 'Documentation', + ], + + // These are the route keys of pages that should not show up in the navigation menu. + 'exclude' => [ + '404', + ], + + // Any extra links you want to add to the navigation menu can be added here. + // To get started quickly, you can uncomment the defaults here. + // See the documentation link above for more information. + 'custom' => [ + Navigation::item('https://github.com/JsonMapper/JsonMapper', 'GitHub', 200), + ], + + // How should pages in subdirectories be displayed in the menu? + // You can choose between 'dropdown', 'flat', and 'hidden'. + 'subdirectory_display' => 'hidden', + ], + + /* + |-------------------------------------------------------------------------- + | Cache Busting + |-------------------------------------------------------------------------- + | + | Any assets loaded using the Hyde Asset helpers will automatically have + | a "cache busting" query string appended to the URL. This is useful + | when you want to force browsers to load a new version of an asset. + | All included Blade templates use this feature to load assets. + | + | To disable the cache busting, set this setting to false. + | + */ + + 'cache_busting' => true, + + /* + |-------------------------------------------------------------------------- + | Load app.css from CDN + |-------------------------------------------------------------------------- + | + | Hyde ships with an app.css file containing compiled TailwindCSS styles + | in the _media/ directory. If you want to load this file from the + | HydeFront JsDelivr CDN, you can set this setting to true. + | + */ + + 'load_app_styles_from_cdn' => false, + + /* + |-------------------------------------------------------------------------- + | Tailwind Play CDN + |-------------------------------------------------------------------------- + | + | The next setting enables a script for the TailwindCSS Play CDN which will + | compile CSS in the browser. While this is useful for local development + | it's not recommended for production use. To keep things consistent, + | your Tailwind configuration file will be injected into the HTML. + */ + + 'use_play_cdn' => false, + + /* + |-------------------------------------------------------------------------- + | Default Color Scheme + |-------------------------------------------------------------------------- + | + | The default color scheme for the meta color-scheme tag, note that this + | is just a hint to the user-agent and does not force a specific theme. + | + */ + + 'default_color_scheme' => 'light', + + /* + |-------------------------------------------------------------------------- + | Built-in Server + |-------------------------------------------------------------------------- + | + | Here you can configure settings for the built-in realtime compiler server. + | The server also includes a magic dashboard feature that supercharges + | your local development! This feature can also be customised here. + | + */ + + 'server' => [ + // The default port the preview is served on + 'port' => env('SERVER_PORT', 8080), + + // The default host the preview is served on + 'host' => env('SERVER_HOST', 'localhost'), + + // Should preview pages be saved to the output directory? + 'save_preview' => env('SERVER_SAVE_PREVIEW', false), + + // Should the live edit feature be enabled? + 'live_edit' => env('SERVER_LIVE_EDIT', true), + + // Configure the realtime compiler dashboard + 'dashboard' => [ + // Should the realtime compiler dashboard be enabled? + 'enabled' => env('SERVER_DASHBOARD', true), + + // Can the dashboard make edits to the project file system? + 'interactive' => true, + + // Should the dashboard show tips? + 'tips' => true, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Additional Advanced Options + |-------------------------------------------------------------------------- + | + | Finally, here are some additional configuration options that you most + | likely won't need to change. These are intended for advanced users, + | and some should only be changed if you know what you're doing. + | + */ + + // Change the file extensions to be considered as media files and are copied to the output directory. + // If you want to add more extensions, add it to the empty merge array, or just override the entire array. + 'media_extensions' => array_merge([], \Hyde\Support\Filesystem\MediaFile::EXTENSIONS), + + // The list of directories that are considered to be safe to empty upon site build. + // If the site output directory is set to a directory that is not in this list, + // the build command will prompt for confirmation before emptying it. + 'safe_output_directories' => ['_site', 'docs', 'build'], + + // Should a JSON build manifest with metadata about the build be generated? + 'generate_build_manifest' => true, + + // Where should the build manifest be saved? (Relative to project root, for example _site/build-manifest.json) + 'build_manifest_path' => 'app/storage/framework/cache/build-manifest.json', + + // Should the theme toggle buttons be displayed in the layouts? + 'theme_toggle_buttons' => true, + +]; diff --git a/config/markdown.php b/config/markdown.php new file mode 100644 index 0000000..4146803 --- /dev/null +++ b/config/markdown.php @@ -0,0 +1,116 @@ + [ + \League\CommonMark\Extension\GithubFlavoredMarkdownExtension::class, + \League\CommonMark\Extension\Attributes\AttributesExtension::class, + ], + + /* + |-------------------------------------------------------------------------- + | Configuration Options + |-------------------------------------------------------------------------- + | + | Define any options that should be passed to the CommonMark converter. + | + | Hyde handles many of the options automatically, but you may want to + | override some of them and/or add your own. Any custom options + | will be merged with the Hyde defaults during runtime. + | + */ + + 'config' => [ + // + ], + + /* + |-------------------------------------------------------------------------- + | Allow all HTML tags + |-------------------------------------------------------------------------- + | + | HydePHP uses the GitHub Flavored Markdown extension to convert Markdown. + | This, by default strips out some HTML tags. If you want to allow all + | arbitrary HTML tags, and understand the risks involved, you can + | use this config setting to enable all HTML tags. + | + */ + + 'allow_html' => false, + + /* + |-------------------------------------------------------------------------- + | Blade-supported Markdown + |-------------------------------------------------------------------------- + | + | This feature allows you to use basic Laravel Blade in Markdown files. + | + | It's disabled by default since it can be a security risk as it allows + | arbitrary PHP to run. But if your Markdown is trusted, try it out! + | + | To see the syntax and usage, see the documentation: + | @see https://hydephp.com/docs/2.x/advanced-markdown#blade-support + | + */ + + 'enable_blade' => false, + + /* + |-------------------------------------------------------------------------- + | Tailwind Typography Prose Classes + |-------------------------------------------------------------------------- + | + | HydePHP uses Tailwind Typography to style rendered Markdown. + | + | This setting controls the base classes to apply to all the HTML elements + | containing rendered markdown. Please note that if you add any new + | classes, you may need to recompile your CSS file. + | + */ + + 'prose_classes' => 'prose dark:prose-invert', + + /* + |-------------------------------------------------------------------------- + | Heading Permalinks Configuration + |-------------------------------------------------------------------------- + | + | Here you can specify which page classes should have heading permalinks. + | By default, only documentation pages have permalinks enabled, but you + | are free to enable it for any kind of page by adding the page class. + | + */ + + 'permalinks' => [ + 'pages' => [ + \Hyde\Pages\DocumentationPage::class, + ], + ], + +]; diff --git a/docs/guides/hydephp-migration-plan.md b/docs/guides/hydephp-migration-plan.md deleted file mode 100644 index ae28689..0000000 --- a/docs/guides/hydephp-migration-plan.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: HydePHP 2 Migration Plan ---- - -This document outlines a full migration plan from the current Jekyll site to HydePHP 2 while preserving all existing content, URLs, and assets. - -## Goals - -- Replace Jekyll with HydePHP 2 as the static site generator. -- Keep all existing page URLs and information architecture stable. -- Preserve generated CSS/JS behavior and current design. -- Keep deployment to GitHub Pages simple and reproducible. - -## Current State Inventory - -1. **Content** - - Homepage: `/index.md` - - Documentation pages under `/docs/**` -2. **Templates** - - Shared layout in `/_layouts/default.html` -3. **Navigation/Data** - - Menu structure in `/_data/menu.yml` - - Asset manifest in `/_data/manifest.yml` -4. **Assets** - - Source assets in `/assets` - - Generated assets in `/dist` - - Static images/icons in `/images` and repository root -5. **Build** - - Jekyll for page generation - - Webpack/Tailwind pipeline from `package.json` - -## Migration Phases - -### Phase 1: Bootstrap HydePHP 2 - -1. Add HydePHP 2 project files (`composer.json`, Hyde config, and required directories). -2. Keep Node/Tailwind tooling initially to reduce change risk. -3. Add local development commands for Hyde serve/build workflows. - -### Phase 2: Move Templates and Data - -1. Port `/_layouts/default.html` into a Blade layout (for example `resources/views/layouts/app.blade.php`). -2. Convert Liquid syntax to Blade equivalents: - - `{{ content }}` -> Blade content slot/yield - - Menu loops -> Blade loops over data collections - - Relative URL helpers -> Hyde/Laravel URL helpers -3. Move menu/manifest data into Hyde-supported data files or config-accessible structures. - -### Phase 3: Move Markdown Content - -1. Migrate root and `/docs/**` markdown pages into Hyde content directories. -2. Preserve front matter (`title`, `permalink`) and ensure route/path parity. -3. Validate all internal links after migration. - -### Phase 4: Assets and Frontend Build - -1. Keep current webpack build temporarily and point Hyde templates to generated files. -2. Confirm `dist` manifest usage still resolves CSS/JS correctly. -3. Optionally evaluate replacing webpack with a Hyde-native/Vite approach after parity is reached. - -### Phase 5: CI/Deployment Cutover - -1. Replace Jekyll build steps with: - - `composer install --no-dev --prefer-dist` - - `npm ci` - - `npm run prod` - - `php hyde build` -2. Publish Hyde output directory to GitHub Pages. -3. Remove Jekyll-specific configuration (`_config.yml`, Jekyll-only directories) only after successful cutover. - -## Validation Checklist - -- [ ] All existing routes resolve with the same public URLs. -- [ ] Navigation renders identically on desktop/mobile. -- [ ] Dark/light styles and code block styles match current behavior. -- [ ] Social/SEO meta tags are preserved. -- [ ] Generated site builds cleanly in CI and deploys to GitHub Pages. - -## Risk Controls - -- Migrate in small PRs by phase instead of a single large rewrite. -- Keep Jekyll branch/tag available until Hyde production validation completes. -- Run side-by-side local builds (Jekyll vs Hyde) to compare rendered output during migration. diff --git a/hyde b/hyde new file mode 100755 index 0000000..5d42808 --- /dev/null +++ b/hyde @@ -0,0 +1,53 @@ +#!/usr/bin/env php +make(Illuminate\Contracts\Console\Kernel::class); + +$status = $kernel->handle( + $input = new Symfony\Component\Console\Input\ArgvInput, + new Symfony\Component\Console\Output\ConsoleOutput +); + +/* +|-------------------------------------------------------------------------- +| Shutdown The Application +|-------------------------------------------------------------------------- +| +| Once the HydeCLI has finished running, we will fire off the shutdown events +| so that any final work may be done by the application before we shut +| down the process. This is the last thing to happen to the request. +| +*/ + +$kernel->terminate($input, $status); + +exit($status); diff --git a/resources/views/.gitkeep b/resources/views/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/sitemap.xml b/sitemap.xml deleted file mode 100644 index ef4f2fb..0000000 --- a/sitemap.xml +++ /dev/null @@ -1,56 +0,0 @@ ---- -layout: null -sitemap: -exclude: 'yes' ---- - - - {% for post in site.posts %} - {% unless post.published == false %} - - {{ site.url }}{{ post.url }} - {% if post.sitemap.lastmod %} - {{ post.sitemap.lastmod | date: "%Y-%m-%d" }} - {% elsif post.date %} - {{ post.date | date_to_xmlschema }} - {% else %} - {{ site.time | date_to_xmlschema }} - {% endif %} - {% if post.sitemap.changefreq %} - {{ post.sitemap.changefreq }} - {% else %} - monthly - {% endif %} - {% if post.sitemap.priority %} - {{ post.sitemap.priority }} - {% else %} - 0.5 - {% endif %} - - {% endunless %} - {% endfor %} - {% for page in site.pages %} - {% unless page.sitemap.exclude == "yes" or page.name == "feed.xml" or page.name == 'sitemap.xml' %} - - {{ site.url }}{{ page.url | remove: "index.html" }} - {% if page.sitemap.lastmod %} - {{ page.sitemap.lastmod | date: "%Y-%m-%d" }} - {% elsif page.date %} - {{ page.date | date_to_xmlschema }} - {% else %} - {{ site.time | date_to_xmlschema }} - {% endif %} - {% if page.sitemap.changefreq %} - {{ page.sitemap.changefreq }} - {% else %} - monthly - {% endif %} - {% if page.sitemap.priority %} - {{ page.sitemap.priority }} - {% else %} - 0.3 - {% endif %} - - {% endunless %} - {% endfor %} - \ No newline at end of file