gpt4 book ai didi

css - S3 上的鹈鹕 : theme not rendering properly

转载 作者:行者123 更新时间:2023-11-28 10:15:38 24 4
gpt4 key购买 nike

我已经按照 http://docs.getpelican.com/en/3.5.0/quickstart.html#installation 中的说明在虚拟环境中安装了 Pelican。 .正在运行 make html然后 make serve确实在 localhost:8000 上产生了预期的结果:内容和主题按预期呈现。但是,本地服务器发出警告:

WARNING:root:Unable to find file /favicon.ico/index.html or variations.

我运行 make s3_upload有和没有 --guess-mime-type选项。无论哪种情况,我都会确保 css我的 s3 存储桶中的文件 具有正确的 mime 类型(文本/纯文本) CSS 文件必须具有 text/css 作为 mime 类型:

 Done: Processed 1 article(s), 0 draft(s) and 0 page(s) in 0.35 seconds.
s3cmd sync /home/theuser/virtualenvs/pelican/theblog/output/ s3://theuser.com --acl-public --delete-removed --guess-mime-type

文件上传到 s3 但博客没有正确呈现(显然 css 指令无法识别)。我没有在我的测试 Markdown 文档中添加任何内联 css。

为什么博客无法从 s3 正确呈现?我应该在哪里寻找错误日志?谢谢。

编辑:

我通过 http://jigsaw.w3.org/css-validator/ 运行博客,并得到“恭喜,未发现错误”和“本文档验证为 CSS 级别 3”。

假设博客的 URI 是 www.theuser.com ,我也试过设置 pelicanconf.pySITEURL作为

 SITEURL =  'http://s3.amazonaws.com/theuser.com'
SITEURL = 'http://theuser.com'

最佳答案

我不确定在解决上述问题时我还破坏了什么,但是删除 python-magic 就可以了。

显然 python-magic 不允许通过 s3cmd 设置正确的 mime 类型,特别是对于 CSS 文件:它们的 mime 类型默认为 text/普通。 CSS mime-type 必须在 S3 上设置为 text/css,否则 CSS 文件将被忽略。

这个链接让我走上了正确的轨道:http://worklog.kevinclarke.info/2014/08/28/fixing-css-mime-type-for-s3-octopress/

关于css - S3 上的鹈鹕 : theme not rendering properly,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29549630/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com