Skip to content

Commit

Permalink
Merge branch 'master' into 2.x-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Feb 8, 2024
2 parents 81684d0 + 78dcbf5 commit 33ecc1c
Show file tree
Hide file tree
Showing 17 changed files with 64 additions and 63 deletions.
1 change: 0 additions & 1 deletion .idea/develop.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions docs/advanced-features/build-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ They are shown here in order of presumed convenience, but you are free to choose

### Autodiscovery registration

The easiest way to register build tasks, is to not do it. Just let Hyde do it for you!
The easiest way to register build tasks is to not do it -- just let Hyde do it for you!

Any classes that end in `BuildTask.php` that are stored in `app/Actions` will be autoloaded and registered to run automatically.

Expand Down Expand Up @@ -139,7 +139,8 @@ or you can register the extensions programmatically, I recommend you do this in
The build tasks are registered in an internal array of the `BuildService` class, which is bound as a singleton in the underlying Laravel service container.
To actually register your task, provide the fully qualified class name of the task to the `BuildTaskService::registerTask()` method.

Here is an example of how to do this using in a service provider. Though you could technically do it anywhere using the `app()` helper, just as long as it's done early enough in the application lifecycle, so it's registered before the build command is executed.
Here is an example of how to do this using a service provider. Though you could technically do it anywhere using the `app()` helper,
just as long as it's done early enough in the application lifecycle, so it's registered before the build command is executed.

```php
class MyServiceProvider extends ServiceProvider
Expand Down
8 changes: 4 additions & 4 deletions docs/advanced-features/hyde-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ under the `HydePage` class documentation which is conveniently located just belo

## HydePage

The base class for all Hyde pages, all other page classes extend this class.
The base class for all Hyde pages. All other page classes extend this class.

Unlike other frameworks, in general you don't instantiate pages yourself in Hyde, instead, the page models acts as
Unlike other frameworks, you generally don't instantiate pages yourself in Hyde. Instead, the page models act as
blueprints defining information for Hyde to know how to parse a file, and what data around it should be generated.

To create a parsed file instance, you'd typically just create a source file, and you can then access the parsed file
To get a parsed file instance, you'd typically just create a source file, and you can then access the parsed file
from the HydeKernel's page index.

In Blade views, you can always access the current page instance being rendered using the `$page` variable.
Expand Down Expand Up @@ -320,7 +320,7 @@ class DocumentationPage extends BaseMarkdownPage

Page class for HTML pages.

Html pages are stored in the `_pages` directory and using the `.html` extension.
HTML pages are stored in the `_pages` directory and using the `.html` extension.
These pages will be copied exactly as they are to the `_site/` directory.

### Quick Reference
Expand Down
10 changes: 5 additions & 5 deletions docs/advanced-features/in-memory-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ autodiscovery, you may benefit from creating a custom page class instead, as tha

### About discovery

Since the InMemoryPages are not present in the filesystem, they cannot be found by the auto-discovery process,
thus it's up to the developer to manually register them. If you are developing for your own project, you can do this in
Since the InMemoryPages are not present in the filesystem, they cannot be found by the auto-discovery process.
Instead, it's up to the developer to manually register them. If you are working on your own project, you can do this in
the `boot` method of a service provider, such as the `AppServiceProvider` which is already present in your `app/` directory.

If you are developing a package, you may instead want to register the page in your package extension class, within the
page collection callback. In either case, if you want your page to be able to be fully processed by Hyde, you need to
make sure you register it before the full application is booted so that routes can be generated.

_To see how to register the page, see the examples below, first we must look at how to actually create the page._
_To see how to register the page, see the examples below. But first we must look at how to actually create the page._


## Creating the page

To create an InMemoryPage, you need to instantiate it, and pass it the required parameters.
To create an InMemoryPage, you need to instantiate it with the required parameters.

A page would not be useful without any content to render. The class offers two content options through the constructor.
Since a page would not be useful without any content to render, the class offers two content options through the constructor.

You can either pass a string to the `$contents` parameter, Hyde will then save that literally as the page's contents.

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture-concepts/autodiscovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The kernel is also where the discovered data is stored in memory, so it's import
### The kernel lifecycle

Now that we know the role of the HydeKernel, let's take a look at its lifecycle. The kernel is "lazy-booted", meaning
that the all the heavy lifting only happens when you actually need it. Once booted, the kernel data will stay in memory
that all the heavy lifting only happens when you actually need it. Once booted, the kernel data will stay in memory
until the console application is terminated.

The kernel data is primarily stored in three collections that get generated during the kernel's boot process.
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture-concepts/automatic-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Routes::get('docs/readme')

When designing Blade layouts it can be useful to use the `x-link` component to automatically resolve relative links.

You can of course, use it just like a normal anchor tag like so:
You can of course use it just like a normal anchor tag like so:

```blade
<x-link href="index.html">Home</x-link>
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture-concepts/dynamic-data-discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You might also want to read about the [autodiscovery lifecycle](autodiscovery) f

