Support maxBookmarkGroupColumns too

This commit is contained in:
shamoon 2025-03-17 13:03:04 -07:00
parent 708c4e64d1
commit a3b693e2b6
No known key found for this signature in database
3 changed files with 16 additions and 3 deletions

View File

@ -264,13 +264,19 @@ fullWidth: true
### Maximum Group Columns
You can set the maximum number of columns of service groups on larger screen sizes (groups with `style: columns` which is default) by adding:
You can set the maximum number of columns of groups on larger screen sizes (note this is only for groups with the default `style: columns`, not groups with `stle: row`) by adding:
```yaml
maxGroupColumns: 8 # default is 4, max 8
maxGroupColumns: 8 # default is 4 for services, 6 for bookmarks, max 8
```
By default homepage will max out at 4 columns (thus the minimum for this setting is _5_). Of course, if you're setting this to higher numbers, you may want to consider enabling the [fullWidth](#full-width) option as well.
By default homepage will max out at 4 columns for services and 6 for bookmarks, thus the minimum for this setting is _5_. Of course, if you're setting this to higher numbers, you may want to consider enabling the [fullWidth](#full-width) option as well.
If you want to set the maximum columns for bookmark groups separately, you can do so by adding:
```yaml
maxBookmarkGroupColumns: 6 # default is 6, max 8
```
### Collapsible sections

View File

@ -12,6 +12,7 @@ export default function BookmarksGroup({
disableCollapse,
groupsInitiallyCollapsed,
bookmarksStyle,
maxGroupColumns,
}) {
const panel = useRef();
@ -25,6 +26,9 @@ export default function BookmarksGroup({
className={classNames(
"bookmark-group flex-1 overflow-hidden",
layout?.style === "row" ? "basis-full" : "basis-full md:basis-1/4 lg:basis-1/5 xl:basis-1/6",
layout?.style !== "row" && maxGroupColumns && parseInt(maxGroupColumns, 10) > 6
? `3xl:basis-1/${maxGroupColumns}`
: "",
layout?.header === false ? "px-1" : "p-1 pb-0",
)}
>

View File

@ -334,6 +334,7 @@ function Home({ initialSettings }) {
bookmarks={group}
layout={settings.layout?.[group.name]}
disableCollapse={settings.disableCollapse}
maxGroupColumns={settings.maxBookmarkGroupColumns ?? settings.maxGroupColumns}
groupsInitiallyCollapsed={settings.groupsInitiallyCollapsed}
/>
),
@ -362,6 +363,7 @@ function Home({ initialSettings }) {
bookmarks={group}
layout={settings.layout?.[group.name]}
disableCollapse={settings.disableCollapse}
maxGroupColumns={settings.maxBookmarkGroupColumns ?? settings.maxGroupColumns}
groupsInitiallyCollapsed={settings.groupsInitiallyCollapsed}
bookmarksStyle={settings.bookmarksStyle}
/>
@ -378,6 +380,7 @@ function Home({ initialSettings }) {
settings.layout,
settings.fiveColumns,
settings.maxGroupColumns,
settings.maxBookmarkGroupColumns,
settings.disableCollapse,
settings.useEqualHeights,
settings.cardBlur,