Repository: roots/sage Branch: main Commit: 55ef65d093b7 Files: 49 Total size: 30.3 KB Directory structure: gitextract_mlgy7jua/ ├── .editorconfig ├── .gitattributes ├── .github/ │ ├── labeler.yml │ ├── renovate.json │ └── workflows/ │ ├── discourse.yml │ ├── labeler.yml │ └── main.yml ├── .gitignore ├── LICENSE.md ├── README.md ├── app/ │ ├── Providers/ │ │ └── ThemeServiceProvider.php │ ├── View/ │ │ └── Composers/ │ │ ├── App.php │ │ ├── Comments.php │ │ └── Post.php │ ├── filters.php │ └── setup.php ├── composer.json ├── functions.php ├── index.php ├── package.json ├── public/ │ └── .gitkeep ├── resources/ │ ├── css/ │ │ ├── app.css │ │ └── editor.css │ ├── fonts/ │ │ └── .gitkeep │ ├── images/ │ │ └── .gitkeep │ ├── js/ │ │ ├── app.js │ │ └── editor.js │ └── views/ │ ├── 404.blade.php │ ├── components/ │ │ └── alert.blade.php │ ├── forms/ │ │ └── search.blade.php │ ├── index.blade.php │ ├── layouts/ │ │ └── app.blade.php │ ├── page.blade.php │ ├── partials/ │ │ ├── comments.blade.php │ │ ├── content-page.blade.php │ │ ├── content-search.blade.php │ │ ├── content-single.blade.php │ │ ├── content.blade.php │ │ ├── entry-meta.blade.php │ │ └── page-header.blade.php │ ├── search.blade.php │ ├── sections/ │ │ ├── footer.blade.php │ │ ├── header.blade.php │ │ └── sidebar.blade.php │ ├── single.blade.php │ └── template-custom.blade.php ├── style.css ├── theme.json └── vite.config.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .editorconfig ================================================ 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 ================================================ FILE: .gitattributes ================================================ /.gitattributes export-ignore /.github export-ignore ================================================ FILE: .github/labeler.yml ================================================ build: - changed-files: - any-glob-to-any-file: - vite.config.js dependencies: - changed-files: - any-glob-to-any-file: - package-lock.json javascript: - changed-files: - any-glob-to-any-file: - resources/js/**/*.js php: - changed-files: - any-glob-to-any-file: - functions.php - app/**/*.php - resources/views/**/*.php views: - changed-files: - any-glob-to-any-file: - index.php - resources/views/**/*.php ================================================ FILE: .github/renovate.json ================================================ { "baseBranchPatterns": [ "main" ], "commitMessageAction": "⬆️ Bump", "commitMessageTopic": "{{depName}}", "extends": [ "config:recommended", "schedule:weekly" ], "rangeStrategy": "replace", "ignoreDeps": ["php"], "packageRules": [ { "matchUpdateTypes": ["major"], "enabled": false }, { "matchPackageNames": ["node"], "enabled": false }, { "matchManagers": ["composer"], "matchDepTypes": ["require"], "matchPackageNames": ["php"], "enabled": false }, { "matchUpdateTypes": [ "minor", "patch", "pin" ], "enabled": true } ], "timezone": "America/Detroit" } ================================================ FILE: .github/workflows/discourse.yml ================================================ name: Post release topic on Discourse on: release: types: [published] jobs: post: runs-on: ubuntu-latest steps: - uses: roots/discourse-topic-github-release-action@main with: discourse-api-key: ${{ secrets.DISCOURSE_RELEASES_API_KEY }} discourse-base-url: ${{ secrets.DISCOURSE_BASE_URL }} github-token: ${{ github.token }} discourse-category: 11 discourse-tags: releases ================================================ FILE: .github/workflows/labeler.yml ================================================ name: "Pull Request Labeler" on: - pull_request_target jobs: triage: runs-on: ubuntu-latest steps: - uses: actions/labeler@v5 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" ================================================ FILE: .github/workflows/main.yml ================================================ name: Main on: push: branches: - main pull_request: branches: - main jobs: node: name: Node ${{ matrix.node }} runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" strategy: matrix: node: ['20'] steps: - name: Checkout the project uses: actions/checkout@v4 - name: Setup the Node ${{ matrix.node }} environment on ${{ runner.os }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Install dependencies using npm run: npm install - name: Build and compile assets run: | npm run build cat public/build/manifest.json - name: Validate theme.json run: | THEME_JSON="public/build/assets/theme.json" if [ ! -f "$THEME_JSON" ]; then echo "❌ theme.json not found" exit 1 fi jq -e ' (.settings.color.palette | length > 0) and (.settings.typography.fontFamilies | length > 0) and (.settings.typography.fontSizes | length > 0) ' "$THEME_JSON" 2>&1 || { echo "❌ Invalid theme.json structure or missing required values" exit 1 } php: name: PHP ${{ matrix.php }} runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" strategy: matrix: php: ['8.2'] steps: - name: Checkout the project uses: actions/checkout@v4 - name: Setup the PHP ${{ matrix.php }} environment on ${{ runner.os }} uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} coverage: xdebug env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Restore the Composer cache directory id: composercache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - uses: actions/cache@v4 with: path: ${{ steps.composercache.outputs.dir }} key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer- - name: Install Composer dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest - name: Run Pint run: vendor/bin/pint --test ================================================ FILE: .gitignore ================================================ /node_modules /vendor /public/* !/public/.gitkeep .env npm-debug.log ================================================ FILE: LICENSE.md ================================================ 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 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. ================================================ FILE: README.md ================================================
# Sage **Advanced hybrid WordPress starter theme with Laravel Blade and Tailwind CSS** - 🔧 Clean, efficient theme templating with Laravel Blade - ⚡️ Modern front-end development workflow powered by Vite - 🎨 Out of the box support for Tailwind CSS - 🚀 Harness the power of Laravel with [Acorn integration](https://github.com/roots/acorn) - 📦 Block editor support built-in Sage brings proper PHP templating and modern JavaScript tooling to WordPress themes. Write organized, component-based code using Laravel Blade, enjoy instant builds and CSS hot-reloading with Vite, and leverage Laravel's robust feature set through Acorn. [Read the docs to get started](https://roots.io/sage/docs/installation/) ## Support us Roots is an independent open source org, supported only by developers like you. Your sponsorship funds [WP Packages](https://wp-packages.org/) and the entire Roots ecosystem, and keeps them independent. Support us by purchasing [Radicle](https://roots.io/radicle/) or [sponsoring us on GitHub](https://github.com/sponsors/roots) — sponsors get access to our private Discord. ### Sponsors'.__('Pages:', 'sage'), 'after' => '
', ]); } } ================================================ FILE: app/filters.php ================================================ %s', get_permalink(), __('Continued', 'sage')); }); ================================================ FILE: app/setup.php ================================================ "@import url('{$style}')", ]; return $settings; }); /** * Inject scripts into the block editor. * * @return void */ add_action('admin_head', function () { if (! get_current_screen()?->is_block_editor()) { return; } if (! Vite::isRunningHot()) { $dependencies = json_decode(Vite::content('editor.deps.json')); foreach ($dependencies as $dependency) { if (! wp_script_is($dependency)) { wp_enqueue_script($dependency); } } } echo Vite::withEntryPoints([ 'resources/js/editor.js', ])->toHtml(); }); /** * Use the generated theme.json file. * * @return string */ add_filter('theme_file_path', function ($path, $file) { return $file === 'theme.json' ? public_path('build/assets/theme.json') : $path; }, 10, 2); /** * Disable on-demand block asset loading. * * @link https://core.trac.wordpress.org/ticket/61965 */ add_filter('should_load_separate_core_block_assets', '__return_false'); /** * 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' => '', 'before_title' => '%s for inclusion.', 'sage'), $file)
);
}
});
================================================
FILE: index.php
================================================
render();
================================================
FILE: package.json
================================================
{
"name": "sage",
"private": true,
"engines": {
"node": ">=20.0.0"
},
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite 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/vite-plugin": "^1.0.0",
"@tailwindcss/vite": "^4.0.0",
"laravel-vite-plugin": "^2.0.0",
"tailwindcss": "^4.0.0",
"vite": "^7.0.0"
}
}
================================================
FILE: public/.gitkeep
================================================
================================================
FILE: resources/css/app.css
================================================
@import "tailwindcss" theme(static);
@source "../../app/**/*.php";
@source "../**/*.blade.php";
@source "../**/*.js";
================================================
FILE: resources/css/editor.css
================================================
@import "tailwindcss";
================================================
FILE: resources/fonts/.gitkeep
================================================
================================================
FILE: resources/images/.gitkeep
================================================
================================================
FILE: resources/js/app.js
================================================
import.meta.glob([
'../images/**',
'../fonts/**',
]);
================================================
FILE: resources/js/editor.js
================================================
import domReady from '@wordpress/dom-ready';
domReady(() => {
//
});
================================================
FILE: resources/views/404.blade.php
================================================
@extends('layouts.app')
@section('content')
@include('partials.page-header')
@if (! have_posts())
{{ __('By', 'sage') }} {{ get_the_author() }}
================================================ FILE: resources/views/partials/page-header.blade.php ================================================
{!! $title !!}
{!! $responses !!}
@if ($paginated()) @endif @endif @if ($closed())