github pages - How to deploy pure html to Octopress? -


i using octopress write posts, uses markdown file generate html files, using :

rake new_post['my_post'] rake generate 

but if need add javascript demo inside post, need write code inside post, may possibly html page writing as.

can achieve octopress , remain overall consistency of style?

you can put javascript block own html file, in source/_includes/ directory. can embed post using liquid include tags:

--- layout: post title: "js demo" date: 2015-01-01 01:01:01 categories:  ---  {% include myjs.html %} 

and contents of myjs.html be:

<div id="myelement"></div>  <script> $('div#myelement').text("hello world"); </script> 

and myjs.html @ source/_includes/myjs.html. final page source code (for example) render as:

<div><h1>js demo</h1></div> <div id="myelement">hello world</div> 

if want structure javascript code you're including bit more, can make directory javascript files in (e.g.) source/_includes/demo/, put javascript source/_includes/demo.html. markdown have following liquid include tags:

{% include demo/demo.html %} 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -