TryGhost / Ghost-App

Includes for Ghost Apps
MIT License
111 stars 39 forks source link

Setting up a new ghost app. #19

Closed andrew-luhring closed 10 years ago

andrew-luhring commented 10 years ago

first issue :-)

So... I've been digging through the ghost source all day today trying to find a way to hook into the Posts array and only grab the main image of every post (Protip: there isn't one... As far as I can tell, anyway -- even though each post does, in fact, have an "image" property). Anyway, at some point I stumbled onto this api feature, and now I'm here. So hi.

How do I install an app I make? I've read this And I'm stuck on this because I am evidently so bad at sql, that I can't add an item to an array.

In /content/data/blah.ghost.json I see:


   {
        "id": 15,
        "uuid": "a number",
        "key": "activeApps",
        "value": "[]",
        "type": "app",
        "created_at": 1408810169322,
        "created_by": 1,
        "updated_at": 1408837881785,
        "updated_by": 1
      }

so I:


   {    
        "id" : 15,
        "key": "activeApps",
        "value": ["appName"],
    }

And that didn't... blow anything to pieces, but it still doesn't work-- or if it does, I can't figure out how to make it say so... I stopped and restarted ghost. Nothin. Where am I going wrong?

ErisDS commented 10 years ago

Hi @andrew-luhring, welcome to Ghost!

I totally appreciate your enthusiasm! Unfortunately, apps are still a work in progress, and have been ignored for a time whilst we shipped other stuff. I don't think it's been tested recently so it may well be completely broken at the moment. The documentation you found is intended for people creating demo apps whilst trying to make apps work. Obviously, at some point we need people to try to build real world apps in order to test that everything is working, but I'm not sure that time has come just yet.

Two alternative things for you:

  1. You can pull out the first image in a post, if it's the first thing in the post using the {{content words="0"}} hack
  2. The post images feature is one of the next things we want to work on, so why not throw your developer might behind the Ghost repo and help us get it shipped?
k-j-kleist commented 9 years ago

I just updated the "Installing" part of https://github.com/TryGhost/Ghost/wiki/Apps-Getting-Started-for-Ghost-Devs. Note the backslash escaped double quotes!

Seems to work for me, but as of now I've just added console.log() to the lifecycle methods. Next step: adding a handlebar helper (although https://github.com/TryGhost/Ghost-App/issues/14 is not very encouraging... )