Sage 10 (#2138)
* Sage 10 (#2122) There's a new version of Sage in the pipeline. The most significant change is the introduction of Acorn. I'll release more information about Acorn as it nears completion. TODO - [ ] Restructure templates (@retlehs) - [ ] Code splitting (@austinpray, @QWp6t, @swalkinshaw) - [ ] WooCommerce compatibility (@QWp6t, @retlehs) - [ ] API for build process (possibly extend Laravel Mix) (@QWp6t, @austinpray) - [ ] Acorn - https://github.com/QWp6t/acorn/issues/1 (@QWp6t) - [ ] Documentation Sage 10 and Acorn are both still works in progress so you should definitely not start any projects with them in their current state unless you're willing to do an inordinate amount of debugging and go through the hassle of keeping up with updates as we push them. * Add wp_body_open hook (WP 5.2+) * Add missing search blade Enable preflight by default Bump version to 10.0.0 in package.json and style.css Change PHP requirement to 7.1.3 Upgrade roots/sage-installer Remove deprecated qwp6t/acorn repository from composer.json Add some sane optimizations to composer.json Remove excessive linebreaks from helpers.php Make config linebreaking uniform Add missing space to ! conditionals to stay consistent with PSR-1/2 Update the file structure in README.md and add the new sponsor Revert to shorthand @php() Add aside markup to sidebar and wrap it in @hasSection Add a document wrapper Add ARIA roles to the document, main, aside, header, nav, and footer wrappers Change entry-meta conditional in content-search.blade.php to an @includeWhen Add some sane linebreaks throughout the views and codebase to increase readability Add docblocks to the example Title.php composer * Add WP Blade Check * Remove redundant ARIA roles * Revert language_attributes() to get_language_attributes() Remove roots/wp-blade-check until we decide on where to put it Only enable preflight when not in production * Make searchform translations match WordPress core * Update Travis conf * rmdist is gone in Sage 10 * Change to Laravel Mix Clean up and refactor starter styles Remove autoload from styles/scripts Remove $ import on customizer.js as Mix autoload will handle that Fix conditional on comments.blade.php Bump PHP version to 7.1.3 on Travis Remove unnecessary fields in package.json as it will never be published Rename main.css/main.js to app.css/app.js Automatically remove Blade cache when theme is activated, changed, or removed * Simplify Blade cache removal * Use ->uri() on asset for sanity purposes * Fix app.js typo * Add npm-run-all This lets us run related scripts together pretty easily since we can use glob patterns (e.g. `lint:*` — `**` is supported too). You can either run scripts sequentially with `run-s` or in parallel with `run-p`. See: https://github.com/mysticatea/npm-run-all * Add -c (continue on error) flag to lint command This way lint issues for the scripts doesn’t block the styles from being linted. * run-s all the things * Break up `build:production` * Refine `start` script to call `build` but using `--watch` * Since the base command is the same, this makes it easier to maintain. * Use run-s for `test` script for consistency. * Refactor build commands The only thing that differs between `build` and `build:production` is the Node environment variable. We can use `run-s build:mix` preceeded by the correspinding environment setting. * Fix start command We need to pass `--watch` to the `build:mix` not `build`. Also, this means we need to set the Node environment beforehand since `build:mix` doesn’t have that. * Fix hot command `dist` needs to exist for HMR to work since it looks for `dist/hot`. This means we should probably build once before starting HMR. This also renames `build:mix` to just `mix` to keep a consistent naming scheme. * Move cache location to `storage/` Add app.name to configuration Add a ServiceProvider stub Add missing trailing commas to config Remove automatic Blade cache removal action as it is no longer necessary Clean up .gitignore Clean up JavaScript docblocks Remove home.js example Remove leftover Sage 9 information from README * Remove redundent $asset in setup.php * Add clean:views npm script (#2176) Since views are in a predictable location within the theme, this might be handy. A side effect of adding this is that generated views are now cleared on every production build, which might be a good thing. If not, it’s not hard to change. * [Sage 10] Add src and public mix path helpers (#2177) Since Mix uses the `webpack.mix.js` path as the webpack context and doesn’t let us change the context, having a helper can make it easier to add new assets. It also provides a single source of truth for the assets source directory. Also, this adds a `public` function which just makes it easy for setting the `to` path in the `copyDirectory` task. By including the definitions of these functions within the `webpack.mix.js` file itself it makes it clear to Sage users that they are not a part of Mix. * Typo [ci skip] * Syntax optimizations * Combine watch rules using extended glob patterns * Use template literals for mix helpers (src + public). Makes it seem less cluttered. * Use out instead of public for publicPath helper `public` is a future reserved word in JS * Use publicPath instead of out * Use Roots\Acorn\ServiceProvider (#2180) * Make editorconfig account for Blade's outside of resources/views * non-Blade files located in resources/views should also be indent_size = 2 * [Sage 10] Replace jQuery’s .ready() (#2182) * Use DOMContentLoaded listener for document ready * Account for DOMContentLoaded not firing * Extract ready() to utils.js Also uses `window.setTimeout(fn, 0)` to cover async. In a commit/PR in the near future, the `util` directory will be going away since the DOM router has been extracted to its own package (https://github.com/roots/js-dom-router). `utils.js` will function as a place for custom utilities, similar to what `app/helpers.php` is on the PHP side of things. * Replace Travis CI with CircleCI (#2185) * Replace Travis CI with CircleCI * Replace badge [ci skip] * Optimize CircleCI (#2186) * Optimize CircleCI * Change cache keys * Update .gitattributes * Update .gitattributes * Optimize CircleCI config (#2188) * Update composer dependencies * Bump required WordPress version (#2193) * Change WordPress requirement to 5.2 * Restructure (#2200) * Restructure Sage * Composer test -> lint * Fix version_compare() operators (#2195) * Simplify Mix Browsersync API (#2198) * New DOM router + dynamic imports (#2190) * Use new js-dom-router * add dynamic import support with example * Use babel-eslint as eslint parser * Update dependencies * Add post-autoload-dump script for package discovery (#2201) * CircleCI: `yarn install` with `--frozen-lockfile` (#2203) * Bump babel-eslint from 10.0.1 to 10.0.2 (#2209) Bumps [babel-eslint](https://github.com/babel/babel-eslint) from 10.0.1 to 10.0.2. - [Release notes](https://github.com/babel/babel-eslint/releases) - [Commits](https://github.com/babel/babel-eslint/compare/v10.0.1...v10.0.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump sass from 1.21.0 to 1.22.0 (#2211) Bumps [sass](https://github.com/sass/dart-sass) from 1.21.0 to 1.22.0. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.21.0...1.22.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump eslint-plugin-import from 2.17.3 to 2.18.0 (#2210) Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.17.3 to 2.18.0. - [Release notes](https://github.com/benmosher/eslint-plugin-import/releases) - [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md) - [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.17.3...v2.18.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump eslint from 5.16.0 to 6.0.1 (#2212) Bumps [eslint](https://github.com/eslint/eslint) from 5.16.0 to 6.0.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v5.16.0...v6.0.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Fix npm run start script options not forwarded with npm (#2205) This is a known difference between yarn and npm and will eventually break with yarn once backwards compatibility is removed. * Use WordPress’ Browserslist config (#2214) Co-authored-by: Ben Word <ben@benword.com> * Bump sass from 1.22.0 to 1.22.1 (#2216) Bumps [sass](https://github.com/sass/dart-sass) from 1.22.0 to 1.22.1. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.22.0...1.22.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump sass from 1.22.1 to 1.22.3 (#2218) Bumps [sass](https://github.com/sass/dart-sass) from 1.22.1 to 1.22.3. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.22.1...1.22.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump laravel-mix from 4.0.16 to 4.1.2 (#2219) Bumps [laravel-mix](https://github.com/JeffreyWay/laravel-mix) from 4.0.16 to 4.1.2. - [Release notes](https://github.com/JeffreyWay/laravel-mix/releases) - [Commits](https://github.com/JeffreyWay/laravel-mix/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Update README [ci skip] * [Security] Bump lodash from 4.17.11 to 4.17.14 (#2259) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.14. **This update includes security fixes.** - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.14) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump sass from 1.22.3 to 1.22.4 (#2260) Bumps [sass](https://github.com/sass/dart-sass) from 1.22.3 to 1.22.4. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.22.3...1.22.4) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * chore(readme): Use brand color for Twitter follow badge [ci skip] * Acorn asset manager config (#2220) * Add logs directory * Bump sass from 1.22.4 to 1.22.5 (#2263) Bumps [sass](https://github.com/sass/dart-sass) from 1.22.4 to 1.22.5. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.22.4...1.22.5) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Add alert component with view composer (#2267) Resolves #2262 * Fix broken source maps + remove unnecessary conditionals (#2268) Resolves #2266 Laravel Mix has a bug where source maps are not generated if you do not specify the source map type (the second argument). This corrects that. Co-authored-by: Matt Mirus <matt@mattmirus.com> * chore(config): add alert component alias to view config (#2272) This also updates Acorn. * Bump sass from 1.22.5 to 1.22.7 (#2273) Bumps [sass](https://github.com/sass/dart-sass) from 1.22.5 to 1.22.7. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.22.5...1.22.7) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump eslint-plugin-import from 2.18.0 to 2.18.2 (#2275) Bumps [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import) from 2.18.0 to 2.18.2. - [Release notes](https://github.com/benmosher/eslint-plugin-import/releases) - [Changelog](https://github.com/benmosher/eslint-plugin-import/blob/master/CHANGELOG.md) - [Commits](https://github.com/benmosher/eslint-plugin-import/compare/v2.18.0...v2.18.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * No scripts/suggests during `composer install` on CircleCI [ci skip] * Add timezone, globals, and locale app config [ci skip] * Add logging config * Update theme structure in README [ci skip] * Move get_search_form and body_class to Acorn comments_template() now defaults to `partials/comments.blade.php` Composers are now autoloaded * Bump sass from 1.22.7 to 1.22.9 (#2281) Bumps [sass](https://github.com/sass/dart-sass) from 1.22.7 to 1.22.9. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.22.7...1.22.9) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump eslint from 6.0.1 to 6.1.0 (#2276) Bumps [eslint](https://github.com/eslint/eslint) from 6.0.1 to 6.1.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v6.0.1...v6.1.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Update sponsors [ci skip] * Keep a commented out example of calling a Composer class * Bump dependencies Add sage-svg (#2270) Add sage-directives (#2265) Start changelog (Related to #2271) * Set `wp_nav_menu` echo to `false` (#2278) * Bump @wordpress/browserslist-config from 2.5.0 to 2.6.0 (#2282) Bumps [@wordpress/browserslist-config](https://github.com/WordPress/gutenberg/tree/HEAD/packages/browserslist-config) from 2.5.0 to 2.6.0. - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/master/packages/browserslist-config/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/browserslist-config@2.6.0/packages/browserslist-config) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * chore(deps): log1x/sage-directives from 1.0.9 to 1.1.2 (#2286) Bumps [log1x/sage-directives](https://github.com/Log1x/sage-directives) from 1.0.9 to 1.1.2. - [Release notes](https://github.com/Log1x/sage-directives/releases) - [Changelog](https://github.com/Log1x/sage-directives/blob/master/CHANGELOG.md) - [Commits](https://github.com/Log1x/sage-directives/compare/v1.0.9...v1.1.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump sass-loader from 7.1.0 to 7.2.0 (#2287) Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 7.1.0 to 7.2.0. - [Release notes](https://github.com/webpack-contrib/sass-loader/releases) - [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/sass-loader/compare/v7.1.0...v7.2.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Remove unnecessary linebreak [ci skip] * docs(changelog): Use lowercase for "webpack" Keeps it consistent with [their brand](https://webpack.js.org/branding/#the-name). [ci skip] * Bump rimraf from 2.6.3 to 3.0.0 (#2289) Bumps [rimraf](https://github.com/isaacs/rimraf) from 2.6.3 to 3.0.0. - [Release notes](https://github.com/isaacs/rimraf/releases) - [Commits](https://github.com/isaacs/rimraf/compare/v2.6.3...v3.0.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump sass from 1.22.9 to 1.22.10 (#2292) Bumps [sass](https://github.com/sass/dart-sass) from 1.22.9 to 1.22.10. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.22.9...1.22.10) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump sass-loader from 7.2.0 to 7.3.1 (#2293) Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 7.2.0 to 7.3.1. - [Release notes](https://github.com/webpack-contrib/sass-loader/releases) - [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/sass-loader/compare/v7.2.0...v7.3.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump eslint from 6.1.0 to 6.2.1 (#2294) Bumps [eslint](https://github.com/eslint/eslint) from 6.1.0 to 6.2.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v6.1.0...v6.2.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump babel-eslint from 10.0.2 to 10.0.3 (#2295) Bumps [babel-eslint](https://github.com/babel/babel-eslint) from 10.0.2 to 10.0.3. - [Release notes](https://github.com/babel/babel-eslint/releases) - [Commits](https://github.com/babel/babel-eslint/compare/v10.0.2...v10.0.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump eslint from 6.2.1 to 6.2.2 (#2296) Bumps [eslint](https://github.com/eslint/eslint) from 6.2.1 to 6.2.2. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v6.2.1...v6.2.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump log1x/sage-directives from 1.1.2 to 1.1.3 (#2297) Bumps [log1x/sage-directives](https://github.com/Log1x/sage-directives) from 1.1.2 to 1.1.3. - [Release notes](https://github.com/Log1x/sage-directives/releases) - [Changelog](https://github.com/Log1x/sage-directives/blob/master/CHANGELOG.md) - [Commits](https://github.com/Log1x/sage-directives/compare/v1.1.2...v1.1.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Adds i18n support (#2290) Adds translation commands to package.json. Includes support for Javascript strings. Adds translator comment to example app/Composers/Title.php. Does not implement the loading of translated strings as this is a costly operation and implementations can be opinionated. * Update Composers to work with the latest Acorn - Bump dependencies - Run all translate commands with translate:* * Use $this->data in the Alert Composer (#2300) * Use $this->data for handling data in the example Alert composer * Bump Acorn * Update sponsors [ci skip] * Update sponsors [ci skip] * Update sponsors [ci skip] * Call ->render() on view instead of relying on toString (#2330) * Bump for Acorn (#2337) * Breaking Change: Bump required PHP version to 7.2 * chore(deps): Bump dependencies * fix(app): Change app.env and app.debug default values (important*) * chore(deps-dev): Add filp/whoops to required-dev * chore(ci): Remove php-71 from CircleCI * Use mix-manifest.json (Fixes #2329) * Pre-Sage 10 Alpha (#2338) - Refactor default styles and scripts - Clean up default view markup - Change `Title.php` to `Post.php` to suggest a more organized workflow (Supersedes #2320) - Create an `App` composer to show an example of a global variable - Add `align-wide` and `responsive-embeds` to `add_theme_support` by default - Remove deprecated `soil-jquery-cdn` from `add_theme_support` - Clean up docblocks project-wide - Update linting to match the latest PSR-12 standards (e.g. the license docblocks) - Add an appropriate `#app` wrapper to make the project ready for frameworks like Vue - Add `laravel-mix-purgecss` for purgeCSS in production - Add `laravel-mix-copy-watched` for asset watching & versioning - Add `laravel-mix-wp-blocks` to handle compiling blocks - Reduce the footprint of the default `webpack.mix.js` - Append filetypes to asset names - Add default block editor assets - Add handling for the WordPress asset manifest - Remove visual editor styling (Fixes #2269) - Add sensible default styles and folders - Remove unused `phpcs.xml` - Move `sage-directives` and `sage-svg` to suggests - Bump dependencies - Add Brandon Nifong as an author - Change license URI to https - Remove unused function namespaces from setup.php - Append filetypes to asset names - Add default block editor assets - Add handling for the WordPress asset manifest - Ignore dist when running phpcs - Change the search input class the the WP default * Inline manifest.js when enqueueing editor.js (#2344) * Add theme color palette support (#2352) * Bump bootstrap from 4.3.1 to 4.4.1 (#2350) Bumps [bootstrap](https://github.com/twbs/bootstrap) from 4.3.1 to 4.4.1. - [Release notes](https://github.com/twbs/bootstrap/releases) - [Commits](https://github.com/twbs/bootstrap/compare/v4.3.1...v4.4.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump eslint from 6.6.0 to 6.7.2 (#2354) Bumps [eslint](https://github.com/eslint/eslint) from 6.6.0 to 6.7.2. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v6.6.0...v6.7.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump sass from 1.23.3 to 1.23.7 (#2345) Bumps [sass](https://github.com/sass/dart-sass) from 1.23.3 to 1.23.7. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.23.3...1.23.7) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Sage 10 editor scripts & styles (#2351) * adds alternate button style and super basic starter css * Adds transition variable * Add bootstrap max-width to editor-styles * updates button scss, editor wrapper scss, and registration * rename is-style-ghost to is-style-outline * simplify structure and cleanup css * Protect Ben Word's typographic holdings * Remove scoping from .has-xyz-color classes * Restore scss partial import structure * rename partials, move color util, apply bootstrap font * alphabetical selectors ¯\_(ツ)_/¯ * Bump stylelint from 11.1.1 to 12.0.0 (#2342) Bumps [stylelint](https://github.com/stylelint/stylelint) from 11.1.1 to 12.0.0. - [Release notes](https://github.com/stylelint/stylelint/releases) - [Changelog](https://github.com/stylelint/stylelint/blob/master/CHANGELOG.md) - [Commits](https://github.com/stylelint/stylelint/compare/11.1.1...12.0.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump squizlabs/php_codesniffer from 3.5.2 to 3.5.3 (#2356) Bumps [squizlabs/php_codesniffer](https://github.com/squizlabs/PHP_CodeSniffer) from 3.5.2 to 3.5.3. - [Release notes](https://github.com/squizlabs/PHP_CodeSniffer/releases) - [Commits](https://github.com/squizlabs/PHP_CodeSniffer/compare/3.5.2...3.5.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * README updates for 10.0.0-alpha.1 (#2271) * Update theme structure + files in README * Update setup.php * Keep hierarchical assets directory structure (#2372) * fix(stylelint): Fix broken tests (#2375) feat(stylelint): Set `at-rule-empty-line-before` to `null` to allow sane seperation of imports * chore(deps): Bump dependencies (#2376) * update laravel-mix-wp-blocks (#2381) * Update sponsors [ci skip] * Sage 10 fixes/cleanup (#2413) * fix(templates): Move the document wrapper from app.blade.php to index.php to fix hook run sequence (See: #2123) * feat(mix): Add purgecss-with-wordpress whitelists by default * chore(docblocks): Remove copyright/license from PHP docblocks * chore(babel): Remove unused dynamic import plugin until Webpack 5 * chore(babel): Remove unused .babelrc * chore(deps): Bump dependencies * Laravel 7.x (#2429) * enhance(acorn): Update to Laravel 7.x * enhance(blade): Convert existing alert component to a new View Component * chore(deps): Bump minimum PHP version to 7.2.5 * chore(deps): Bump dependencies * chore(configs): Clean up configs * BREAKING(config): Bump configs to support Laravel 7.x * BREAKING(components): @Alert() has been replaced with <x-alert ...> * BREAKING(composers): View co * enhance(deps): Add `Requires PHP` and `Requires at least` to theme style headers. Bump WordPress requirement to v5.4 (#2409) * Sage 10 Chores (#2431) * enhance(functions): Make functions.php pretty * fix(component): Fix improper use of translation on the Alert component * enhance(component): Add `$slot` fallback ternary to the Alert component view * chore(component): Move Alert component message to a slot by default to properly pass the translated string. * chore(component): Properly set default values for Alert * chore(deps): Bump dependencies * chore(theme): Fix required PHP version in style.css * Bump roots/acorn from 1.0.2 to 1.0.3 (#2433) Bumps [roots/acorn](https://github.com/roots/acorn) from 1.0.2 to 1.0.3. - [Release notes](https://github.com/roots/acorn/releases) - [Commits](https://github.com/roots/acorn/compare/v1.0.2...v1.0.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump roots/acorn from 1.0.3 to 1.0.4 (#2440) Bumps [roots/acorn](https://github.com/roots/acorn) from 1.0.3 to 1.0.4. - [Release notes](https://github.com/roots/acorn/releases) - [Commits](https://github.com/roots/acorn/compare/v1.0.3...v1.0.4) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump stylelint from 13.2.1 to 13.3.0 (#2439) Bumps [stylelint](https://github.com/stylelint/stylelint) from 13.2.1 to 13.3.0. - [Release notes](https://github.com/stylelint/stylelint/releases) - [Changelog](https://github.com/stylelint/stylelint/blob/master/CHANGELOG.md) - [Commits](https://github.com/stylelint/stylelint/compare/13.2.1...13.3.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Update sponsors [ci skip] * Bump roots/acorn from 1.0.4 to 1.0.6 (#2444) Bumps [roots/acorn](https://github.com/roots/acorn) from 1.0.4 to 1.0.6. - [Release notes](https://github.com/roots/acorn/releases) - [Commits](https://github.com/roots/acorn/compare/v1.0.4...v1.0.6) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump @wordpress/dependency-extraction-webpack-plugin from 2.4.0 to 2.5.0 (#2448) Bumps [@wordpress/dependency-extraction-webpack-plugin](https://github.com/WordPress/gutenberg/tree/HEAD/packages/dependency-extraction-webpack-plugin) from 2.4.0 to 2.5.0. - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/master/packages/dependency-extraction-webpack-plugin/CHANGELOG.md) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/dependency-extraction-webpack-plugin@2.5.0/packages/dependency-extraction-webpack-plugin) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump @wordpress/babel-preset-default from 4.11.0 to 4.12.1 (#2450) Bumps [@wordpress/babel-preset-default](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default) from 4.11.0 to 4.12.1. - [Release notes](https://github.com/WordPress/gutenberg/releases) - [Changelog](https://github.com/WordPress/gutenberg/blob/master/changelog.txt) - [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/babel-preset-default@4.12.1/packages/babel-preset-default) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump squizlabs/php_codesniffer from 3.5.4 to 3.5.5 (#2451) Bumps [squizlabs/php_codesniffer](https://github.com/squizlabs/PHP_CodeSniffer) from 3.5.4 to 3.5.5. - [Release notes](https://github.com/squizlabs/PHP_CodeSniffer/releases) - [Commits](https://github.com/squizlabs/PHP_CodeSniffer/compare/3.5.4...3.5.5) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump laravel-mix-copy-watched from 2.2.3 to 2.2.4 (#2452) Bumps [laravel-mix-copy-watched](https://github.com/dsktschy/laravel-mix-copy-watched) from 2.2.3 to 2.2.4. - [Release notes](https://github.com/dsktschy/laravel-mix-copy-watched/releases) - [Commits](https://github.com/dsktschy/laravel-mix-copy-watched/compare/v2.2.3...v2.2.4) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump jquery from 3.4.1 to 3.5.0 (#2445) Bumps [jquery](https://github.com/jquery/jquery) from 3.4.1 to 3.5.0. - [Release notes](https://github.com/jquery/jquery/releases) - [Commits](https://github.com/jquery/jquery/compare/3.4.1...3.5.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump stylelint from 13.3.0 to 13.3.3 (#2453) Bumps [stylelint](https://github.com/stylelint/stylelint) from 13.3.0 to 13.3.3. - [Release notes](https://github.com/stylelint/stylelint/releases) - [Changelog](https://github.com/stylelint/stylelint/blob/master/CHANGELOG.md) - [Commits](https://github.com/stylelint/stylelint/compare/13.3.0...13.3.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Update README.md Co-authored-by: Ben Word <ben@benword.com> Co-authored-by: Brandon Nifong <brandon@tendency.me> Co-authored-by: Nathan Knowler <nathan@knowler.me> Co-authored-by: Tang Rufus <tangrufus@gmail.com> Co-authored-by: dependabot-preview[bot] <dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Oskar Schöldström <m@oxy.fi> Co-authored-by: Matt Mirus <matt@mattmirus.com> Co-authored-by: Kelly Mears <developers@tinypixel.dev>
This commit is contained in:
@@ -1,60 +0,0 @@
|
||||
const path = require('path');
|
||||
const { argv } = require('yargs');
|
||||
const merge = require('webpack-merge');
|
||||
|
||||
const desire = require('./util/desire');
|
||||
|
||||
const userConfig = merge(desire(`${__dirname}/../config`), desire(`${__dirname}/../config-local`));
|
||||
|
||||
const isProduction = !!((argv.env && argv.env.production) || argv.p);
|
||||
const rootPath = (userConfig.paths && userConfig.paths.root)
|
||||
? userConfig.paths.root
|
||||
: process.cwd();
|
||||
|
||||
const config = merge({
|
||||
open: true,
|
||||
copy: 'images/**/*',
|
||||
proxyUrl: 'http://localhost:3000',
|
||||
cacheBusting: '[name]_[hash]',
|
||||
paths: {
|
||||
root: rootPath,
|
||||
assets: path.join(rootPath, 'resources/assets'),
|
||||
dist: path.join(rootPath, 'dist'),
|
||||
},
|
||||
enabled: {
|
||||
sourceMaps: !isProduction,
|
||||
optimize: isProduction,
|
||||
cacheBusting: isProduction,
|
||||
watcher: !!argv.watch,
|
||||
},
|
||||
watch: [],
|
||||
}, userConfig);
|
||||
|
||||
module.exports = merge(config, {
|
||||
env: Object.assign({ production: isProduction, development: !isProduction }, argv.env),
|
||||
publicPath: `${config.publicPath}/${path.basename(config.paths.dist)}/`,
|
||||
manifest: {},
|
||||
});
|
||||
|
||||
if (process.env.NODE_ENV === undefined) {
|
||||
process.env.NODE_ENV = isProduction ? 'production' : 'development';
|
||||
}
|
||||
|
||||
/**
|
||||
* If your publicPath differs between environments, but you know it at compile time,
|
||||
* then set SAGE_DIST_PATH as an environment variable before compiling.
|
||||
* Example:
|
||||
* SAGE_DIST_PATH=/wp-content/themes/sage/dist/ yarn build:production
|
||||
*/
|
||||
if (process.env.SAGE_DIST_PATH) {
|
||||
module.exports.publicPath = process.env.SAGE_DIST_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
* If you don't know your publicPath at compile time, then uncomment the lines
|
||||
* below and use WordPress's wp_localize_script() to set SAGE_DIST_PATH global.
|
||||
* Example:
|
||||
* wp_localize_script('sage/main.js', 'SAGE_DIST_PATH', get_theme_file_uri('dist/'))
|
||||
*/
|
||||
// Object.keys(module.exports.entry).forEach(id =>
|
||||
// module.exports.entry[id].unshift(path.join(__dirname, 'helpers/public-path.js')));
|
||||
@@ -1,7 +0,0 @@
|
||||
const hotMiddlewareScript = require('webpack-hot-middleware/client?noInfo=true&timeout=20000&reload=true');
|
||||
|
||||
hotMiddlewareScript.subscribe(event => {
|
||||
if (event.action === 'reload') {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
@@ -1,7 +0,0 @@
|
||||
/* eslint-env browser */
|
||||
/* globals SAGE_DIST_PATH */
|
||||
|
||||
/** Dynamically set absolute public path from current protocol and host */
|
||||
if (SAGE_DIST_PATH) {
|
||||
__webpack_public_path__ = SAGE_DIST_PATH; // eslint-disable-line no-undef, camelcase
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
/* eslint-disable */
|
||||
|
||||
const cssnanoConfig = {
|
||||
preset: ['default', { discardComments: { removeAll: true } }]
|
||||
};
|
||||
|
||||
module.exports = ({ file, options }) => {
|
||||
return {
|
||||
parser: options.enabled.optimize ? 'postcss-safe-parser' : undefined,
|
||||
plugins: {
|
||||
autoprefixer: true,
|
||||
cssnano: options.enabled.optimize ? cssnanoConfig : false,
|
||||
},
|
||||
};
|
||||
};
|
||||
@@ -1,15 +0,0 @@
|
||||
/**
|
||||
* Loop through webpack entry
|
||||
* and add the hot middleware
|
||||
* @param {Object} entry webpack entry
|
||||
* @return {Object} entry with hot middleware
|
||||
*/
|
||||
module.exports = (entry) => {
|
||||
const results = {};
|
||||
|
||||
Object.keys(entry).forEach((name) => {
|
||||
results[name] = Array.isArray(entry[name]) ? entry[name].slice(0) : [entry[name]];
|
||||
results[name].unshift(`${__dirname}/../helpers/hmr-client.js`);
|
||||
});
|
||||
return results;
|
||||
};
|
||||
@@ -1,34 +0,0 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = (key, value) => {
|
||||
if (typeof value === 'string') {
|
||||
return value;
|
||||
}
|
||||
const manifest = value;
|
||||
/**
|
||||
* Hack to prepend scripts/ or styles/ to manifest keys
|
||||
*
|
||||
* This might need to be reworked at some point.
|
||||
*
|
||||
* Before:
|
||||
* {
|
||||
* "main.js": "scripts/main_abcdef.js"
|
||||
* "main.css": "styles/main_abcdef.css"
|
||||
* }
|
||||
* After:
|
||||
* {
|
||||
* "scripts/main.js": "scripts/main_abcdef.js"
|
||||
* "styles/main.css": "styles/main_abcdef.css"
|
||||
* }
|
||||
*/
|
||||
Object.keys(manifest).forEach((src) => {
|
||||
const sourcePath = path.basename(path.dirname(src));
|
||||
const targetPath = path.basename(path.dirname(manifest[src]));
|
||||
if (sourcePath === targetPath) {
|
||||
return;
|
||||
}
|
||||
manifest[`${targetPath}/${src}`] = manifest[src];
|
||||
delete manifest[src];
|
||||
});
|
||||
return manifest;
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* @export
|
||||
* @param {string} dependency
|
||||
* @param {any} [fallback]
|
||||
* @return {any}
|
||||
*/
|
||||
module.exports = (dependency, fallback) => {
|
||||
try {
|
||||
require.resolve(dependency);
|
||||
} catch (err) {
|
||||
return fallback;
|
||||
}
|
||||
return require(dependency); // eslint-disable-line import/no-dynamic-require
|
||||
};
|
||||
@@ -1,228 +0,0 @@
|
||||
'use strict'; // eslint-disable-line
|
||||
|
||||
const webpack = require('webpack');
|
||||
const merge = require('webpack-merge');
|
||||
const CleanPlugin = require('clean-webpack-plugin');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
const StyleLintPlugin = require('stylelint-webpack-plugin');
|
||||
const CopyGlobsPlugin = require('copy-globs-webpack-plugin');
|
||||
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');
|
||||
|
||||
const desire = require('./util/desire');
|
||||
const config = require('./config');
|
||||
|
||||
const assetsFilenames = (config.enabled.cacheBusting) ? config.cacheBusting : '[name]';
|
||||
|
||||
let webpackConfig = {
|
||||
context: config.paths.assets,
|
||||
entry: config.entry,
|
||||
devtool: (config.enabled.sourceMaps ? '#source-map' : undefined),
|
||||
output: {
|
||||
path: config.paths.dist,
|
||||
publicPath: config.publicPath,
|
||||
filename: `scripts/${assetsFilenames}.js`,
|
||||
},
|
||||
stats: {
|
||||
hash: false,
|
||||
version: false,
|
||||
timings: false,
|
||||
children: false,
|
||||
errors: false,
|
||||
errorDetails: false,
|
||||
warnings: false,
|
||||
chunks: false,
|
||||
modules: false,
|
||||
reasons: false,
|
||||
source: false,
|
||||
publicPath: false,
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
include: config.paths.assets,
|
||||
use: 'eslint',
|
||||
},
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.(js|s?[ca]ss)$/,
|
||||
include: config.paths.assets,
|
||||
loader: 'import-glob',
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: [/node_modules(?)/],
|
||||
use: [
|
||||
{ loader: 'cache' },
|
||||
{ loader: 'buble', options: { objectAssign: 'Object.assign' } },
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
include: config.paths.assets,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: 'style',
|
||||
use: [
|
||||
{ loader: 'cache' },
|
||||
{ loader: 'css', options: { sourceMap: config.enabled.sourceMaps } },
|
||||
{
|
||||
loader: 'postcss', options: {
|
||||
config: { path: __dirname, ctx: config },
|
||||
sourceMap: config.enabled.sourceMaps,
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
include: config.paths.assets,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: 'style',
|
||||
use: [
|
||||
{ loader: 'cache' },
|
||||
{ loader: 'css', options: { sourceMap: config.enabled.sourceMaps } },
|
||||
{
|
||||
loader: 'postcss', options: {
|
||||
config: { path: __dirname, ctx: config },
|
||||
sourceMap: config.enabled.sourceMaps,
|
||||
},
|
||||
},
|
||||
{ loader: 'resolve-url', options: { sourceMap: config.enabled.sourceMaps } },
|
||||
{
|
||||
loader: 'sass', options: {
|
||||
sourceMap: config.enabled.sourceMaps,
|
||||
sourceComments: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|otf|eot|woff2?|png|jpe?g|gif|svg|ico)$/,
|
||||
include: config.paths.assets,
|
||||
loader: 'url',
|
||||
options: {
|
||||
limit: 4096,
|
||||
name: `[path]${assetsFilenames}.[ext]`,
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.(ttf|otf|eot|woff2?|png|jpe?g|gif|svg|ico)$/,
|
||||
include: /node_modules/,
|
||||
loader: 'url',
|
||||
options: {
|
||||
limit: 4096,
|
||||
outputPath: 'vendor/',
|
||||
name: `${config.cacheBusting}.[ext]`,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
modules: [
|
||||
config.paths.assets,
|
||||
'node_modules',
|
||||
],
|
||||
enforceExtension: false,
|
||||
},
|
||||
resolveLoader: {
|
||||
moduleExtensions: ['-loader'],
|
||||
},
|
||||
externals: {
|
||||
jquery: 'jQuery',
|
||||
},
|
||||
plugins: [
|
||||
new CleanPlugin([config.paths.dist], {
|
||||
root: config.paths.root,
|
||||
verbose: false,
|
||||
}),
|
||||
/**
|
||||
* It would be nice to switch to copy-webpack-plugin, but
|
||||
* unfortunately it doesn't provide a reliable way of
|
||||
* tracking the before/after file names
|
||||
*/
|
||||
new CopyGlobsPlugin({
|
||||
pattern: config.copy,
|
||||
output: `[path]${assetsFilenames}.[ext]`,
|
||||
manifest: config.manifest,
|
||||
}),
|
||||
new ExtractTextPlugin({
|
||||
filename: `styles/${assetsFilenames}.css`,
|
||||
allChunks: true,
|
||||
disable: (config.enabled.watcher),
|
||||
}),
|
||||
new webpack.ProvidePlugin({
|
||||
$: 'jquery',
|
||||
jQuery: 'jquery',
|
||||
'window.jQuery': 'jquery',
|
||||
Popper: 'popper.js/dist/umd/popper.js',
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
minimize: config.enabled.optimize,
|
||||
debug: config.enabled.watcher,
|
||||
stats: { colors: true },
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
test: /\.s?css$/,
|
||||
options: {
|
||||
output: { path: config.paths.dist },
|
||||
context: config.paths.assets,
|
||||
},
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
test: /\.js$/,
|
||||
options: {
|
||||
eslint: { failOnWarning: false, failOnError: true },
|
||||
},
|
||||
}),
|
||||
new StyleLintPlugin({
|
||||
failOnError: !config.enabled.watcher,
|
||||
syntax: 'scss',
|
||||
}),
|
||||
new FriendlyErrorsWebpackPlugin(),
|
||||
],
|
||||
};
|
||||
|
||||
/* eslint-disable global-require */ /** Let's only load dependencies as needed */
|
||||
|
||||
if (config.enabled.optimize) {
|
||||
webpackConfig = merge(webpackConfig, require('./webpack.config.optimize'));
|
||||
}
|
||||
|
||||
if (config.env.production) {
|
||||
webpackConfig.plugins.push(new webpack.NoEmitOnErrorsPlugin());
|
||||
}
|
||||
|
||||
if (config.enabled.cacheBusting) {
|
||||
const WebpackAssetsManifest = require('webpack-assets-manifest');
|
||||
|
||||
webpackConfig.plugins.push(
|
||||
new WebpackAssetsManifest({
|
||||
output: 'assets.json',
|
||||
space: 2,
|
||||
writeToDisk: false,
|
||||
assets: config.manifest,
|
||||
replacer: require('./util/assetManifestsFormatter'),
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (config.enabled.watcher) {
|
||||
webpackConfig.entry = require('./util/addHotMiddleware')(webpackConfig.entry);
|
||||
webpackConfig = merge(webpackConfig, require('./webpack.config.watch'));
|
||||
}
|
||||
|
||||
/**
|
||||
* During installation via sage-installer (i.e. composer create-project) some
|
||||
* presets may generate a preset specific config (webpack.config.preset.js) to
|
||||
* override some of the default options set here. We use webpack-merge to merge
|
||||
* them in. If you need to modify Sage's default webpack config, we recommend
|
||||
* that you modify this file directly, instead of creating your own preset
|
||||
* file, as there are limitations to using webpack-merge which can hinder your
|
||||
* ability to change certain options.
|
||||
*/
|
||||
module.exports = merge.smartStrategy({
|
||||
'module.loaders': 'replace',
|
||||
})(webpackConfig, desire(`${__dirname}/webpack.config.preset`));
|
||||
@@ -1,35 +0,0 @@
|
||||
'use strict'; // eslint-disable-line
|
||||
|
||||
const { default: ImageminPlugin } = require('imagemin-webpack-plugin');
|
||||
const imageminMozjpeg = require('imagemin-mozjpeg');
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
||||
|
||||
const config = require('./config');
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
new ImageminPlugin({
|
||||
optipng: { optimizationLevel: 2 },
|
||||
gifsicle: { optimizationLevel: 3 },
|
||||
pngquant: { quality: '65-90', speed: 4 },
|
||||
svgo: {
|
||||
plugins: [
|
||||
{ removeUnknownsAndDefaults: false },
|
||||
{ cleanupIDs: false },
|
||||
{ removeViewBox: false },
|
||||
],
|
||||
},
|
||||
plugins: [imageminMozjpeg({ quality: 75 })],
|
||||
disable: (config.enabled.watcher),
|
||||
}),
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
ecma: 5,
|
||||
compress: {
|
||||
warnings: true,
|
||||
drop_console: true,
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
};
|
||||
@@ -1,37 +0,0 @@
|
||||
const url = require('url');
|
||||
const webpack = require('webpack');
|
||||
const BrowserSyncPlugin = require('browsersync-webpack-plugin');
|
||||
|
||||
const config = require('./config');
|
||||
|
||||
const target = process.env.DEVURL || config.devUrl;
|
||||
|
||||
/**
|
||||
* We do this to enable injection over SSL.
|
||||
*/
|
||||
if (url.parse(target).protocol === 'https:') {
|
||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0;
|
||||
|
||||
config.proxyUrl = config.proxyUrl.replace('http:', 'https:');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
output: {
|
||||
pathinfo: true,
|
||||
publicPath: config.proxyUrl + config.publicPath,
|
||||
},
|
||||
devtool: '#cheap-module-source-map',
|
||||
stats: false,
|
||||
plugins: [
|
||||
new webpack.optimize.OccurrenceOrderPlugin(),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
new BrowserSyncPlugin({
|
||||
target,
|
||||
open: config.open,
|
||||
proxyUrl: config.proxyUrl,
|
||||
watch: config.watch,
|
||||
delay: 500,
|
||||
}),
|
||||
],
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"entry": {
|
||||
"main": [
|
||||
"./scripts/main.js",
|
||||
"./styles/main.scss"
|
||||
],
|
||||
"customizer": [
|
||||
"./scripts/customizer.js"
|
||||
]
|
||||
},
|
||||
"publicPath": "/app/themes/sage",
|
||||
"devUrl": "http://example.test",
|
||||
"proxyUrl": "http://localhost:3000",
|
||||
"cacheBusting": "[name]_[hash:8]",
|
||||
"watch": [
|
||||
"app/**/*.php",
|
||||
"config/**/*.php",
|
||||
"resources/views/**/*.php"
|
||||
]
|
||||
}
|
||||
9
resources/assets/scripts/app.js
Normal file
9
resources/assets/scripts/app.js
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* External Dependencies
|
||||
*/
|
||||
import 'jquery';
|
||||
import 'bootstrap';
|
||||
|
||||
$(document).ready(() => {
|
||||
// console.log('Hello world');
|
||||
});
|
||||
@@ -1 +0,0 @@
|
||||
import 'bootstrap';
|
||||
@@ -1,5 +1,15 @@
|
||||
import $ from 'jquery';
|
||||
/**
|
||||
* This file allows you to add functionality to the Theme Customizer
|
||||
* live preview. jQuery is readily available.
|
||||
*
|
||||
* {@link https://codex.wordpress.org/Theme_Customization_API}
|
||||
*/
|
||||
|
||||
wp.customize('blogname', (value) => {
|
||||
/**
|
||||
* Change the blog name value.
|
||||
*
|
||||
* @param {string} value
|
||||
*/
|
||||
wp.customize('blogname', value => {
|
||||
value.bind(to => $('.brand').text(to));
|
||||
});
|
||||
|
||||
15
resources/assets/scripts/editor.js
Normal file
15
resources/assets/scripts/editor.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import '@wordpress/edit-post';
|
||||
import domReady from '@wordpress/dom-ready';
|
||||
import {
|
||||
unregisterBlockStyle,
|
||||
registerBlockStyle,
|
||||
} from '@wordpress/blocks';
|
||||
|
||||
domReady(() => {
|
||||
unregisterBlockStyle('core/button', 'outline');
|
||||
|
||||
registerBlockStyle('core/button', {
|
||||
name: 'outline',
|
||||
label: 'Outline',
|
||||
});
|
||||
});
|
||||
@@ -1,24 +0,0 @@
|
||||
// import external dependencies
|
||||
import 'jquery';
|
||||
|
||||
// Import everything from autoload
|
||||
import './autoload/**/*'
|
||||
|
||||
// import local dependencies
|
||||
import Router from './util/Router';
|
||||
import common from './routes/common';
|
||||
import home from './routes/home';
|
||||
import aboutUs from './routes/about';
|
||||
|
||||
/** Populate Router instance with DOM routes */
|
||||
const routes = new Router({
|
||||
// All pages
|
||||
common,
|
||||
// Home page
|
||||
home,
|
||||
// About Us page, note the change from about-us to aboutUs.
|
||||
aboutUs,
|
||||
});
|
||||
|
||||
// Load Events
|
||||
jQuery(document).ready(() => routes.loadEvents());
|
||||
@@ -1,5 +0,0 @@
|
||||
export default {
|
||||
init() {
|
||||
// JavaScript to be fired on the about us page
|
||||
},
|
||||
};
|
||||
@@ -1,8 +0,0 @@
|
||||
export default {
|
||||
init() {
|
||||
// JavaScript to be fired on all pages
|
||||
},
|
||||
finalize() {
|
||||
// JavaScript to be fired on all pages, after page specific JS is fired
|
||||
},
|
||||
};
|
||||
@@ -1,8 +0,0 @@
|
||||
export default {
|
||||
init() {
|
||||
// JavaScript to be fired on the home page
|
||||
},
|
||||
finalize() {
|
||||
// JavaScript to be fired on the home page, after the init JS
|
||||
},
|
||||
};
|
||||
@@ -1,71 +0,0 @@
|
||||
import camelCase from './camelCase';
|
||||
|
||||
/**
|
||||
* DOM-based Routing
|
||||
*
|
||||
* Based on {@link http://goo.gl/EUTi53|Markup-based Unobtrusive Comprehensive DOM-ready Execution} by Paul Irish
|
||||
*
|
||||
* The routing fires all common scripts, followed by the page specific scripts.
|
||||
* Add additional events for more control over timing e.g. a finalize event
|
||||
*/
|
||||
class Router {
|
||||
|
||||
/**
|
||||
* Create a new Router
|
||||
* @param {Object} routes
|
||||
*/
|
||||
constructor(routes) {
|
||||
this.routes = routes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fire Router events
|
||||
* @param {string} route DOM-based route derived from body classes (`<body class="...">`)
|
||||
* @param {string} [event] Events on the route. By default, `init` and `finalize` events are called.
|
||||
* @param {string} [arg] Any custom argument to be passed to the event.
|
||||
*/
|
||||
fire(route, event = 'init', arg) {
|
||||
document.dispatchEvent(new CustomEvent('routed', {
|
||||
bubbles: true,
|
||||
detail: {
|
||||
route,
|
||||
fn: event,
|
||||
},
|
||||
}));
|
||||
|
||||
const fire = route !== '' && this.routes[route] && typeof this.routes[route][event] === 'function';
|
||||
if (fire) {
|
||||
this.routes[route][event](arg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Automatically load and fire Router events
|
||||
*
|
||||
* Events are fired in the following order:
|
||||
* * common init
|
||||
* * page-specific init
|
||||
* * page-specific finalize
|
||||
* * common finalize
|
||||
*/
|
||||
loadEvents() {
|
||||
// Fire common init JS
|
||||
this.fire('common');
|
||||
|
||||
// Fire page-specific init JS, and then finalize JS
|
||||
document.body.className
|
||||
.toLowerCase()
|
||||
.replace(/-/g, '_')
|
||||
.split(/\s+/)
|
||||
.map(camelCase)
|
||||
.forEach((className) => {
|
||||
this.fire(className);
|
||||
this.fire(className, 'finalize');
|
||||
});
|
||||
|
||||
// Fire common finalize JS
|
||||
this.fire('common', 'finalize');
|
||||
}
|
||||
}
|
||||
|
||||
export default Router;
|
||||
@@ -1,9 +0,0 @@
|
||||
/**
|
||||
* the most terrible camelizer on the internet, guaranteed!
|
||||
* @param {string} str String that isn't camel-case, e.g., CAMeL_CaSEiS-harD
|
||||
* @return {string} String converted to camel-case, e.g., camelCaseIsHard
|
||||
*/
|
||||
export default str => `${str.charAt(0).toLowerCase()}${str.replace(/[\W_]/g, '|').split('|')
|
||||
.map(part => `${part.charAt(0).toUpperCase()}${part.slice(1)}`)
|
||||
.join('')
|
||||
.slice(1)}`;
|
||||
12
resources/assets/styles/app.scss
Normal file
12
resources/assets/styles/app.scss
Normal file
@@ -0,0 +1,12 @@
|
||||
/** Config */
|
||||
@import 'config/variables';
|
||||
@import 'config/external';
|
||||
|
||||
/** Common */
|
||||
@import 'common/global';
|
||||
|
||||
/** Components */
|
||||
@import 'components';
|
||||
|
||||
/** Partials */
|
||||
@import 'partials/header';
|
||||
@@ -1 +0,0 @@
|
||||
@import "~bootstrap/scss/bootstrap";
|
||||
@@ -1,10 +0,0 @@
|
||||
/** Import Bootstrap functions */
|
||||
@import "~bootstrap/scss/functions";
|
||||
|
||||
$theme-colors: (
|
||||
primary: #525ddc
|
||||
);
|
||||
|
||||
/** Bootstrap navbar fix (https://git.io/fADqW) */
|
||||
$navbar-dark-toggler-icon-bg: none;
|
||||
$navbar-light-toggler-icon-bg: none;
|
||||
22
resources/assets/styles/common/global.scss
Normal file
22
resources/assets/styles/common/global.scss
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Global
|
||||
*/
|
||||
|
||||
a {
|
||||
color: map-get($theme-colors, 'primary');
|
||||
}
|
||||
|
||||
/**
|
||||
* Block editor color palette utilities
|
||||
* @see https://git.io/JeyD6
|
||||
*/
|
||||
|
||||
@each $color-name, $color-value in $theme-colors {
|
||||
.has-#{$color-name}-color {
|
||||
color: $color-value;
|
||||
}
|
||||
|
||||
.has-#{$color-name}-background-color {
|
||||
background-color: $color-value;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
.comment-list {
|
||||
@extend .list-unstyled;
|
||||
}
|
||||
|
||||
.comment-list ol {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.comment-form p {
|
||||
@extend .form-group;
|
||||
}
|
||||
|
||||
.comment-form input[type="text"],
|
||||
.comment-form input[type="email"],
|
||||
.comment-form input[type="url"],
|
||||
.comment-form textarea {
|
||||
@extend .form-control;
|
||||
}
|
||||
|
||||
.comment-form input[type="submit"] {
|
||||
@extend .btn;
|
||||
@extend .btn-secondary;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/** Search form */
|
||||
.search-form {
|
||||
@extend .form-inline;
|
||||
}
|
||||
|
||||
.search-form label {
|
||||
@extend .form-group;
|
||||
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.search-form .search-field {
|
||||
@extend .form-control;
|
||||
}
|
||||
|
||||
.search-form .search-submit {
|
||||
@extend .btn;
|
||||
@extend .btn-secondary;
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
/**
|
||||
* WordPress Generated Classes
|
||||
* @see http://codex.wordpress.org/CSS#WordPress_Generated_Classes
|
||||
*/
|
||||
|
||||
/** Media alignment */
|
||||
.alignnone {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.aligncenter {
|
||||
display: block;
|
||||
margin: ($spacer / 2) auto;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.alignleft,
|
||||
.alignright {
|
||||
margin-bottom: ($spacer / 2);
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(sm) {
|
||||
.alignleft {
|
||||
float: left;
|
||||
margin-right: ($spacer / 2);
|
||||
}
|
||||
|
||||
.alignright {
|
||||
float: right;
|
||||
margin-left: ($spacer / 2);
|
||||
}
|
||||
}
|
||||
|
||||
/** Captions */
|
||||
.wp-caption {
|
||||
@extend .figure;
|
||||
}
|
||||
|
||||
.wp-caption img {
|
||||
@extend .figure-img;
|
||||
@extend .img-fluid;
|
||||
}
|
||||
|
||||
.wp-caption-text {
|
||||
@extend .figure-caption;
|
||||
}
|
||||
|
||||
/** Text meant only for screen readers */
|
||||
.screen-reader-text {
|
||||
@extend .sr-only;
|
||||
@extend .sr-only-focusable;
|
||||
}
|
||||
36
resources/assets/styles/components/button.scss
Normal file
36
resources/assets/styles/components/button.scss
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Button
|
||||
*/
|
||||
|
||||
.wp-block-button {
|
||||
&__link {
|
||||
font-size: $btn-font-size;
|
||||
line-height: $btn-line-height;
|
||||
padding-bottom: $btn-padding-y;
|
||||
padding-left: $btn-padding-x;
|
||||
padding-right: $btn-padding-x;
|
||||
padding-top: $btn-padding-y;
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
&.is-style-outline {
|
||||
.wp-block-button__link {
|
||||
@include button-outline-variant(
|
||||
map-get($theme-colors, 'primary'),
|
||||
map-get($theme-colors, 'light')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-style-solid {
|
||||
.wp-block-button__link {
|
||||
@include button-variant(
|
||||
map-get($theme-colors, 'primary'),
|
||||
map-get($theme-colors, 'light')
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
5
resources/assets/styles/components/index.scss
Normal file
5
resources/assets/styles/components/index.scss
Normal file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* Components
|
||||
*/
|
||||
|
||||
@import 'button';
|
||||
5
resources/assets/styles/config/external.scss
Normal file
5
resources/assets/styles/config/external.scss
Normal file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* External
|
||||
*/
|
||||
|
||||
@import '~bootstrap/scss/bootstrap';
|
||||
7
resources/assets/styles/config/variables.scss
Normal file
7
resources/assets/styles/config/variables.scss
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Variables
|
||||
*/
|
||||
|
||||
$theme-colors: (
|
||||
primary: #525ddc,
|
||||
);
|
||||
16
resources/assets/styles/editor.scss
Normal file
16
resources/assets/styles/editor.scss
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Editor
|
||||
*/
|
||||
|
||||
@import 'config/variables';
|
||||
|
||||
@import '~bootstrap/scss/functions';
|
||||
@import '~bootstrap/scss/variables';
|
||||
@import '~bootstrap/scss/mixins';
|
||||
|
||||
.editor-styles-wrapper > * {
|
||||
@import 'common/global';
|
||||
@import 'components';
|
||||
|
||||
font-family: $font-family-base;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
.banner .nav li {
|
||||
@extend .nav-item;
|
||||
}
|
||||
|
||||
.banner .nav a {
|
||||
@extend .nav-link;
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
body#tinymce {
|
||||
margin: 12px !important;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
@import "common/variables";
|
||||
|
||||
/** Import everything from autoload */
|
||||
@import "./autoload/**/*";
|
||||
|
||||
/**
|
||||
* Import npm dependencies
|
||||
*
|
||||
* Prefix your imports with `~` to grab from node_modules/
|
||||
* @see https://github.com/webpack-contrib/sass-loader#imports
|
||||
*/
|
||||
// @import "~some-node-module";
|
||||
|
||||
/** Import theme styles */
|
||||
@import "common/global";
|
||||
@import "components/buttons";
|
||||
@import "components/comments";
|
||||
@import "components/forms";
|
||||
@import "components/wp-classes";
|
||||
@import "layouts/header";
|
||||
@import "layouts/sidebar";
|
||||
@import "layouts/footer";
|
||||
@import "layouts/pages";
|
||||
@import "layouts/posts";
|
||||
@import "layouts/tinymce";
|
||||
7
resources/assets/styles/partials/header.scss
Normal file
7
resources/assets/styles/partials/header.scss
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Header
|
||||
*/
|
||||
|
||||
.brand {
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Do not edit anything in this file unless you know what you're doing
|
||||
*/
|
||||
|
||||
use Roots\Sage\Config;
|
||||
use Roots\Sage\Container;
|
||||
|
||||
/**
|
||||
* Helper function for prettying up errors
|
||||
* @param string $message
|
||||
* @param string $subtitle
|
||||
* @param string $title
|
||||
*/
|
||||
$sage_error = function ($message, $subtitle = '', $title = '') {
|
||||
$title = $title ?: __('Sage › Error', 'sage');
|
||||
$footer = '<a href="https://roots.io/sage/docs/">roots.io/sage/docs/</a>';
|
||||
$message = "<h1>{$title}<br><small>{$subtitle}</small></h1><p>{$message}</p><p>{$footer}</p>";
|
||||
wp_die($message, $title);
|
||||
};
|
||||
|
||||
/**
|
||||
* Ensure compatible version of PHP is used
|
||||
*/
|
||||
if (version_compare('7.1', phpversion(), '>=')) {
|
||||
$sage_error(__('You must be using PHP 7.1 or greater.', 'sage'), __('Invalid PHP version', 'sage'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure compatible version of WordPress is used
|
||||
*/
|
||||
if (version_compare('4.7.0', get_bloginfo('version'), '>=')) {
|
||||
$sage_error(__('You must be using WordPress 4.7.0 or greater.', 'sage'), __('Invalid WordPress version', 'sage'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure dependencies are loaded
|
||||
*/
|
||||
if (!class_exists('Roots\\Sage\\Container')) {
|
||||
if (!file_exists($composer = __DIR__.'/../vendor/autoload.php')) {
|
||||
$sage_error(
|
||||
__('You must run <code>composer install</code> from the Sage directory.', 'sage'),
|
||||
__('Autoloader not found.', 'sage')
|
||||
);
|
||||
}
|
||||
require_once $composer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sage required files
|
||||
*
|
||||
* The mapped array determines the code library included in your theme.
|
||||
* Add or remove files to the array as needed. Supports child theme overrides.
|
||||
*/
|
||||
array_map(function ($file) use ($sage_error) {
|
||||
$file = "../app/{$file}.php";
|
||||
if (!locate_template($file, true, true)) {
|
||||
$sage_error(sprintf(__('Error locating <code>%s</code> for inclusion.', 'sage'), $file), 'File not found');
|
||||
}
|
||||
}, ['helpers', 'setup', 'filters', 'admin']);
|
||||
|
||||
/**
|
||||
* Here's what's happening with these hooks:
|
||||
* 1. WordPress initially detects theme in themes/sage/resources
|
||||
* 2. Upon activation, we tell WordPress that the theme is actually in themes/sage/resources/views
|
||||
* 3. When we call get_template_directory() or get_template_directory_uri(), we point it back to themes/sage/resources
|
||||
*
|
||||
* We do this so that the Template Hierarchy will look in themes/sage/resources/views for core WordPress themes
|
||||
* But functions.php, style.css, and index.php are all still located in themes/sage/resources
|
||||
*
|
||||
* This is not compatible with the WordPress Customizer theme preview prior to theme activation
|
||||
*
|
||||
* get_template_directory() -> /srv/www/example.com/current/web/app/themes/sage/resources
|
||||
* get_stylesheet_directory() -> /srv/www/example.com/current/web/app/themes/sage/resources
|
||||
* locate_template()
|
||||
* ├── STYLESHEETPATH -> /srv/www/example.com/current/web/app/themes/sage/resources/views
|
||||
* └── TEMPLATEPATH -> /srv/www/example.com/current/web/app/themes/sage/resources
|
||||
*/
|
||||
array_map(
|
||||
'add_filter',
|
||||
['theme_file_path', 'theme_file_uri', 'parent_theme_file_path', 'parent_theme_file_uri'],
|
||||
array_fill(0, 4, 'dirname')
|
||||
);
|
||||
Container::getInstance()
|
||||
->bindIf('config', function () {
|
||||
return new Config([
|
||||
'assets' => require dirname(__DIR__).'/config/assets.php',
|
||||
'theme' => require dirname(__DIR__).'/config/theme.php',
|
||||
'view' => require dirname(__DIR__).'/config/view.php',
|
||||
]);
|
||||
}, true);
|
||||
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
|
||||
// this file is deliberately blank
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 225 B |
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
Theme Name: Sage Starter Theme
|
||||
Theme URI: https://roots.io/sage/
|
||||
Description: Sage is a WordPress starter theme.
|
||||
Version: 9.0.9
|
||||
Author: Roots
|
||||
Author URI: https://roots.io/
|
||||
Text Domain: sage
|
||||
|
||||
License: MIT License
|
||||
License URI: http://opensource.org/licenses/MIT
|
||||
*/
|
||||
@@ -3,10 +3,11 @@
|
||||
@section('content')
|
||||
@include('partials.page-header')
|
||||
|
||||
@if (!have_posts())
|
||||
<div class="alert alert-warning">
|
||||
{{ __('Sorry, but the page you were trying to view does not exist.', 'sage') }}
|
||||
</div>
|
||||
@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
|
||||
|
||||
3
resources/views/components/alert.blade.php
Normal file
3
resources/views/components/alert.blade.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<div class="alert alert-{{ $type }}">
|
||||
{!! $message ?? $slot !!}
|
||||
</div>
|
||||
8
resources/views/forms/search.blade.php
Normal file
8
resources/views/forms/search.blade.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<form role="search" method="get" class="search-form" action="{{ home_url('/') }}">
|
||||
<label>
|
||||
<span class="screen-reader-text">{{ _x('Search for:', 'label', 'sage') }}</span>
|
||||
<input type="search" class="search-field" placeholder="{!! esc_attr_x('Search …', 'placeholder', 'sage') !!}" value="{{ get_search_query() }}" name="s">
|
||||
</label>
|
||||
|
||||
<input type="submit" class="button" value="{{ esc_attr_x('Search', 'submit button', 'sage') }}">
|
||||
</form>
|
||||
@@ -3,16 +3,21 @@
|
||||
@section('content')
|
||||
@include('partials.page-header')
|
||||
|
||||
@if (!have_posts())
|
||||
<div class="alert alert-warning">
|
||||
{{ __('Sorry, no results were found.', 'sage') }}
|
||||
</div>
|
||||
@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() @endphp
|
||||
@include('partials.content-'.get_post_type())
|
||||
@while(have_posts()) @php(the_post())
|
||||
@includeFirst(['partials.content-' . get_post_type(), 'partials.content'])
|
||||
@endwhile
|
||||
|
||||
{!! get_the_posts_navigation() !!}
|
||||
@endsection
|
||||
|
||||
@section('sidebar')
|
||||
@include('partials.sidebar')
|
||||
@endsection
|
||||
|
||||
@@ -1,23 +1,15 @@
|
||||
<!doctype html>
|
||||
<html {!! get_language_attributes() !!}>
|
||||
@include('partials.head')
|
||||
<body @php body_class() @endphp>
|
||||
@php do_action('get_header') @endphp
|
||||
@include('partials.header')
|
||||
<div class="wrap container" role="document">
|
||||
<div class="content">
|
||||
<main class="main">
|
||||
@yield('content')
|
||||
</main>
|
||||
@if (App\display_sidebar())
|
||||
<aside class="sidebar">
|
||||
@include('partials.sidebar')
|
||||
</aside>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@php do_action('get_footer') @endphp
|
||||
@include('partials.footer')
|
||||
@php wp_footer() @endphp
|
||||
</body>
|
||||
</html>
|
||||
@include('partials.header')
|
||||
|
||||
<div class="container">
|
||||
<main class="main">
|
||||
@yield('content')
|
||||
</main>
|
||||
|
||||
@hasSection('sidebar')
|
||||
<aside class="sidebar">
|
||||
@yield('sidebar')
|
||||
</aside>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@include('partials.footer')
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
@while(have_posts()) @php the_post() @endphp
|
||||
@while(have_posts()) @php(the_post())
|
||||
@include('partials.page-header')
|
||||
@include('partials.content-page')
|
||||
@includeFirst(['partials.content-page', 'partials.content'])
|
||||
@endwhile
|
||||
@endsection
|
||||
|
||||
@@ -1,38 +1,39 @@
|
||||
@php
|
||||
if (post_password_required()) {
|
||||
return;
|
||||
}
|
||||
@endphp
|
||||
@if (! post_password_required())
|
||||
<section id="comments" class="comments">
|
||||
@if (have_comments())
|
||||
<h2>
|
||||
{!! sprintf(_nx('One response to “%2$s”', '%1$s responses to “%2$s”', get_comments_number(), 'comments title', 'sage'), number_format_i18n(get_comments_number()), '<span>' . get_the_title() . '</span>') !!}
|
||||
</h2>
|
||||
|
||||
<section id="comments" class="comments">
|
||||
@if (have_comments())
|
||||
<h2>
|
||||
{!! sprintf(_nx('One response to “%2$s”', '%1$s responses to “%2$s”', get_comments_number(), 'comments title', 'sage'), number_format_i18n(get_comments_number()), '<span>' . get_the_title() . '</span>') !!}
|
||||
</h2>
|
||||
<ol class="comment-list">
|
||||
{!! wp_list_comments(['style' => 'ol', 'short_ping' => true]) !!}
|
||||
</ol>
|
||||
|
||||
<ol class="comment-list">
|
||||
{!! wp_list_comments(['style' => 'ol', 'short_ping' => true]) !!}
|
||||
</ol>
|
||||
@if (get_comment_pages_count() > 1 && get_option('page_comments'))
|
||||
<nav>
|
||||
<ul class="pager">
|
||||
@if (get_previous_comments_link())
|
||||
<li class="previous">
|
||||
{!! get_previous_comments_link(__('← Older comments', 'sage')) !!}
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (get_comment_pages_count() > 1 && get_option('page_comments'))
|
||||
<nav>
|
||||
<ul class="pager">
|
||||
@if (get_previous_comments_link())
|
||||
<li class="previous">@php previous_comments_link(__('← Older comments', 'sage')) @endphp</li>
|
||||
@endif
|
||||
@if (get_next_comments_link())
|
||||
<li class="next">@php next_comments_link(__('Newer comments →', 'sage')) @endphp</li>
|
||||
@endif
|
||||
</ul>
|
||||
</nav>
|
||||
@if (get_next_comments_link())
|
||||
<li class="next">
|
||||
{!! get_next_comments_link(__('Newer comments →', 'sage')) !!}
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</nav>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if (!comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments'))
|
||||
<div class="alert alert-warning">
|
||||
{{ __('Comments are closed.', 'sage') }}
|
||||
</div>
|
||||
@endif
|
||||
@if (! comments_open() && get_comments_number() != '0' && post_type_supports(get_post_type(), 'comments'))
|
||||
<x-alert type="warning">
|
||||
{!! __('Comments are closed.', 'sage') !!}
|
||||
</x-alert>
|
||||
@endif
|
||||
|
||||
@php comment_form() @endphp
|
||||
</section>
|
||||
@php(comment_form())
|
||||
</section>
|
||||
@endif
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
@php the_content() @endphp
|
||||
@php(the_content())
|
||||
{!! wp_link_pages(['echo' => 0, 'before' => '<nav class="page-nav"><p>' . __('Pages:', 'sage'), 'after' => '</p></nav>']) !!}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
<article @php post_class() @endphp>
|
||||
<article @php(post_class())>
|
||||
<header>
|
||||
<h2 class="entry-title"><a href="{{ get_permalink() }}">{!! get_the_title() !!}</a></h2>
|
||||
@if (get_post_type() === 'post')
|
||||
@include('partials/entry-meta')
|
||||
@endif
|
||||
<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() @endphp
|
||||
@php(the_excerpt())
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
<article @php post_class() @endphp>
|
||||
<article @php(post_class())>
|
||||
<header>
|
||||
<h1 class="entry-title">{!! get_the_title() !!}</h1>
|
||||
<h1 class="entry-title">
|
||||
{!! $title !!}
|
||||
</h1>
|
||||
|
||||
@include('partials/entry-meta')
|
||||
</header>
|
||||
|
||||
<div class="entry-content">
|
||||
@php the_content() @endphp
|
||||
@php(the_content())
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
{!! wp_link_pages(['echo' => 0, 'before' => '<nav class="page-nav"><p>' . __('Pages:', 'sage'), 'after' => '</p></nav>']) !!}
|
||||
</footer>
|
||||
@php comments_template('/partials/comments.blade.php') @endphp
|
||||
|
||||
@php(comments_template())
|
||||
</article>
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
<article @php post_class() @endphp>
|
||||
<article @php(post_class())>
|
||||
<header>
|
||||
<h2 class="entry-title"><a href="{{ get_permalink() }}">{!! get_the_title() !!}</a></h2>
|
||||
<h2 class="entry-title">
|
||||
<a href="{{ get_permalink() }}">
|
||||
{!! $title !!}
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
@include('partials/entry-meta')
|
||||
</header>
|
||||
|
||||
<div class="entry-summary">
|
||||
@php the_excerpt() @endphp
|
||||
@php(the_excerpt())
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<time class="updated" datetime="{{ get_post_time('c', true) }}">{{ get_the_date() }}</time>
|
||||
<time class="updated" datetime="{{ get_post_time('c', true) }}">
|
||||
{{ get_the_date() }}
|
||||
</time>
|
||||
|
||||
<p class="byline author vcard">
|
||||
{{ __('By', 'sage') }} <a href="{{ get_author_posts_url(get_the_author_meta('ID')) }}" rel="author" class="fn">
|
||||
<span>{{ __('By', 'sage') }}</span>
|
||||
<a href="{{ get_author_posts_url(get_the_author_meta('ID')) }}" rel="author" class="fn">
|
||||
{{ get_the_author() }}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<footer class="content-info">
|
||||
<div class="container">
|
||||
@php dynamic_sidebar('sidebar-footer') @endphp
|
||||
@php(dynamic_sidebar('sidebar-footer'))
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
@php wp_head() @endphp
|
||||
</head>
|
||||
@@ -1,9 +1,12 @@
|
||||
<header class="banner">
|
||||
<div class="container">
|
||||
<a class="brand" href="{{ home_url('/') }}">{{ get_bloginfo('name', 'display') }}</a>
|
||||
<a class="brand" href="{{ home_url('/') }}">
|
||||
{{ $siteName }}
|
||||
</a>
|
||||
|
||||
<nav class="nav-primary">
|
||||
@if (has_nav_menu('primary_navigation'))
|
||||
{!! wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav']) !!}
|
||||
{!! wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav', 'echo' => false]) !!}
|
||||
@endif
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<div class="page-header">
|
||||
<h1>{!! App::title() !!}</h1>
|
||||
<h1>{!! $title !!}</h1>
|
||||
</div>
|
||||
|
||||
@@ -1 +1 @@
|
||||
@php dynamic_sidebar('sidebar-primary') @endphp
|
||||
@php(dynamic_sidebar('sidebar-primary'))
|
||||
|
||||
@@ -3,14 +3,15 @@
|
||||
@section('content')
|
||||
@include('partials.page-header')
|
||||
|
||||
@if (!have_posts())
|
||||
<div class="alert alert-warning">
|
||||
{{ __('Sorry, no results were found.', 'sage') }}
|
||||
</div>
|
||||
@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() @endphp
|
||||
@while(have_posts()) @php(the_post())
|
||||
@include('partials.content-search')
|
||||
@endwhile
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
@while(have_posts()) @php the_post() @endphp
|
||||
@include('partials.content-single-'.get_post_type())
|
||||
@while(have_posts()) @php(the_post())
|
||||
@includeFirst(['partials.content-single-' . get_post_type(), 'partials.content-single'])
|
||||
@endwhile
|
||||
@endsection
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
@while(have_posts()) @php the_post() @endphp
|
||||
@while(have_posts()) @php(the_post())
|
||||
@include('partials.page-header')
|
||||
@include('partials.content-page')
|
||||
@endwhile
|
||||
|
||||
Reference in New Issue
Block a user