again...
This commit is contained in:
@@ -1975,21 +1975,29 @@ spec:
|
||||
set -e
|
||||
mkdir -p /app/assets
|
||||
|
||||
# 1) Extract all bookmark links into JSON (raw fields)
|
||||
yq -o=json '
|
||||
[ .pages[] as $p
|
||||
| ($p.columns[]?.widgets[]? | select(.type == "bookmarks")) as $w
|
||||
| .columns[]? as $c
|
||||
| $c.widgets[]? as $w
|
||||
| select($w.type == "bookmarks")
|
||||
| $w.groups[]? as $g
|
||||
| $g.links[]?
|
||||
| select(.url != null and .url != "")
|
||||
| {
|
||||
title: ((.title // .url) | tostring),
|
||||
url: (.url | tostring),
|
||||
page: ($p.name // "" | tostring),
|
||||
widget: ($w.title // "" | tostring),
|
||||
group: ($g.title // "" | tostring)
|
||||
title: (.title // ""),
|
||||
url: .url,
|
||||
page: ($p.name // ""),
|
||||
widget: ($w.title // ""),
|
||||
group: ($g.title // "")
|
||||
}
|
||||
] | unique_by(.url)
|
||||
' /config/glance.yml > /app/assets/bookmarks.json
|
||||
]
|
||||
' /config/glance.yml \
|
||||
| yq -o=json '
|
||||
map(.title = (if .title == "" then .url else .title end))
|
||||
| unique_by(.url)
|
||||
' - \
|
||||
> /app/assets/bookmarks.json
|
||||
|
||||
echo "Bookmarks indexed: $(yq -r 'length' /app/assets/bookmarks.json)"
|
||||
volumeMounts:
|
||||
|
||||
Reference in New Issue
Block a user