Public Api gone in ghost version 2.11.0


#1

Yesterday I upgrate my ghost-cli to ghost 2.11.0. After upgrating I can’t find public api in SETTINGS > Labs.
For that various things are not working like {{#get }}...{{/get}} tag.


#2

Hey @kingrayhan o/

The 2.11.0 release included a change to remove the Public API from the labs settings, if it had never been on before.

Were you using this previously?

The Public API has been deprecated in favor of our Content API.

If you are to update the package.json in the theme you’re using, so that your API version is 2 like here, in Casper you should have that functionality back.

I do wonder though, if you were using it before, how/why it has been removed, would you mind providing some more information about how your settings were previously configured?


#3

Thanks, @fabien, I didn’t know that I can enable ghost-api from package.json engines key.
Now it working fine.


#4

Is package.json the only thing that needs updated after upgrading to 2.11.0 or later? Because I did it and get still doesn’t work fully (filter="page:true" returns nothing while include="authors,tags" only fetches tags’ info, not the authors’). I can still see the Public API option, with a deprecation warning, but I’m not sure if it should be left on or off (it won’t help either way for now).

L.E. Solved both my issues by using the new {{#get "pages"}}{{# foreach pages}}... instead of {{#get "posts" filter="page:true"}}{{# foreach posts}}... and by changing the author handlebars to more specific ones, such as {{primary_author.name}} instead of {{author}}.