![]() Publish your post That’s all there is to it Ghost allows you to paste embed code directly into the HTML block to share CodePen content with your readers. Please let me know if you have any other pro tips that I may have missed. Paste it into a HTML card in the editor Create a new HTML block in the Ghost editor on the post you would like to embed your code snippet and paste in the embed code. To save a snippet, highlight the content youd like to transform into a. This should serve as a head start for any other people looking to share code snippets, and have them look great on your Ghost site. Snippets allow any staff user to re-use content and cards across posts and pages. The above are the libraries that we run on pixelite, but your needs might be different (i.e. The end result is the same, except this method allows you to version control the theme (which I prefer). This is just like the above, except you edit the template file default.hbs, and insert the code in the appropriate sections. ![]() If you want to find the links to more libraries, or newer versions of the above, check out. The only real gotcha here is that you must add first, then followed by any and all languages you want to syntax highlight for. I have also added some extra CSS to reduce the size of PrismJS code blocks within the Casper theme in Ghost (as it can be quite large), and also allow long strings to wrap to newlines (to avoid horizontal scrolling). You simply add the following code to your Site Header in your blog settings: Found at /ghost/#/settings/code-injection in your admin section This is likely the simplest way if you do not have your theme in code, or run Ghost pro, and don't really care about code at all. Only second option can be version controlled (which I prefer). By embedding a Google Analytics JavaScript code snippet in the theme, you can make sure that statistics gathering is enabled for every page. Visit the pages of your Ghost.io site in your new language to send your. The code snippets are the same, it is only the method of embedding the snippets that change. Copy and paste the Localize code snippet into your Ghost.io blog header section. There are 2 options, and which option you use is up to you. In this blog post I will explain the changes I made to the Casper theme, and how you can look to implement these in your own Ghost site. Out of the box Ghost will not syntax highlight your code snippets.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |