oskarrough / ember-wordpress

The bridge between Ember.js and Wordpress
http://ember-wordpress.surge.sh
MIT License
95 stars 26 forks source link

Clarify how to deploy #11

Open oskarrough opened 8 years ago

oskarrough commented 8 years ago

You have (at least) two options:

  1. Deploy to a seperate host from your Wordpress install
  2. Deploy as a Wordpress theme

Solution 1 is definitely the simplest as it doesn't require any extra steps but the DNS management. Solution 2 also works, but requires a few nifty tricks to work properly.

I'll have to add this to the readme. Until then, you can ask here.

sheriffderek commented 8 years ago

What about option 3?

Keeping the CMS totally separate / but on the same host is great for client and developer.

There are many gotchas around pretty-permalinks and other terminal host/apache stuff that all depend on the setup. I'll try to collect the Digital Ocean issues next fresh project.

oskarrough commented 8 years ago

Yes, that's actually how we normally do it.

Because of the <base> tag Ember generates, this works. Although it's a pretty frustrating workflow…

oskarrough commented 8 years ago

This line in functions.php can also be critical, if you have your Ember app inside a WP theme.

// Remove canonical redirects that would otherwise overwrite the Ember routing
remove_filter('template_redirect', 'redirect_canonical');
sheriffderek commented 8 years ago

I'm still wondering why you put the Ember app inside the WordPress theme vs just having it in the root of your host public folder - or really, anywhere else.

oskarrough commented 8 years ago

I might be going the wrong way about this but putting it inside a Wordpress theme allows you to let Wordpress do the initial routing BEFORE your Ember app is loaded.

This is essentially server-side rendering, which might be useful for SEO. Personally I prefer to let Google figure it out these days but some clients require it for sharing on, say, Facebook, who can't read JavaScript apps yet.

sheriffderek commented 8 years ago

Very interesting. I'll have to check into that.

I didn't worry about it on a site - and to my surprise everything was thoroughly indexed by Google - down to the orphaned routes I had left in there ~ so I figured that wasn't a thing anymore. BUT - if there is a way to have WP just automatically do the work instead of adding fastboot - that could be really convenient.

sheriffderek commented 7 years ago

Maybe a section in the readme with links to ember-cli-deploy and surge.sh would know this out. + a clear explanation of how the Ember app is essentially a separate entity - that doesn't really care where your WP install is. BUT there are some considerations depending on CORS and other things to ensure proper refresh... so we should try and collect those bits.

chriswebd commented 7 years ago

to deploy it using theme you have to convert the ember app into wordpress theme

josephbergdoll commented 7 years ago

🌚