【发布时间】:2018-11-09 04:07:57
【问题描述】:
我正在尝试转换在 localhost:2368 上运行的幽灵网站。我正在使用 buster,它使用 wget 从 localhost:2368 下载文件并将其变成静态网站。我的问题是 wget 将所有链接都引用为 localhost:2368。
<link rel="stylesheet" type="text/css"
href="http://localhost:2368/assets/styles/style.css">
我已经识别出生成静态网站时调用wget的buster代码:
if arguments['generate']:
command = ("wget "
"--recursive " # follow links to download entire site
"--convert-links " # make links relative
"--page-requisites " # grab everything: css / inlined images
"--no-parent " # don't go to parent level
"--directory-prefix {1} " # download contents to static/ folder
"--no-host-directories " # don't create domain named folder
"--restrict-file-name=unix " # don't escape query string
"{0}").format(arguments['--domain'], static_path)
我使用 py -m buster generate --domain=localhost:2368 来生成网站。我有什么方法可以生成这些文件并引用我的网站?例如,应该是 abc.com,而不是 localhost:2368。
【问题讨论】:
-
在所有文件中将
http://localhost:2368替换为http://example.com? -
谢谢,但是帖子太多了。
-
我认为自动化字符串替换比更改 wget 更容易。
-
我本来打算这样做作为最后的手段,但幸运的是设法得到了修复。希望这个帖子可以帮助那些将来被困在这里的人。
标签: wget ghost-blog