Editing the source code of a post

Hey all -

I’m new to Ghost from Wordpress. Using wordpress, I’d frequently edit the actual html source of posts. Is there an easy way to do this when editing a post in Ghost? I’ve googled the matter and read through the documentation. Theoretically, you could pull the JSON from he mySql db and edit it directly, but I was wondering if there was a way to do that in either the native Ghost editor or some other tool. If this has been asked already, pointing me to the relevant discussion would be greatly appreciated.

Ghost has the HTML for inputting custom HTML.

What are you trying to do by editing the post HTML?

Hi RyanF. Thanks for the quick reply. As a former wordpress user, I am used to html editing as my means of solving things that do not make sense to me in the editor. For Ghost, for the first set of things that immediately jumped out to me were…

  1. If I am just writing a normal paragraph, is it possible to change the color of one word?
  2. The image editor allows you to change the size, but won’t let me set a specific resolution.

I’ll again note that I am new to Ghost, so some of this may be supported in better ways.

With Ghost, I think the editor will make a lot more sense :blush:

For making a single word a different color, you can use an HTML card. Click the plus (+) button or type / to bring up the card selector and choose HTML. Then, you can style the word however you need. The bonus here is you can do this just for the paragraph in question and leave the rest of the paragraph as it is.

With post images, Ghost optimizes for you, so there’s nothing to worry about there. After you add your image, you have three options for size, which will differ depending on your theme.

A few additional thoughts:

The HTML card in Ghost is similar to the text view in the WP editor. So yes, to change the color of a single word, you have to use the HTML card as Ryan said; you can’t do it in the regular Ghost editor.

Note, though, that you can’t edit the HTML in any other cards, at least not directly. You can pull up the site in developer tools and see the HTML and CSS used in a given card, then try to replicate that in an HTML card that you save as a snippet (which I have done), but it’s not necessarily easy.

As I have come across things in Ghost that are either hard or impossible in the regular editor, I have created more and more snippets using the HTML card. If you are used to working with HTML and CSS in WP, you’ll be able to do the same.

Finally, note that the Ghost editor is focused on making it easy for writers to write; it is not intended as a full-fledged web site editor. So, accept that and the limitations it presents, and figure out your own workarounds for things that are missing that you feel like you need.

2 Likes

thanks @BruceInLouisville. The snippet idea is pretty cool. It does look like some of the integrations are for editors, so that may be a way to go if I want to get more granular.

http://45.79.137.44/ferrari-museum/

For the feature image, is there a way to shrink this down? Or, should I edit the template. It’s so large on a desktop that you have to scroll to see all of it. I tried uploading a smaller version, but the theme just stretched it back to the original size.

The issue here is the aspect ratio (the image is taller than it is wide). If you use a landscape image (or crop that image to be landscape), then the issue should resolve itself!

Gotcha. The featured image is optimized for landscape across the page. Thereafter, portraits wil fit inline with the post. Thanks!

Yeah! It will depend on the theme, though.