Merge pull request #2 from badegguk/theme

add sage theme
This commit is contained in:
Steve Ross
2025-09-03 20:18:58 +01:00
committed by GitHub
48 changed files with 9918 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
quote_type = single
[*.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

7
web/app/themes/badegg/.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
/node_modules
/vendor
/public
.env
.budfiles
npm-debug.log
yarn-error.log

View File

@@ -0,0 +1,19 @@
Copyright (c) Roots Software Foundation LLC
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.

View File

@@ -0,0 +1,54 @@
<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="https://packagist.org/packages/roots/sage">
<img alt="Packagist Installs" src="https://img.shields.io/packagist/dt/roots/sage?label=projects%20created&colorB=2b3072&colorA=525ddc&style=flat-square">
</a>
<a href="https://github.com/roots/sage/actions/workflows/main.yml">
<img alt="Build Status" src="https://img.shields.io/github/actions/workflow/status/roots/sage/main.yml?branch=main&logo=github&label=CI&style=flat-square">
</a>
<a href="https://twitter.com/rootswp">
<img alt="Follow Roots" src="https://img.shields.io/badge/follow%20@rootswp-1da1f2?logo=twitter&logoColor=ffffff&message=&style=flat-square">
</a>
</p>
<p align="center">Advanced WordPress starter theme with Tailwind CSS and Laravel Blade</p>
<p align="center">
<a href="https://roots.io/sage/">Website</a> &nbsp;&nbsp; <a href="https://roots.io/sage/docs/installation/">Documentation</a> &nbsp;&nbsp; <a href="https://github.com/roots/sage/releases">Releases</a> &nbsp;&nbsp; <a href="https://discourse.roots.io/">Community</a>
</p>
## Sponsors
Sage is an open source project and completely free to use. If you've benefited from our projects and would like to support our future endeavors, please consider [sponsoring Roots](https://github.com/sponsors/roots).
<div align="center">
<a href="https://k-m.com/"><img src="https://cdn.roots.io/app/uploads/km-digital.svg" alt="KM Digital" width="120" height="90"></a> <a href="https://carrot.com/"><img src="https://cdn.roots.io/app/uploads/carrot.svg" alt="Carrot" width="120" height="90"></a> <a href="https://wordpress.com/"><img src="https://cdn.roots.io/app/uploads/wordpress.svg" alt="WordPress.com" width="120" height="90"></a> <a href="https://worksitesafety.ca/careers/"><img src="https://cdn.roots.io/app/uploads/worksite-safety.svg" alt="Worksite Safety" width="120" height="90"></a> <a href="https://www.copiadigital.com/"><img src="https://cdn.roots.io/app/uploads/copia-digital.svg" alt="Copia Digital" width="120" height="90"></a> <a href="https://www.freave.com/"><img src="https://cdn.roots.io/app/uploads/freave.svg" alt="Freave" width="120" height="90"></a> <a href="https://40q.agency/"><img src="https://cdn.roots.io/app/uploads/40q.svg" alt="40Q" width="120" height="90"></a>
</div>
## Overview
Sage is a WordPress starter theme with block editor support.
- 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)
- Modern frontend development workflow powered by [Bud](https://bud.js.org/)
- Out of the box support for [Tailwind CSS](https://tailwindcss.com/)
## Getting Started
See the [Sage installation documentation](https://roots.io/sage/docs/installation/).
## Stay Connected
- Join us on Discord by [sponsoring us on GitHub](https://github.com/sponsors/roots)
- Participate on [Roots Discourse](https://discourse.roots.io/)
- Follow [@rootswp on Twitter](https://twitter.com/rootswp)
- Read the [Roots Blog](https://roots.io/blog/)
- Subscribe to the [Roots Newsletter](https://roots.io/newsletter/)

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Providers;
use Roots\Acorn\Sage\SageServiceProvider;
class ThemeServiceProvider extends SageServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
parent::register();
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
parent::boot();
}
}

View File

@@ -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');
}
}

View File

@@ -0,0 +1,119 @@
<?php
namespace App\View\Composers;
use Roots\Acorn\View\Composer;
class Comments extends Composer
{
/**
* List of views served by this composer.
*
* @var array
*/
protected static $views = [
'partials.comments',
];
/**
* Data to be passed to view before rendering.
*
* @return array
*/
public function with()
{
return [
'title' => $this->title(),
'responses' => $this->responses(),
'previous' => $this->previous(),
'next' => $this->next(),
'paginated' => $this->paginated(),
'closed' => $this->closed(),
];
}
/**
* The comment title.
*
* @return string
*/
public function title()
{
return sprintf(
/* translators: %1$s is replaced with the number of comments and %2$s with the post title */
_nx('%1$s response to &ldquo;%2$s&rdquo;', '%1$s responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'sage'),
get_comments_number() === 1 ? _x('One', 'comments title', 'sage') : number_format_i18n(get_comments_number()),
get_the_title()
);
}
/**
* Retrieve the comments.
*
* @return string
*/
public function responses()
{
if (! have_comments()) {
return;
}
return wp_list_comments([
'style' => 'ol',
'short_ping' => true,
'echo' => false,
]);
}
/**
* The previous comments link.
*
* @return string
*/
public function previous()
{
if (! get_previous_comments_link()) {
return;
}
return get_previous_comments_link(
__('&larr; Older comments', 'sage')
);
}
/**
* The next comments link.
*
* @return string
*/
public function next()
{
if (! get_next_comments_link()) {
return;
}
return get_next_comments_link(
__('Newer comments &rarr;', 'sage')
);
}
/**
* Determine if the comments are paginated.
*
* @return bool
*/
public function paginated()
{
return get_comment_pages_count() > 1 && get_option('page_comments');
}
/**
* Determine if the comments are closed.
*
* @return bool
*/
public function closed()
{
return ! comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments');
}
}

View File

@@ -0,0 +1,84 @@
<?php
namespace App\View\Composers;
use Roots\Acorn\View\Composer;
class Post extends Composer
{
/**
* List of views served by this composer.
*
* @var array
*/
protected static $views = [
'partials.page-header',
'partials.content',
'partials.content-*',
];
/**
* Data to be passed to view before rendering, but after merging.
*
* @return array
*/
public function override()
{
return [
'title' => $this->title(),
'pagination' => $this->pagination(),
];
}
/**
* Retrieve the post title.
*
* @return string
*/
public function title()
{
if ($this->view->name() !== 'partials.page-header') {
return get_the_title();
}
if (is_home()) {
if ($home = get_option('page_for_posts', true)) {
return get_the_title($home);
}
return __('Latest Posts', 'sage');
}
if (is_archive()) {
return get_the_archive_title();
}
if (is_search()) {
return sprintf(
/* translators: %s is replaced with the search query */
__('Search Results for %s', 'sage'),
get_search_query()
);
}
if (is_404()) {
return __('Not Found', 'sage');
}
return get_the_title();
}
/**
* Retrieve the pagination links.
*
* @return string
*/
public function pagination()
{
return wp_link_pages([
'echo' => 0,
'before' => '<p>'.__('Pages:', 'sage'),
'after' => '</p>',
]);
}
}

View File

@@ -0,0 +1,16 @@
<?php
/**
* Theme filters.
*/
namespace App;
/**
* Add "… Continued" to the excerpt.
*
* @return string
*/
add_filter('excerpt_more', function () {
return sprintf(' &hellip; <a href="%s">%s</a>', get_permalink(), __('Continued', 'sage'));
});

View File

@@ -0,0 +1,124 @@
<?php
/**
* Theme setup.
*/
namespace App;
use function Roots\bundle;
/**
* Register the theme assets.
*
* @return void
*/
add_action('wp_enqueue_scripts', function () {
bundle('app')->enqueue();
}, 100);
/**
* Register the theme assets with the block editor.
*
* @return void
*/
add_action('enqueue_block_editor_assets', function () {
bundle('editor')->enqueue();
}, 100);
/**
* Register the initial theme setup.
*
* @return void
*/
add_action('after_setup_theme', function () {
/**
* Disable full-site editing support.
*
* @link https://wptavern.com/gutenberg-10-5-embeds-pdfs-adds-verse-block-color-options-and-introduces-new-patterns
*/
remove_theme_support('block-templates');
/**
* Register the navigation menus.
*
* @link https://developer.wordpress.org/reference/functions/register_nav_menus/
*/
register_nav_menus([
'primary_navigation' => __('Primary Navigation', 'sage'),
]);
/**
* Disable the default block patterns.
*
* @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/#disabling-the-default-block-patterns
*/
remove_theme_support('core-block-patterns');
/**
* Enable plugins to manage the document title.
*
* @link https://developer.wordpress.org/reference/functions/add_theme_support/#title-tag
*/
add_theme_support('title-tag');
/**
* Enable post thumbnail support.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support('post-thumbnails');
/**
* Enable responsive embed support.
*
* @link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#responsive-embedded-content
*/
add_theme_support('responsive-embeds');
/**
* Enable HTML5 markup support.
*
* @link https://developer.wordpress.org/reference/functions/add_theme_support/#html5
*/
add_theme_support('html5', [
'caption',
'comment-form',
'comment-list',
'gallery',
'search-form',
'script',
'style',
]);
/**
* Enable selective refresh for widgets in customizer.
*
* @link https://developer.wordpress.org/reference/functions/add_theme_support/#customize-selective-refresh-widgets
*/
add_theme_support('customize-selective-refresh-widgets');
}, 20);
/**
* Register the theme sidebars.
*
* @return void
*/
add_action('widgets_init', function () {
$config = [
'before_widget' => '<section class="widget %1$s %2$s">',
'after_widget' => '</section>',
'before_title' => '<h3>',
'after_title' => '</h3>',
];
register_sidebar([
'name' => __('Primary', 'sage'),
'id' => 'sidebar-primary',
] + $config);
register_sidebar([
'name' => __('Footer', 'sage'),
'id' => 'sidebar-footer',
] + $config);
});

View File

@@ -0,0 +1,80 @@
/**
* Compiler configuration
*
* @see {@link https://roots.io/sage/docs sage documentation}
* @see {@link https://bud.js.org/learn/config bud.js configuration guide}
*
* @type {import('@roots/bud').Config}
*/
export default async (app) => {
/**
* Application assets & entrypoints
*
* @see {@link https://bud.js.org/reference/bud.entry}
* @see {@link https://bud.js.org/reference/bud.assets}
*/
app
.entry('app', ['@scripts/app', '@styles/app'])
.entry('editor', ['@scripts/editor', '@styles/editor'])
.assets(['images']);
/**
* Set public path
*
* @see {@link https://bud.js.org/reference/bud.setPublicPath}
*/
app.setPublicPath('/app/themes/sage/public/');
/**
* Development server settings
*
* @see {@link https://bud.js.org/reference/bud.setUrl}
* @see {@link https://bud.js.org/reference/bud.setProxyUrl}
* @see {@link https://bud.js.org/reference/bud.watch}
*/
app
.setUrl('http://localhost:3000')
.setProxyUrl('https://think-boats.com.local.1fp.ltd')
.watch(['resources/views', 'app']);
/**
* Generate WordPress `theme.json`
*
* @note This overwrites `theme.json` on every build.
*
* @see {@link https://bud.js.org/extensions/sage/theme.json}
* @see {@link https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json}
*/
app.wpjson
.setSettings({
background: {
backgroundImage: true,
},
color: {
custom: false,
customDuotone: false,
customGradient: false,
defaultDuotone: false,
defaultGradients: false,
defaultPalette: false,
duotone: [],
},
custom: {
spacing: {},
typography: {
'font-size': {},
'line-height': {},
},
},
spacing: {
padding: true,
units: ['px', '%', 'em', 'rem', 'vw', 'vh'],
},
typography: {
customFontSize: false,
},
})
.useTailwindColors()
.useTailwindFontFamily()
.useTailwindFontSize();
};

View File

@@ -0,0 +1,64 @@
{
"name": "roots/sage",
"type": "wordpress-theme",
"license": "MIT",
"description": "WordPress starter theme with a modern development workflow",
"homepage": "https://roots.io/sage/",
"authors": [
{
"name": "Ben Word",
"email": "ben@benword.com",
"homepage": "https://github.com/retlehs"
},
{
"name": "Scott Walkinshaw",
"email": "scott.walkinshaw@gmail.com",
"homepage": "https://github.com/swalkinshaw"
},
{
"name": "QWp6t",
"email": "hi@qwp6t.me",
"homepage": "https://github.com/qwp6t"
},
{
"name": "Brandon Nifong",
"email": "brandon@tendency.me",
"homepage": "https://github.com/log1x"
}
],
"keywords": [
"wordpress"
],
"support": {
"issues": "https://github.com/roots/sage/issues",
"forum": "https://discourse.roots.io/"
},
"autoload": {
"psr-4": {
"App\\": "app/"
}
},
"require": {
"php": ">=8.1"
},
"require-dev": {
"laravel/pint": "^1.13"
},
"suggest": {
"log1x/sage-directives": "A collection of useful Blade directives for WordPress and Sage (^1.0)."
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"acorn": {
"providers": [
"App\\Providers\\ThemeServiceProvider"
]
}
}
}

87
web/app/themes/badegg/composer.lock generated Normal file
View File

@@ -0,0 +1,87 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "d8fb7181c59363e264a92e0c7c1c932f",
"packages": [],
"packages-dev": [
{
"name": "laravel/pint",
"version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/pint.git",
"reference": "53072e8ea22213a7ed168a8a15b96fbb8b82d44b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/pint/zipball/53072e8ea22213a7ed168a8a15b96fbb8b82d44b",
"reference": "53072e8ea22213a7ed168a8a15b96fbb8b82d44b",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-mbstring": "*",
"ext-tokenizer": "*",
"ext-xml": "*",
"php": "^8.1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.66.0",
"illuminate/view": "^10.48.25",
"larastan/larastan": "^2.9.12",
"laravel-zero/framework": "^10.48.25",
"mockery/mockery": "^1.6.12",
"nunomaduro/termwind": "^1.17.0",
"pestphp/pest": "^2.36.0"
},
"bin": [
"builds/pint"
],
"type": "project",
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Seeders\\": "database/seeders/",
"Database\\Factories\\": "database/factories/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nuno Maduro",
"email": "enunomaduro@gmail.com"
}
],
"description": "An opinionated code formatter for PHP.",
"homepage": "https://laravel.com",
"keywords": [
"format",
"formatter",
"lint",
"linter",
"php"
],
"support": {
"issues": "https://github.com/laravel/pint/issues",
"source": "https://github.com/laravel/pint"
},
"time": "2025-01-14T16:20:53+00:00"
}
],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": {},
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": ">=8.1"
},
"platform-dev": {},
"plugin-api-version": "2.6.0"
}

View File

@@ -0,0 +1,65 @@
<?php
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our theme. We will simply require it into the script here so that we
| don't have to worry about manually loading any of our classes later on.
|
*/
if (! file_exists($composer = __DIR__.'/vendor/autoload.php')) {
wp_die(__('Error locating autoloader. Please run <code>composer install</code>.', 'sage'));
}
require $composer;
/*
|--------------------------------------------------------------------------
| Register The Bootloader
|--------------------------------------------------------------------------
|
| The first thing we will do is schedule a new Acorn application container
| to boot when WordPress is finished loading the theme. The application
| serves as the "glue" for all the components of Laravel and is
| the IoC container for the system binding all of the various parts.
|
*/
if (! function_exists('\Roots\bootloader')) {
wp_die(
__('You need to install Acorn to use this theme.', 'sage'),
'',
[
'link_url' => 'https://roots.io/acorn/docs/installation/',
'link_text' => __('Acorn Docs: Installation', 'sage'),
]
);
}
\Roots\bootloader()->boot();
/*
|--------------------------------------------------------------------------
| Register Sage Theme Files
|--------------------------------------------------------------------------
|
| Out of the box, Sage ships with categorically named theme files
| containing common functionality and setup to be bootstrapped with your
| theme. Simply add (or remove) files from the array below to change what
| is registered alongside Sage.
|
*/
collect(['setup', 'filters'])
->each(function ($file) {
if (! locate_template($file = "app/{$file}.php", true, true)) {
wp_die(
/* translators: %s is replaced with the relative file path */
sprintf(__('Error locating <code>%s</code> for inclusion.', 'sage'), $file)
);
}
});

