Skip to content

Commit

Permalink
[TASK] initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick zach committed Mar 3, 2022
0 parents commit 2f5e4b9
Show file tree
Hide file tree
Showing 50 changed files with 19,736 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .editorconfig
@@ -0,0 +1,24 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.php]
indent_size = 4

[*.blade.php]
indent_size = 2

[resources/views/**.php]
indent_size = 2

[index.php]
indent_size = 2
4 changes: 4 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ['@roots/eslint-config/sage'],
};
6 changes: 6 additions & 0 deletions .gitignore
@@ -0,0 +1,6 @@
/node_modules
/vendor
/public
.env
npm-debug.log
yarn-error.log
1 change: 1 addition & 0 deletions .nvmrc
@@ -0,0 +1 @@
v16.13.1
9 changes: 9 additions & 0 deletions .prettierrc
@@ -0,0 +1,9 @@
{
"bracketSpacing": false,
"jsxBracketSameLine": true,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
6 changes: 6 additions & 0 deletions .stylelintrc
@@ -0,0 +1,6 @@
{
"extends": [
"@roots/sage/stylelint-config",
"@roots/bud-tailwindcss/stylelint-config"
]
}
23 changes: 23 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,23 @@
## HEAD

* [Full changelog](https://github.com/roots/sage/compare/v10.0.0...main)

## 10.0.0: March 1st, 2022

* [Release notes](https://github.com/roots/sage/releases/tag/v10.0.0)
* [Full changelog](https://github.com/roots/sage/compare/10.0.0-beta.3...v10.0.0)

## 10.0.0-beta.3: February 14th, 2022

* [Release notes](https://github.com/roots/sage/releases/tag/10.0.0-beta.3)
* [Full changelog](https://github.com/roots/sage/compare/10.0.0-beta.2...10.0.0-beta.3)

## 10.0.0-beta.2: December 21st, 2021

* [Release notes](https://github.com/roots/sage/releases/tag/10.0.0-beta.2)
* [Full changelog](https://github.com/roots/sage/compare/10.0.0-beta.1...10.0.0-beta.2)

## 10.0.0-beta.1: October 21st, 2021

* [Release notes](https://github.com/roots/sage/releases/tag/10.0.0-beta.1)
* [Full changelog](https://github.com/roots/sage/compare/9.0.9...10.0.0-beta.1)
19 changes: 19 additions & 0 deletions LICENSE.md
@@ -0,0 +1,19 @@
Copyright © Patrick Zach

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
142 changes: 142 additions & 0 deletions README.md
@@ -0,0 +1,142 @@
<p align="center">
<a href="https://roots.io/sage/">
<img alt="Sage" src="https://cdn.roots.io/app/uploads/logo-sage.svg" height="100">
</a>
</p>

<p align="center">
<a href="LICENSE.md">
<img alt="MIT License" src="https://img.shields.io/github/license/roots/sage?color=%23525ddc&style=flat-square" />
</a>

<a href="https://packagist.org/packages/roots/sage">
<img alt="Packagist" src="https://img.shields.io/packagist/v/roots/sage.svg?style=flat-square" />
</a>

<a href="https://github.com/roots/sage/actions">
<img alt="Build Status" src="https://img.shields.io/github/workflow/status/roots/sage/Main?style=flat-square" />
</a>

<a href="https://twitter.com/rootswp">
<img alt="Follow Roots" src="https://img.shields.io/twitter/follow/rootswp.svg?style=flat-square&color=1da1f2" />
</a>
</p>

<p align="center">
<strong>WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and a modern development workflow</strong>
</p>

<p align="center">
<a href="https://roots.io/"><strong><code>Website</code></strong></a> &nbsp;&nbsp; <a href="https://docs.roots.io/sage/10.x/installation/"><strong><code>Documentation</code></strong></a> &nbsp;&nbsp; <a href="https://github.com/roots/sage/releases"><strong><code>Releases</code></strong></a> &nbsp;&nbsp; <a href="https://discourse.roots.io/"><strong><code>Support</code></strong></a>
</p>

## Supporting

**Sage** is an open source project and completely free to use.

However, the amount of effort needed to maintain and develop new features and products within the Roots ecosystem is not sustainable without proper financial backing. If you have the capability, please consider donating using the links below:

<div align="center">

[![Sponsor on GitHub](https://img.shields.io/static/v1?label=sponsor&message=%E2%9D%A4&logo=GitHub&style=flat-square)](https://github.com/sponsors/roots)
[![Sponsor on Patreon](https://img.shields.io/badge/sponsor-patreon-orange.svg?style=flat-square&logo=patreon")](https://www.patreon.com/rootsdev)
[![Donate via PayPal](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square&logo=paypal)](https://www.paypal.me/rootsdev)

</div>

## Features

- Harness the power of [Laravel](https://laravel.com) and its available packages thanks to [Acorn](https://github.com/roots/acorn).
- Clean, efficient theme templating utilizing [Laravel Blade](https://laravel.com/docs/master/blade).
- Lightning fast frontend development workflow powered by [Bud](https://bud.js.org/).
- Out of the box support for [Tailwind CSS](https://tailwindcss.com/).

## Requirements

Make sure all dependencies have been installed before moving on:

- [Acorn](https://docs.roots.io/acorn/2.x/installation/) v2
- [WordPress](https://wordpress.org/) >= 5.9
- [PHP](https://secure.php.net/manual/en/install.php) >= 7.4.0 (with [`php-mbstring`](https://secure.php.net/manual/en/book.mbstring.php) enabled)
- [Composer](https://getcomposer.org/download/)
- [Node.js](http://nodejs.org/) >= 16
- [Yarn](https://yarnpkg.com/en/docs/install)

## Theme installation

Install Sage using Composer from your WordPress themes directory (replace `your-theme-name` below with the name of your theme):

```sh
# @ app/themes/ or wp-content/themes/
$ composer create-project roots/sage your-theme-name
```

To install the latest development version of Sage, add `dev-main` to the end of the command:

```sh
$ composer create-project roots/sage your-theme-name dev-main
```

Make sure that you have [Acorn installed](https://docs.roots.io/acorn/2.x/installation/).

## Theme structure

```sh
themes/your-theme-name/ # → Root of your Sage based theme
├── app/ # → Theme PHP
│ ├── Providers/ # → Service providers
│ ├── View/ # → View models
│ ├── filters.php # → Theme filters
│ └── setup.php # → Theme setup
├── composer.json # → Autoloading for `app/` files
├── public/ # → Built theme assets (never edit)
├── functions.php # → Theme bootloader
├── index.php # → Theme template wrapper
├── node_modules/ # → Node.js packages (never edit)
├── package.json # → Node.js dependencies and scripts
├── resources/ # → Theme assets and templates
│ ├── fonts/ # → Theme fonts
│ ├── images/ # → Theme images
│ ├── scripts/ # → Theme javascript
│ ├── styles/ # → Theme stylesheets
│ └── views/ # → Theme templates
│ ├── components/ # → Component templates
│ ├── forms/ # → Form templates
│ ├── layouts/ # → Base templates
│ ├── partials/ # → Partial templates
└── sections/ # → Section templates
├── screenshot.png # → Theme screenshot for WP admin
├── style.css # → Theme meta information
├── vendor/ # → Composer packages (never edit)
└── bud.config.js # → Bud configuration
```

## Theme setup

Edit `app/setup.php` to enable or disable theme features, setup navigation menus, post thumbnail sizes, and sidebars.

## Theme development

- Run `yarn` from the theme directory to install dependencies
- Update `bud.config.js` with your local dev URL

### Build commands

- `yarn dev` — Compile assets when file changes are made, start Browsersync session
- `yarn build` — Compile assets for production

## Sage sponsors

Help support our open-source development efforts by [becoming a GitHub sponsor](https://github.com/sponsors/roots) or [patron](https://www.patreon.com/rootsdev).

<a href="https://k-m.com/"><img src="https://cdn.roots.io/app/uploads/km-digital.svg" alt="KM Digital" width="200" height="150"></a> <a href="https://carrot.com/"><img src="https://cdn.roots.io/app/uploads/carrot.svg" alt="Carrot" width="200" height="150"></a> <a href="https://www.c21redwood.com/"><img src="https://cdn.roots.io/app/uploads/c21redwood.svg" alt="C21 Redwood Realty" width="200" height="150"></a> <a href="https://wordpress.com/"><img src="https://cdn.roots.io/app/uploads/wordpress.svg" alt="WordPress.com" width="200" height="150"></a> <a href="https://icons8.com/"><img src="https://cdn.roots.io/app/uploads/icons8.svg" alt="Icons8" width="200" height="150"></a> <a href="https://generodigital.com/"><img src="https://cdn.roots.io/app/uploads/genero.svg" alt="Genero" width="200" height="150"></a> <a href="https://40q.agency/"><img src="https://cdn.roots.io/app/uploads/40q.svg" alt="40Q" width="200" height="150"></a> <a href="https://pantheon.io/"><img src="https://cdn.roots.io/app/uploads/pantheon.svg" alt="Pantheon" width="200" height="150"></a>

## Community

Keep track of development and community news.

- Join us on Roots Slack by becoming a [GitHub sponsor](https://github.com/sponsors/roots) or [patron](https://www.patreon.com/rootsdev)
- Participate on the [Roots Discourse](https://discourse.roots.io/)
- Follow [@rootswp on Twitter](https://twitter.com/rootswp)
- Read and subscribe to the [Roots Blog](https://roots.io/blog/)
- Subscribe to the [Roots Newsletter](https://roots.io/subscribe/)
28 changes: 28 additions & 0 deletions app/Providers/ThemeServiceProvider.php
@@ -0,0 +1,28 @@
<?php

namespace App\Providers;

use Roots\Acorn\ServiceProvider;

class ThemeServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}

/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
}
}
57 changes: 57 additions & 0 deletions app/View/Components/Alert.php
@@ -0,0 +1,57 @@
<?php

namespace App\View\Components;

use Roots\Acorn\View\Component;

class Alert extends Component
{
/**
* The alert type.
*
* @var string
*/
public $type;

/**
* The alert message.
*
* @var string
*/
public $message;

/**
* The alert types.
*
* @var array
*/
public $types = [
'default' => 'text-indigo-50 bg-indigo-400',
'success' => 'text-green-50 bg-green-400',
'caution' => 'text-yellow-50 bg-yellow-400',
'warning' => 'text-red-50 bg-red-400',
];

/**
* Create the component instance.
*
* @param string $type
* @param string $message
* @return void
*/
public function __construct($type = 'default', $message = null)
{
$this->type = $this->types[$type] ?? $this->types['default'];
$this->message = $message;
}

/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\View\View|string
*/
public function render()
{
return $this->view('components.alert');
}
}
39 changes: 39 additions & 0 deletions app/View/Composers/App.php
@@ -0,0 +1,39 @@
<?php

namespace App\View\Composers;

use Roots\Acorn\View\Composer;

class App extends Composer
{
/**
* List of views served by this composer.
*
* @var array
*/
protected static $views = [
'*',
];

/**
* Data to be passed to view before rendering.
*
* @return array
*/
public function with()
{
return [
'siteName' => $this->siteName(),
];
}

/**
* Returns the site name.
*
* @return string
*/
public function siteName()
{
return get_bloginfo('name', 'display');
}
}

0 comments on commit 2f5e4b9

Please sign in to comment.