
Tonik — WordPress starter theme with CLI, ES6, Webpack and more - patrulo
http://github.com/tonik/theme
======
fimdomeio
I started separating the admin from the "theme" by using the wordpress rest
api (admin running in a subdomain). While this might seem overkill at first
but I find that there's a lot less documentation to read and I can reuse a lot
more code from other projects without any changes.

~~~
Already__Taken
Most of my WP sites don't do a lot. Can you use the rest API to handle the
contact form and search? that was I could just use a static generation from wp
itself. The wp admin wouldn't even need to be publically accessible then.

~~~
sanat
The WP API handle search but not contact forms. Most plugins still don't
provide you with an API.

Contact form 7's latest build has them using their own API - but it's still
undocumented.

------
ezekg
This looks pretty cool. A couple years back, I built a similar starter theme
and CLI package for WP dev. Back then CoffeeScript and Grunt were the norm, so
it's a bit outdated now. But the CLI actually grew from a scaffold like you
have now, to being able to deploy over SSH using Capistrano, database and all,
which was really nice.

I don't do much WP dev anymore (thankfully moved to using Rails, Go and Node),
but when I do I usually use that old project for deployment. I'll be sure to
check this out, as the services architecture looks like a nice change of pace.
I tried Bedrock/Sage in the past, but it was just too much for me and made
some things harder than they should be.

Added links to my old projects below in case anybody is curious,

[0]: [https://github.com/themejuice/tj](https://github.com/themejuice/tj)
(CLI) [1]:
[https://github.com/themejuice/sprout](https://github.com/themejuice/sprout)
(theme)

------
mandazi
Cool. I'll check this out.

One thing I really find myself having a hard time working with WordPress
themes is that many of them are bloated and require so many plugins. The
amount of css/js files that are required to load a page in a premium WordPress
theme averages around 30+ files (at least from what I have seen working with
WordPress themes).

~~~
tyingq
>The amount of css/js files that are required to load a page in a premium
WordPress theme averages around 30+ files

HTTP/2 alleviates most of this, but there are plugins that can concatenate and
minify css/js. It is a shame though that most of the attractive themes are so
bloated.

~~~
chrisan
> It is a shame though that most of the attractive themes are so bloated.

The target audience just doesn't care (or dont even know). Theme authors want
to solve as many problems as possible to increase the chances someone buys
their theme. It's in their best interest to sell something with everything but
the kitchen sink (V5.0 now with kitchen sink!)

~~~
tyingq
Sure. But it's more than that. For example, they take 3 pieces of
functionality and make them all emit separate js/css. Often with copy/paste
code duplication for common functions. Or pull in some huge 3rd party library
to use one tiny piece of it that you could do in vanilla js anyway.

------
gibbitz
I built a custom gulpfile that uses composer to manage the updating of WP and
plugins along with building and FTP transfer a while back that I've been using
for about a year. I should have built a swanky page and open-sourced it then
:(. Composer sure makes WP development much easier to integrate with build
systems. This is totally the way to go as long as clients prefer using WP to
something more full-featured or server intensive. I'll have to check this out
when I decide that webpack has some advantage over gulp/rollup. Right now I'm
able to get smaller packages and do more easier with gulp, so I'm in no hurry.

------
joe_momma
I like it, neat that NPM is used

------
dangerface
I keep seeing these projects to make wordpress work more like a cms and I keep
thinking why not just use a cms?

~~~
uzegonemad
What's your recommendation for an open-source CMS? Preferably one with
relatively simple administration that a layman (client) could still
comprehend.

cc @tyingq, @zaphar, @bybjorn, @dangerface

~~~
dangerface
Good question. I like perch its quick and easy to build with, I moved from
wordpress to perch last year and it has cut development time in half.

It's super flexible no need for dodgy third part plugins that's no longer
maintained. Instead of plugins I just build everything I need custom with the
tools perch provides, I end up with something thats perfect for the client and
its a lot faster than trying to modify some third party plugin.

Clients are initially scared of perch, they want wordpress because thats what
they are used to and "thats what every one else uses". Five minutes into their
perch training their attitude is "This is great. Why does every one else use
wordpress?".

Sure its not free like wordpress but its only £50 and its worth every penny,
you will easily make that money back in development costs in a day.

[https://grabaperch.com/](https://grabaperch.com/)

~~~
SippinLean
>an open-source CMS

~~~
dangerface
It meets the original definition of open source as in the source code is open
and modifiable, you know the opposite of closed source.

If you mean the OSI definition of open source which defines how free the
licence is, rather than how open the source code is then I suggest you check
out the FSF they are the original OSI and advocate for free software and
generally don't feel the need to change an existing definition and make it
theirs.

~~~
FlipperPA
I don't believe it is "open" \- although you have the code to modify, the
license will make it very clear that it is anything but "open."

~~~
dangerface
If you have the code to modify then its open source, thats all that open
source is it has nothing to do with the license unless you are talking about
an OSI license in which case its just an OSI license and nothing to do with
the source code or its openness.

