Update README and index.html for enhanced metadata and visuals. Added a thumbnail link to README and improved SEO with Open Graph and Twitter meta tags in index.html, including updated title and description for better social sharing.
Browse files- .gitattributes +1 -0
- README.md +1 -0
- frontend/index.html +19 -1
- frontend/og.png +3 -0
- scripts/make_og.py +35 -0
.gitattributes
CHANGED
|
@@ -34,3 +34,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
*.wav filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -10,6 +10,7 @@ app_file: app.py
|
|
| 10 |
pinned: false
|
| 11 |
license: mit
|
| 12 |
short_description: A vending machine app that generates endless chill beats
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 10 |
pinned: false
|
| 11 |
license: mit
|
| 12 |
short_description: A vending machine app that generates endless chill beats
|
| 13 |
+
thumbnail: https://build-small-hackathon-lofinity.hf.space/static/og.png
|
| 14 |
---
|
| 15 |
|
| 16 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
frontend/index.html
CHANGED
|
@@ -3,7 +3,25 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 6 |
-
<title>LoFinity</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
| 8 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| 9 |
<link
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="utf-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 6 |
+
<title>LoFinity β chill beats, freshly vended</title>
|
| 7 |
+
<meta name="description" content="A magical vending machine that dispenses endless lofi cassette tapes. Tell it a vibe; it brews you a beat." />
|
| 8 |
+
|
| 9 |
+
<!-- Open Graph / Discord / social preview (single-line per tag so simple
|
| 10 |
+
scrapers parse them). Absolute URLs point at the deployed Space;
|
| 11 |
+
the image is built by scripts/make_og.py. -->
|
| 12 |
+
<meta property="og:type" content="website" />
|
| 13 |
+
<meta property="og:site_name" content="LoFinity" />
|
| 14 |
+
<meta property="og:title" content="LoFinity β chill beats, freshly vended" />
|
| 15 |
+
<meta property="og:description" content="A magical vending machine that dispenses endless lofi cassette tapes. Tell it a vibe; it brews you a beat." />
|
| 16 |
+
<meta property="og:url" content="https://build-small-hackathon-lofinity.hf.space/" />
|
| 17 |
+
<meta property="og:image" content="https://build-small-hackathon-lofinity.hf.space/static/og.png" />
|
| 18 |
+
<meta property="og:image:width" content="1200" />
|
| 19 |
+
<meta property="og:image:height" content="630" />
|
| 20 |
+
<meta property="og:image:alt" content="LoFinity title screen β chill beats, freshly vended" />
|
| 21 |
+
<meta name="twitter:card" content="summary_large_image" />
|
| 22 |
+
<meta name="twitter:title" content="LoFinity β chill beats, freshly vended" />
|
| 23 |
+
<meta name="twitter:description" content="A magical vending machine that dispenses endless lofi cassette tapes." />
|
| 24 |
+
<meta name="twitter:image" content="https://build-small-hackathon-lofinity.hf.space/static/og.png" />
|
| 25 |
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
| 26 |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
| 27 |
<link
|
frontend/og.png
ADDED
|
Git LFS Details
|
scripts/make_og.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Fit a screenshot into the 1200x630 Open Graph image for the Space.
|
| 2 |
+
|
| 3 |
+
Cover-crops (scale-to-fill, centred) the given image to 1200x630 and writes
|
| 4 |
+
frontend/og.png β the file the OG tags in index.html and the README thumbnail
|
| 5 |
+
point at. Pass a screenshot of the app; re-run whenever you want a new one.
|
| 6 |
+
|
| 7 |
+
python scripts/make_og.py ~/Desktop/shot.png
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
import sys
|
| 11 |
+
from pathlib import Path
|
| 12 |
+
|
| 13 |
+
from PIL import Image
|
| 14 |
+
|
| 15 |
+
ROOT = Path(__file__).resolve().parent.parent
|
| 16 |
+
OUT = ROOT / "frontend" / "og.png"
|
| 17 |
+
W, H = 1200, 630 # the ratio Discord/OG previews expect (1.91:1)
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def main():
|
| 21 |
+
if len(sys.argv) < 2:
|
| 22 |
+
print("usage: python scripts/make_og.py <screenshot>")
|
| 23 |
+
return 1
|
| 24 |
+
src = Image.open(sys.argv[1]).convert("RGB")
|
| 25 |
+
sw, sh = src.size
|
| 26 |
+
scale = max(W / sw, H / sh) # cover: fill the frame, crop the overflow
|
| 27 |
+
resized = src.resize((round(sw * scale), round(sh * scale)), Image.LANCZOS)
|
| 28 |
+
nw, nh = resized.size
|
| 29 |
+
left, top = (nw - W) // 2, (nh - H) // 2
|
| 30 |
+
resized.crop((left, top, left + W, top + H)).save(OUT, "PNG", optimize=True)
|
| 31 |
+
print(f"wrote {OUT.relative_to(ROOT)} ({OUT.stat().st_size // 1024} KB, {W}x{H})")
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
if __name__ == "__main__":
|
| 35 |
+
sys.exit(main())
|