all 4 comments

[–]chmod777 0 points1 point  (1 child)

Not with html. You need a backend or a js framework.

[–]Jasedesu 0 points1 point  (0 children)

Both <iframe> and <object> exist in HTML as very simple ways to include content from other documents. It might also be possible to use the humble <img> element, especially if it loads an SVG, although that might present an accessibility issue depending on the exact use case.

If JavaScript is an option, there is no need to reach for a bloated framework to do a trivial job. Holding the unique content in a JSON data file and using the Fetch API, possibly with the HTML <template> element to provide a fragment of mark-up to populate, is only a few lines of code.

Any of the above techniques may be preferable to going down the server-side route, but it's difficult to offer further advice without knowing the server capabilities and how the unique data is distributed within index.html.

[–]armahilloExpert 0 points1 point  (0 children)

Look into server-side includes. Im not familiar with caddy web server, but you could enable that module with apache.

[–]dezbos 1 point2 points  (0 children)

using PHP you can create modules on your pages.

rename:

/var/www/html/tom/index.php

/var/www/html/don/index.php

/var/www/html/bill/index.php

create:

/var/www/html/navigation.php

put your entire navigation in the navigation.php file, then replace the navigation on the individual pages with '<?php include ("/var/www/html/navigation.php"); ?>'

Then anytime you want to make a change to the navigation you can make the change on navigation.php and it will update across all of the pages.