Tuesday, 15 September 2015

Compiling html templates to complete website -



Compiling html templates to complete website -

i'm used using asp.net , visual studio develop websites. i'm trying develop plain .html website in similar matter. mean utilize master pages etc there code reuse , maybe deploy these template files grouping of .html files.

for example

head.html

<script src="jquery.js" type="text/javascript"></script> <script src="jquery.ui.js" type="text/javascript"></script> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" /> <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js">

header.html

<div data-role="header"> <h1>page title</h1> </div><!-- /header -->

footer.html

<div data-role="footer"> <h4>page footer</h4> </div><!-- /footer -->

layout.html

<!doctype html> <html> <head> <title>page title</title> #include(head.html) </script> </head> <body> <div data-role="page"> #include(header.html) #include_body() #include(footer.html) </div><!-- /page --> </body> </html>

index.html

<div data-role="content"> <p>page content goes here.</p> </div><!-- /content -->

and combine of these single output file....

<!doctype html> <html> <head> <title>page title</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" /> <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script> </head> <body> <div data-role="page"> <div data-role="header"> <h1>page title</h1> </div><!-- /header --> <div data-role="content"> <p>page content goes here.</p> </div><!-- /content --> <div data-role="footer"> <h4>page footer</h4> </div><!-- /footer --> </div><!-- /page --> </body> </html>

does exist? i'm not familiar ruby or anything...

server-side includes (ssi) may meet needs. basic server requirements met, can do, example:

<!--#include virtual="includes/my_file.html" -->

html

No comments:

Post a Comment