Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intergrating Static Site generators with php

I'm currently building a website using php that won't need regular updating and I thought of using static site generators as it will have a blog like feature. However my website contains a form the will link with a database and the problem i'm having is that the static site generators don't recognize and parse php.

I am currently considering using one of three static site generators -Jekyll -wintersmith - Piecrust

I was wondering if this can be done or are static site generators just for static pages

like image 666
Omar Flores Avatar asked Oct 01 '13 19:10

Omar Flores


People also ask

Can a static website use PHP?

The PHP to static HTML works quickly and effectively, to take the information and create fully functional, SEO friendly pages, without the trapped header or slugs limitation often associated with CMS programming. It can even include breadcrumbs or anything, really, that fits into a traditional web page.

Is Hugo better than Jekyll?

Conclusion - they're both great options. There are not a lot of things that Hugo can do but Jekyll cannot and vice versa. For some sites with thousands of pages, Hugo is a must because of its build speed. For others, Jekyll can be a must because of a few plugins with specific functionalities not found in Hugo.


1 Answers

In Jekyll, you can use the {% raw %} tag to avoid processing a specific part of your files. For example:

This will be {% raw %}<?php echo("parsed"); ?>{% endraw %} correctly.

After processing, the above should be translated to This will be <?php echo("parsed"); ?> correctly.

like image 81
agarie Avatar answered Oct 19 '22 22:10

agarie