Dynamic content with Jekyll

I am thinking of using Jekyll as a blogging mechanism for an upcoming project. However, I need a small part of the website to be dynamic, using some kind of server-side language (Ruby, PHP, Node.js, etc.).

I want the posts to be static, as expected from Jekyll, however at the bottom of the page I have a piece of content that should randomly rotate on every page load. I do not want to use JavaScript for this.

Is this possible in Jekyll?

+6
source share
3 answers

You can use the server-side . You may need to configure the server or change the extension of the generated files to .shtml.

Jekyll should generate this when you need to insert dynamic content:

<!--#include virtual="dynamic.rb" --> 

dynamic.rb must display valid html to display.

+3
source

If you don't want to use javascript at all, you can put dynamic content on another server and then paste it into your jekyll site using an iframe.

+2
source

No, Jekyll only creates static pages. You will need to use JavaScript for any dynamic content.

+1
source

Source: https://habr.com/ru/post/919229/


All Articles