basic video fetching
This commit is contained in:
parent
48642bdd96
commit
cca6660c95
4 changed files with 177 additions and 0 deletions
29
templates/videos.html
Normal file
29
templates/videos.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Video Results</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1>Video Results</h1>
|
||||
{{ if .Results }}
|
||||
{{ range .Results }}
|
||||
<div class="video-result">
|
||||
<h2>{{ .Title }}</h2>
|
||||
<a href="{{ .Href }}" target="_blank">
|
||||
<img src="{{ .Image }}" alt="{{ .Title }}" style="width:100%;max-width:600px;">
|
||||
</a>
|
||||
<p>{{ .Views }} views | {{ .Duration }}</p>
|
||||
<p>By {{ .Creator }}</p>
|
||||
</div>
|
||||
<!-- Removed the break as it's not directly supported in Go templates. If you want only the first result, adjust in Go code instead -->
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<p>No results found. Try adjusting your search term.</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue