Skip to content

Commit 3f33826

Browse files
authored
Merge pull request #39 from yCodeTech/sage-v10.8.2
Update to Sage v10.8.2 and PHP 8.2
2 parents 7042a81 + 7836aa1 commit 3f33826

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+301
-324
lines changed

.editorconfig

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,10 @@ root = true
44
charset = utf-8
55
end_of_line = lf
66
insert_final_newline = true
7-
indent_style = space
8-
indent_size = 2
7+
indent_style = tab
8+
indent_size = 4
99
trim_trailing_whitespace = true
1010
quote_type = single
1111

1212
[*.md]
1313
trim_trailing_whitespace = false
14-
15-
[*.php]
16-
indent_size = 4
17-
18-
[*.blade.php]
19-
indent_size = 2
20-
21-
[resources/views/**.php]
22-
indent_size = 2
23-
24-
[index.php]
25-
indent_size = 2

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
/vendor
33
/public
44
.env
5-
.budfiles
65
npm-debug.log
7-
yarn-error.log
6+
.vscode

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) Roots Software Foundation LLC
1+
Copyright (c) Roots Software LLC
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of
44
this software and associated documentation files (the "Software"), to deal in

README.md

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@
55
</p>
66

77
<p align="center">
8-
<a href="https://packagist.org/packages/roots/sage">
9-
<img alt="Packagist Installs" src="https://img.shields.io/packagist/dt/roots/sage?label=projects%20created&colorB=2b3072&colorA=525ddc&style=flat-square">
8+
<a href="https://img.shields.io/badge/php-%23777BB4.svg?&logo=php&logoColor=white">
9+
<img alt="PHP version" src="https://img.shields.io/badge/v10.8.2-525DDC?style=flat-square&logo=rootssage&label=Sage&labelColor=%23f6f7f8
10+
">
1011
</a>
11-
12-
<a href="https://github.com/roots/sage/actions/workflows/main.yml">
13-
<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">
14-
</a>
15-
16-
<a href="https://twitter.com/rootswp">
17-
<img alt="Follow Roots" src="https://img.shields.io/badge/follow%20@rootswp-1da1f2?logo=twitter&logoColor=ffffff&message=&style=flat-square">
12+
<a href="https://img.shields.io/badge/php-%23777BB4.svg?&logo=php&logoColor=white">
13+
<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
14+
">
1815
</a>
1916
</p>
2017

@@ -29,13 +26,13 @@
2926

3027
## Overview
3128

32-
Sage is a WordPress starter theme with block editor support.
29+
Sage is a hybrid WordPress starter theme with:
3330

34-
- Harness the power of [Laravel](https://laravel.com) and its available packages thanks to [Acorn](https://github.com/roots/acorn)
35-
- Clean, efficient theme templating utilizing [Laravel Blade](https://laravel.com/docs/master/blade)
36-
- Modern frontend development workflow powered by ~~[Bud](https://bud.js.org/)~~ [Laravel Mix](https://laravel-mix.com/)
37-
- Out of the box support for ~~[Tailwind CSS](https://tailwindcss.com/)~~ [SASS](https://sass-lang.com/)
38-
- Out of the box support for [log1x/sage-directives](https://github.com/log1x/sage-directives)
31+
- Clean, efficient theme templating utilizing [Laravel Blade](https://laravel.com/docs/master/blade)
32+
- Harness the power of [Laravel](https://laravel.com) and its available packages thanks to [Acorn](https://github.com/roots/acorn)
33+
- Modern frontend development workflow powered by ~~[Bud](https://bud.js.org/)~~ [Laravel Mix](https://laravel-mix.com/)
34+
- Out of the box support for ~~[Tailwind CSS](https://tailwindcss.com/)~~ [SASS](https://sass-lang.com/)
35+
- Out of the box support for [log1x/sage-directives](https://github.com/log1x/sage-directives)
3936

4037
## Getting Started
4138

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

4643
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_
4744

48-
```json
49-
"post-autoload-dump": [
50-
"Roots\\Acorn\\ComposerScripts::postAutoloadDump"
51-
]
52-
```
45+
```json
46+
"post-autoload-dump": [
47+
"Roots\\Acorn\\ComposerScripts::postAutoloadDump"
48+
]
49+
```
5350

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

56-
- 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:
53+
- 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:
5754

58-
```bash
59-
git clone [email protected]:yCodeTech/sage10-laravelmix.git sage-theme
60-
```
55+
```bash
56+
git clone [email protected]:yCodeTech/sage10-laravelmix.git sage-theme
57+
```
6158

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

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

7370
## Stay Connected
7471

75-
- Join us on Discord by [sponsoring us on GitHub](https://github.com/sponsors/roots)
76-
- Participate on [Roots Discourse](https://discourse.roots.io/)
77-
- Follow [@rootswp on Twitter](https://twitter.com/rootswp)
78-
- Read the [Roots Blog](https://roots.io/blog/)
79-
- Subscribe to the [Roots Newsletter](https://roots.io/newsletter/)
72+
- Join us on Discord by [sponsoring us on GitHub](https://github.com/sponsors/roots)
73+
- Participate on [Roots Discourse](https://discourse.roots.io/)
74+
- Follow [@rootswp on Twitter](https://twitter.com/rootswp)
75+
- Read the [Roots Blog](https://roots.io/blog/)
76+
- Subscribe to the [Roots Newsletter](https://roots.io/newsletter/)
8077

8178
## Sponsors
8279

8380
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).
8481

8582
<div align="center">
86-
<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>
83+
<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>
8784
</div>

app/View/Components/Alert.php

Lines changed: 0 additions & 57 deletions
This file was deleted.

app/View/Composers/Comments.php

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<?php
2+
3+
namespace App\View\Composers;
4+
5+
use Roots\Acorn\View\Composer;
6+
7+
class Comments extends Composer
8+
{
9+
/**
10+
* List of views served by this composer.
11+
*
12+
* @var array
13+
*/
14+
protected static $views = [
15+
'partials.comments',
16+
];
17+
18+
/**
19+
* Data to be passed to view before rendering.
20+
*
21+
* @return array
22+
*/
23+
public function with()
24+
{
25+
return [
26+
'title' => $this->title(),
27+
'responses' => $this->responses(),
28+
'previous' => $this->previous(),
29+
'next' => $this->next(),
30+
'paginated' => $this->paginated(),
31+
'closed' => $this->closed(),
32+
];
33+
}
34+
35+
/**
36+
* The comment title.
37+
*
38+
* @return string
39+
*/
40+
public function title()
41+
{
42+
return sprintf(
43+
/* translators: %1$s is replaced with the number of comments and %2$s with the post title */
44+
_nx('%1$s response to &ldquo;%2$s&rdquo;', '%1$s responses to &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'sage'),
45+
get_comments_number() === 1 ? _x('One', 'comments title', 'sage') : number_format_i18n(get_comments_number()),
46+
get_the_title()
47+
);
48+
}
49+
50+
/**
51+
* Retrieve the comments.
52+
*
53+
* @return string
54+
*/
55+
public function responses()
56+
{
57+
if (! have_comments()) {
58+
return;
59+
}
60+
61+
return wp_list_comments([
62+
'style' => 'ol',
63+
'short_ping' => true,
64+
'echo' => false,
65+
]);
66+
}
67+
68+
/**
69+
* The previous comments link.
70+
*
71+
* @return string
72+
*/
73+
public function previous()
74+
{
75+
if (! get_previous_comments_link()) {
76+
return;
77+
}
78+
79+
return get_previous_comments_link(
80+
__('&larr; Older comments', 'sage')
81+
);
82+
}
83+
84+
/**
85+
* The next comments link.
86+
*
87+
* @return string
88+
*/
89+
public function next()
90+
{
91+
if (! get_next_comments_link()) {
92+
return;
93+
}
94+
95+
return get_next_comments_link(
96+
__('Newer comments &rarr;', 'sage')
97+
);
98+
}
99+
100+
/**
101+
* Determine if the comments are paginated.
102+
*
103+
* @return bool
104+
*/
105+
public function paginated()
106+
{
107+
return get_comment_pages_count() > 1 && get_option('page_comments');
108+
}
109+
110+
/**
111+
* Determine if the comments are closed.
112+
*
113+
* @return bool
114+
*/
115+
public function closed()
116+
{
117+
return ! comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments');
118+
}
119+
}

app/View/Composers/Post.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ public function override()
2626
{
2727
return [
2828
'title' => $this->title(),
29+
'pagination' => $this->pagination(),
2930
];
3031
}
3132

3233
/**
33-
* Returns the post title.
34+
* Retrieve the post title.
3435
*
3536
* @return string
3637
*/
@@ -66,4 +67,18 @@ public function title()
6667

6768
return get_the_title();
6869
}
70+
71+
/**
72+
* Retrieve the pagination links.
73+
*
74+
* @return string
75+
*/
76+
public function pagination()
77+
{
78+
return wp_link_pages([
79+
'echo' => 0,
80+
'before' => '<p>'.__('Pages:', 'sage'),
81+
'after' => '</p>',
82+
]);
83+
}
6984
}

0 commit comments

Comments
 (0)