1

I want to create an file upload option for a favicon using the Theme Customization options: https://octobercms.com/docs/themes/development#customization

However, if I understand correctly, favcicons (and Apple Touch Icons) need to a) have a particular name and b) be located on the root directly (i.e., www.website.com/favicon.ico).

Is it possible to use the theme customization fileupload field and have the files uploaded to the root directory and given the names required to function as favicons and apple touch icons?

If so, any idea how?

Thanks.

4

3 回答 3

3
<link rel="icon" type="image/png" href="{{ 'assets/images/october.png'|theme }}">

将此代码放在您的布局文件中,并提供 favicon 的完整路径。

于 2018-05-21T10:54:33.770 回答
2

对于 favicon 和 Apple Touch 图标,您可以声明一个 href 属性

<link rel="icon" type="image/png" href="http://example.com/myicon.png">

<link rel="apple-touch-icon" href="touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="152x152" href="touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="180x180" href="touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="167x167" href="touch-icon-ipad-retina.png">

我们也可以安装这个免费插件:SEO Extension

于 2017-01-30T19:42:23.140 回答
0

您可以通过创建一个插件来实现它,该插件定义了一个新的表单小部件,该小部件可用于图像上传,然后用于为网站图标生成所需的文件。

于 2017-01-30T09:55:28.653 回答