I'm on pset5, trying to make a homepage with multiple HTML files. I want all the files to share the same navigation bar heading, implementing this in a way so that I don't have to copy the same code for it in every file. I've searched online and one way to do this seems to be to through SSI, where I include the following in each file, with "value" containing the HTML file I want to be implemented:
<!--#include file="value" -->
. However, CS50 IDE interprets this as a comment. Does CS50 simply not run SSI, am I doing it incorrectly, or is there a better way to include one html file in multiple at once?
Add a comment
|
1 Answer
SSI is not standard, so if the code does not work, the server may not support it, or the syntax is not adequate. It is not possible what you intend only with HTML or CSS, it is necessary to use some programming language suitable for the case such as PHP. The most "easy" is to use a framework like flask (with python) that allows you to do this easily through a template engine with jinja