After basic information about the page has been gathered, such as the source file information and the front matter,
the page model is run through a series of factories. These are just classes that work around the limited data
that is available at this point, and will assign the rich data needed to make your Hyde page awesome.
that is available at this point and will generate the rich data used to make your Hyde page awesome.

There are a few factory classes. The one we will be looking at here is the `HydePageDataFactory` class, which is
responsible for data applicable to all page models. Complex structures and data only relevant to some page types
Expand Down Expand Up @@ -94,4 +94,4 @@ foreach ($data->toArray() as $key => $value) {
}
```

And that's pretty much it! Hyde will do this for all the data it can discover, all so that you can focus on your content.
And that's pretty much it! Hyde will do this for all the data it can discover, freeing you to focus on your content.
10 changes: 5 additions & 5 deletions docs/architecture-concepts/extensions-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ navigation.priority: 1000

## Introduction

The Extensions API a powerful interface designed for package developers who want to extend the functionality of HydePHP.
The Extensions API is a powerful interface designed for package developers who want to extend the functionality of HydePHP.

Using the API, you can hook directly into the HydePHP Kernel and extend sites with custom page types and new features.

Expand All @@ -24,7 +24,7 @@ so you can understand how your code works with the internals.

### The why and how of the Extensions API

HydePHP being a static site generator, the Extensions API is centered around [Page Models](page-models),
HydePHP being a static site generator, the Extensions API is centred around [Page Models](page-models),
which you are hopefully already familiar with, otherwise you should read up on them first.

What the Extensions API does is to allow you to create custom page types, and tell HydePHP how to discover them.
Expand Down Expand Up @@ -73,11 +73,11 @@ If our pages need more complex discovery logic, we can create custom handlers. s

### Discovery handlers

The discovery handlers lets you run code at various points of the booting process. This is usually only needed if your
The discovery handlers let you run code at various points of the booting process. This is usually only needed if your
page models cannot provide the information required for Hyde run the standard auto-discovery, and thus need custom logic.

Usually in these cases, you would only need to add files to the Kernel `FileCollection`,
though the `HydeExtension` class offers following three discovery handlers, in case you need them:
though the `HydeExtension` class offers the following three discovery handlers, in case you need them:

```php
/** Runs during file discovery */
Expand Down Expand Up @@ -111,7 +111,7 @@ class JsonPageExtension extends HydeExtension {
```

Since the discovery steps are handled sequentially, the added pages will automatically be discovered as routes without
us having to implement that handler method. As we inject the page objects directly, we bypass the need of the `FileCollection`.
us having to implement that handler method. As we inject the page objects directly, we bypass the need for the `FileCollection`.


## Registering your extension
Expand Down
10 changes: 5 additions & 5 deletions docs/architecture-concepts/the-hydekernel.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ as a singleton into the application service container.

## Accessing the kernel

The HydeKernel It is stored as a singleton in this class, and is bound into the
Laravel Application Service Container, and can be accessed in a few ways.
The HydeKernel is stored as a singleton in a static property in its own class and can be accessed in a few ways.

Commonly, you'll use the `Hyde` facade, but you can also use Dependency Injection
by type-hinting the `HydeKernel::class`, or use the `hyde()` function to get the Kernel.
Commonly, you'll use the `Hyde` facade which forwards calls to the singleton instance.
You can also use the `hyde()` function to get the Kernel, and call methods on it.

The Kernel instance is constructed in `bootstrap.php`, and is available globally as `$hyde`.
Since the instance is also bound into the Laravel Application Service Container you can also use Dependency Injection by type-hinting the `HydeKernel::class`.

Here are some examples of how you can call methods on the Kernel. All methods call the same method on the same instance, so it's just a matter of preference.

Expand All @@ -42,6 +41,7 @@ app(HydeKernel::class)->version();
hyde()->version();
```

The Kernel instance is constructed in `bootstrap.php`, and is available globally as `$hyde`.

## The kernel lifecycle

Expand Down
10 changes: 5 additions & 5 deletions docs/creating-content/blog-posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ navigation:

Making blog posts with Hyde is easy. At the most basic level, all you need is to add a Markdown file to your `_posts` folder.

To use the full power of the Hyde post module however, you'll want to add YAML [Front Matter](front-matter) to your posts.
To use the full power of the Hyde post module you'll want to add YAML [Front Matter](front-matter) to your posts.

**You can interactively scaffold posts with automatic front matter using the HydeCLI:**

Expand Down Expand Up @@ -54,7 +54,7 @@ and understand how your front matter is used. You can read more about the Front

### Blog Post Example

Before digging in deeper on all the supported options, let's take a look at what a basic post with front matter looks like.
Before digging deeper into all the supported options, let's take a look at what a basic post with front matter looks like.

```markdown
// filepath _posts/my-new-post.md
Expand Down Expand Up @@ -90,8 +90,8 @@ Keep on reading to see further explanations, details, and examples.
| `author` | string/array | _See [author](#author) section_ |
| `image` | string/array | _See [image](#image) section_ |

Note that YAML here is pretty forgiving. In most cases you do not need to wrap strings in quotes,
but it can help in certain edge cases, for example if the text contains special Yaml characters, thus they are included here.
Note that YAML here is pretty forgiving. In most cases you do not need to wrap strings in quotes.
However, it can help in certain edge cases, for example if the text contains special Yaml characters, thus they are included here.

In the examples below, when there are multiple examples, they signify various ways to use the same property.

Expand Down Expand Up @@ -212,4 +212,4 @@ To use images stored in the `_media/` directory, you can use the following synta

_Note the relative path since the blog post is compiled to `posts/example.html`_

To learn more, check out the [chapter in managing assets](managing-assets#managing-images)
To learn more, check out the [managing assets chapter](managing-assets#managing-images) on the topic.
2 changes: 1 addition & 1 deletion docs/creating-content/compile-and-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Once the site is compiled there is nothing to configure or worry about.
### FTP and File Managers

If you have a conventional web host, you can use `FTP`/`SFTP`/`FTPS` to upload your compiled site files to the web server.
Some web hosting services also have web based file managers.
Some web hosting services also have web-based file managers.

To deploy your site using any of these methods, all you need to do is upload the entire contents of your `_site`
directory to the web server's public document root, which is usually the `public_html`, `htdocs`, or `www` directory.
Expand Down
16 changes: 8 additions & 8 deletions docs/creating-content/documentation-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ to keep in mind when creating blog posts so that you don't get unexpected result

#### Filenames

- Hyde Documentation pages are files are stored in the `_docs` directory
- Hyde Documentation pages are files stored in the `_docs` directory
- The filename is used as the filename for the compiled HTML
- Filenames should use `kebab-case-name` format, followed by the appropriate extension
- Files prefixed with `_underscores` are ignored by Hyde
Expand Down Expand Up @@ -123,7 +123,7 @@ _I personally think the config route is easier as it gives an instant overview,
### Sidebar labels
The sidebar items are labeled with the `label` property. The default label is the filename of the file.
The sidebar items are labelled with the `label` property. The default label is the filename of the file.
You can change it with the following front matter:

```yaml
Expand Down Expand Up @@ -252,7 +252,7 @@ Please note that this option is not added to the config file by default, as it's

### Table of contents settings

In the `config/docs.php` file you can configure the behavior, content, and the look and feel of the sidebar table of contents.
In the `config/docs.php` file you can configure the behaviour, content, and the look and feel of the sidebar table of contents.
You can also disable the feature completely.

```php
Expand All @@ -267,7 +267,7 @@ You can also disable the feature completely.
### Using 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.
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).
Expand All @@ -285,7 +285,7 @@ If you set this to false, Hyde will match the directory structure of the source
The HydeSearch plugin adds a search feature to documentation pages. It consists of two parts, a search index generator
that runs during the build command, and a frontend JavaScript plugin that adds the actual search widget.

>info Tip: The HydeSearch plugin is what powers the search feature on this site! Why not [try it out](search)!
>info Tip: The HydeSearch plugin is what powers the search feature on this site! Why not [try it out](search)?

The search feature is enabled by default. You can disable it by removing the `documentationSearch` from the Hyde `Features` config array.

Expand All @@ -303,7 +303,7 @@ The search works by generating a JSON search index which the JavaScript plugin l
Two ways to access the search are added, one is a full page search screen that will be saved to `docs/search.html`.

The second method is a button added to the documentation pages, similar to how Algolia DocSearch works.
Opening it will open a modal with an integrated search screen. You can also open the dialog using the keyboard shortcut `/`.
Opening it will open a modal with an integrated search screen. You can also open the dialogue using the keyboard shortcut `/`.

>info The full page can be disabled by setting `create_search_page` to `false` in the `docs` config.

Expand All @@ -329,7 +329,7 @@ The Realtime Compiler that powers the `php hyde serve` command will automaticall

### Introduction

Hyde can automatically add links to documentation pages that takes the user
Hyde can automatically add links to documentation pages that take the user
to a GitHub page (or similar) to edit the page. This makes it great for open-source projects
looking to allow others to contribute to the documentation in a quick and easy manner.

Expand All @@ -341,7 +341,7 @@ if not, please send a PR and/or create an issue on the [GitHub repository](https

### Configuration

As an example configuration, let's take a practical example for how HydePHP.com uses this feature.
As an example configuration, let's take a practical example of how HydePHP.com uses this feature.

```php
// Filepath: config/docs.php
Expand Down
Loading

0 comments on commit 33ecc1c

Please sign in to comment.