blog/themes/typing/scripts/cloudinary.js

14 lines
1.8 KiB
JavaScript

/*
* Put {% cloudinary folder/filename.jpg %} in your post.
* Change the username in data-src tag,
* and cloud name in layout/_partial/after-footer.ejs
* src is an animated svg generated from https://loading.io/
* More info:
* https://hexo.io/docs/tag-plugins
* https://hexo.io/api/tag
* https://cloudinary.com/documentation/responsive_images
*/
hexo.extend.tag.register('cloudinary', function (fileName) {
return '<img class="cld-responsive" data-src="https://res.cloudinary.com/curben/image/upload/w_auto,f_auto,q_auto,c_scale/c_limit,w_500/' + fileName + '" src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIiBjbGFzcz0ibGRzLXJpcHBsZSIgc3R5bGU9ImJhY2tncm91bmQ6MCUgMCUiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZjNDMwOSIgc3Ryb2tlLXdpZHRoPSIyIj48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiBjYWxjTW9kZT0ic3BsaW5lIiB2YWx1ZXM9IjA7NDAiIGtleVRpbWVzPSIwOzEiIGR1cj0iMSIga2V5U3BsaW5lcz0iMCAwLjIgMC44IDEiIGJlZ2luPSItMC41cyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiBjYWxjTW9kZT0ic3BsaW5lIiB2YWx1ZXM9IjE7MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxIiBrZXlTcGxpbmVzPSIwLjIgMCAwLjggMSIgYmVnaW49Ii0wLjVzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIvPjwvY2lyY2xlPjxjaXJjbGU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