jbarone / ghostToHugo

Convert Ghost blog export to Hugo posts
MIT License
134 stars 14 forks source link

Add support for Gallery Card #21

Closed jbarone closed 5 years ago

jbarone commented 5 years ago

Ghost supports a Gallery card that needs to be handled in ghostToHugo

https://github.com/TryGhost/Ghost/blob/4f9e687f62e0f1023c1d10aa6b06d82c523fc2a6/core/server/lib/mobiledoc/cards/gallery.js

daegalus commented 5 years ago

Did you ever get a chance to make any progress on this? I am using this to convert multiple ghost blogs to Hugo, and i had 1 successful but just hit a problem on another that uses the gallery card.

jbarone commented 5 years ago

Sorry to hear that you're having an issue @Daegalus. I honestly got distracted by other things, but I do have some time to look into it. Lemme see if I can solve this for you.

jbarone commented 5 years ago

@Daegalus I've implemented the gallery card in a minimal way, by creating HTML similar to that created by Ghost. The HTML does not assume any classes or styles and will need to be manually edited after conversion to suit the theme being used.

Example Output:

<figure>
  <div>
    <div>
      <div><img src="/images/kitten1.jpg" width="5184" height="3456"/></div>
      <div><img src="/images/kitten2.jpg" width="5184" height="3456"/></div>
      <div><img src="/images/kitten3.jpg" width="3200" height="2361"/></div>
    </div>
  </div>
  <figcaption>
    Kittens!
  </figcaption>
</figure>

I hope this at least helps you in your conversion.

I'm making a note for future work for some configurable templating that should help customize this in the future.

daegalus commented 5 years ago

That is perfect, thank you for the quick turnaround.