Skip to content

Commit

Permalink
documented layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelrhmanSaid committed Jun 5, 2024
1 parent 0c0a1eb commit 831965d
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 9 deletions.
42 changes: 39 additions & 3 deletions docs/layouts/dashboard.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
---
title: Dashboard
title: Dashboard Layout
---

# Dashboard
# Dashboard Layout

Work in progress...
Dashboard layout extends the scaffold layout and provides a layout for the dashboard pages. It includes the core plugins and stylesheets required for the dashboard to function, also provides useful features that can be used in other layouts.

Dashboard layout provides an authentication-specific layout under `dashboard.auth` namespace. This layout is used for the authentication pages like login, register, forgot password, etc.

## Usage

To use the dashboard layout, extend it in the layout file:

```blade
<x-layouts::dashboard :title="$title">
<!-- Page content -->
</x-layouts::dashboard>
```

## Features

The dashboard layout provides the sidebar and topbar components for the dashboard pages. It also includes the core plugins and stylesheets required for the dashboard to function.

### Sidebar

The sidebar component is used to display the navigation links for the dashboard pages. You can register the sidebar links in the `config/sidebar.php` file, like this:

```php
return [
// ...

[
'route' => 'dashboard.index',
'icon' => 'fa fa-home',
'title' => 'Dashboard',
],
];
```

### Topbar

The topbar component is used to display the user profile, dark/light mode switch, and the logout button, etc.
42 changes: 39 additions & 3 deletions docs/layouts/scaffold.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
---
title: Scaffold
title: Scaffold Layout
---

# Scaffold
# Scaffold Layout

Work in progress...
Scaffold layout is the base layout for all pages. It includes the core plugins and stylesheets required for the site to function, also provides useful features that can be used in other layouts.

## Usage

To use the scaffold layout, extend it in the layout file:

```blade
<x-layouts::scaffold :title="$title" :direction="$direction">
<!-- Page content -->
</x-layouts::scaffold>
```

## Properties

The scaffold layout has the following properties:

- **title**: The title of the page, default to `app_name` from the settings.
- **direction**: The direction of the text, either `ltr` or `rtl`.

## Features

The scaffold layout provides the following features:

### Service Worker registration

The scaffold layout registers a service worker to cache the assets and provide offline support. The service worker is disabled in development mode.

### Stacks

The scaffold layout provides a way to include stylesheets and scripts in the head and body of the page. The stacks are used to include the core stylesheets and scripts required for the site to function.

Stacks that are available in the scaffold layout:

- **styles**: Append stylesheets to the head of the page.
- **pre-content**: Append scripts immediately after the opening body tag.
- **templates**: Append templates to the body of the page.
- **scripts**: Append scripts to the body of the page.
22 changes: 19 additions & 3 deletions docs/layouts/website.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
---
title: Website
title: Website Layout
---

# Website
# Website Layout

Work in progress...
Website layout extends the scaffold layout and provides a layout for the website pages. It includes the core plugins and stylesheets required for the website to function, also provides useful features that can be used in other layouts.

Website layout provides an authentication-specific layout under `website.auth` namespace. This layout is used for the authentication pages like login, register, forgot password, etc.

## Usage

To use the website layout, extend it in the layout file:

```blade
<x-layouts::website :title="$title">
<!-- Page content -->
</x-layouts::website>
```

## Features

The website layout provides the google analytics and facebook pixel scripts for the website pages. It also includes the core plugins and stylesheets required for the website to function.

0 comments on commit 831965d

Please sign in to comment.