drewbaker / wp-easy

Plugin that powers the WP Easy theme
0 stars 1 forks source link

Move the default templates, assets and route config to theme #5

Closed drewbaker closed 6 days ago

drewbaker commented 1 week ago

The current default template and routes are very specific... Probably don't need them at all, or use something more generic.

drewbaker commented 1 week ago

@rsm0128 I actually don't think the plugin should include any templates of any sort. And no JS or CSS obviously. That all needs to live in the theme.

If there is no router defined in the theme, then you could just use the plugin for the single-file-components and use the regular Wordpress template hierarchy if you wanted to.

drewbaker commented 1 week ago

Good example is the fonts.js file... clearly that should not be in the plugin

drewbaker commented 6 days ago

So the idea is, in my theme I should be able to have this structure:

/components/work-block.php
/templates/home.php
/scripts/main.js
/styles/main.css
/images/logo.svg
/layouts/default.php

And the plugin looks there for them.

drewbaker commented 6 days ago

Scripts and styles should all be auto loaded from theme: https://github.com/drewbaker/wp-easy-theme/blob/main/functions/framework.php#L45

drewbaker commented 6 days ago

Got a WIP of fixes here: https://github.com/drewbaker/wp-easy/tree/remove-theme-features

drewbaker commented 6 days ago

Closed with https://github.com/drewbaker/wp-easy/commit/00cc7430396e30741b7885696e1eaad2fa3633aa