2020-03-26 12:57:10 -06:00
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
// Algolia search
|
|
|
|
docsearch({
|
|
|
|
apiKey: '14275a785f6ebd31d162f9d2d8fc0125',
|
|
|
|
indexName: 'caddyserver',
|
|
|
|
inputSelector: '#search',
|
2020-03-26 13:00:57 -06:00
|
|
|
debug: false // Set debug to true if you want to inspect the dropdown
|
2020-03-26 12:57:10 -06:00
|
|
|
});
|
|
|
|
});
|
2020-07-16 15:51:46 -06:00
|
|
|
|
|
|
|
const caddyImportPath = 'github.com/caddyserver/caddy/v2';
|
|
|
|
|
|
|
|
function isStandard(packagePath) {
|
|
|
|
return packagePath.startsWith(caddyImportPath);
|
|
|
|
}
|
|
|
|
|
|
|
|
function substrBeforeLastDot(s) {
|
|
|
|
return s.substr(0, s.lastIndexOf('.'))
|
|
|
|
}
|
|
|
|
|
|
|
|
function substrAfterLastDot(s) {
|
|
|
|
return s.substr(s.lastIndexOf('.'))
|
|
|
|
}
|
|
|
|
|
|
|
|
function truncate(str, len) {
|
|
|
|
if (!str) return "";
|
|
|
|
var startLen = str.length;
|
|
|
|
str = str.substring(0, len);
|
|
|
|
if (startLen > len) {
|
|
|
|
str += "...";
|
|
|
|
}
|
|
|
|
return str;
|
|
|
|
}
|