View File

@@ -0,0 +1,3 @@
<?php
echo view(app('sage.view'), app('sage.data'))->render();

View File

@@ -0,0 +1,34 @@
{
"extends": [
"@roots/bud/config/jsconfig.json",
"@roots/sage/config/jsconfig.json"
],
"compilerOptions": {
"baseUrl": "resources",
/**
* Resolve aliases
*/
"paths": {
"@fonts/*": ["fonts/*"],
"@images/*": ["images/*"],
"@scripts/*": ["scripts/*"],
"@styles/*": ["styles/*"]
},
/**
* Type definitions
*/
"types": [
"@roots/bud",
"@roots/bud-react",
"@roots/bud-postcss",
"@roots/bud-preset-recommend",
"@roots/bud-preset-wordpress",
"@roots/bud-tailwindcss",
"@roots/bud-wordpress-theme-json",
"@roots/sage"
]
},
"files": ["bud.config.js"],
"include": ["resources"],
"exclude": ["node_modules", "public"]
}

View File

@@ -0,0 +1,27 @@
{
"name": "sage",
"private": true,
"browserslist": [
"extends @roots/browserslist-config"
],
"engines": {
"node": ">=20.0.0"
},
"type": "module",
"scripts": {
"dev": "bud dev",
"build": "bud build",
"translate": "npm run translate:pot && npm run translate:update",
"translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --include=\"theme.json,patterns,app,resources\"",
"translate:update": "for file in ./resources/lang/*.po; do wp i18n update-po ./resources/lang/sage.pot $file; done",
"translate:compile": "npm run translate:mo && npm run translate:js",
"translate:js": "wp i18n make-json ./resources/lang --pretty-print",
"translate:mo": "wp i18n make-mo ./resources/lang ./resources/lang"
},
"devDependencies": {
"@roots/bud": "6.20.0",
"@roots/bud-tailwindcss": "6.20.0",
"@roots/sage": "6.20.0"
},
"dependencies": {}
}

View File

@@ -0,0 +1,13 @@
import domReady from '@roots/sage/client/dom-ready';
/**
* Application entrypoint
*/
domReady(async () => {
// ...
});
/**
* @see {@link https://webpack.js.org/api/hot-module-replacement/}
*/
if (import.meta.webpackHot) import.meta.webpackHot.accept(console.error);

View File

@@ -0,0 +1,9 @@
/**
* @see {@link https://bud.js.org/extensions/bud-preset-wordpress/editor-integration/filters}
*/
roots.register.filters('@scripts/filters');
/**
* @see {@link https://webpack.js.org/api/hot-module-replacement/}
*/
if (import.meta.webpackHot) import.meta.webpackHot.accept(console.error);

View File

@@ -0,0 +1,25 @@
/**
* @see {@link https://developer.wordpress.org/block-editor/reference-guides/filters/block-filters/#blocks-registerblocktype}
*/
export const hook = 'blocks.registerBlockType';
/**
* Filter handle
*/
export const name = 'sage/button';
/**
* Filter callback
*
* @param {object} settings
* @param {string} name
* @returns modified settings
*/
export function callback(settings, name) {
if (name !== 'core/button') return settings;
return {
...settings,
styles: [{ label: 'Outline', name: 'outline' }],
};
}

View File

