Fix opengraph icons

This commit is contained in:
2021-11-10 19:30:49 +01:00
parent 04fb4e5b27
commit e99a00e369
6 changed files with 17 additions and 24 deletions

View File

@@ -28,8 +28,8 @@
window.user_authenticated = {{.Authenticated}};
</script>
<link rel='stylesheet' href='/res/svelte/file_viewer.css?v1'>
<script defer src='/res/svelte/file_viewer.js?v1'></script>
<link rel='stylesheet' href='/res/svelte/file_viewer.css?v3'>
<script defer src='/res/svelte/file_viewer.js?v3'></script>
{{template "analytics"}}
</head>

View File

@@ -224,10 +224,10 @@
</div>
<div>
<div class="feat_label">
Bandwidth
Download speed
</div>
<div class="feat_normal">
Up to 8 MiB/s, may be slower during busy periods
Up to 4 MiB/s, may be slower during busy periods
</div>
<div class="feat_pro">
<span class="text_highlight">High priority</span>

View File

@@ -13,6 +13,8 @@ let set_ad_type = (t) => {
} else if (ad_type === "adaround") {
adaround_load.set(true)
}
console.log("leaderboard ad is " + t)
}
onMount(() => {
@@ -24,27 +26,23 @@ onMount(() => {
}
}
switch (Math.floor(Math.random() * 10)) {
switch (Math.floor(Math.random() * 6)) {
case 0:
set_ad_type("publisherrest_1")
break
case 1:
set_ad_type("publisherrest_3")
break
case 2:
case 3:
set_ad_type("brave")
break
case 4:
case 5:
case 2:
set_ad_type("aads1")
break
case 3:
set_ad_type("ads.plus")
break
case 6:
case 7:
case 4:
set_ad_type("pixfuture")
break
case 8:
case 9:
case 5:
set_ad_type("adaround")
break
}

View File

@@ -14,6 +14,8 @@ let set_ad_type = (t) => {
} else if (ad_type === "adaround") {
adaround_load.set(true)
}
console.log("skyscraper ad is " + t)
}

View File

@@ -59,12 +59,14 @@ func (wc *WebController) metadataFromFile(f pixelapi.FileInfo) (og ogData) {
og.addLink("image_src", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
} else if strings.HasPrefix(f.MimeType, "audio") {
og.addProp("og:type", "music.song")
og.addProp("og:image", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
og.addProp("og:audio", wc.websiteAddress+"/api/file/"+f.ID)
og.addProp("og:audio:secure_url", wc.websiteAddress+"/api/file/"+f.ID)
og.addProp("og:audio:type", f.MimeType)
og.addLink("image_src", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
} else {
og.addProp("og:type", "website")
og.addProp("og:image", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
og.addLink("image_src", wc.websiteAddress+"/api/file/"+f.ID+"/thumbnail")
}
return og

View File

@@ -114,15 +114,6 @@ type hsl struct {
Lightness float64
}
func (h hsl) cssString() string {
return fmt.Sprintf(
"hsl(%d, %.3f%%, %.3f%%)",
h.Hue,
h.Saturation*100,
h.Lightness*100,
)
}
func (orig hsl) RGB() string {
var r, g, b, q, p float64
var h, s, l = float64(orig.Hue) / 360, orig.Saturation, orig.Lightness