Skip to content

Commit 6c3f56d

Browse files
committed
Update customization documentation for new author system
1 parent 50de689 commit 6c3f56d

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

docs/digging-deeper/customization.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,29 @@ Here are the default settings:
124124
125125
### Authors
126126

127-
Hyde has support for adding authors in front matter, for example to automatically add a link to your website or social media profiles.
128-
However, it's tedious to have to add those to each and every post you make, and keeping them updated is even harder.
127+
Hyde supports adding authors to blog posts, allowing you to automatically include information like display names and website links.
128+
We even support fields for avatars, biographies, and social media profiles, which you can use in your custom Blade templates.
129129

130+
While you can set all this data directly in the front matter, that quickly becomes tedious and hard to maintain.
130131
Instead, you can predefine authors in the Hyde config. When writing posts, just specify the username in the front matter,
131132
and the rest of the data will be pulled from a matching entry found in the configuration file.
132133

133-
#### Example
134+
#### Configuration
135+
136+
Authors are defined in the `config/hyde.php` file under the `authors` key. Each author is keyed by their username and configured using the `Author::create()` method:
134137

135138
```php
136139
// filepath: config/hyde.php
137140
'authors' => [
138-
Author::create(
139-
username: 'mr_hyde', // Required username
140-
name: 'Mr. Hyde', // Optional display name
141-
website: 'https://hydephp.com' // Optional website URL
141+
'mr_hyde' => Author::create(
142+
name: 'Mr. Hyde',
143+
website: 'https://hydephp.com',
144+
bio: 'The mysterious author of HydePHP',
145+
avatar: 'avatar.png',
146+
socials: [
147+
'twitter' => '@HydeFramework',
148+
'github' => 'hydephp',
149+
],
142150
),
143151
],
144152
```
@@ -150,14 +158,21 @@ author:
150158
username: mr_hyde
151159
name: Mr. Hyde
152160
website: https://hydephp.com
161+
bio: The mysterious author of HydePHP
162+
avatar: avatar.png
163+
socials:
164+
twitter: "@HydeFramework"
165+
github: hydephp
153166
```
154167
155-
But you only have to specify the username:
168+
But you only have to specify the username to get all the other data.
156169
157170
```yaml
158171
author: mr_hyde
159172
```
160173
174+
If you want to override some of the data for a specific post, you can do so in the front matter. Additionally, the front matter method is great for guest authors or one-off posts.
175+
161176
### Footer
162177
163178
Most websites have a footer with copyright details and contact information. You probably want to change the Markdown to include your information, though you are of course welcome to keep the default attribution link!

0 commit comments

Comments
 (0)