-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhyde.php
486 lines (416 loc) · 17.8 KB
/
hyde.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
<?php
/*
|--------------------------------------------------------------------------
| __ __ __ ___ __ _____
| / // /_ _____/ /__ / _ \/ // / _ \
| / _ / // / _ / -_) ___/ _ / ___/
| /_//_/\_, /\_,_/\__/_/ /_//_/_/
| /___/
|--------------------------------------------------------------------------
|
| Welcome to HydePHP! In this file, you can customize your new Static Site!
|
| HydePHP favours convention over configuration and as such requires virtually
| no configuration out of the box to get started. Though, you may want to
| change the options to personalize your site and make it your own!
|
| Tip: The settings here can also be overridden by creating a hyde.yml file
| in the root of your project directory. Note that these cannot call any
| PHP functions, so you can't use env() or similar helpers. Also, note
| that any settings in the yml file will override settings here.
|
*/
use Hyde\Facades\Author;
use Hyde\Facades\Features;
use Hyde\Facades\Meta;
return [
/*
|--------------------------------------------------------------------------
| Site Name
|--------------------------------------------------------------------------
|
| This value sets the name of your site and is, for example, used in
| the compiled page titles and more. The default value is HydePHP.
|
*/
'name' => env('SITE_NAME', 'HydePHP'),
/*
|--------------------------------------------------------------------------
| 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', 'http://localhost'),
/*
|--------------------------------------------------------------------------
| Site Language
|--------------------------------------------------------------------------
|
| This value sets the language of your site and is used for the
| <html lang=""> 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' => false,
/*
|--------------------------------------------------------------------------
| 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', 'HydePHP').' 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 `<head>` and `<body>` 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 <head> tag
'head' => '',
// Add any extra HTML to include before the closing <body> 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.
| This config concept is directly inspired by Laravel Jetstream.
|
*/
'features' => [
// Page Modules
Features::htmlPages(),
Features::markdownPosts(),
Features::bladePages(),
Features::markdownPages(),
Features::documentationPages(),
// Frontend Features
Features::darkmode(),
Features::documentationSearch(),
// Integrations
Features::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.
|
| Here you can add predefined authors. When writing posts,
| just specify the username in the front matter, and the
| rest of the data will be pulled from a matching entry.
|
*/
'authors' => [
Author::create(
'mr_hyde', // Required username
'Mr. Hyde', // Optional display name
'https://hydephp.com' // Optional website URL
),
],
/*
|--------------------------------------------------------------------------
| Footer Text
|--------------------------------------------------------------------------
|
| Here you can customize the footer Markdown text for your site.
|
| If you don't want to write Markdown here, you 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/1.x/customization#footer
|
*/
'footer' => 'Site proudly built with [HydePHP](https://github.com/hydephp/hyde) 🎩',
/*
|--------------------------------------------------------------------------
| 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,
'posts' => 10,
'docs/index' => 100,
],
// 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' => 'Docs',
],
// 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' => [
// NavItem::forLink('https://github.com/hydephp/hyde', 'GitHub', 200),
],
// How should pages in subdirectories be displayed in the menu?
// You can choose between 'dropdown', 'flat', and 'hidden'.
'subdirectories' => 'hidden',
],
/*
|--------------------------------------------------------------------------
| Cache Busting
|--------------------------------------------------------------------------
|
| Any assets loaded using the Asset::mediaLink() helper 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.
|
| The mediaLink helper is used in the built-in views to load the
| default stylesheets and scripts, and thus use this feature.
|
| To disable cache busting, set this setting to false.
|
*/
'enable_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 alo 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' => true,
// 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',
// Here you can specify HydeFront version and URL for when loading app.css from the CDN.
// Only change these if you know what you're doing as some versions may be incompatible with your Hyde version.
'hydefront_version' => \Hyde\Framework\Services\AssetService::HYDEFRONT_VERSION,
'hydefront_cdn_url' => \Hyde\Framework\Services\AssetService::HYDEFRONT_CDN_URL,
];