Skip to content

Releases: hydephp/develop

v0.60.0-beta - 2022-08-12

12 Aug 13:37
Compare
Choose a tag to compare

About

This release continues refactoring the internal codebase. As part of this, a large part of deprecated code has been removed and the package has been updated accordingly.

Added

  • Added getRouteKey method to PageContract and AbstractPage

Changed

  • Blog posts now have the same open graph title format as other pages
  • Merged deprecated method getRoutesForModel into getRoutes in RouteCollection
  • Cleans up and refactors GeneratesDocumentationSearchIndexFile, and marks it as internal
  • Changed MarkdownFileParser to expect that the supplied filepath is relative to the root of the project (this may break method calls where an absolute path is supplied, see upgrade guide)
  • internal: Inline deprecated internal method usage getOutputPath replacing it Hyde::pages() helper with in HydeRebuildStaticSiteCommand

Removed

  • Removed class RoutingService as it is no longer used
  • Removed deprecated legacy class Compiler from the Hyde Realtime Compiler
  • Removed deprecated interface RoutingServiceContract (deprecated in v0.59)
  • Removed deprecated method stylePath from AssetService (deprecated in v0.50)
  • Removed deprecated method getHomeLink from NavigationMenu (deprecated in v0.50)
  • Removed deprecated method parseFile from MarkdownDocument (deprecated in v0.56)
  • Removed deprecated method getPostDescription from MarkdownPost (deprecated in v0.58)
  • Removed deprecated method getCanonicalLink from MarkdownPost (deprecated in v0.58)
  • Removed deprecated method getInstance from RoutingService (deprecated in v0.59)
  • Removed deprecated method getRoutesForModel from RouteCollection
  • Removed deprecated method getOutputPath from HydeRebuildStaticSiteCommand
  • Removed deprecated property $body from MarkdownDocument
  • internal: Remove deprecated testing helper functions backup and restore

Fixed

  • MarkdownFileParser not using the Hyde path #399
  • Undefined variable $currentRoute in search.html #421
  • Fixes issues in the documentation search.json and search.html when using custom output directories

Upgrade Guide

MarkdownFileParser path change

This class now expects the supplied filepath to be relative to the root of the project. This will only affect you if you have written any custom code that uses this class. All internal Hyde code is already updated to use the new path format.

To upgrade, change any calls you may have like follows:

-return (new MarkdownFileParser(Hyde::path('_posts/foo.md')))->get();
+return (new MarkdownFileParser('_posts/foo.md'))->get();

What's Changed

Full Changelog: v0.59.0-beta...v0.60.0-beta

v0.59.0-beta - 2022-08-11

11 Aug 19:50
Compare
Choose a tag to compare

About

This release refactors the internal routing system. Unless you have written custom code that directly uses these classes and methods, updating should be fairly smooth. If not, you may want to read through the following overview.

The route index has been decoupled from page index and is split into two new collection classes, PageCollection and RouteCollection. The PageCollection contains all the site's parsed pages, and the RouteCollection contains all the page routes.

The RoutingService class remains for compatibility with existing code, but now only forwards calls to the new RouteCollection. The RoutingServiceContract interface is now deprecated.

Added

  • Adds a new RouteCollection class
  • Adds a new PageCollection class
  • Adds a $routeKey property to the AbstractPage class
  • The page and route collections are now stored as properties of the HydeKernel
  • Adds an option to the Hyde::image() helper to request the returned image path use the configured base URL if it's set
  • Adds a new save() method to Markdown-based pages, to save the page object to the filesystem
  • Added new internal helpers to improve serialization of object models

Changed

  • breaking: Navigation menu priorities now use route keys instead of slugs, see upgrade notes below
  • Removed constructor from RoutingServiceContract interface
  • Refactored RoutingService to use the new RouteCollection class
  • AbstractPage::all() now returns a PageCollection, and includes the source file path as the array key
  • Improved ConvertsArrayToFrontMatter action, which now supports nested arrays
  • An exception is now thrown when attempting to get the path to an Image without a defined source path or URI
  • internal: The HydeKernel is now stored as a singleton within the kernel class, instead of the service container
  • internal: Refactor commands with shared code to extend new abstract base class
  • internal: A large part of the codebase has been refactored and cleaned up while making an effort to maintain compatibility with existing code

Deprecated

  • Deprecated interface RoutingServiceContract
  • Deprecated RoutingServiceContract::getInstance()

Removed

  • Removed all non public-contract methods from RoutingService

Fixed

  • Fix #383: Navigation menu titles can't be set in BladeMatter
  • Fix #385: DocumentationPage::home() did not work for custom documentation page output directories
  • Fix #386: Documentation page sidebar labels were not constructed from front matter
  • Fix bugs relating to the documentation sidebar labels that appeared in the last release
  • Fix #410: Search index generator breaks when storing documentation page source files in subdirectories

Upgrade notes

Route keys are now used in navigation config

Prior to this release, the navigation menu priorities were based on the page slug. This has been changed to the route key. A route key in Hyde is in short the compiled page's path, relative to the site's root. For example, _site/foo/bar.html has the route key foo/bar.

This change is breaking as the order of navigation items may be changed unless the configuration is updated. However, this is really easy. Just change docs to docs/index in the config/hyde.php file.

'navigation' => [
	'order' => [
		'index' => 0,
		'posts' => 10,
-		'docs' => 100,
+		'docs/index' => 100,
	],
],

If you have used the config to hide the documentation page from the navigation menu, you also need to use the route key by changing 'exclude' => ['docs'] to 'exclude' => ['docs/index'].
The same goes if you have used the config to change the navigation titles for the home and documentation pages.

What's Changed

  • Fix #383: Navigation menu titles can't be set in BladeMatter by @caendesilva in #384
  • Fix bug where DocumentationPage::home() did not work when the documentation page output directory is customized by @caendesilva in #385
  • Add missing constructor for documentation page sidebar labels by @caendesilva in #387
  • Change documentation page label fallback to previous behaviour by @caendesilva in #389
  • Change browser test image fixture to more reliable host by @caendesilva in #390
  • Add option to Hyde::image() helper to prefer full URI paths by @caendesilva in #394
  • Refactor internal routing structure to decouple page index from route index by @caendesilva in #395
  • Improve ConvertsArrayToFrontMatter action by @caendesilva in #396
  • Add helper to save Markdown-based page models to disk by @caendesilva in #397
  • Improve model serializations by @caendesilva in #398
  • Bring out the HydeKernel singleton from the service container by @caendesilva in #400
  • Code quality improvements by @caendesilva in #401
  • Improve types by @caendesilva in #403
  • Throw exception instead of returning null when attempting to get source for Image without source by @caendesilva in #406
  • Code quality improvements by @caendesilva in #405
  • Move shared command logic to base action command class by @caendesilva in #407
  • Reduce complexity by using route keys to get navigation menu priorities from config by @caendesilva in #409
  • Code quality improvements by @caendesilva in #408
  • Fix #410: Search index generator breaks when storing documentation page source files in subdirectories by @caendesilva in #412

Full Changelog: v0.58.0-beta...v0.59.0-beta

v0.58.0-beta - 2022-08-08

08 Aug 18:36
Compare
Choose a tag to compare

About

This update contains breaking changes to the internal API regarding page models. This should only affect you directly if you've written any code that interacts with the internal page models, such as constructing them using non-built-in Hyde helpers.

The update makes large changes to how dynamic data is constructed. Instead of generating page data at runtime, now the data is generated when constructing a page object. This gives the major benefit of being able to see all dynamic data right away, without having to render the page.

The way metadata tags are handled internally is also refactored. The rendered result should not be affected.

Added

  • Added compile() method to Facades\Markdown, replacing the parse() method of the same class
  • Adds new actions to handle complex dynamic constructors
  • Adds new front matter schema traits to define the public API for front matter and hold their data
  • Adds new Meta::link() helper to create <link> tags
  • Adds new Meta::get() helper to get the metadata array
  • Adds a new system for creating and storing page metadata
  • Adds several new metadata model classes

Changed

  • Breaking: Rename AbstractMarkdownPage constructor parameter slug to identifier
  • Breaking: Rename AbstractPage property slug to identifier
  • Breaking: Change AbstractMarkdownPage constructor argument positions, putting identifier first
  • Breaking: Splits Markdown data from MarkdownDocument into new Markdown model class
  • Breaking: The default config/hyde.php file now uses Models\Author instead of Helpers\Author
  • Major: Restructure internal page data to use new front matter schema traits
  • Begin changing references to slugs to identifiers, see motivation below
  • Makes some helpers in SourceFileParser public static allowing them to be used outside the class
  • Page metadata is now stored as a page property, making it easier to see and understand
  • Page metadata is now generated at compile time instead of build time
  • Page metadata types are now strongly typed, however all types are String able, so end usage is not affected

Deprecated

  • Deprecated Facades\Markdown::parse(), use Facades\Markdown::render() instead
  • Deprecated Facades\Markdown.php, will be merged into Models\Markdown.php

Removed

  • Removed Facades\Markdown.php, merged into Models\Markdown.php
  • Removed body() method from MarkdownDocumentContract interface and all its implementations. Use markdown()->body() (or cast to string) instead
  • Removed body property from Markdown pages. Use markdown()->body() (or cast to string) instead
  • Removed deprecated Helpers\Author (fully merged into Models\Author, simply swap namespace to upgrade)
  • Removed metadata constructor helpers from the MarkdownPost class as it is now handled in the new metadata class
  • Several internal single-use helper traits have been merged into their respective classes

