Skip to content

Instantly share code, notes, and snippets.

@iTonyYo
Last active August 29, 2015 13:58
Show Gist options
  • Save iTonyYo/9929190 to your computer and use it in GitHub Desktop.
Save iTonyYo/9929190 to your computer and use it in GitHub Desktop.
Site icon link tags with jade template engine. Jade ' include ' allows you to insert the contents into another jade file simply.
//
Build Passing.
Doctype: HTML5
Jade: 1.3.0+
#TODO[x]: Site Icon
eg: http://www.example.com/[logo | favicon].[svg | jpg | gif | ico | png]
'address bar icon', IE5~7, eg: http://www.example.com/image.ico
#TODO[x]: Site Icon Setup Example
- var opts = {
a: {
rel: 'logo',
type: 'image/svg',
href:'logo.svg'
},
b: {
rel: 'icon',
type: 'image/gif',
href: 'favicon-32x32.gif'
},
c: {
rel: 'icon',
type: 'image/jpg',
href: 'favicon-32x32.jpg'
},
d: {
rel: 'icon',
type: 'image/vnd.microsoft.icon',
href: 'favicon.ico'
},
e: {
rel: 'shortcut icon',
type: 'image/x-icon',
href: 'favicon.ico'
},
f: {
rel: 'address bar icon',
type: 'image/x-icon',
href: 'favicon.ico'
},
g: {
rel: 'icon',
type: 'image/png',
href: 'favicon-16x16.png'
},
h: {
rel: 'icon',
type: 'image/png',
href: 'favicon-32x32.png'
},
i: {
rel: 'icon',
type: 'image/png',
href: 'favicon-96x96.png'
},
j: {
rel: 'icon',
type: 'image/png',
href: 'favicon-160x160.png'
},
k: {
rel: 'icon',
type: 'image/png',
href: 'favicon-196x196.png'
}
}
#TODO[x]: Dependencies
initialization.jade (//gist.github.com/Tony-Stark/9d7359ff69ef8336b151)
Author: 沈维忠 ( Shen Weizhong / Tony Stark )
Cell Phone: (+86) 15921299022
Github://github.com/Tony-Stark/
Trello: //trello.com/shenweizhong/
个人全球统一标识( Gravatar )://en.gravatar.com/swzcowboy/
个人主页( Personal Homepage )://tony-stark.github.io/
Linkedin://cn.linkedin.com/in/itonyyo/
Twitter: @iTonyYo, //twitter.com/iTonyYo/
Instagram://instagram.com/itonyyo/
Facebook://www.facebook.com/shenweizhong/
Google+: //plus.google.com/114960355664861539339/
Instagram: //instagram.com/itonyyo/
QQ:563214029, //user.qzone.qq.com/563214029/
Sina Weibo: //weibo.com/itonyyo/
WhatsApp:15921299022
微信( WeChat ):iTonyYo
Facebook Messenger:shenweizhong
Skype:live:swzyocowboy
Line:shenweizhong
Email: [email protected], [email protected], [email protected], [email protected], [email protected]
Version: 0.1.5-alpha
Creation Date: ~ ( Tony ).
Last Update: 2014.08.15 20:20 ( Tony ).
- var opts = {a: {rel: 'logo', type: 'image/svg', href:'logo.svg'}, b: {rel: 'icon', type: 'image/gif', href: 'favicon-32x32.gif'}, c: {rel: 'icon', type: 'image/jpg', href: 'favicon-32x32.jpg'}, d: {rel: 'icon', type: 'image/vnd.microsoft.icon', href: 'favicon.ico'}, e: {rel: 'shortcut icon', type: 'image/x-icon', href: 'favicon.ico'}, f: {rel: 'address bar icon', type: 'image/x-icon', href: 'favicon.ico'}, g: {rel: 'icon', type: 'image/png', href: 'favicon-16x16.png'}, h: {rel: 'icon', type: 'image/png', href: 'favicon-32x32.png'}, i: {rel: 'icon', type: 'image/png', href: 'favicon-96x96.png'}, j: {rel: 'icon', type: 'image/png', href: 'favicon-160x160.png'}, k: {rel: 'icon', type: 'image/png', href: 'favicon-196x196.png'}}
- each val, index in opts
if val.rel === 'address bar icon'
+ie('if lt IE 8]', '[endif')
link(rel=val.rel, type=val.type, href=val.href)
else
link(rel=val.rel, type=val.type, href=val.href)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment