startpage/bookmark.go

208 lines
5.4 KiB
Go
Raw Normal View History

2022-05-08 14:32:13 +02:00
package main
2022-05-12 21:15:55 +02:00
import (
"sort"
"strings"
)
2022-05-08 14:32:13 +02:00
var (
Bookmarks = []Bookmark{
{
Title: "DuckDuckGo",
Image: "https://duckduckgo.com/assets/logo_homepage.alt.v108.svg",
Link: "https://duckduckgo.com/",
Color: "#e37151",
2022-05-08 14:32:13 +02:00
},
2022-05-08 21:43:47 +02:00
{
Title: "Cloud",
Image: "https://cloud.tordarus.net/svg/core/logo/logo?color=ffffff&v=1",
Link: "https://cloud.tordarus.net/",
Color: "#007ec2",
},
{
Title: "Torrents",
Image: "/transmission.png",
Link: "https://torrents.tordarus.net/",
Color: "#e7402c",
},
2022-05-09 17:13:58 +02:00
{
Title: "Nyaa.si",
Image: "https://progsoft.net/images/nyaa-v2-icon-a591b5ae622eb38f31c00297cf9b53fd88c058ef.png",
Link: "https://nyaa.si/",
Color: "#e7402c",
ImageSize: "111%",
IconPadding: "0em",
},
2022-05-08 21:43:47 +02:00
{
Title: "Adblock",
Image: "/pihole.svg",
Link: "https://adblock.tordarus.net/",
Color: "#272c30",
},
2022-05-08 14:32:13 +02:00
{
Title: "Postbank",
2022-05-08 16:24:00 +02:00
Image: "https://wintouch.de/wp-content/uploads/2014/06/Postbank-Icon.png",
2022-05-12 21:15:55 +02:00
Link: "https://meine.postbank.de/",
Color: "#ffcc00",
},
{
Title: "DKB",
Image: "https://vdiv-sa.de/wp-content/uploads/2016/08/DKB_AG_web_RGB.jpg",
Link: "https://www.dkb.de/",
Color: "#ffffff",
2022-05-08 14:32:13 +02:00
},
2022-05-08 16:17:57 +02:00
{
Title: "Finanzen",
Image: "https://docs.firefly-iii.org/img/logo.png",
Link: "https://finance.tordarus.net",
Color: "#ffffff",
ImageSize: "cover",
IconPadding: "0em",
},
2022-05-08 14:32:13 +02:00
{
2022-05-08 16:24:00 +02:00
Title: "YouTube",
Image: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/42/YouTube_light_icon_%282017%29.svg/1280px-YouTube_light_icon_%282017%29.svg.png",
Color: "#ff0000",
Link: "https://www.youtube.com/",
IconPadding: "1.5em",
2022-05-08 14:32:13 +02:00
},
2022-05-08 21:43:47 +02:00
{
Title: "Netflix",
Image: "https://1000logos.net/wp-content/uploads/2017/05/emblem-Netflix.jpg",
Color: "#000000",
Link: "https://www.netflix.com/",
},
2022-05-08 14:32:13 +02:00
{
Title: "Jisho",
Image: "https://assets.jisho.org/assets/jisho-logo-v4@2x-7330091c079b9dd59601401b052b52e103978221c8fb6f5e22406d871fcc746a.png",
2022-05-08 16:17:57 +02:00
Link: "https://jisho.org/",
2022-05-08 14:32:13 +02:00
Color: "#ffffff",
},
{
Title: "Wadoku",
Image: "https://www.wadoku.de/img/wadoku_logo.svg",
Link: "https://www.wadoku.de/",
Color: "#ffffff",
},
{
Title: "Übersetzer",
Image: "https://tools.avans.nl/tools/image/wZkdyaMblN.jpg",
Link: "https://www.deepl.com/translator",
Color: "#042b48",
ImageSize: "cover",
IconPadding: "0em",
2022-05-08 14:32:13 +02:00
},
{
Title: "WaniKani",
Image: "https://assets.wanikani.com/assets/logo--retro-colors-b79775af8773b5a416e4ec3fae02e62d391b7e88e57f9fe0c2e4997a3383b002.png",
Link: "https://www.wanikani.com/",
Color: "#ffffff",
},
{
Title: "Passwörter",
Image: "https://raw.githubusercontent.com/dani-garcia/vaultwarden/main/resources/vaultwarden-logo-white.svg",
Link: "https://pw.tordarus.net",
Color: "#175ddc",
},
{
Title: "Projekte",
2022-05-09 17:13:58 +02:00
Image: "/gitea.png", //"https://git.tordarus.net/assets/img/logo.svg",
Link: "https://git.tordarus.net",
Color: "#609926",
ImageSize: "cover",
IconPadding: "0em",
2022-05-08 14:32:13 +02:00
},
2022-05-08 21:43:47 +02:00
{
Title: "Regexr",
Image: "https://raw.githubusercontent.com/gskinner/regexr/master/dev/icons/RegExr.svg",
Link: "https://regex.tordarus.net",
Color: "#101112",
ImageSize: "contain",
IconPadding: "0em",
},
2022-05-08 14:32:13 +02:00
{
Title: "Wikipedia",
Image: "https://upload.wikimedia.org/wikipedia/commons/8/80/Wikipedia-logo-v2.svg",
Link: "https://www.wikipedia.org/",
Color: "#ffffff",
},
{
Title: "Reddit",
Image: "https://www.redditinc.com/assets/images/site/reddit-logo.png",
Link: "https://www.reddit.com/",
Color: "#ff4300",
ImageSize: "cover",
IconPadding: "0em",
2022-05-08 14:32:13 +02:00
},
{
Title: "Tagesschau",
Image: "https://m47ch.com/wp-content/uploads/2010/12/Tagesschau.png",
2022-05-08 16:02:39 +02:00
Link: "https://www.tagesschau.de/",
2022-05-08 14:32:13 +02:00
Color: "#003f8c",
},
{
Title: "Golem",
Image: "https://www.golem.de/staticrl/images/golem-logo-opt2.svg",
Link: "https://www.golem.de/",
Color: "#000000",
},
{
Title: "Comico",
Image: "https://play-lh.googleusercontent.com/xZ5bfg-XfyEmM1641bXduE27w44OmyWeVspg626wRYF0ejAgZAvsRKP4sECblfmnpg=w512",
Link: "https://comico.jp/",
Color: "#f40000",
ImageSize: "cover",
IconPadding: "0em",
2022-05-08 14:32:13 +02:00
},
{
Title: "Manganelo",
Image: "https://manganato.com/themes/hm/images/logo.png",
Link: "https://manganato.com/",
Color: "#ffffff",
ImageSize: "contain",
IconPadding: "0em",
2022-05-08 14:32:13 +02:00
},
2022-05-08 16:17:57 +02:00
{
Title: "Manga List",
Image: "https://www.firstcomicsnews.com/wp-content/uploads/2020/09/manga-logo.png",
Link: "https://manga.tordarus.net/",
Color: "#be151b",
},
2022-05-08 14:32:13 +02:00
}
)
type Bookmark struct {
Title string
Image string
ImageSize string
IconPadding string
Color string
Link string
HideBorder bool
Order int
}
func ParseBookmarks() {
// set default values
for i := range Bookmarks {
if Bookmarks[i].Color == "" {
Bookmarks[i].Color = DefaultSettings.Background
}
if Bookmarks[i].ImageSize == "" {
Bookmarks[i].ImageSize = "contain"
}
}
sort.SliceStable(Bookmarks, func(i, j int) bool {
return Bookmarks[i].Order < Bookmarks[j].Order
})
}
2022-05-12 21:15:55 +02:00
func (b *Bookmark) SmallLink() string {
lnk := b.Link
lnk = strings.TrimPrefix(lnk, "https://")
lnk = strings.TrimPrefix(lnk, "http://")
lnk = strings.TrimSuffix(lnk, "/")
return lnk
}