Giter Site home page Giter Site logo

htmlburger / wpemerge-theme Goto Github PK

View Code? Open in Web Editor NEW
283.0 18.0 31.0 1.4 MB

An organized, ES6 and SASS powered theme taking advantage of the WP Emerge framework. ๐Ÿš€

Home Page: https://wpemerge.com/

License: GNU General Public License v2.0

PHP 47.87% JavaScript 33.28% CSS 0.59% SCSS 7.64% Blade 10.62%
wp-emerge-theme wpemerge wordpress starter-theme blade php

wpemerge-theme's People

Contributors

9585999 avatar atanas-dev avatar dependabot-preview[bot] avatar elvishp2006 avatar knowler avatar mickaelperrin avatar paulomfr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wpemerge-theme's Issues

Intergration with WooCommerce

Version

Please add the exact versions used for each of the following:

  • WP Emerge Starter Theme: Not sure, CLI shows 0.15.0.
  • WP Emerge (if not the default):
  • WordPress: 5.2.3
  • PHP: 7.3

Expected behavior

WooCommerce using template files from WPEmerge.

Actual behavior

WooCommerce seems to not use template files from WPEmerge.

WPEmerge works great for Wordpress, and I might be missing something now, but as soon as you get to a WooCommerce page it seems to ignore the standard template files (using Blade, but standard ones does the same).

This results in different header, footer, nav and general site structure. It would be nice if WooCommerce is rendered within the existing WPEmerge site structure from the template files.

Have I missed anything to make it work?

Comments

I'm in the process of migrating a client website over from Sage, and is well underway but ran into above problems with WooCommerce. Big thumbs up on this project, it's really a breeze to work with.

This documentation package is very difficult!

  • WP Emerge Starter Theme
  • WordPress: 5.2.2
  • PHP: 7.2

This documentation package is very difficult!

Unfortunately, the documentation of this package is grossly misleading.
For the easiest thing, you can not use the documentation, for example, the engine does not have the correct guidance for setting up the engine, and in the end I did not succeed.

In the first step, I installed the WP Emerge Blade with Composer.
In the second step, I added the following code in the configuration file (not at all referred to as the file):
\ WPEmergeBlade \ View \ ServiceProvider :: class

What should I do to use it?

Update to TailwindCSS 2 ?

Hi,

Firstly thanks for making such a great framework and theme. I'm from a Laravel background so I really want to try this, plus your documentation is top notch. I appreciate the info for Bedrock users.

When do you think you will have TailwindCSS 2 implemented?

"failed to open stream" Error

Version

  • WP Emerge Starter Theme: latest
  • WordPress: 4.9.8
  • PHP: 7.1

Actual behavior

While installing CSS framework i get error like this:
Warning: file_get_contents(/Users/kristjankoppel/Propxls/clients/flowit/cms/wp-content/themes/flowit/resources/css/_vendor.css): failed to open stream: No such file or directory in /Users/kristjankoppel/Propxls/clients/flowit/cms/wp-content/themes/flowit/vendor/htmlburger/wpemerge-cli/src/Presets/StatementAppenderTrait.php on line 17
Warning: file_put_contents(/Users/kristjankoppel/Propxls/clients/flowit/cms/wp-content/themes/flowit/resources/css/_vendor.css): failed to open stream: No such file or directory in /Users/kristjankoppel/Propxls/clients/flowit/cms/wp-content/themes/flowit/vendor/htmlburger/wpemerge-cli/src/Presets/StatementAppenderTrait.php on line 33

Steps to reproduce (in case of a bug)

  • follow Quickstart guide

Comments

