aceberg/git-confed

View on GitHub
internal/web/templates/header.html

Summary

Maintainability
Test Coverage
{{ define "header"}}

<!DOCTYPE html>
<html lang="en" data-bs-theme="{{ .Config.Color }}">
<head>
    <title>Git Config Editor</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--Favicon-->
    <link href="data:image/x-icon;base64, {{ .Config.Icon }}" rel="icon" type="image/x-icon" />
    {{ if eq .Config.NodePath "" }}
    <!-- Font for icons -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css">
    <!-- Bootstrap and theme -->
    <link href="https://cdn.jsdelivr.net/npm/aceberg-bootswatch-fork@v5.3.3-2/dist/{{ .Config.Theme }}/bootstrap.min.css" rel="stylesheet">
    <!-- JavaScript Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
    {{ else }} <!-- Local node_modules -->
    <link rel="stylesheet" href="{{ .Config.NodePath }}/node_modules/bootstrap-icons/font/bootstrap-icons.css">
    <link href="{{ .Config.NodePath }}/node_modules/bootswatch/dist/{{ .Config.Theme }}/bootstrap.min.css" rel="stylesheet">
    <script src="{{ .Config.NodePath }}/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    {{ end }}
</head>
<body>
    <nav class="navbar navbar-expand-sm navbar-dark bg-primary">
        <div class="container">
            <ul class="navbar-nav">
                <li class="nav-item">
                  <a class="nav-link active" href="/">
                    <img src="data:image/png;base64, {{ .Config.Icon }}" width="30"/>
                  </a>
                </li>
                <li class="nav-item">
                  <a class="nav-link active" href="/">Home</a>
                </li>
                <li class="nav-item">
                  <a class="nav-link active" href="/blocks/">Blocks</a>
                </li>
                <li class="nav-item">
                  <a class="nav-link active" href="/config/">Config</a>
                </li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
              <li class="nav-item"><a class="nav-link active" target="_blank" href="https://github.com/aceberg/git-confed">
                <h3>&nbsp;&nbsp;&nbsp;<i class="bi bi-github"></i></h3>
              </a></li>
            </ul>
        </div>
    </nav>

{{ end }}