mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 12:36:16 -04:00
docs: Add links to Caddyfile directives in code blocks (#82)
This commit is contained in:
parent
ec9e966e55
commit
99c602bf11
2 changed files with 21 additions and 0 deletions
|
@ -30,4 +30,20 @@ $(function() {
|
|||
// to the outer pre element, and our CSS file has a style to
|
||||
// ensure the inner code block does not produce extra padding
|
||||
$('article > pre:not(.chroma) > code:not(.cmd)').parent().addClass('chroma');
|
||||
|
||||
// Add links to Caddyfile directives in code blocks.
|
||||
// See include/docs-head.html for the whitelist bootstrapping logic
|
||||
$('pre.chroma .k')
|
||||
.filter(function (k, item) {
|
||||
return window.CaddyfileDirectives.includes(item.innerText);
|
||||
})
|
||||
.map(function(k, item) {
|
||||
$(item).html(
|
||||
'<a href="/docs/caddyfile/directives/' + item.innerText + '"'
|
||||
+ 'style="color: inherit;"'
|
||||
+ '>'
|
||||
+ item.innerText
|
||||
+ '</a>'
|
||||
);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue