added site button

This commit is contained in:
TheLastBilly 2023-05-22 12:25:33 -04:00
parent 1ca89931c8
commit bd6fbb2bce
4 changed files with 11 additions and 1 deletions

View File

@ -45,6 +45,7 @@ type Options struct {
ImagePath string ImagePath string
RunManager bool RunManager bool
UploadSize int64 UploadSize int64
SiteURL string
} }
type Comic struct { type Comic struct {
@ -72,6 +73,7 @@ type Context struct {
Last int Last int
Title string Title string
UserName string UserName string
SiteURL string
} }
type Err struct { type Err struct {
@ -89,6 +91,7 @@ func (o * Options) Parse() error {
flag.StringVar(&o.ImagePath, "i", "", "Image path for new comic") flag.StringVar(&o.ImagePath, "i", "", "Image path for new comic")
flag.BoolVar(&o.RunManager, "r", false, "Runs the content manager instead of the site") flag.BoolVar(&o.RunManager, "r", false, "Runs the content manager instead of the site")
flag.Int64Var(&o.UploadSize, "z", 10, "Max upload size for posts") flag.Int64Var(&o.UploadSize, "z", 10, "Max upload size for posts")
flag.StringVar(&o.SiteURL, "0", "https://comics.blackram.works", "URL of the site once deployed")
flag.Parse() flag.Parse()

View File

@ -73,6 +73,8 @@ func managerIndexView(w http.ResponseWriter, r * http.Request) {
}) })
} }
context.SiteURL = options.SiteURL
err = executeTemplate(w, "manager", context) err = executeTemplate(w, "manager", context)
} }

View File

@ -5,6 +5,11 @@
<h1>{{ .UserName }} &ltLogout&gt</h1> <h1>{{ .UserName }} &ltLogout&gt</h1>
</a> </a>
</div> </div>
<div class="site-button">
<a href="{{ .SiteURL }}">
<h1>&ltSite&gt</h1>
</a>
</div>
</div> </div>
{{ end }} {{ end }}

View File

@ -24,7 +24,7 @@
background-color: #282828; background-color: #282828;
} }
.publish-button { .site-button {
margin-left: auto; margin-left: auto;
} }