Fixed

  • Fix Path property in Image model should be relative to media directory #359
  • Fix Add toString method to Image model to get the link #370
  • Fix Blog post OpenGraph images must be resolved relatively #374
  • Fix PageContract needs compile method #366

Upgrade guide and extra information

Rename slugs to identifiers

Previously internally called slug(s), are now called identifier(s). In all honestly, this has 90% to do with the fact that I hate the word "slug".
I considered using basename as an alternative, but that does not fit with nested pages. Here instead is the definition of an identifier in the context of HydePHP:

An identifier is a string that is in essence everything in the filepath between the source directory and the file extension.

So, for example, a page source file stored as _pages/foo/bar.md would have the identifier foo/bar. Each page type can only have one identifier of the same name.
But since you could have a file with the same identifier in the _posts directory, we internally always need to specify what source model we are using.

The identifier property is closely related to the page model's route key property, which consists of the site output directory followed by the identifier.

Heavily refactor constructors of Markdown-based page models

Adds a new interface to the Markdown page model constructors, that expects instantiated FrontMatter and MarkdownDocument objects. Normally you would use the SourceFileParser to create the object.

This means that the constructor for all Markdown-based pages is completely changed. To use a format matching the old behaviour, you can use the MarkdownPageModel::make method.

Title property has been removed from page model constructors

The following syntax has been removed: new MarkdownPage(title: 'Foo Bar')
Instead, you can add it with front matter: MarkdownPage::make(matter: ['title' => 'Foo Bar'])

Markdown pages now have front matter in an object instead of array

This means that instead of the following $post->matter['title'], you would use $post->matter('title'), which allows you to add a fallback like so: $post->matter('title', 'Untitled')

Author helper has been merged into the model

The deprecated Helpers\Author has been fully merged into Models\Author. Simply swap namespaces to upgrade.

-use Hyde\Framework\Helpers\Author;
+use Hyde\Framework\Models\Author;

What's Changed

...

Read more

v0.57.0-beta - 2022-08-03

03 Aug 18:35
Compare
Choose a tag to compare

About

This update refactors the internal page source model parsing. This will likely not affect you directly, however, if you have written custom code that interacts with any class relating to the PageParser contract, you'll want to take a closer look at the changes.

Added

  • Added a new static shorthand to quickly parse Markdown files into MarkdownDocuments (MarkdownFileParser::parse())
  • Added toArray() method to MarkdownDocuments, which returns an array of all the body lines

Changed

  • All source model parsing is now handled by the new SourceFileParser action
  • Blog post front matter no longer includes merged slug
  • MarkdownDocument now implements the Arrayable interface
  • Markdown page models no longer includes the slug merged into the front matter
  • All Markdown page models now have the title property inferred when parsing
  • internal: The DocumentationPage slug now behaves like other pages, and the basename is produced at runtime, see below
  • internal: Refactor search index generator to use route system

Deprecated

  • Deprecated MarkdownDocument::parseFile(), will be renamed to MarkdownDocument::parse()

Removed

  • The PageParserContract interface, and all of its implementations have been removed
  • Removed $localPath property from DocumentationPage class, see above
  • Removed trait HasDynamicTitle

What's Changed

Full Changelog: v0.56.0-beta...v0.57.0-beta

v0.56.0-beta - 2022-08-03

03 Aug 11:02
Compare
Choose a tag to compare

About

This update makes changes to the internal Markdown services. If you have written code or integrations that uses any of these services, you may want to take a closer look. Otherwise, this should not affect you much.

Many Markdown related classes have been moved to a new namespace, and the classes themselves have been restructured. Again, this only affects those who in the past have used these classes outside of what Hyde normally provides.

Due to the nature of this refactor, where so much have been changed, not everything is documented here. See the attached pull request for the full Markdown change diff: #318

Added

  • Added model FrontMatter.php
  • Create MarkdownConverter.php
  • Create MarkdownServiceProvider.php
  • internal: Added Benchmarking framework

Changed

  • Move Markdown::hasTableOfContents() to DocumentationPage::hasTableOfContents()
  • Move most Markdown related classes into Modules\Markdown namespace
  • Rename MarkdownConverterService to MarkdownService
  • Rename MarkdownFileService to MarkdownFileParser
  • Replace CommonMarkConverter with Hyde MarkdownConverter

Removed

  • Remove old MarkdownConverter action
  • Delete HasMarkdownFeatures.php

What's Changed

Full Changelog: v0.55.0-beta...v0.56.0-beta

v0.55.0-beta - 2022-08-01

01 Aug 11:20
Compare
Choose a tag to compare

About

This update removes the deprecated LegacyPageRouter class from the Hyde Realtime Compiler (HydeRC). Along with this release, the HydeRC is now on version 2.5, and requires Hyde version 0.48.0-beta or higher.

