Customization
Customizing Blade Views in Prezet
Prezet uses Laravel's blade templating engine to render your blog's pages. When you installed the Prezet package, the blade view were published to your application's resources/views/vendor/prezet
directory. This allows you to easily customize the appearance and functionality of your Prezet-powered blog.
Should you ever need to re-publish the blade views, you can do so by running the following command:
1php artisan vendor:publish --tag=prezet-views
#Blade View File Structure
The published blade views are organized within the resources/views/vendor/prezet
directory as follows:
1resources/ 2└── views/ 3 └── vendor/ 4 └── prezet/ 5 ├── index.blade.php 6 ├── ogimage.blade.php 7 ├── show.blade.php 8 └── components/ 9 ├── ...10 ├── alert.blade.php11 ├── logo.blade.php12 ├── template.blade.php13 └── youtube.blade.php
#Customizing Blade Views
To tailor the views to your aesthetic, you can modify these files directly. Here's quick overview of how each file is used and how you might customize it:
#Main Template
components/template.blade.php
This is the main layout template used by both index.blade.php and show.blade.php. This file contains the overall structure of your blog pages.
#Logo Template
components/logo.blade.php
This file is used to display your blog's logo. Customize this file to change the appearance of your logo.
#Routable Views
These views are used to render the main blog pages:
-
index.blade.php
:- Default Route:
GET /prezet
- Controller:
IndexController
- Purpose: This is the template for your blog's index page. Customize this to change the layout of your blog's main page, including how posts are listed and any additional content you want to display.
- Default Route:
-
show.blade.php
:- Default Route:
GET /prezet/{slug}
- Controller:
ShowController
- Purpose: This template is used for individual blog post pages. Modify this file to change how your blog posts are displayed.
- Default Route:
-
ogimage.blade.php
:- Default Route:
GET /prezet/ogimage/{slug}
- Controller:
OgimageController
- Purpose: This file is used to generate Open Graph images for your posts. See the OG Image documentation for more information.
- Default Route:
#Component Files
These files are example blade components that can be inlined in your markdown files. See the Blade Components documentation for more details:
-
components/alert.blade.php
:- Purpose: This component is used to display alert style callouts on your blog. Modify this file to change the appearance of alerts or add additional functionality.
-
components/youtube.blade.php
:- Purpose: This component is used to embed YouTube videos in your posts. Modify this if you want to change how videos are displayed or add additional functionality.