I got a realtive big project for what I have many plain HTML pages. All the pages have the same template, but when I change one value in the template I have to change all the other pages manually.
Is there a way to do it like less for CSS or CoffeeScript for JS?
Lg Knerd
If all you have are plain HTML pages you could use SSI although it is a bit dated and youll need to be running this on a web server like Apache.
http://en.wikipedia.org/wiki/Server_Side_Includes
Personally I would use php so I could just include the files with the php include function
Related
I'm working on Webpack/Gulp enviroment, and I wanna add function to include HTML partials like header and footer inside other page views.
The best solution for this will be like in PHP, include file and it's fine.
I used html-webpack-plugin, html-loader and gulp-file-include but this not working for me or this build one file from this partials and on development mode on local server i can't look to results because this partial before build not working.
Someone maybe have a solution or think for this?
For most of my project's documentation I prefer a standard sphinx layout. However for the landing page I would prefer to use custom HTML/CSS/JS without any of the layout, TOC, or sidebars of the normal sphinx site. Is there a way to include a raw HTML standalone page in a sphinx-generated website in a way that completely disregards the normal layout of the rest of the site?
As a counter example I know that I can include raw HTML bits into a page using the following (see also this question)
.. raw:: html
:file: myfile-html
However this just embeds a file within the normal layout. I would like to have a completely standalone HTML page.
I just ran into this problem myself, and the way I solved it was to simply include the html file in my source/_static folder, then refer to it with a relative link.
So if source/_static/my_standalone.htm is the path where I have my non-generated HTML file, and the .rst file where I want to type my link is at source/otherfolder/index.rst, I write it like this in my rst:
Link to my non-Sphinx HTML file
===============================
To get to my standalone, non-generated HTML file,
just `click here <../_static/my_standalone.html>`_ now!
I have a few .html files in a project I am working on for a class. All with the same header and footer. We are required to use SSI with Apache, but I am having trouble looking for a way to have my includes code acknowledged by WebStorm. To be honest, I'd be content with just a way to include the same code header by using just one line of code, but I'd rather not have to replace the code with SSI code in every page before I hand it in.
I'm front-end developer and in work I use Twig with Symfony2 on Apache server. But now I have to make mockups in HTML, CSS on my interaction computer-human course on university. I need some application to able to including other html file in html file, extending html file with other html file - something similar like in Twig include and extend features. Does something like that exist?
I'd rather don't use html frame.
You could use server side includes - but this requires a server (hence the name !!)
Then you could, for example add a header to each page:
<!--#include virtual="header.html" -->
Apache, nginx, lighttpd and IIS are the four major web servers that support this language.
Your other option would be to use JavaScript and AJAX to pull in other content post load.
How can I import an HTML file within my HTML file? I will prepare header.html and footer.html files separately and every file that I want to include them I want to import them into my HTML file.,
EDIT: I see that solution based on SSI technique. I use Ubuntu and Tomcat 7.0.11. How can I enable SSI at tomcat?
There are many solutions to this problem. You can write simple JavaScript code to include parts of your page on load, you can enable SSI on your web-server, and finally you can use any server-side language to dynamically include chunks of any page for output. Your choice depends on how dynamic your web-site is.
You can include html files using frames or iframes. If you're using a server side language such as PHP or ASP you can do this without frames using includes.
If you wanted to strictly use HTML (and assuming you are using JS too) I would do the following:
You could have a <div> for the header, I will call it <div id="header">.
Using jQuery we could say something like: $('#header').load(---html file---);. Aside from the pain it might be to include the JS file in all pages, it will allow you to make changes to the header globally throughout your application.