S3 上的 Pelican:主题无法正确呈现
Pelican on S3: theme not rendering properly
我已经按照 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.
I 运行 make s3_upload
有和没有 --guess-mime-type
选项。无论哪种情况,我都确保我的 s3 存储桶 中的 css
文件具有正确的 MIME 类型 (text/plain) 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 指令未被识别)。我没有在我的测试降价文档中添加任何内联 css。
为什么博客无法从 s3 正确呈现?我应该在哪里寻找错误日志?谢谢。
编辑:
我 运行 通过 http://jigsaw.w3.org/css-validator/ 的博客,得到了 "Congratulation, no error found" & "This document validates as CSS level 3".
假设博客的 URI 是 www.theuser.com
,我还尝试将 pelicanconf.py
的 SITEURL
设置为
SITEURL = 'http://s3.amazonaws.com/theuser.com'
SITEURL = 'http://theuser.com'
我不确定在解决上述问题时我还破坏了什么,但是删除 python-magic
就成功了。
显然 python-magic
不允许 s3cmd
设置正确的 mime 类型,特别是对于 CSS 文件:它们的 mime 类型默认为 text/plain
。 CSS mime-type 必须在 S3 上设置为 text/css
否则 CSS 文件将被忽略。
这 link 让我走上正轨:http://worklog.kevinclarke.info/2014/08/28/fixing-css-mime-type-for-s3-octopress/
我已经按照 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.
I 运行 make s3_upload
有和没有 --guess-mime-type
选项。无论哪种情况,我都确保我的 s3 存储桶 中的 CSS 文件必须有 text/css 作为 mime 类型:css
文件具有正确的 MIME 类型 (text/plain)
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 指令未被识别)。我没有在我的测试降价文档中添加任何内联 css。
为什么博客无法从 s3 正确呈现?我应该在哪里寻找错误日志?谢谢。
编辑:
我 运行 通过 http://jigsaw.w3.org/css-validator/ 的博客,得到了 "Congratulation, no error found" & "This document validates as CSS level 3".
假设博客的 URI 是 www.theuser.com
,我还尝试将 pelicanconf.py
的 SITEURL
设置为
SITEURL = 'http://s3.amazonaws.com/theuser.com'
SITEURL = 'http://theuser.com'
我不确定在解决上述问题时我还破坏了什么,但是删除 python-magic
就成功了。
显然 python-magic
不允许 s3cmd
设置正确的 mime 类型,特别是对于 CSS 文件:它们的 mime 类型默认为 text/plain
。 CSS mime-type 必须在 S3 上设置为 text/css
否则 CSS 文件将被忽略。
这 link 让我走上正轨:http://worklog.kevinclarke.info/2014/08/28/fixing-css-mime-type-for-s3-octopress/