静态页面的动态创建...(我问这个不是因为我想这样做,而是因为我必须...)

发布于 2024-07-13 10:04:14 字数 1072 浏览 4 评论 0原文

有谁知道一个用于将静态页面串在一起的实用程序。

例如:
假设我写了一个页面的页眉和页脚,我只想更改内容而不****叹****动态生成页面的内容。 (IE页面是动态生成的,但最终结果只是一个要转储到FTP目录中的静态页面。)

我通常不赞成这样做 没有类似的东西 网络服务器上的Tiles服务器端包含,但不幸的是我的 雇主__有...__他们有使用 静态页面,我无能为力 改变他们的想法。 (C++ 程序员)

我发现的与我在这里描述的最接近的东西是一个名为 cook 用于构建 tiddlywiki

对,所以一个实用程序可以采用以下目录:

  • 静态页面部件
    • 标题.htm
    • 页脚.htm
  • 更改的部分
    • about.htm
    • 信息.htm
    • 产品.htm
    • 等.htm

并将其更改为:

  • 网站建设
    • about.htm(包含页眉和页脚以及 /Parts that Change/about.htm 的内容)
    • info.htm(同样的位...)
    • products.htm(同样的位...)
    • etc.htm(同样的位...)

Does anyone know of a utility for ****ahem**** stringing together static pages.

For instance:
Say I wrote a header and a footer of a page, and I only wanted to change the content without ****sigh**** dynamically generating the content of the page. (I.E. the page is dynamically generated, but the end result is just a static page to be dumped into an FTP directory.)

I don't normally endorse doing this
sort of thing without something like
Tiles or serverside includes on a webserver, but unfortunately my
employer __does...__they have use
static pages and there's nothing I can
do to change their minds. (C++
Programmers)

The closest thing to what I am describing here that I have found would be a utility called cook that's used to build tiddlywiki.

Right, so a utility that can take a directory of:

  • Static Page Parts
    • Header.htm
    • Footer.htm
  • Parts that Change
    • about.htm
    • info.htm
    • products.htm
    • etc.htm

And change it into:

  • Site Build
    • about.htm (with header and footer as well as content of /Parts that Change/about.htm) in between
    • info.htm (same bit...)
    • products.htm (same bit...)
    • etc.htm (same bit...)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

柠栀 2024-07-20 10:04:14

听起来像是 Webby 的工作。

Sounds like a job for Webby.

并安 2024-07-20 10:04:14

听起来你想要的最终结果是需要 N 个文件并将内容拼接到静态 HTML 页面中,该页面会上传到我假设的网络服务器。 那个听起来是对的吗?

我认为 Dreamweaver 具有该功能,但如果您想要更底层的功能,请使用此算法:

load config file that you use for build parameters
open stream to output file
for each file in source folder 
    load to stream
    write to output stream
close output stream
post file to remote site

编辑页面后,只需让您的客户端运行此处理器即可。 如果我完全误解了您想要完成的任务,请告诉我。

编辑:您还可以尝试在“动态”页面中放入某种令牌(%HEADER%,%FOOTER%等),并且当您的处理器遇到该令牌时,将其替换为实际的静态内容。

Sounds like what you want the end result is something that will take N files and stitch the content into a static HTML page that gets uploaded to what I'm assuming is a webserver. Does that sound about right?

I think Dreamweaver has that functionality, but if you want something a little more low level, use this algorithm:

load config file that you use for build parameters
open stream to output file
for each file in source folder 
    load to stream
    write to output stream
close output stream
post file to remote site

Once your pages have been edited, just have your client run this processor. Please let me know if I've totally mis-interpreted what your trying to accomplish.

EDIT: You can also try putting some kind of token in your "dynamic" pages (%HEADER%, %FOOTER%, etc..) and when ever your processor encounters that token replace it with the actual static content.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文