Split up the main page into different parts.
This commit is contained in:
parent
a4d5060163
commit
92504f4130
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"converge/pkg/templates"
|
||||
"github.com/a-h/templ"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
@ -23,17 +24,21 @@ type Rendering struct {
|
||||
|
||||
func render(dir string, name string, params Params, render RenderFunc) {
|
||||
fname := filepath.Join(dir, name)
|
||||
log.Printf("Writing to %s", fname)
|
||||
f, err := os.Create(fname)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
render(params.secure, params.host, params.username).Render(context.Background(), f)
|
||||
err = render(params.secure, params.host, params.username).Render(context.Background(), f)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
dir := "html"
|
||||
dir := "html/docs"
|
||||
|
||||
params := Params{
|
||||
secure: "s",
|
||||
|
@ -18,7 +18,7 @@ templ Downloads() {
|
||||
<tr>
|
||||
<td>agent</td>
|
||||
<td>The agent to run inside aa CI job</td>
|
||||
<td><a href="docs/agent">agent</a></td>
|
||||
<td><a href="downloads/agent">agent</a></td>
|
||||
<td><a href="docs/agent.exe">agent.exe</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -5,14 +5,14 @@ templ Index(secure string, host string, username string) {
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="css/bootstrap.min.css"
|
||||
<link rel="stylesheet" href="../css/bootstrap.min.css"
|
||||
crossorigin="anonymous">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Converge</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script src="js/bootstrap.bundle.min.js"
|
||||
<script src="../js/bootstrap.bundle.min.js"
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
<div class="container-fluid">
|
||||
|
Loading…
Reference in New Issue
Block a user