Skip to content

Commit

Permalink
Merge pull request #873 from hydephp/separate-internal-application-fi…
Browse files Browse the repository at this point in the history
…les-from-project-structure

Breaking: Separate internal application files from project structure
  • Loading branch information
caendesilva authored Feb 12, 2023
2 parents dcf0266 + 940098d commit 963312a
Show file tree
Hide file tree
Showing 74 changed files with 590 additions and 517 deletions.
4 changes: 2 additions & 2 deletions .idea/develop.iml

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

3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ These are changes that break backwards compatibility and that are likely to conc

- HydePHP now requires PHP 8.1 or higher.
- Almost all namespaces in the framework have been changed and restructured.
- Many of the internal underling Laravel application files have been moved, this means your `app/` directory will look a bit different. See [`#873`](https://github.com/hydephp/develop/pull/873)
- The `config/site.php` file has been merged into `config/hyde.php`. See [`#964`](https://github.com/hydephp/develop/pull/964) for the upgrade guide.

#### Breaking internal changes

These are changes that break backwards compatibility but are unlikely to concern users using HydePHP to create sites.
Instead, these changes will likely only concern those who write custom code and integrations using the HydePHP framework.

Expand Down
2 changes: 1 addition & 1 deletion _pages/404.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
Sorry, the page you are looking for could not be found.
</p>

<a href="{{ config('site.url') ?? '/' }}">
<a href="{{ config('hyde.url') ?? '/' }}">
<button
class="bg-transparent text-grey-darkest font-bold uppercase tracking-wide py-3 px-6 border-2 border-grey-light hover:border-grey rounded-lg">
Go Home
Expand Down
14 changes: 3 additions & 11 deletions config/app.php → app/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/*
|--------------------------------------------------------------------------
| Application Name (Logo)
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
Expand All @@ -24,15 +24,7 @@
|
*/

'name' => "
\033[34m __ __ __ \033[33m ___ __ _____
\033[34m / // /_ _____/ /__ \033[33m/ _ \/ // / _ \
\033[34m / _ / // / _ / -_)\033[33m ___/ _ / ___/
\033[34m /_//_/\_, /\_,_/\__/\033[33m_/ /_//_/_/
\033[34m /___/
\033[0m",
'name' => 'HydePHP',

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -78,9 +70,9 @@

'providers' => [
App\Providers\AppServiceProvider::class,
Hyde\Foundation\Providers\ConfigurationServiceProvider::class,
Hyde\Framework\HydeServiceProvider::class,
Hyde\Foundation\Providers\ViewServiceProvider::class,
Hyde\Foundation\Providers\ConfigurationServiceProvider::class,
Hyde\Console\ConsoleServiceProvider::class,
],

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
138 changes: 133 additions & 5 deletions config/hyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@

/*
|--------------------------------------------------------------------------
| The HydePHP Configuration File
| __ __ __ ___ __ _____
| / // /_ _____/ /__ / _ \/ // / _ \
| / _ / // / _ / -_) ___/ _ / ___/
| /_//_/\_, /\_,_/\__/_/ /_//_/_/
| /___/
|--------------------------------------------------------------------------
|
| This configuration file lets you change and customize the behaviour
| of your HydePHP site. To customize the presentation options, like
| the site name, please see the new config/site.php file instead.
| 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.
|
*/

Expand All @@ -17,6 +28,123 @@

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'),

/*
|--------------------------------------------------------------------------
| Pretty URLs
|--------------------------------------------------------------------------
|
| When the setting is enabled, generated links in the compiled HTML site
| are without the .html extension. Since this breaks local browsing you
| can leave the setting disabled, and instead add the --pretty-urls flag
| when running the php hyde build command for deployment.
|
| Note that this can cause issues when you are serving from a subdirectory.
| See https://github.com/hydephp/develop/issues/228
|
*/

'pretty_urls' => false,

/*
|--------------------------------------------------------------------------
| Sitemap Generation
|--------------------------------------------------------------------------
|
| When the setting is enabled, a sitemap.xml file will automatically be
| generated when the site is built.
|
| 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.
|
*/

// Should the RSS feed be generated?
'generate_rss_feed' => true,

// What filename should the RSS file use?
'rss_filename' => 'feed.xml',

// The channel description. By default this is "Site Name + RSS Feed".
// 'rss_description' => '',

/*
|--------------------------------------------------------------------------
| 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',

/*
|--------------------------------------------------------------------------
| 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',

/*
|--------------------------------------------------------------------------
| 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',

/*
|--------------------------------------------------------------------------
| Built-in Server
Expand Down Expand Up @@ -65,7 +193,7 @@
// Meta::name('description', 'My Hyde Blog'),
// Meta::name('keywords', 'Static Sites, Blogs, Documentation'),
Meta::name('generator', 'HydePHP '.Hyde\Hyde::version()),
Meta::property('site_name', config('site.name', 'HydePHP')),
Meta::property('site_name', env('SITE_NAME', 'HydePHP')),
],

/*
Expand Down
143 changes: 0 additions & 143 deletions config/site.php

This file was deleted.

2 changes: 1 addition & 1 deletion docs/digging-deeper/advanced-customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ When run, Hyde will update the source directory setting in the config file, then
The media directory houses assets like images and stylesheets. The default directory is `_media`, and upon building the site,
Hyde will copy all files in this directory to `_site/media` (or whatever your configured output and media directories are).

You can change the path to this directory by setting the `media_directory` setting in `config/site.php`.
You can change the path to this directory by setting the `media_directory` setting in `config/hyde.php`.
Note that this change will affect both the source and output directories. For example, if you set the value to `assets`,
all files from `assets` will be copied to `_site/assets`.

Expand Down
Loading

0 comments on commit 963312a

Please sign in to comment.