Goren Berdichevsky
Goren Berdichevsky

Reputation: 447

Insert HTML to Jekyll post

I'd like to include some Web Audio API HTML5 code into a Jekyll post. Here's a clone of the HTML page + Javascript code that I'd like to include:

view-source:http://www.smartjava.org/examples/webaudio/example3.html

How should this be achieved?

Upvotes: 22

Views: 9751

Answers (2)

M. Inam
M. Inam

Reputation: 329

You can simply write HTML code and it'd work. Learn more here

Upvotes: -4

kmil0v
kmil0v

Reputation: 242

Actually, if you are using markdown to create your posts, you can use Liquid's include tag.

You just have to create a folder with the name _includes/ in the DocumentRoot of your project, then, create an HTML file inside, for example "mycomponent.html" and call it in your post with something like this:

{% include mycomponent.html %}

This file can have any HTML/CSS/JS you want.

Notice how you include just your HTML file; the external CSS/JS can be included in the layout that you're using.

Upvotes: 20

Related Questions