mirror of
https://github.com/caddyserver/website.git
synced 2025-04-24 22:16:15 -04:00
feat(redesign): better display on grouped by namespaces
This commit is contained in:
parent
982393ff91
commit
e6c6310277
2 changed files with 16 additions and 7 deletions
|
@ -39,12 +39,13 @@
|
|||
|
||||
function renderList(list) {
|
||||
if (groupBy === 'type') {
|
||||
const groupedData = packageManager.group(groupBy)
|
||||
const groupedData = Object.entries(packageManager.group(groupBy)).filter(([_, items]) => !!items.length)
|
||||
document.getElementById('side-panel-packages').innerHTML = `
|
||||
<div>
|
||||
${Object.keys(groupedData).map(k => `<a href="#${k}"> ${ k }</a>`).join('')}
|
||||
<h2 class="blue">Namespaces</h2>
|
||||
${groupedData.map(([k]) => `<a href="#${k}"> ${ k }</a>`).join('')}
|
||||
</div>`;
|
||||
document.getElementById('packages').innerHTML = Object.entries(groupedData).filter(([_, items]) => !!items.length).map(([category, items]) => `
|
||||
document.getElementById('packages').innerHTML = groupedData.map(([category, items]) => `
|
||||
<section id="${category}">
|
||||
<h2 class="blue">${category}</h2>
|
||||
<div class="card-list">${items.map(getCardTemplate).join('')}</div>
|
||||
|
|
|
@ -23,14 +23,13 @@ html {
|
|||
}
|
||||
|
||||
#side-panel-packages {
|
||||
padding-top: 32px;
|
||||
padding-bottom: 32px;
|
||||
}
|
||||
|
||||
#side-panel-packages>div {
|
||||
padding: 1rem 1rem 1rem 0;
|
||||
padding: 32px 1rem 1rem 0;
|
||||
overflow-y: scroll;
|
||||
width: 300px;
|
||||
width: 250px;
|
||||
max-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -46,7 +45,7 @@ html {
|
|||
gap: 48px;
|
||||
}
|
||||
|
||||
#packages>section>h2 {
|
||||
h2 {
|
||||
padding-bottom: 16px;
|
||||
color: rgb(14, 110, 189);
|
||||
border-color: rgb(14, 110, 189);
|
||||
|
@ -149,6 +148,15 @@ article {
|
|||
.filters {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.wrapper.list {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#side-panel-packages>div {
|
||||
overflow: unset;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
input,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue