将静态站点生成器与php集成 [英] Intergrating Static Site generators with php

查看:43
本文介绍了将静态站点生成器与php集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用php建立一个不需要定期更新的网站,并且我考虑使用静态网站生成器,因为它将具有类似Blog的功能.但是我的网站包含一个将与数据库链接的表格,而我遇到的问题是静态网站生成器无法识别和解析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

推荐答案

在Jekyll中,您可以使用{% raw %}标记来避免处理文件的特定部分.例如:

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.

处理后,以上内容应翻译为This will be <?php echo("parsed"); ?> correctly.

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

这篇关于将静态站点生成器与php集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