@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@@ -0,0 +1,13 @@
@extends('layouts.app')
@section('content')
@include('partials.page-header')
@if (! have_posts())
<x-alert type="warning">
{!! __('Sorry, but the page you are trying to view does not exist.', 'sage') !!}
</x-alert>
{!! get_search_form(false) !!}
@endif
@endsection

View File

@@ -0,0 +1,15 @@
@props([
'type' => null,
'message' => null,
])
@php($class = match ($type) {
'success' => 'text-green-50 bg-green-400',
'caution' => 'text-yellow-50 bg-yellow-400',
'warning' => 'text-red-50 bg-red-400',
default => 'text-indigo-50 bg-indigo-400',
})
<div {{ $attributes->merge(['class' => "px-2 py-1 {$class}"]) }}>
{!! $message ?? $slot !!}
</div>

View File

@@ -0,0 +1,16 @@
<form role="search" method="get" class="search-form" action="{{ home_url('/') }}">
<label>
<span class="sr-only">
{{ _x('Search for:', 'label', 'sage') }}
</span>
<input
type="search"
placeholder="{!! esc_attr_x('Search &hellip;', 'placeholder', 'sage') !!}"
value="{{ get_search_query() }}"
name="s"
>
</label>
<button>{{ _x('Search', 'submit button', 'sage') }}</button>
</form>

