zqjimlove / hexo-cdnify Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
<img data-src="__default__">
<img src="//cdn">
<link rel="apple-touch-icon" href="__default__">
<link rel="icon" href="_default___">
<link rel="shortcut icon" href="__default__">
<link rel="stylesheet" href="__default__">
<script src="__default__"></script>
<source src="__default__"></source>
Is it possible to add support for css files, so also fonts and images in css can be loaded from the cdn?
e.g.
@font-face {
font-family: 'Titillium Web';
font-style: normal;
font-weight: 600;
src: local('Titillium WebSemiBold'), local('TitilliumWeb-SemiBold'), url(fonts/anMUvcNT0H1YN4FII8wpr46gJz9aNFrmnwBdd69aqzY.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
font-display: swap;
}
Furthermore I also have some inline styles loading images.
<span style="background-image:url(/images/6b7f0cf87fd84937834f07bb6719c0e521445911.png)" alt="Use the ACME DNS-Challenge to get a TLS certificate" class="thumbnail-image"></span>
I want to replace it to cdn.com/blog/
instead of cdn.com
What should I do, I was tried to insert the base as https://cdn.com/blog/
but it doesn't work
I have added an options.local
for example http://127.0.0.1
to allow for rewriting localhost urls to cdn urls like this:
rewriteURL = function(origUrl) {
if (options.local) {
if (origUrl.indexOf(options.local) === 0) {
origUrl = origUrl.replace(options.local,'')
}
}
return isLocalPath(origUrl) ? Url.resolve(base, origUrl) : origUrl;
},
I am posting here in case anyone can find this useful or if you want to add this permanently.
对某个标签的某个字段的数据,通过配置正则表达式和替换内容,进行自动替换。
这样适用性更广也更灵活。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.