css - 本地 Jekyll 服务与实际输出不同
问题描述
我对本地 Jekyll 服务和实际输出之间的差异有疑问。
第一张图是实际输出。Favicon 无法在网站上正确显示。
第二张图片是当地的 jekyll 服务。它正确显示了我的网站图标。
我已经尝试过其他人的答案,它正在改变 _config.yml,如下面的解释。
答案说修复此代码。
url: "http://flash-kim142.github.io"
至
url: "https://flash-kim142.github.io"
目前我favicon.png
的位置是/Desktop/Documents/Github/My Blog/assets
我应该更改此位置还是必须尝试其他方法?
解决方案
Your favicon
URL should be relative to your file, so use assets/<filename>.<extension>
. Don't include the whole hard-code path like Desktop/Documents/...
.
This is your generated code on your home page:
<!-- For all browsers -->
<link rel="stylesheet" href="/assets/css/main.css">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="shortcut icon" type="image/png" href="favicon.png">
<link rel="apple-touch-icon" sizes="180x180" href="/Documents/GitHub/My Blog/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/Documents/GitHub/My Blog/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/Documents/GitHub/My Blog/favicon-16x16.png">
<link rel="icon" type="image/png" href="/Documents/GitHub/My Blog/assets/favicon.png">
<link rel="mask-icon" href="/Documents/GitHub/My Blog/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/Documents/GitHub/My Blog/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="/Documents/GitHub/My Blog/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link href="/assets/favicon.png/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/>
But it should be like this:
<!-- For all browsers -->
<link rel="stylesheet" href="./assets/css/main.css">
<link rel="shortcut icon" href="./favicon.ico">
<link rel="shortcut icon" type="image/png" href="./favicon.png">
<link rel="apple-touch-icon" sizes="180x180" href="./apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./favicon-16x16.png">
<link rel="icon" type="image/png" href="./assets/favicon.png">
<link rel="mask-icon" href="./safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="./favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="./browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link href="/assets/favicon.png/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/>
推荐阅读
- java - 关于如何将数据键入移动应用程序的盒装空间的建议
- python - 我必须从多个文本文件(.txt)中识别段落并创建一个数据框 [paragraph1, "text of the file1 in paragraphs"]
- python-3.x - Altair 中具有自定义置信区间的折线图
- oracle - java.sql.SQLDataException: ORA-01830: 日期格式图片在转换整个输入字符串之前结束 (Oracle)
- javascript - 我必须在 D3 中使用“+(x)+”、“+(y)+”什么?而不是使用 d3.event.x&d3.event.y?
- python - 使用参数返回不同值的 Lambda 函数
- winapi - 如何在 Direct2D 窗口应用程序中使用 DXGI 翻转模型?
- scala - 在 Scala 中处理两个选项
- apache-kafka - 无法从使用 aiosfstream(Salesforce 的 Python 库)订阅的频道批量接收消息
- django - 无法将面板添加到 openstack django Horizon