Changed

  • hyde/hyde now requires HydeRC version 2.5 or higher.
  • hyde/realtime-compiler no longer supports Framework versions older than v0.48.0-beta.

Removed

  • Remove the deprecated LegacyPageRouter class from the HydeRC.

What's Changed

Full Changelog: v0.54.0-beta...v0.55.0-beta

v0.54.0-beta - 2022-08-01

01 Aug 09:34
Compare
Choose a tag to compare

About

This release refactors and cleans up a large part of the internal code base. For most end users, this will not have any visible effect. If you have developed integrations that depend on methods you may want to take a closer look at the associated pull requests as it is not practical to list them all here.

Overview

Here is a short overview of the areas that are impacted. If you don't know what any of these mean, they don't affect you.

  • HydeKernel has been internally separated into foundation classes
  • DiscoveryService has been refactored
  • Page compiling logic are now handled within the page models

Added

  • internal: Adds methods to the HydeKernelContract interface
  • Added new filesystem helpers, Hyde::touch(), and Hyde::unlink()

Changed

  • internal: The HydeKernel has been refactored to move related logic to service classes. This does not change the end usage as the Hyde facade still works the same
  • DiscoveryService::getSourceFileListForModel() now throws an exception instead of returning false when given an invalid model class
  • DiscoveryService::getFilePathForModelClassFiles method was renamed to DiscoveryService::getModelSourceDirectory
  • DiscoveryService::getFileExtensionForModelFiles method was renamed to DiscoveryService::getModelFileExtension
  • The Hyde::copy() helper now always uses paths relative to the project
  • The Hyde::copy() helper will always overwrite existing files
  • Replaced SitemapService::canGenerateSitemap() with Features::sitemap()
  • Replaced RssFeedService::canGenerateFeed() with Features::rss()
  • RSS feed is now always present on all pages, see reasoning in a93e30020

Deprecated

  • Deprecated trait HasMarkdownFeatures.php

Removed

  • Removed deprecated Hyde::uriPath() helper
  • Removed deprecated CollectionService::findModelFromFilePath()

Upgrade tips

When refactoring the Hyde::copy() helper change, you have two options (that you can combine). If one or more of your inputs are already qualified Hyde paths, use the native copy helper. If you don't want to overwrite existing files, make that check first.

What's Changed

Full Changelog: v0.53.0-beta...v0.54.0-beta

v0.53.0-beta - 2022-07-30

30 Jul 18:33
Compare
Choose a tag to compare

About

This release refactors some internal code. If you have published any Blade views or created any custom integrations, you may want to take a closer look at the changes. Otherwise, this should not affect most existing sites.

Added

  • Added Hyde::url() and Hyde::hasSiteUrl() helpers, replacing now deprecated Hyde::uriPath() helper

Changed

  • The HTML page titles are now generated in the page object, using the new htmlTitle() helper
  • Renamed helper Hyde::pageLink() to Hyde::formatHtmlPath()
  • internal: DiscoveryService.php is no longer deprecated
  • internal: CollectionService.php was merged into DiscoveryService
  • internal: Renamed trait GeneratesPageMetadata to HasArticleMetadata

Deprecated

  • Deprecated Hyde::uriPath(), use Hyde::url() or Hyde::hasSiteUrl() instead
  • Deprecated Helpers\Author.php, will be merged into Models\Author.php

Removed

  • internal: CollectionService.php has been removed, all its functionality has been moved to DiscoveryService
  • internal: The $currentPage parameter of a few methods has been removed, it is no longer necessary due to it being inferred from the view being rendered

What's Changed

Full Changelog: v0.52.0-beta...v0.53.0-beta

v0.52.0-beta - 2022-07-29

29 Jul 19:42
Compare
Choose a tag to compare

About

This update internally refactors how documentation sidebars are handled. If you have published Blade views relating to these, or built framework integrations you may want to take a closer look at the changed files.

Added

  • Hyde now supports nested pages!

Changed

  • internal: Refactor how documentation sidebars are generated and handled
  • internal: (Sidebar) categories are now internally referred to as "groups"
  • internal: The sidebar related Blade views have been renamed
  • DocumentationPage::indexPath() was renamed to DocumentationPage::home() and now returns a Route instead of a URL. It no longer resolves to README files.

What's Changed

Full Changelog: v0.51.0-beta...v0.52.0-beta

v0.51.0-beta - 2022-07-28

28 Jul 15:53
Compare
Choose a tag to compare

Added

  • Add Laravel Tinker as a development dependency for the Monorepo
  • Improved the hyde make:page command to add page type selection shorthands

Removed

  • Removed test files from the hyde/hyde sub repository

What's Changed

Full Changelog: v0.50.0-beta...v0.51.0-beta