Skip to content

Instantly share code, notes, and snippets.

@iTonyYo
Last active August 29, 2015 13:57
Show Gist options
  • Save iTonyYo/9889584 to your computer and use it in GitHub Desktop.
Save iTonyYo/9889584 to your computer and use it in GitHub Desktop.
Pre-Resolve DNS 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]: Pre-Resolve DNS
Firefox 3.5+, Chrome, Safari 5+ and IE 9+
Conditional comments were disabled in IE10.
However, IE10+ are much less buggy than the earlier ones.
So I supposed that they are the browser just like google
browser(A Level).
#TODO[X]: Setup Example
- var opts = {
ie9: true,
prefetchUrl: [
'//www.google-analytics.com/',
'//s17.cnzz.com/',
'//tony-stark.github.io/'
]
}
#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.7-alpha
Creation Date: ~ ( Tony ).
Last Update: 2014.08.15 20:16 ( Tony ).
- var opts = {ie9: true, prefetchUrl: ['//www.google-analytics.com/', '//s17.cnzz.com/', '//tony-stark.github.io/']}
mixin prefetch_loop (rel, urls)
- for (var i = 0; i < urls.length; i++)
link(rel=rel, href=urls[i])
meta(http-equiv='x-dns-prefetch-control', content='off')
if opts.ie9
+ie('if IE 9]', '[endif')
+prefetch_loop('prefetch', opts.prefetchUrl)
+ie('if gt IE 9]><!--', '--<![endif')
+prefetch_loop('dns-prefetch', opts.prefetchUrl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment