Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
81655d2
chore: rename directories `styles` and `scripts` to `scss` and `js` r…
yCodeTech Jan 16, 2025
6304b94
chore: update editorconfig and gitignore files.
yCodeTech Jan 16, 2025
a0d1856
refactor: change bootloader to use the `ThemeServiceProvider`
yCodeTech Jan 16, 2025
860d214
refactor: 🎨 Move default theme markup to the app layout
yCodeTech Jan 16, 2025
008d8f1
remove: unnecessary components/partials.
yCodeTech Jan 16, 2025
cb07ec8
chore: remove unnecessary stuff from jsconfig and update Roots name i…
yCodeTech Jan 16, 2025
e26ad93
fix: check `wp_link_pages` pagination before rendering to prevent emp…
yCodeTech Jan 16, 2025
d2daf74
docs: remove bundles description from the comment since we removed bu…
yCodeTech Jan 16, 2025
ca0548d
chore: update theme attributes in style.css and bump version, and bum…
yCodeTech Jan 16, 2025
2ee3b0b
build: remove various irrelevant properties, dependency, and make sur…
yCodeTech Jan 16, 2025
1668624
style: auto formatting
yCodeTech Jan 16, 2025
a95985f
build: remove declaration of providers and require PHP 8.2 and above
yCodeTech Jan 16, 2025
8bb6952
remove: soil features
yCodeTech Jan 26, 2025
8a9c7c2
revert: commit a0d1856 that changed the bootloader.
yCodeTech Jan 26, 2025
4513dbf
revert: commit a95985f partially.
yCodeTech Jan 26, 2025
d832f2a
remove: `node-sass-glob-importer` unmaintained dependency.
yCodeTech Jan 26, 2025
b756e07
fix: the renamed css and js files when including them in the site. Re…
yCodeTech Jan 26, 2025
3be9ff5
feat: add comments view and composer
yCodeTech Jan 26, 2025
7836aa1
docs: update badges and some text.
yCodeTech Jan 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,10 @@ root = true
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
indent_style = tab
indent_size = 4
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
/vendor
/public
.env
.budfiles
npm-debug.log
yarn-error.log
.vscode
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) Roots Software Foundation LLC
Copyright (c) Roots Software 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
Expand Down
59 changes: 28 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
</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 href="https://img.shields.io/badge/php-%23777BB4.svg?&logo=php&logoColor=white">
<img alt="PHP version" src="https://img.shields.io/badge/v10.8.2-525DDC?style=flat-square&logo=rootssage&label=Sage&labelColor=%23f6f7f8
">
</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 href="https://img.shields.io/badge/php-%23777BB4.svg?&logo=php&logoColor=white">
<img alt="PHP version" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2FyCodeTech%2Fsage10-laravelmix%2Fraw%2Fmaster%2Fcomposer.json&query=%24.require.php&style=flat-square&label=php&color=%23777BB4
">
</a>
</p>

Expand All @@ -29,13 +26,13 @@

## Overview

Sage is a WordPress starter theme with block editor support.
Sage is a hybrid WordPress starter theme with:

- 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/)~~ [Laravel Mix](https://laravel-mix.com/)
- Out of the box support for ~~[Tailwind CSS](https://tailwindcss.com/)~~ [SASS](https://sass-lang.com/)
- Out of the box support for [log1x/sage-directives](https://github.com/log1x/sage-directives)
- Clean, efficient theme templating utilizing [Laravel Blade](https://laravel.com/docs/master/blade)
- Harness the power of [Laravel](https://laravel.com) and its available packages thanks to [Acorn](https://github.com/roots/acorn)
- Modern frontend development workflow powered by ~~[Bud](https://bud.js.org/)~~ [Laravel Mix](https://laravel-mix.com/)
- Out of the box support for ~~[Tailwind CSS](https://tailwindcss.com/)~~ [SASS](https://sass-lang.com/)
- Out of the box support for [log1x/sage-directives](https://github.com/log1x/sage-directives)

## Getting Started

Expand All @@ -45,21 +42,21 @@ This Laravel Mix adaptation of Sage 10 is for Bedrock installs. See the [Bedrock

1. Once Bedrock is installed, in the root directory, install [roots/acorn](https://github.com/roots/acorn) with `composer require roots/acorn`. Then add the following into the _scripts_ section of the _composer.json_

```json
"post-autoload-dump": [
"Roots\\Acorn\\ComposerScripts::postAutoloadDump"
]
```
```json
"post-autoload-dump": [
"Roots\\Acorn\\ComposerScripts::postAutoloadDump"
]
```

2. In the _themes_ directory either clone this repository or download the zip file and unzip it into the directory.

- If cloning, you can specify the sage theme directory name in the git command, otherwise it will be the same name as this repo. Example:
- If cloning, you can specify the sage theme directory name in the git command, otherwise it will be the same name as this repo. Example:

```bash
git clone git@github.com:yCodeTech/sage10-laravelmix.git sage-theme
```
```bash
git clone git@github.com:yCodeTech/sage10-laravelmix.git sage-theme
```

(Note: the theme name in WP will be _Sage 10 Theme_, unless it's changed in the style.css file.)
(Note: the theme name in WP will be _Sage 10 Theme_, unless it's changed in the style.css file.)

3. Do a `composer install` and a `npm install` in the new sage theme directory.
4. Activate the theme in wp-admin and start coding locally with Laravel Mix.
Expand All @@ -72,16 +69,16 @@ This Laravel Mix adaptation of Sage 10 is for Bedrock installs. See the [Bedrock

## 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/)
- 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/)

## 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://pantheon.io/"><img src="https://cdn.roots.io/app/uploads/pantheon.svg" alt="Pantheon" 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://generodigital.com/"><img src="https://cdn.roots.io/app/uploads/genero.svg" alt="Genero" 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>
<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>
57 changes: 0 additions & 57 deletions app/View/Components/Alert.php

This file was deleted.

119 changes: 119 additions & 0 deletions app/View/Composers/Comments.php
Original file line number Diff line number Diff line change
@@ -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');
}
}
17 changes: 16 additions & 1 deletion app/View/Composers/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ public function override()
{
return [
'title' => $this->title(),
'pagination' => $this->pagination(),
];
}

/**
* Returns the post title.
* Retrieve the post title.
*
* @return string
*/
Expand Down Expand Up @@ -66,4 +67,18 @@ public function title()

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>',
]);
}
}
Loading
Loading