Skip to content

Commit

Permalink
ADD: added assets sub-package
Browse files Browse the repository at this point in the history
  • Loading branch information
fileformat committed Mar 31, 2024
1 parent 182a3ea commit fec7e1b
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
6 changes: 6 additions & 0 deletions assets/assets.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package assets

import "embed"

//go:embed templates/*.tmpl
var TemplateFS embed.FS
77 changes: 77 additions & 0 deletions assets/templates/_base.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{ template "title" .}} - BIMI Explorer</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="referrer" content="unsafe-url" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" />
<style>

.logo-container a {
margin: 6px;
max-width: 350px;
min-width: 100px;
height: 100px;
display: inline-block; }

/* faded border around logos in lists */
.logo-container img {
box-shadow: 0 0 5px #1d1d1d;
border: solid #ccc 1px;
//max-width: 100%;
//height: 100%;
object-fit: contain;
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
padding: 5px;
}

</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js"></script>
</head>

<body>
<nav class="navbar navbar-expand d-flex justify-content-between d-print-none border-bottom bg-body-tertiary pb-1 mb-2">
<div class="container">
<div class="navbar-nav">
<a class="navbar-brand h1 mb-0" href="/" title="{{site.title}}"><span class="d-sm-none">BIMI</span><span class="d-none d-sm-inline"><img
alt="{{site.title}} Logo" class="navbar-logo me-2" src="/images/logo.svg" style="height:1em;vertical-align:middle;"/>BIMI Explorer</span></a>
</div>
<div class="navbar-nav">
<a class="nav-link" href="/">Home</a>
#each crumbtrail
<span class="navbar-text font-weight-bold">&nbsp;&raquo;&nbsp;</span><a class="nav-link text-nobreak"
href="{{this.url}}">{{this.text}}</a>
/each
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col">
<h1>
{{.h1}}
</h1>
<hr />
{{ template "body" . }}
<hr class="mt-3" />
<div class="text-center"><small>
<a href="https://github.com/AwesomeLogos/bimi-explorer">Source</a>
| <a href="https://andrew.marcuse.info/contact.html">Contact</a>
</small></div>
</div>
</div>
</div>
</body>
</html>
5 changes: 5 additions & 0 deletions assets/templates/index.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ define "title" }}BIMI Explorer{{end}}

{{define "body"}}
<h1>{{ . }}</h1>
{{end}}

0 comments on commit fec7e1b

Please sign in to comment.