View File

@@ -0,0 +1,23 @@
@extends('layouts.app')
@section('content')
@include('partials.page-header')
@if (! have_posts())
<x-alert type="warning">
{!! __('Sorry, no results were found.', 'sage') !!}
</x-alert>
{!! get_search_form(false) !!}
@endif
@while(have_posts()) @php(the_post())
@includeFirst(['partials.content-' . get_post_type(), 'partials.content'])
@endwhile
{!! get_the_posts_navigation() !!}
@endsection
@section('sidebar')
@include('sections.sidebar')
@endsection

View File

@@ -0,0 +1,36 @@
<!doctype html>
<html @php(language_attributes())>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@php(do_action('get_header'))
@php(wp_head())
</head>
<body @php(body_class())>
@php(wp_body_open())
<div id="app">
<a class="sr-only focus:not-sr-only" href="#main">
{{ __('Skip to content') }}
</a>
@include('sections.header')
<main id="main" class="main">
@yield('content')
</main>
@hasSection('sidebar')
<aside class="sidebar">
@yield('sidebar')
</aside>
@endif
@include('sections.footer')
</div>
@php(do_action('get_footer'))
@php(wp_footer())
</body>
</html>

View File

@@ -0,0 +1,8 @@
@extends('layouts.app')
@section('content')
@while(have_posts()) @php(the_post())
@include('partials.page-header')
@includeFirst(['partials.content-page', 'partials.content'])
@endwhile
@endsection

View File

@@ -0,0 +1,39 @@
@if (! post_password_required())
<section id="comments" class="comments">
@if ($responses)
<h2>
{!! $title !!}
</h2>
<ol class="comment-list">
{!! $responses !!}
</ol>
@if ($paginated)
<nav aria-label="Comment">
<ul class="pager">
@if ($previous)
<li class="previous">
{!! $previous !!}
</li>
@endif
@if ($next)
<li class="next">
{!! $next !!}
</li>
@endif
</ul>
</nav>
@endif
@endif
@if ($closed)
<x-alert type="warning">
{!! __('Comments are closed.', 'sage') !!}
</x-alert>
@endif
@php(comment_form())
</section>
@endif

View File

@@ -0,0 +1,7 @@
@php(the_content())
@if ($pagination)
<nav class="page-nav" aria-label="Page">
{!! $pagination !!}
</nav>
@endif

View File

