Best way to enable / update shared elements on a small html based site

I know that with a large site, you would like to separate footers, menus, etc., so that updating this file displays an update on every page containing the element.

The same is recommended for a small site made exclusively in HTML / CSS, or is it easier or easier / standard to encode the menu on each page and update each page if necessary?

I do not necessarily want to introduce PHP, etc. to this site, but the ease of updating the menu will be enjoyable. Any other suggestions? I heard that Server Side Includes might be one of the options ... is this considered "pure html" or is it needed more to configure on the server?

Thanks!

+3
source share
6 answers

If you do not have a one-page website, do yourself a favor and you have separate files with your repeated header / footer / other elements.

Thus, you only need to make one change and do it. No matter how happy you think you are, you will inevitably forget the page somewhere in the update in any other way. This is a human thing.

If this is “just” HTML, and you are not using the server language, then you are correct that you want to use the server side. Contact your host to find out if it will handle SSI on regular * .htm / *. Html files or if you need to use the * .shtm / * extension. Shtml.

+6
source

html, . , , PHP .

-, , .

Apache.

IIS.

+2

, , , - , PHP JSP - , - , , , , , .

Java/JSP, JSP- , . , API . , , , .

0

" HTML" , PHP.

, JavaScript , jQuery, .js .

0

/ , DIV, . , - .

0

php. index.php, :

http://pastebay.com/51887

, , "includes/navigation.php" :

http://pastebay.com/51888

, , , , "includes/navigation.php".:)

-1

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


All Articles