mirror of
https://github.com/caddyserver/website.git
synced 2025-04-27 23:46:16 -04:00
docs: All-new design, along with many content updates in prep for RC1
This commit is contained in:
parent
fe58da0269
commit
3ecf039665
23 changed files with 562 additions and 435 deletions
|
@ -34,7 +34,7 @@ $(function() {
|
|||
// don't allow hoverbox to close anymore, we're re-opening it
|
||||
clearTimeout(hoverTimeout);
|
||||
|
||||
var pos = $(this).position();
|
||||
var pos = $(this).offset();
|
||||
|
||||
// there is a gap between the hoverbox and the link that originated it;
|
||||
// there may be a different link in this gap; if the hover box is visible,
|
||||
|
@ -43,7 +43,7 @@ $(function() {
|
|||
// visit the hoverbox while it is over a list of links that are tightly
|
||||
// stacked vertically; if user wants to visit hoverbox for link in this
|
||||
// gap, they can just move the cursor slow enough to fire the timeout
|
||||
if ($hovercard.is(':visible') && $hovercard.position().top - 10 < pos.top) {
|
||||
if ($hovercard.is(':visible') && $hovercard.offset().top - 10 < pos.top) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -159,8 +159,16 @@ function beginRendering(json) {
|
|||
renderData(pageData.structure, 0, "", $('<div class="group"/>'));
|
||||
console.log("DOCS:", pageDocs);
|
||||
|
||||
if ($('#field-list').html().trim()) {
|
||||
$('#field-list-header').show();
|
||||
if ($('#field-list-contents').html().trim()) {
|
||||
$('#field-list').show();
|
||||
}
|
||||
|
||||
// if the browser tried to navigate directly to an element
|
||||
// on the page when it loaded, it would have failed since
|
||||
// we hadn't rendered it yet; but now we can scroll to it
|
||||
// directly since rendering has finished
|
||||
if (window.location.hash) {
|
||||
window.location.hash = window.location.hash;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -291,7 +299,7 @@ function appendToFieldDocs(cleanFieldPath, fieldDoc) {
|
|||
if (canTraverse()) {
|
||||
dt = '<a href="./'+cleanFieldPath+'/">'+dt+'</a>';
|
||||
}
|
||||
$('#field-list').append('<dt class="field-name" id="'+cleanFieldPath+'"><a href="#'+cleanFieldPath+'" class="inline-link">🔗</a>'+dt+'</dt> <dd>'+fieldDoc+'</dd>');
|
||||
$('#field-list-contents').append('<dt class="field-name" id="'+cleanFieldPath+'"><a href="#'+cleanFieldPath+'" class="inline-link">🔗</a>'+dt+'</dt> <dd>'+fieldDoc+'</dd>');
|
||||
}
|
||||
|
||||
function indent(nesting, $group) {
|
||||
|
|
|
@ -18,7 +18,16 @@ $(function() {
|
|||
$currentPageLink.addClass('current');
|
||||
|
||||
// add anchor links, inspired by https://github.com/bryanbraun/anchorjs
|
||||
$('article h1[id],h2[id],h3[id],h4[id],h5[id],h6[id]').each(function() {
|
||||
$(this).append($('<a href="#'+this.id+'" class="anchor-link" aria-label="Anchor"></a>'));
|
||||
$('article > h1[id], article > h2[id], article > h3[id], article > h4[id], article > h5[id], article > h6[id]').each(function() {
|
||||
var $anchor = $('<a href="#'+this.id+'" class="anchor-link" title="Direct link">🔗</a>');
|
||||
$(this).append($anchor);
|
||||
});
|
||||
|
||||
// the server-side markdown renderer annoyingly renders
|
||||
// colored code blocks differently from plain ones, in that
|
||||
// colorized ones do not have the additional <code> inside
|
||||
// the <pre>; this line finds those and adds a .chroma class
|
||||
// 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');
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue