Skip to content

Commit

Permalink
adding update for styles
Browse files Browse the repository at this point in the history
  • Loading branch information
tnylea committed Aug 21, 2024
1 parent c60f091 commit 961c075
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 35 deletions.
29 changes: 28 additions & 1 deletion content/docs/features/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Wave allows you to customize the look and feel of your application through a fle

- [Themes](#themes)
- [Theme Views](#theme-views)
- [Theme Pages](#theme-pages)
- [Theme Assets](#theme-assets)
- [Compiling Assets \& HMR](#compiling-assets--hmr)
- [Building Assets](#building-assets)
Expand All @@ -38,6 +39,32 @@ return view('theme::home');

That will return the view located at `resources/themes/anchor/home.blade.php`.

## Theme Pages

Each theme will have their own `pages` directory that are mapped to a specific route. We'll cover Volt pages in the next section a little more; however, it's probably important to know all the different pages that are provided with each theme.

In addition to all the authentication routes, you will also find the following pages included in each theme.

- **Homepage** - (pages/index.blade.php)
- **Dashboard** - (pages/dashboard/index.blade.php)
- **Pricing** - (pages/pricing/index.blade.php)
- **Profile** - (pages/profile/[username.blade.php])
- **Settings**
- **Profile Settings** - (pages/settings/profile.blade.php)
- **Security Settings** - (pages/settings/security.blade.php)
- **API keys** - (pages/settings/api.blade.php)
- **Subscription** - (pages/settings/subscription.blade.php)
- **Invoices** - (pages/settings/invoices.blade.php)
- **Subscription Welcome** - (pages/subscription/welcome.blade.php)
- **Notifications** - (pages/notification/index.blade.php)
- **Blog**
- **Blog Home/List** - (pages/blog/index.blade.php)
- **Blog Categories** - (pages/blog/.Wave.Category-slug/index.blad.php)
- **Blog Post** - (pages/blog/.Wave.Category-slug/[.Wave.Post-slug].blade.php)
- **Changelog**
- **Changelog Home** - (pages/changelog/index.blade.php)
- **Changelog Item/Entry** - (pages/changelog/[.Wave.Changelog].blade.php)

## Theme Assets

Every theme will have it's own assets located at the following locations:
Expand Down Expand Up @@ -112,7 +139,7 @@ Now that you have the theme installed, you'll need to head to the admin to activ

To activate a Theme you can simply click the Activate button for the current theme you would like to activate, and that will be the current active theme.

> Important: After activating a theme you will need to make sure that you stop your asset watcher `npm run dev` and re-run it after the new theme has been activated. This is because we need the asset watcher to look in the correct directory.
> After activating a theme you may need to make sure that you stop your asset watcher `npm run dev` and re-run it after the new theme has been activated.
## Digging Deeper

Expand Down
8 changes: 4 additions & 4 deletions content/docs/guides/about.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: About Guides
description: Learn how you can host your website and make it live for the world to see.
nextTitle: 'Folder Structure'
nextURL: '/docs/guides/folder-structure'
prevTitle: 'Github Action'
prevURL: '/docs/features/github-action'
nextTitle: 'Creating Themes'
nextURL: '/docs/guides/creating-themes'
prevTitle: 'Prompts'
prevURL: '/docs/prompts/create-a-role'
---


Expand Down
140 changes: 114 additions & 26 deletions content/docs/guides/creating-themes.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,132 @@
---
title: Creating Themes
description: Learn how you can host your website and make it live for the world to see.
nextTitle: 'Folder Structure'
nextURL: '/docs/guides/folder-structure'
prevTitle: 'Github Action'
prevURL: '/docs/features/github-action'
nextTitle: ''
nextURL: null
prevTitle: 'About Guides'
prevURL: '/docs/guides/about'
---

# Creating Themes

<div class="flex items-start px-5 py-5 mb-12 md:mb-5 mt-1 md:translate-y-0 translate-y-5 leading-[18px] bg-neutral-950 border border-yellow-400 rounded-md">
<img class="hidden my-0 mr-5 w-auto h-12 md:h-20 md:block" src="/assets/images/icons/globe.png" />
<div>
<h1 class="mb-0 text-base md:text-3xl">Deploying your website</h1>
<p class="my-1">There are many ways that you can host your website and make your masterpiece live for the world to see.</p>
</div>
</div>
It will probably be beneficial to learn how to create a simple theme for Wave, so that's what we'll cover in this quick guide.

If you do not want to host your website on Github pages, you can host with a handful of other alternatives.
- [Creating Themes](#creating-themes)
- [The Simplest Theme](#the-simplest-theme)
- [Add a homepage view](#add-a-homepage-view)
- [Creating Your Assets](#creating-your-assets)
- [Example Theme](#example-theme)

## Website Build

When you run the `static build` command your website will be built into a new folder named `_site`. This folder will contain all the contents for your website. You can simply move the contents to any server and your site will be served up accordingly.
### The Simplest Theme

Remember that if you are hosting your website inside of a subfolder, you will need to pass the full URL to the build command in order for all the assets and images to link up correctly. Here's an example:
Creating your own theme is as easy as creating a new folder inside of `resources/themes`. The name of this folder should be the name of your theme in all lowercase letters (Example: `resources/views/example`). Next, we need to add a `theme.json` inside of the theme folder with the following contents:

```json
{
"name": "Example",
"version": "1.0"
}
```
static build https://my-website/subfolder/

In this *.json* file you will specify the `name` of the theme and the `version`.

That's it! You should now see this theme inside of the admin; however, you will see a broken image because you haven't added an image yet. That is why the recommended minimum for any theme is:

1. theme.json - (containing information about the theme)
2. theme.jpg - (containing a screenshot/cover of the theme)

That's really all that's needed to create a theme; however, you will get an error when you try and visit the homepage and other areas of the application because you haven't created those views yet.

### Add a homepage view

Because each theme utilizes **Folio/Volt pages**, we can simply create a new **pages** folder with an **index.blade.php** file. (Example: `resources/themes/example/pages/index.blade.php).

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Example Theme</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="flex justify-center items-center w-screen h-screen">
<div class="relative text-center">
<h1 class="mb-3 text-4xl font-light">Example Theme</h1>
<p>This is a simple example of a blank theme. <a href="https://devdojo.com/wave/docs" target="_blank" class="underline">Click here to view the docs</a></p>
</div>
</body>
</html>
```

## Alternatives
Add that HTML to your **index.blade.php** file and you will now be able to visit the homepage of your application and see this view.

You can do the same for the dashboard by creating a file at `resources/themes/example/pages/dashboard/index.blade.php` and you will now be able to visit your application `/dashboard` route.

As you can see you can do this with any other pages in your application, it might be good to look at one of the current themes to see all the pages that are created.

### Creating Your Assets

You probably do not want to load the Tailwind CSS Cdn link, like we've showed in the example HTML file. Instead, you'll probably want to create your own `app.css` and `app.js` this way you can use the **vite** asset builder to compile your assets. Create the two following files:

1. resources/themes/example/assets/css/app.css
2. resources/themes/example/assets/js/app.js

> You will want to swap out `example` with the name of your folder.
Next, add the following contents to your `app.css`

```css
@tailwind base;
@tailwind components;
@tailwind utilities;
```

You can also add any javascript that you want to your `app.js`. Remember you do not need to include Alpine or Livewire javascript from this file because they will automatically be injected since we are using the latest version of Livewire.

Next, we want to reference our `app.css` and our `app.js` from our application, so inside the head of your layout or the `pages/index.blade.php`, we can add the following:

```
@vite(['resources/themes/anchor/assets/css/app.css', 'resources/themes/anchor/assets/js/app.js'])
```

You will also want to add the **filament** and the **livewire** styles. Be sure to include those before the **@vite** helper:

```
@filamentStyles
@livewireStyles
@vite(['resources/themes/example/assets/css/app.css', 'resources/themes/example/assets/js/app.js'])
```

> Important: Make sure to add the filament and livewire styles before your vite helper. Adding them after may result in some mis-aligned styles.
The final result should look something like this:

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Example Theme</title>
@filamentStyles
@livewireStyles
@vite(['resources/themes/example/assets/css/app.css', 'resources/themes/example/assets/js/app.js'])
</head>
<body class="flex justify-center items-center w-screen h-screen">
<div class="relative text-center">
<h1 class="mb-3 text-4xl font-light">Example Theme</h1>
<p>This is a simple example of a blank theme. <a href="https://devdojo.com/wave/docs" target="_blank" class="underline">Click here to view the docs</a></p>
</div>
</body>
</html>
```

There are a handful of alternatives that you can use to host your site for free. Here are a link to a few of those alternatives below:
Now, you'll be able to run `npm run dev` and your theme will be hot-reloading 🔥

- [DigitalOcean](https://m.do.co/c/dc19b9819d06)
- [Cloudflare Pages](https://pages.cloudflare.com/)
- [Firebase](https://firebase.google.com/products/hosting)
- [Static.app](https://static.app/)
- [Netlify](https://www.netlify.com/)
- [Vercel](https://vercel.com/)
When you're ready to compile your assets for production you can run `npm run build` and the correct theme assets will be minified and saved to your public directory.

## DevDojo Static Hosting
### Example Theme

Eventually we'll be providing a free hosted solution where you will get your own `website.devdojo.io` subdomain and have the ability to use your own custom domain. If you want to see this implemented sooner you can can help us out by <a href="https://github.com/thedevdojo/static" target="_blank" class="text-yellow-300 underline">starring the repo</a>, and telling your friends about static 🤘
If you want to reference this example theme that we've created in this example to use it as a starting point for your theme, you can find the <a href="https://github.com/thedevdojo/example" target="_blank">Example Theme here</a>.
4 changes: 2 additions & 2 deletions includes/hero.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<div id="container" class="flex relative z-20 flex-col items-center pb-10 mx-auto max-w-7xl h-auto sm:pb-16 md:pb-20 lg:pb-28 md:px-3 md:pt-0 lg:flex-row lg:relative">
<div class="px-6 pt-20 mx-auto max-w-7xl lg:pt-40 lg:px-8">
<div class="relative z-20 mx-auto max-w-5xl text-left sm:text-center">
<h1 class="mx-auto max-w-full text-5xl font-bold text-balance sm:text-pretty sm:text-6xl text-gray-950 md:text-7xl giarek">Ship Your SaaS in a Weekend.</h1>
<h1 class="mx-auto max-w-full text-5xl font-bold tracking-tight text-balance sm:text-pretty sm:tracking-normal sm:text-6xl text-gray-950 md:text-7xl giarek">Ship Your SaaS in a Weekend.</h1>
<!-- <h1 class="mx-auto max-w-2xl text-3xl font-bold sm:text-5xl text-gray-950 md:text-7xl giarek">Start Shipping your SaaS in Days, Not Months.</h1> -->
<p class="mx-auto mt-4 max-w-full text-sm text-left text-gray-600 sm:mt-5 sm:text-center md:leading-9 sm:max-w-3xl md:text-xl">Wave is the perfect boilerplate for launching a SaaS without breaking a sweat. <br class="hidden sm:block">Wave will help you make your first dollars online quickly.</p>
<p class="mx-auto mt-4 max-w-full text-sm text-left text-gray-600 sm:mt-5 sm:text-center md:leading-9 sm:max-w-3xl md:text-xl">Wave is the perfect boilerplate for launching a SaaS without breaking a sweat. <br class="hidden sm:block">Start building today and start earning your first dollars online quickly.</p>
<div class="flex gap-x-2 justify-center items-center mt-5 sm:mt-6">

<include src="elements/button.html"
Expand Down
2 changes: 1 addition & 1 deletion includes/save-hours.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="relative z-20 mx-auto">

<div class="px-6 mx-auto max-w-7xl lg:px-8">
<h2 class="mb-7 text-3xl font-bold text-left sm:text-4xl sm:text-center giarek text-gray-950 md:text-5xl">Save Yourself from the Choppy Waters Ahead</h2>
<h2 class="mb-7 text-3xl font-bold tracking-tight text-left sm:tracking-normal sm:text-4xl sm:text-center giarek text-gray-950 md:text-5xl">Save Yourself from the Choppy Waters Ahead</h2>
<p class="mx-auto mt-4 max-w-3xl text-sm text-left text-gray-600 sm:text-center sm:text-xl sm:mt-5">Think of all the time spent on setting up the essentials for a SaaS product. Wave does the heavy lifting for you, saving you over 100 hours of tedious work.</p>
</div>

Expand Down
2 changes: 1 addition & 1 deletion includes/technologies.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="relative mx-auto max-w-7xl md:px-8">

<div id="features-header" class="px-6 mx-auto max-w-7xl lg:px-8">
<h2 class="mb-7 text-3xl font-bold text-left sm:text-4xl sm:text-center giarek text-gray-950 md:text-5xl">Powering the Propellers</h2>
<h2 class="mb-7 text-3xl font-bold tracking-tight text-left sm:tracking-normal sm:text-4xl sm:text-center giarek text-gray-950 md:text-5xl">Powering the Propellers</h2>
<p class="mx-auto mt-4 max-w-2xl text-sm text-left text-gray-600 sm:text-center sm:text-xl sm:mt-5">Wave is built with the most modern tech, propelling your project forward at full speed. Check out what's powering the engine.</p>
</div>

Expand Down

0 comments on commit 961c075

Please sign in to comment.