@@ -0,0 +1,15 @@
<article @php(post_class())>
<header>
<h2 class="entry-title">
<a href="{{ get_permalink() }}">
{!! $title !!}
</a>
</h2>
@includeWhen(get_post_type() === 'post', 'partials.entry-meta')
</header>
<div class="entry-summary">
@php(the_excerpt())
</div>
</article>

View File

@@ -0,0 +1,23 @@
<article @php(post_class('h-entry'))>
<header>
<h1 class="p-name">
{!! $title !!}
</h1>
@include('partials.entry-meta')
</header>
<div class="e-content">
@php(the_content())
</div>
@if ($pagination)
<footer>
<nav class="page-nav" aria-label="Page">
{!! $pagination !!}
</nav>
</footer>
@endif
@php(comments_template())
</article>

View File

@@ -0,0 +1,15 @@
<article @php(post_class())>
<header>
<h2 class="entry-title">
<a href="{{ get_permalink() }}">
{!! $title !!}
</a>
</h2>
@include('partials.entry-meta')
</header>
<div class="entry-summary">
@php(the_excerpt())
</div>
</article>

View File

@@ -0,0 +1,10 @@
<time class="dt-published" datetime="{{ get_post_time('c', true) }}">
{{ get_the_date() }}
</time>
<p>
<span>{{ __('By', 'sage') }}</span>
<a href="{{ get_author_posts_url(get_the_author_meta('ID')) }}" class="p-author h-card">
{{ get_the_author() }}
</a>
</p>

View File

@@ -0,0 +1,3 @@
<div class="page-header">
<h1>{!! $title !!}</h1>
</div>

View File

@@ -0,0 +1,19 @@
@extends('layouts.app')
@section('content')
@include('partials.page-header')
@if (! have_posts())
<x-alert type="warning">
{!! __('Sorry, no results were found.', 'sage') !!}
</x-alert>
{!! get_search_form(false) !!}
@endif
@while(have_posts()) @php(the_post())
@include('partials.content-search')
@endwhile
{!! get_the_posts_navigation() !!}
@endsection

View File

@@ -0,0 +1,3 @@
<footer class="content-info">
@php(dynamic_sidebar('sidebar-footer'))
</footer>

View File

@@ -0,0 +1,11 @@
<header class="banner">
<a class="brand" href="{{ home_url('/') }}">
{!! $siteName !!}
</a>
@if (has_nav_menu('primary_navigation'))
<nav class="nav-primary" aria-label="{{ wp_get_nav_menu_name('primary_navigation') }}">
{!! wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav', 'echo' => false]) !!}
</nav>
@endif
</header>

View File

@@ -0,0 +1 @@
@php(dynamic_sidebar('sidebar-primary'))

View File

@@ -0,0 +1,7 @@
@extends('layouts.app')
@section('content')
@while(have_posts()) @php(the_post())
@includeFirst(['partials.content-single-' . get_post_type(), 'partials.content-single'])
@endwhile
@endsection

View File

@@ -0,0 +1,12 @@
{{--
Template Name: Custom Template
--}}
@extends('layouts.app')
@section('content')
@while(have_posts()) @php(the_post())
@include('partials.page-header')
@include('partials.content-page')
@endwhile
@endsection

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

View File

@@ -0,0 +1,13 @@
/*
Theme Name: Bad Egg Digital
Theme URI: https://www.badegg.uk/
Description: This theme was written specifically for Think-Boats.com using Roots' Sage as its foundation.
Version: 10.8.2
Author: Roots
Author URI: https://www.badegg.uk/
Text Domain: sage
License: MIT License
License URI: https://opensource.org/licenses/MIT
Requires PHP: 8.1
Requires at least: 5.9
*/

View File

@@ -0,0 +1,12 @@
/** @type {import('tailwindcss').Config} config */
const config = {
content: ['./app/**/*.php', './resources/**/*.{php,vue,js}'],
theme: {
extend: {
colors: {}, // Extend Tailwind's default colors
},
},
plugins: [],
};
export default config;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff