Live data from Hacker News

Tonik — WordPress starter theme with CLI, ES6, Webpack and more

github.com

11–20 of 61 posts

Re: Tonik — WordPress starter theme with CLI, ES6, Webpack and more

#12

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.

Do you have any detailed notes on how you set this up? I haven't used WP in a long time, to be honest, so not sure how their rest api works? Is it straight forward? Would love to read about this setup you do, sounds great.

Re: Tonik — WordPress starter theme with CLI, ES6, Webpack and more

#13
post #4
post #2

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).

>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.

Autoptimize is a good one

Re: Tonik — WordPress starter theme with CLI, ES6, Webpack and more

#14

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.

Do you have any detailed notes on how you set this up? I haven't used WP in a long time, to be honest, so not sure how their rest api works? Is it straight forward? Would love to read about this setup you do, sounds great.

The REST API is included with WordPress 4.7+ and on by default. Docs here: https://developer.wordpress.org/rest-api/ (if you find anything missing, I'd love to know)

Re: Tonik — WordPress starter theme with CLI, ES6, Webpack and more

#15

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

WordPress is a cms first and foremost. edit: lol today I learned cms != blog

wordpress.org says its a blog in the title, it's the first word.

Re: Tonik — WordPress starter theme with CLI, ES6, Webpack and more

#16

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.

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.

Re: Tonik — WordPress starter theme with CLI, ES6, Webpack and more

#17

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

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

Re: Tonik — WordPress starter theme with CLI, ES6, Webpack and more

#18
post #4
post #2

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).

>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.

> 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!)

Re: Tonik — WordPress starter theme with CLI, ES6, Webpack and more

#19
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.

Re: Tonik — WordPress starter theme with CLI, ES6, Webpack and more

#20

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

It's simple, non-tech admin staff are familiar with the interface (and can be easily trained), there's a vast ecosystem of plugins and integrations for it, it's easy to hire people or teams who have experience working with it. WP has its flaws and an upper limit to what it's capable of, but it's often a very pragmatic choice for small to medium sized content-driven websites.
Post reply on HN