Domanda

I'm using Nginx SSI tags to include template files (header/footer/sidebar) in my website pages. However, I'm expected to deliver the HTML to the client and not actually run it on the browser.

The problem is: Every-time I want to export the site, I have to open each webpage, click 'save to' and replace the one with the SSI tags.

Is there a way to run nginx on these files and generate the HTML? Like nginx -c index.html or some other solution?

È stato utile?

Soluzione

SSI are meant to be run by a Nginx filter when serving pages, they are not a form of HTML shorthand (like SASS is for CSS).

Still, on Linux/MacOS (and Windows, if you download it) you can use wget to mirror you website. You will be requesting and getting all processed web pages that are (recursively) linked from the home page. Try with:

wget --mirror localhost:8080

or any other URL for your website.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top