/images/2018/rest/screen.thumbnail.jpg

So I've started to use ResSructured text to write my posts instead of markdown as it is just as quick as markdown and it's easier to use more of the native features in nikola like shortcodes and plugins. The ReStructured text documentation covers most things, but to have a greater amount of contril over my posts I needed to use the following tweaks. So here are my tweaks and tips when writing in Restructured text in Nikola with a bit of HTMl and Nikola's Python shortcodes thrown in.



Add html into your posts

At times you might want to add some html directly into your posts, if you wanted to embed an iframe for example. In Nikola their seems like there is more than one way of doing things. If it was something you wanted on lots of pages you'd set up a template; but if it is a one off and you wanted to embed html into one post, you could add in the following code.


 .. raw:: html 
   
<embed>
...
</embed>

Add a blank line when using ReStructred text

If you regularly want to change the padding of your page, you're better off changing the css in the theme. But if you're a beginner (like me), lazy (like me) or only want to do it once, you can add in a blank line by using a 'pipe' character.

|

Using # to link to a section of a post

This can be useful if you want to direct people via an external link to a section of your post.

So if I have an internal link already set up (like post above) the hyperlink will be the normal page address and then #link_name and that can be used as an external link that will take you to the section of a page. for example:

https://neilharrison.me/posts/restructured-text/#post

Use alignment with the images and thumbnail shortcode

  .. thumbnail:: /images/image.jpg
                   :align: left
   

Footnote

You might end up here!

Comments

Comments powered by Disqus
Your SEO optimized title