I wanted to try wpemerge-theme and setup my local WP setup. Then i followed the Quickstart guide found here: https://docs.theme.wpemerge.com/quickstart.html
I chose my options and first time installing i got error:
The process "yarn add "bootstrap@^3.3" --dev" exceeded the timeout of 60 seconds.
Then i removed the whole theme folder and started again. After that i didn't get timeout error only that failed to open stream error. Also i'm using Lando(https://docs.devwithlando.io) for my local development environment.

500 on Apache instances due to duplicate headers

Version 0.15.0

  • WordPress: 5.2.2
  • PHP: 7.3

Expected behavior

Frontend/ Backend to load with the starter theme

Actual behavior

500 Internal Server Error

Comments

On Apache (MAMP etc) stacks, the theme throws a 500 instantly with all dependencies met & installed.

Upon closer inspection, it wasn't a PHP exception but an Apache exception due to duplicate headers being sent. It appears both ResponseService class from wpemerge and BladeView extensible class on wpemerge-blade are sending 'Content-type' headers which is throwing the exception. In the team I work with, nginx isn't complaining after all.

Line references to the conflicting headers being output (on the starter theme with all dependencies including wpemerge core and wpemerge-blade installed):

  • /vendor/htmlburger/wpemerge/src/Responses/ResponseService.php L51 -> respond function
  • /vendor/htmlburger/wpemerge-blade/src/View/BladeView.php L56 -> toResponse function

The respond function on wpemerge core seems to be outputting conditionally (if ( ! headers_sent() )), however, the issue persists.

Commenting out either/ or one of the output resolves the issue. I'm wary of commenting out the headers from being sent as part of the response object on the wpemerge-core as that'll probably strip other headers too. For now, I'm sticking with commenting out the single header addition on BladeView class.

Any thoughts?

TIA,
Sudarshan

using blade in wpemerge-theme

Hi, how use this theme with wpmerge-blade?

Is it normal that standard templates are not defined if they are not explicitly indicated in routs behavior?

Resolve image from scss file

Version

  • WP Emerge Starter Theme: 0.15.1
  • WP Emerge (if not the default):
  • WordPress: 5.2.3
  • PHP: 7.3.8

Expected behavior

Resolve image from any sass file with according hash

Actual behavior & Steps to reproduce (in case of a bug)

I have a .svg file located here : mytheme/resources/images/myfile.svg

I import it into my theme.js using import '@images/myfile.svg;

The file is well generated as follow : mytheme/dist/images/myfile.12345.svg

In my main index.scss file I have this error : Module not found: Error: Can't resolve '@dist/images/myfile.svg' in 'C:\xampp\htdocs\studiolv\wp-content\themes\mytheme\resources\styles\theme'
...when trying to use url css resolver like so :
cursor: url('~@dist/images/myfile.svg'), pointer;

Comments

I didn't change anything from webpack image's file-loader configuration.

Unable to contribute

Version

  • WP Emerge Starter Theme: 0.15.1
  • WordPress: 5.4
  • PHP: 7.4.2

Expected behavior

Activate theme to contribute.

Actual behavior

When run composer install and then try to activate the theme, is returned and error saying that App::make() is an undefined method.

Steps to reproduce (in case of a bug)

  1. Clone this repo.
  2. Run composer install && composer run post-create-project-cmd .
  3. Activate the WP Emerge theme from your WordPress admin panel.

Comments

Screenshots:

Screen
Screen Shot 2020-04-12 at 11 55 27

/app/src/App.php
The app

Script WPEmerge\Cli\App::createConfigJson handling the post-create-project-cmd event terminated with an exception

Version

Please add the exact versions used for each of the following:

  • WP Emerge Starter Theme: 0.15.1
  • WP Emerge (if not the default):
  • WordPress: 5.3.2
  • PHP: 7.3.5

Expected behavior

I expected to see the theme install correctly.
Please describe the expected behavior here.
I expected a complete flawless install with proper configuration and additional options to add my preferred css frameworks

Actual behavior

Instead I got this error "Script WPEmerge\Cli\App::createConfigJson handling the post-create-project-cmd event terminated with an exception"
Please describe the actual, unexpected behavior here.
ERROR: Script WPEmerge\Cli\App::createConfigJson handling the post-create-project-cmd event terminated with an exception

[ErrorException]
Trying to access array offset on value of type int

Steps to reproduce (in case of a bug)

Comments

I'm on MacOS Catalina 10.15.2 if that helps.
Please add any other comments here.

Problems using the yarn:hot script

Version

  • WP Emerge Starter Theme: 0.16.1
  • WP Emerge (if not the default): 0.16.0
  • WordPress: 5.5
  • PHP: 7.3.9

Issue

I'm using MAMP for development and the dev URL is a local domain (like mydomain.loc). I've set the domain in config.json (as url and hotUrl).

  • If I set the port in config.json to any number distinct of 80, it shows a page with some kind of file browser where all the theme files are listed
  • If I set the post to 80, it shows an error: "Error: listen EACCES: permission denied 127.0.0.1:80"

I've also tried to leave the default localhost URL in the config.json and the result is the same (a file listing page).

What am I doing wrong?

Error during composer create-project: Entrypoint undefined = extract-text-webpack-plugin-output-filename

Version

  • WP Emerge Starter Theme: 0.15.1
  • WordPress: 5.3.2
  • PHP: 7.3.9
  • Composer: 1.9.2
  • Yarn: 1.21.1
  • macOS: Catalina 10.15.2

Expected behavior

Composer create project should create a project without errors.

Actual behavior

Got some errors with the default command (from the quickstart https://docs.wpemerge.com/#/starter-theme/quickstart) for a new project:

https://tppr.me/drKtH

[130] ./resources/styles/editor/index.scss 41 bytes [built]
    + 120 hidden modules
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js??ref--7-1!node_modules/postcss-loader/lib/index.js??ref--7-2!node_modules/sass-loader/lib/loader.js!node_modules/import-glob/index.js!resources/styles/admin/index.scss:
    Entrypoint undefined = extract-text-webpack-plugin-output-filename
    [0] ./node_modules/css-loader??ref--7-1!./node_modules/postcss-loader/lib??ref--7-2!./node_modules/sass-loader/lib/loader.js!./node_modules/import-glob!./resources/styles/admin/index.scss 165 bytes {0} [built]
        + 1 hidden module
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js??ref--7-1!node_modules/postcss-loader/lib/index.js??ref--7-2!node_modules/sass-loader/lib/loader.js!node_modules/import-glob/index.js!resources/styles/editor/index.scss:
    Entrypoint undefined = extract-text-webpack-plugin-output-filename
    [0] ./node_modules/css-loader??ref--7-1!./node_modules/postcss-loader/lib??ref--7-2!./node_modules/sass-loader/lib/loader.js!./node_modules/import-glob!./resources/styles/editor/index.scss 2.26 KiB {0} [built]
        + 1 hidden module
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js??ref--7-1!node_modules/postcss-loader/lib/index.js??ref--7-2!node_modules/sass-loader/lib/loader.js!node_modules/import-glob/index.js!resources/styles/login/index.scss:
    Entrypoint undefined = extract-text-webpack-plugin-output-filename
    [0] ./node_modules/css-loader??ref--7-1!./node_modules/postcss-loader/lib??ref--7-2!./node_modules/sass-loader/lib/loader.js!./node_modules/import-glob!./resources/styles/login/index.scss 165 bytes {0} [built]
        + 1 hidden module
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js??ref--7-1!node_modules/postcss-loader/lib/index.js??ref--7-2!node_modules/sass-loader/lib/loader.js!node_modules/import-glob/index.js!resources/styles/theme/index.scss:
    Entrypoint undefined = extract-text-webpack-plugin-output-filename
    [0] ./node_modules/css-loader??ref--7-1!./node_modules/postcss-loader/lib??ref--7-2!./node_modules/sass-loader/lib/loader.js!./node_modules/import-glob!./resources/styles/theme/index.scss 7.23 KiB {0} [built]
        + 1 hidden module

Steps to reproduce (in case of a bug)

  1. Follow the quickstart guide and create a project https://docs.wpemerge.com/#/starter-theme/quickstart
  2. Error during install.

Comments

If i continue, the theme installation finish. But when trying to develop with it, "yarn dev" result in the same type of error:

[./resources/styles/theme/index.scss] 41 bytes [built]
[jquery] external "jQuery" 42 bytes {theme} [built]
    + 123 hidden modules
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js??ref--7-1!node_modules/postcss-loader/lib/index.js??ref--7-2!node_modules/sass-loader/lib/loader.js!node_modules/import-glob/index.js!node_modules/bootstrap/dist/css/bootstrap.css:
    Entrypoint undefined = extract-text-webpack-plugin-output-filename
       2 modules
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js??ref--7-1!node_modules/postcss-loader/lib/index.js??ref--7-2!node_modules/sass-loader/lib/loader.js!node_modules/import-glob/index.js!resources/styles/admin/index.scss:
    Entrypoint undefined = extract-text-webpack-plugin-output-filename
    [./node_modules/css-loader/index.js?!./node_modules/postcss-loader/lib/index.js?!./node_modules/sass-loader/lib/loader.js!./node_modules/import-glob/index.js!./resources/styles/admin/index.scss] ./node_modules/css-loader??ref--7-1!./node_modules/postcss-loader/lib??ref--7-2!./node_modules/sass-loader/lib/loader.js!./node_modules/import-glob!./resources/styles/admin/index.scss 165 bytes {0} [built]
        + 1 hidden module
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js??ref--7-1!node_modules/postcss-loader/lib/index.js??ref--7-2!node_modules/sass-loader/lib/loader.js!node_modules/import-glob/index.js!resources/styles/editor/index.scss:
    Entrypoint undefined = extract-text-webpack-plugin-output-filename
    [./node_modules/css-loader/index.js?!./node_modules/postcss-loader/lib/index.js?!./node_modules/sass-loader/lib/loader.js!./node_modules/import-glob/index.js!./resources/styles/editor/index.scss] ./node_modules/css-loader??ref--7-1!./node_modules/postcss-loader/lib??ref--7-2!./node_modules/sass-loader/lib/loader.js!./node_modules/import-glob!./resources/styles/editor/index.scss 3.39 KiB {0} [built]
        + 1 hidden module
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js??ref--7-1!node_modules/postcss-loader/lib/index.js??ref--7-2!node_modules/sass-loader/lib/loader.js!node_modules/import-glob/index.js!resources/styles/login/index.scss:
    Entrypoint undefined = extract-text-webpack-plugin-output-filename
    [./node_modules/css-loader/index.js?!./node_modules/postcss-loader/lib/index.js?!./node_modules/sass-loader/lib/loader.js!./node_modules/import-glob/index.js!./resources/styles/login/index.scss] ./node_modules/css-loader??ref--7-1!./node_modules/postcss-loader/lib??ref--7-2!./node_modules/sass-loader/lib/loader.js!./node_modules/import-glob!./resources/styles/login/index.scss 165 bytes {0} [built]
        + 1 hidden module
Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js??ref--7-1!node_modules/postcss-loader/lib/index.js??ref--7-2!node_modules/sass-loader/lib/loader.js!node_modules/import-glob/index.js!resources/styles/theme/index.scss:
    Entrypoint undefined = extract-text-webpack-plugin-output-filename
    [./node_modules/css-loader/index.js?!./node_modules/postcss-loader/lib/index.js?!./node_modules/sass-loader/lib/loader.js!./node_modules/import-glob/index.js!./resources/styles/theme/index.scss] ./node_modules/css-loader??ref--7-1!./node_modules/postcss-loader/lib??ref--7-2!./node_modules/sass-loader/lib/loader.js!./node_modules/import-glob!./resources/styles/theme/index.scss 11.7 KiB {0} [built]
        + 1 hidden module

How to regenerate colors ?

Hello, how to generate colors from frontend.config.scss ? With new colors added in config.json

Thanks ! :)

Cannot load view

@SineGrain commented on Thu Aug 02 2018

Hi guys i'm trying to integrate htmlburger/wpemerge-blade with wp-emerge-theme but cannot getting to work.
i installed htmlburger/wpemerge-blade with composer and i added the service provider to config.php

here is my "app/config.php"

<?php
/**
 * WP Emerge configuration.
 *
 * @see  https://docs.wpemerge.com/configuration.html
 */

return [
	/**
	 * Array of service providers you wish to enable.
	 */
	'providers'         => [
		\WPEmergeBlade\View\ServiceProvider::class
	],
	/**
	 * Array of global middleware to apply to all requests.
	 */
	'global_middleware' => [

	],

	/**
	 * Other config goes after this comment.
	 */

];

Here is my
"app/src/controllers/MainController.php"


<?php

namespace App\Controllers;

use WPEmerge\Requests\Request;

class MainController {
	public function home( Request $request, $view ) {
		// Add back-end logic here
		// for example, prepare some variables to pass to the view
		// or validate request parameters etc.
		$name = 'foobar';

		// return app_output( 'Hello World!' ); //this line uncommented work and i see the message
		
                 //I tried also templates/baselayout || templates/baselayout.blade.php 
		return app_view( 'templates.baselayout' ) 
			->with( [
				'name' => $name,
			] );
	}
}

Here is my view
"theme/template/baselayout.blade.php"

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Test WP-Emerge</title>
</head>
<body>
    <p>Hello {{$name}}!!!</p>
    @yeld('content')
</body>
</html>

Here is myb "app/framework.php"


<?php
/**
 * ------------------------------------------------------------------------
 * Routes
 *
 * @see https://docs.wpemerge.com/routing/methods.html
 * ------------------------------------------------------------------------
 */

// Using our ExampleController to handle the homepage, for example.

Router::get( '/', 'App\Controllers\MainController@home' );


// If we do not want to hardcode a url, we can use one of the available route conditions instead:
/*
Router::get( ['post_id', get_option( 'page_on_front' )], 'App\Controllers\ExampleController@home' );
*/

/**
 * Pass all front-end requests through WPEmerge.
 * WARNING: Do not add routes after this - they will be ignored.
 *
 * @see https://docs.wpemerge.com/routing/methods.html#handling-all-requests
 */
Router::handleAll();

/**
 * ------------------------------------------------------------------------
 * Globals
 *
 * @see https://docs.wpemerge.com/view/global-context.html
 * ------------------------------------------------------------------------
 */

/*
View::addGlobal( 'foo', 'bar' );
 */

/**
 * ------------------------------------------------------------------------
 * View composers
 *
 * @see https://docs.wpemerge.com/view/view-composers.html
 * ------------------------------------------------------------------------
 */

/*
View::addComposer( 'partials/foo', \App\ViewComposers\FooPartialViewComposer::class );
 */

When i load the page i receive ERR_EMPTY_RESPONSE

I am doing something wrong or i miss a config?


@atanas-angelov-dev commented on Thu Aug 02 2018

Hi @SineGrain ,

I believe you are affected by an old bug - please update to the latest versions of everything (wpemerge-theme, wpemerge, wpemerge-blade).
Since the theme is setup using composer create-project the simplest solution would be to re-setup it the same way.

After that, restart your webserver and give it another try. If you still have the same error after doing that please submit your composer.lock so I can double check the versions installed.

PS:
You have a couple of typos - these are not the cause for the problem, but wanted to mention them so they don't muddy the results:

  • "theme/template/baselayout.blade.php" - template should be templates
  • @yeld('content') should be @yield('content')

Unable to activate

0.15.1

  • WP Emerge Starter Theme: 0.15.1
  • WP Emerge (if not the default): default
  • WordPress: 5.2.2
  • PHP: 7.2

Expected behavior

Being able to actually activate the theme in wordpress.

Actual behavior

After following quick start instructions can't activate the theme in wp-admin nor wp-cli.

Comments

What am I missing?

Requirements error when trying to require htmlburger/wpemerge-theme within Bedrock

Version

  • WP Emerge Starter Theme: 0.17.1
  • WordPress: 6.0
  • PHP: 8.1

Expected behavior

WP Emerge Theme to be installed and created at /web/app/themes

Actual behavior

composer require htmlburger/wpemerge-theme Throws an requirement error as follows:

Using version ^0.17.1 for htmlburger/wpemerge-theme
./composer.json has been updated
Running composer update htmlburger/wpemerge-theme
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires htmlburger/wpemerge-theme ^0.17.1 -> satisfiable by htmlburger/wpemerge-theme[0.17.1].
    - htmlburger/wpemerge-theme 0.17.1 requires composer/installers ^1.4 -> found composer/installers[v1.4.0, ..., 1.x-dev] but it conflicts with your root composer.json require (^2.1).

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require htmlburger/wpemerge-theme:*" to figure out if any version is installable, or "composer require htmlburger/wpemerge-theme:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Steps to reproduce (in case of a bug)

  1. Create a new Bedrock project running composer create-project roots/bedrock
  2. cd to root folder of your bedrock install
  3. Try to create WP Emerge Theme with composer require htmlburger/wpemerge-theme

Comments

Just followed official documentation found at https://docs.wpemerge.com/#/starter/theme/quickstart (the Quick start on Bedrock section).

Uncaught WPEmergeTheme\Concerns\JsonFileNotFoundException: The required manifest.json file is missing. Please run one of the build commands to generate it.

Version

  • WP Emerge Starter Theme: 0.12.0
  • WP Emerge (if not the default):
  • WordPress: 5.1.1
  • PHP: 7.1
  • Operating System: Windows 10 Enterprise (Version 1809)

Expected behavior

Theme should initialize.

Actual behavior

Uncaught WPEmergeTheme\Concerns\JsonFileNotFoundException: The required manifest.json file is missing. Please run one of the build commands to generate it.

Steps to reproduce (in case of a bug)

  1. Browse to wp-content/themes.
  2. Run composer create-project htmlburger/wpemerge-theme wpemerge-me
  3. Active theme in wordpress backend.

Comments

Seems the theme is looking for a manifest.json file. The function is called here:
wordpress\wp-content\themes\wpemerge-me\vendor\htmlburger\wpemerge-theme-core\src\Assets\Manifest.php

CSS edit triggers full page reload

Version

Please add the exact versions used for each of the following:

  • WP Emerge Starter Theme: 0.15.1
  • WordPress: 5.3.2
  • PHP: 7.3

Expected behavior

By the info shown at /resources/build/browsersync.js (injectCss = true) i think the theme should hot-reload and inject the css without a full page reload.

Actual behavior

Changing some SCSS will trigger a full page reload.

Steps to reproduce (in case of a bug)

  1. Install a fresh wpemerge-theme, use scss.
  2. yarn dev
  3. change something in /resources/styles/theme/index.scss and watch a full page reload to happen.

Comments

Video: https://photos.app.goo.gl/mszfYYFiffmzbsmM8
yarn dev at 40 seconds mark.

Unable to load SVG files as image.

Version

  • WP Emerge Starter Theme: 0.16.1

Expected behavior

Be able to use a SVG file as image in the project.

Actual behavior

When adding a SVG inside images folder, the font-loader is creating the file inside fonts folder and adding a export statement in the SVG file.

Comments

svg-file-loaded-in-images-folder-with-export-statement

Fatal error: Uncaught Error: Call to undefined method WPEmergeTheme\Theme\Theme::make()

Version

  • WP Emerge Starter Theme: 0.15.1
  • WordPress: 5.2.2
  • PHP: 7.3.6

Expected behavior

Method found

Actual behavior

Fatal error: Uncaught Error: Call to undefined method WPEmergeTheme\Theme\Theme::make()
in /usr/src/wordpress/wp-content/themes/project/theme/functions.php:66 Stack trace: #0
/usr/src/wordpress/wp-settings.php(499): include() #1 /usr/src/wordpress/wp-config.php(152):
require_once('/usr/src/wordpr...') #2 /usr/src/wordpress/wp-load.php(37):
require_once('/usr/src/wordpr...') #3 /usr/src/wordpress/wp-blog-header.php(13):
require_once('/usr/src/wordpr...') #4 /usr/src/wordpress/index.php(17):
require('/usr/src/wordpr...') #5 {main} thrown in /usr/src/wordpress/wp-content/themes/project/theme/functions.php on line 66

Steps to reproduce (in case of a bug)

  1. Run composer install
  2. run yarn dev
  3. visit homepage, install wordpress then activate the theme

Comments

I have a particular config but it works fine for other project.
I run all my projects in docker container inside VM.
So I mount the code project (with node modules and vendor) inside docker.
I could install wordpress correctly.

Add support for Gutenbeg Editor Styles

Expected behaviour

Editor styles are correcting recognised, transformed and inlined by Gutenberg.

Actual behaviour

Editor styles are not recognised so the default styles are inlined instead.
This cause having to rely on unnecessary CSS !important rules or additional selectors.

Comments

Solved by commenting out the current editor.css enqueue in app/helpers/assets.php in favour of adding:

/**
 * Support the themeโ€™s editor styles.
 *
 * @link https://developer.wordpress.org/block-editor/developers/themes/theme-support/#editor-styles
 */

add_theme_support( 'editor-styles' );
add_editor_style(  '../dist/styles/editor.css');

to app/setup/theme-support.php

Development URL from config.json not working

Version

Please add the exact versions used for each of the following:

  • WP Emerge Starter Theme: 0.16.2
  • WP Emerge (if not the default):
  • WordPress:
  • PHP:

Expected behavior

Please describe the expected behavior here.

Expect running yarn start to use the development url specified in config.json

Actual behavior

Please describe the actual, unexpected behavior here.

No matter what is entered, localhost:3000 is used for CSS/JS assets.

Steps to reproduce (in case of a bug)

Comments

Please add any other comments here.

Running local dev under Laravel Valet and need to specify the local URL for outputting CSS/JS paths.

Create Project failed

Version

  • WP Emerge Starter Theme:
  • Composer version 1.8.0 2018-12-03 10:31:16

Hai i am running

composer create-project htmlburger/wpemerge-theme your-theme-name

Stop and the middle installation

`Generating autoload files

WPEmerge\Cli\App::createConfigJson

composer create-project wp-coding-standards/wpcs --no-dev
sh: composer: command not found
Script composer create-project wp-coding-standards/wpcs --no-dev handling the install-wpcs event returned with error code 127
Script @install-wpcs was called via post-create-project-cmd`

Sprite with SVG icons?

Is it correct that at the moment developers can't make sprite out of svg files? I looked at config files and so that something like spritesmith is used. I also searched for spritesmith documentation and didn't find anything about svg's.

So if it is correct then i propose for a feature request here :) Maybe something that can deal with svg files and make sprite out of them. OR something that would generate data:uri code.

Feature request: image asset processing & subfolders

Version

  • WP Emerge Starter Theme: 0.16.1
  • WP Emerge (if not the default): master (0.16.1)

Expected behavior

  • It would be useful to be able to process images that aren't directly referenced/findable in css/js etc and so get missed out of dist

  • images in subdirectories eg resources/images/icons should be output with the same path structure

Steps to reproduce (in case of a bug)

  1. add an image to /resources/images/icons/icon.png
  2. build

=> observe image is not output to /dist/images/icons/icon_{manifest_id}.png

Comments

re: image paths.. the following code is a potential fix...

name: (f) => {
    const dirNameInsideResources = path.relative('resources', path.dirname(f));
    return `${dirNameInsideResources}/[name].${utils.filehash(f).substr(0, 10)}.[ext]`;
},

re: image references & compiling as asset

Currently I create a scripts/assets/index.js file to reference any images that aren't used in css or js directly so it picks them up and outputs them to dist\images accordingly.

(It creates a dummy assets.min.js file which doesnt need to be used by anything on the site. It's not perfect but is a way to ensure images are picked up and output to dist)

eg if I import '@images/test/test-emblem.png'; in my assets/index.js then this is output to the dist folder
/images/test/test-emblem.44a9352841.png

I then have an asset helper function

<img src="{{ asset('images/test/test-emblem.png') }}" />

function asset($file) {
    $asset = \App::core()->assets()->getAssetUrl($file);
    return $asset;
}

hopefully some of this could maybe incorporated by default?

thanks
J

include JS Framework

I'm not very strong in webpack settings, since there are also pressets in the laravel, so can you tell me how to properly integrate Vue js into this topic? :)

WPEmerge\view not working

  • WP Emerge : install with composer create-project htmlburger/wpemerge-theme wpemerge
  • WordPress: 5.2.2
  • PHP: 7.2

Route::get()->url( '/hello' )->handle( function() {
return WPEmerge\view( 'templates/about-us.php' )->withStatus( 200 );
} );

Error :
Call to undefined method WPEmerge\View\PhpView::withStatus()

Should I git ignore the cache directory?

Version

Please add the exact versions used for each of the following:

  • WP Emerge Starter Theme: 0.15.0
  • WP Emerge (if not the default): 0.15.0
  • WordPress: 5.2.2
  • PHP: 7.2.19

Expected behavior

I don't see any reason to do versioning on my cache files. Am I missing something?

Actual behavior

theme/cache directory is not git ignored, so it is being commited. Is there any problem if I ignore it? Why it should not be like this by default?

Steps to reproduce (in case of a bug)

  1. yarn dev

Invalid release zip

Version

Please add the exact versions used for each of the following:

  • WP Emerge Starter Theme: 0.15.0
  • WP Emerge (if not the default):
  • WordPress: 5.2.2
  • PHP: 7.1.3

I'm running on Windows, if that helps.

Expected behavior

yarn release generates a valid zip archive.

Actual behavior

yarn release generates an invalid zip archive. The zip cannot be opened/extracted.

No errors shown while executing the command.

Tried opening with PeaZip and Windows zip utility.

Steps to reproduce (in case of a bug)

  1. Install the latest version: composer create-project htmlburger/wpemerge-theme your-theme-name.
  2. Change to theme directory: cd your-theme-name.
  3. Run install directly (since I'm on Windows). .\vendor\bin\wpemerge install (I have to use these slashes).
  4. Generate release zip: yarn release.
  5. Try to open the zip file.

Comments

I think this is probably an issue with the archiver package. Seems to have some open issues on Windows but couldn't find an exact one.

Assets::generateFileVersion() does not work with Bedrock installations

Version

  • WP Emerge Starter Theme: 0.15.1
  • WP Emerge (if not the default):
  • WordPress / Bedrock: 5.3.2
  • PHP: 7.2

Expected behavior

wpemerge-theme-core/src/Assets/Assets::generateFileVersion() should return file versions with Bedrock Wordpress installations.

Actual behavior

The function always returns false, even that asset file exists.

Steps to reproduce (in case of a bug)

  1. Install Wordpress using bedrock
  2. Create a WP Emerge theme
  3. On page load, that theme assets are not versioned in the URL

Comments

We are using Bedrock boilerplate for wordpress projects, as it provides modern file structure, supports managing plugins, themes and localizations through composer and treats Wordpress as a dependency.
Bedrock has the following project structure by default:

- project
   - web (webroot, /)
       - app
          - mu-plugins
          - plugins
          - themes
          - languages
       - wp (Wordpress folder)

The issue is that while generally WP Emerge works fine with Bedrock, the function wpemerge-theme-core/src/Assets/Assets::generateFileVersion() does not return a file version.

How to resolve (example project.com)

  • In normal wordpress installations home_url and site_url are the same. https://project.com
  • In Bedrock, home_url will be https://project.com and site_url will be https://project.com/wp
  1. https://github.com/htmlburger/wpemerge-theme-core/blob/0.15.0/src/Assets/Assets.php#L56
    The line should use home_url instead of site_url
  2. https://github.com/htmlburger/wpemerge-theme-core/blob/0.15.0/src/Assets/Assets.php#L63 There should be an extendable way to replace home_url with project root path.
    The fix for our project was to remove wp/ from ABSPATH:
			// Generate the absolute path to the file
			$file_path = str_replace(
				[$home_url, '/'],
				[str_replace('wp/', '', ABSPATH), DIRECTORY_SEPARATOR],
				$src
			);

Bottom line

Could you implement a fix to this or suggest a way to override generageFileVersion ?

Localization

Hi, how i can upload localization files for this repo?...

Upload release zip in WP admin panel

Version

  • WP Emerge Starter Theme: 0.15
  • WP Emerge (if not the default):
  • WordPress: 5.2.2
  • PHP: 7.1

Expected behavior

To be able to upload the .zip directly into the theme section of the wp-admin

Actual behavior

Install fail, because it can't find the necessary files in the theme.zip like style.css, index.php and such. They should be at the root of the theme to enable this behaviour, but then the theme is not working, because of broken paths.

Steps to reproduce (in case of a bug)

  1. Execute yarn release
  2. Upload the resulting archive to a wordpress install

Make Compatible with Composer 2

Version

Please add the exact versions used for each of the following:

  • WP Emerge Starter Theme: 0.16.1
  • WP Emerge (if not the default):
  • WordPress: 5.5
  • PHP: 7.4

Expected behavior

Installing the theme with Composer v2 should work.

Actual behavior

  Problem 1
    - Root composer.json requires dealerdirect/phpcodesniffer-composer-installer ^0.5.0 -> satisfiable by dealerdirect/phpcodesniffer-composer-installer[v0.5.0].
    - dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

Steps to reproduce (in case of a bug)

  1. Run composer create-project htmlburger/wpemerge-theme wpemerge.
  2. View error.

Comments

Seemingly, updating composer.json > dealerdirect/phpcodesniffer-composer-installer to "^0.7" seems to fix it, but im not sure of the side-effects.

404 Not Found: 'tailwindcss'@^0.6.5

Version

  • WP Emerge Starter Theme: 0.11.0
  • WP Emerge (if not the default):
  • WordPress: N/A
    $ nodejs -v
    v11.2.0

$ npm -v
6.4.1

$ php -v
PHP 7.2.11-2+020181015120510.9+jessie1.gbp8105e0 (cli) (built: Oct 16 2018 03:39:58) ( NTS )

Comments

On install on these using the quick start guild im guessing the following error on the composer step

image

Allow to configure browsersync port

We use node in a docker container and have different ports for our differents projects.

We need to configure the port used by browsersync instead of the default 3000.

A PR will follow to address this little improvement.

Route handle controller is not called

Version

  • WP Emerge Starter Theme: 0.15.1
  • WordPress: 5.2.2
  • PHP: 7.3.6

Expected behavior

Home controller home method should be called

Actual behavior

The route is not going through the home controller

Comments

I added in src/Controllers/Web/HomeController.php

<?php
namespace App\Controllers; // with and without
class HomeController {
  public function index( $request, $view ) {
      return WPEmerge\view( 'templates/home' );
  }
}

In routes/web.php, the following is not working
Route::get()->url( '/' )->handle( 'HomeController@index' );

while the following return the expected template

Route::get()->url( '/' )->handle( function() {
  return WPEmerge\view( 'templates/home' );
} );

May I suggest you add to the starter theme basic usage like first route + first controller so it is easier for people to start / replace.

Overriding WooCommerce templates

Hey, thank you for developing such a good starter theme.

It's been working smoothly, however there is one issue regarding woocommerce.

Some templates need to be overridden, however WP Emerge does not fallback to lookup for views in woocommerce plugin. This makes it necessary to copy all files into theme/woocommerce directory.

Is there a workaround for this?

Would be very grateful for help!

Can't install wpemerge-theme with composer while using PHP 7.4

This is the same issue as described here htmlburger/wpemerge#19
The same error at the end: https://tppr.me/euzLs

For the sake of order, will copy that issue here:

Version
WP Emerge: 0.15.1
WordPress: 5.3
PHP: 7.4

Expected behavior
Install the theme using the composer without any error.

Actual behavior
I'm receiving the following error:

Installing htmlburger/wpemerge-theme (0.15.1)

  • Installing htmlburger/wpemerge-theme (0.15.1): Downloading (100%)
    Created project in cargaexport-wp-theme
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Package operations: 19 installs, 0 updates, 0 removals
  • Installing composer/installers (v1.7.0): Loading from cache
  • Installing squizlabs/php_codesniffer (3.5.3): Downloading (100%)
  • Installing dealerdirect/phpcodesniffer-composer-installer (v0.5.0): Downloading (100%)
  • Installing ralouphie/getallheaders (2.0.5): Loading from cache
  • Installing psr/http-message (1.0.1): Loading from cache
  • Installing guzzlehttp/psr7 (1.6.1): Loading from cache
  • Installing psr/container (1.0.0): Loading from cache
  • Installing pimple/pimple (v3.2.3): Loading from cache
  • Installing htmlburger/wpemerge (0.15.0): Loading from cache
  • Installing htmlburger/wpemerge-theme-core (0.15.0): Downloading (100%)
  • Installing htmlburger/carbon-pagination (v1.1.6): Downloading (100%)
  • Installing symfony/process (v3.4.36): Downloading (100%)
  • Installing psr/log (1.1.2): Loading from cache
  • Installing symfony/debug (v3.4.36): Downloading (100%)
  • Installing symfony/polyfill-mbstring (v1.13.1): Loading from cache
  • Installing symfony/console (v3.4.36): Downloading (100%)
  • Installing htmlburger/wpemerge-cli (0.15.0): Downloading (100%)
  • Installing filp/whoops (2.5.0): Loading from cache
  • Installing wp-coding-standards/wpcs (2.2.0): Downloading (100%)
    guzzlehttp/psr7 suggests installing zendframework/zend-httphandlerrunner (Emit PSR-7 responses)
    symfony/console suggests installing symfony/event-dispatcher
    symfony/console suggests installing symfony/lock
    filp/whoops suggests installing symfony/var-dumper (Pretty print complex values better with var-dumper available)
    filp/whoops suggests installing whoops/soap (Formats errors as SOAP responses)
    Writing lock file

Generating autoload files
PHP CodeSniffer Config installed_paths set to ../../wp-coding-standards/wpcs

WPEmerge\Cli\App::createConfigJson
Script WPEmerge\Cli\App::createConfigJson handling the post-create-project-cmd event terminated with an exception

[ErrorException]
Trying to access array offset on value of type int

Steps to reproduce
using PHP 7.4, do:
composer create-project htmlburger/wpemerge-theme my-wp-theme

Comments
I haven't found any issue related to PHP 7.4 so i'm creating this one.
I was able to install the theme with PHP 7.3

Missing config.json

Version

Please add the exact versions used for each of the following:

  • WP Emerge Starter Theme: 0.10.0
  • WP Emerge (if not the default):
  • WordPress: 4.9.8
  • PHP: 7.2

Expected behavior

Theme should initialize

Actual behavior

get Uncaught RuntimeException: The required theme config.json file is missing.

Steps to reproduce (in case of a bug)

  1. cd into wp-content/themes
  2. run composer create-project htmlburger/wpemerge-theme your-theme-name
  3. Active theme in wordpress backend

Comments

Seems the theme-core is looking for a config.json, but the only one existing is config.json.dist

setup project divided into 2 plugins and a theme

Version

Please add the exact versions used for each of the following:

  • WP Emerge Starter Theme: 0.16.1
  • WP Emerge (if not the default):
  • WP Emerge Starter Plugin: 0.16.1
  • WordPress: 5.6
  • PHP: 7.4

Expected behavior

my project is divided into 2 plugins and a theme 1 plugin will be the admin plugin so I will need all stuff in the Starter plugin for the internal WordPress admin. my second plugin is Gutenberg blocks, most of the blocks will be dynamic ( not ACF blocks ) but I want to use wp emerge-twig for my dynamic blocks. And lastly, a Theme that will use your twig package also for general templates and will properly use all other things. that come with the Starter theme.
" By the way, I use a regular composer setup in bedrock with trellis"

so the question: how can I set up all the Three should any of them have its own setup.?

Please describe the expected behavior here.

Actual behavior

Please describe the actual, unexpected behavior here.

Steps to reproduce (in case of a bug)

Comments

Please add any other comments here.
thanks and best regards

Install TailwindCSS rules at beginning of index.scss file

When installing TailwindCSS via php wpemerge install, it copies the base/components/utilities at the end of the file :

/* ------------------------------------------------------------ *\
    Vendor
\* ------------------------------------------------------------ */

@import './vendor/*.scss';

/* ------------------------------------------------------------ *\
    Settings
\* ------------------------------------------------------------ */

@import '~@styles/frontend.config.scss';
@import '~@styles/shared/_variables.scss';
@import '~@styles/shared/_editor.scss';
@import './_variables.scss';
@import './_sprite.scss';

/* ------------------------------------------------------------ *\
    Theme
\* ------------------------------------------------------------ */

@import '~@styles/editor';
@import './_generic*.scss';

/* ------------------------------------------------------------ *\
    Tailwind CSS
\* ------------------------------------------------------------ */
@import "~tailwindcss/base";
@import "~tailwindcss/components";
@import "~tailwindcss/utilities";

making it take precedence on everything else. It would be more logical (to me, at least), that it would be installed at the beginning of the file, making the custom rules the definitive ones.

/* ------------------------------------------------------------ *\
    Tailwind CSS
\* ------------------------------------------------------------ */
@import "~tailwindcss/base";
@import "~tailwindcss/components";
@import "~tailwindcss/utilities";

/* ------------------------------------------------------------ *\
    Vendor
\* ------------------------------------------------------------ */

@import './vendor/*.scss';

/* ------------------------------------------------------------ *\
    Settings
\* ------------------------------------------------------------ */

@import '~@styles/frontend.config.scss';
@import '~@styles/shared/_variables.scss';
@import '~@styles/shared/_editor.scss';
@import './_variables.scss';
@import './_sprite.scss';

/* ------------------------------------------------------------ *\
    Theme
\* ------------------------------------------------------------ */

@import '~@styles/editor';
@import './_generic*.scss';

Can't reference an image (getAssetUrl) when running yarn hot

Version

  • WP Emerge Starter Theme: 0.16.0
  • WordPress: 5.4.1
  • PHP: 7.3

Expected behavior

Being able to reference an image using getAssetUrl when in yarn hot reload mode.

Actual behavior

Can't reference an image, getAssetUrl method returns empty string.

Steps to reproduce

  1. Create a fresh wpemerge 0.16.0 theme following the quickstart https://docs.wpemerge.com/#/starter/theme/quickstart as seen here: https://tppr.me/UP3N2
  2. Add an image https://tppr.me/95Ri1 and import it https://tppr.me/VBXpd
  3. Reference it in the theme https://tppr.me/bwyTI
  4. Run: yarn hot
  5. Error: https://tppr.me/FaEkH

Comments

If you instead run "yarn start", it will process the image and build the correct manifest.json https://tppr.me/wwJKs so the referenced image inside the theme's file will work https://tppr.me/g7FQk

var_dump on the getAssetUrl method while on hot reload mode https://tppr.me/Z7FDm will output an empty string https://tppr.me/gsaaC

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.