Changes
14 changed files (+45/-33)
-
-
@@ -3,12 +3,15 @@ package configimport ( "fmt" "math" "net/url" "os" "path/filepath" "gopkg.in/yaml.v3" ) var staticDirRevision string type Config struct { Repo struct { ScanPath string `yaml:"scanPath"`
-
@@ -48,6 +51,11 @@ type Config struct {Port uint `yaml:"port"` } `yaml:"server"` // StaticDirRevision represents version / revision of "Dirs.Static" (or the // "embed/static" directory if the option is unset.) HTML templates uses // this string for browser-cache bust. StaticDirRevision string `yaml:"staticDirRevision"` filepath string }
-
@@ -61,6 +69,7 @@ func NewWithDefaults() *Config {} c.Meta.Title = "Repositories" c.StaticDirRevision = staticDirRevision return &c }
-
@@ -122,6 +131,8 @@ func (c *Config) Resolve(cwd string) error {return fmt.Errorf("server.port should be in 0 < x <= %d range", math.MaxUint16) } c.StaticDirRevision = url.QueryEscape(c.StaticDirRevision) return nil }
-
-
-
@@ -6,7 +6,7 @@lib, git, }: buildGoModule { buildGoModule (finalAttrs: { name = "legit"; version = "1.0.0";
-
@@ -28,6 +28,7 @@ buildGoModule {# git binary from nixpkgs links against libs under "/nix/store/.../lib" "-X main.additionalAccessDirs=/nix/store" "-X github.com/pocka/legit/git/exe.gitPath=${lib.getExe git}" "-X github.com/pocka/legit/config.staticDirRevision=v${finalAttrs.version}-embed" ]; # Test scripts invoke system "git" command.
-
@@ -36,4 +37,4 @@ buildGoModule {meta = { mainProgram = "legit"; }; } })
-
-
-
@@ -6,12 +6,12 @@ SPDX-License-Identifier: MIT<!DOCTYPE html> <html lang="en"> <head> {{ template "head" }} {{ template "head" . }} <title>{{ .Config.Meta.Title }}</title> {{- if .Config.Meta.Description }} <meta name="description" content="{{ .Config.Meta.Description }}" /> {{- end }} <link rel="stylesheet" href="/static/errorpage.css" /> <link rel="stylesheet" href="/static/errorpage.css?r={{ .Config.StaticDirRevision }}" /> </head> <body> <header class="header">
-
-
-
@@ -6,12 +6,12 @@ SPDX-License-Identifier: MIT<!DOCTYPE html> <html lang="en"> <head> {{ template "head" }} {{ template "head" . }} <title>{{ .Config.Meta.Title }}</title> {{- if .Config.Meta.Description }} <meta name="description" content="{{ .Config.Meta.Description }}" /> {{- end }} <link rel="stylesheet" href="/static/errorpage.css" /> <link rel="stylesheet" href="/static/errorpage.css?r={{ .Config.StaticDirRevision }}" /> </head> <body> <header class="header">
-
-
-
@@ -2,7 +2,7 @@Shared HTML tags to put inside <head> tag. Include inside <head> tag, like this: <head> {{ template "head" }} {{ template "head" . }} <title>Page Title</title> </head>
-
@@ -13,10 +13,10 @@ SPDX-License-Identifier: MIT<meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="color-scheme" content="light dark" /> <link rel="icon" href="/static/favicon.png" type="image/png" /> <link rel="stylesheet" href="/static/colors.css" /> <link rel="stylesheet" href="/static/global.css" /> <link rel="icon" href="/static/favicon.png?r={{ .Config.StaticDirRevision }}" type="image/png" /> <link rel="stylesheet" href="/static/colors.css?r={{ .Config.StaticDirRevision }}" /> <link rel="stylesheet" href="/static/global.css?r={{ .Config.StaticDirRevision }}" /> <noscript> <link rel="stylesheet" href="/static/noscript.css" /> <link rel="stylesheet" href="/static/noscript.css?r={{ .Config.StaticDirRevision }}" /> </noscript> {{- end }}
-
-
-
@@ -6,8 +6,8 @@ SPDX-License-Identifier: MIT<!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href="/static/html-content.css" /> {{ template "head" }} <link rel="stylesheet" href="/static/html-content.css?r={{ .Config.StaticDirRevision }}" /> {{ template "head" . }} {{- $path := "" -}} {{- $name := "" -}} {{- range .Path -}}
-
-
-
@@ -6,8 +6,8 @@ SPDX-License-Identifier: MIT<!DOCTYPE html> <html lang="en"> <head> {{ template "head" }} <link rel="stylesheet" href="/static/repo-blob-ref.css" /> {{ template "head" . }} <link rel="stylesheet" href="/static/repo-blob-ref.css?r={{ .Config.StaticDirRevision }}" /> {{- $path := "" -}} {{- $name := "" -}} {{- range .Path -}}
-
-
-
@@ -7,13 +7,13 @@ SPDX-License-Identifier: MIT<html lang="en"> {{ $shorthash := slice .Commit.Hash.String 0 8 }} <head> {{ template "head" }} <link rel="stylesheet" href="/static/repo-commit.css" /> {{ template "head" . }} <link rel="stylesheet" href="/static/repo-commit.css?r={{ .Config.StaticDirRevision }}" /> <title> {{ $shorthash }} - {{ .Meta.DisplayName }} </title> <meta name="description" content='{{ $shorthash }} in {{ .Meta.DisplayName }}' /> <script type="module" src="/static/convert-to-local-datetime.js"></script> <script type="module" src="/static/convert-to-local-datetime.js?r={{ .Config.StaticDirRevision }}"></script> </head> <body> <header class="header">
-
-
-
@@ -6,13 +6,13 @@ SPDX-License-Identifier: MIT<!DOCTYPE html> <html lang="en"> <head> {{ template "head" }} <link rel="stylesheet" href="/static/repo-list.css" /> {{ template "head" . }} <link rel="stylesheet" href="/static/repo-list.css?r={{ .Config.StaticDirRevision }}" /> <title>{{ .Config.Meta.Title }}</title> {{- if .Config.Meta.Description }} <meta name="description" content="{{ .Config.Meta.Description }}" /> {{- end }} <script type="module" src="/static/convert-to-local-datetime.js"></script> <script type="module" src="/static/convert-to-local-datetime.js?r={{ .Config.StaticDirRevision }}"></script> </head> <body> <header class="header">
-
-
-
@@ -6,13 +6,13 @@ SPDX-License-Identifier: MIT<!DOCTYPE html> <html lang="en"> <head> {{ template "head" }} <link rel="stylesheet" href="/static/repo-log-ref.css" /> {{ template "head" . }} <link rel="stylesheet" href="/static/repo-log-ref.css?r={{ .Config.StaticDirRevision }}" /> <title> Commit history at {{ .Meta.Ref }} - {{ .Meta.DisplayName }} </title> <meta name="description" content='Commit history on {{ .Meta.DisplayName }} at {{ .Meta.Ref }}' /> <script type="module" src="/static/convert-to-local-datetime.js"></script> <script type="module" src="/static/convert-to-local-datetime.js?r={{ .Config.StaticDirRevision }}"></script> </head> <body> <header class="header">
-
-
-
@@ -6,8 +6,8 @@ SPDX-License-Identifier: MIT<!DOCTYPE html> <html lang="en"> <head> {{ template "head" }} <link rel="stylesheet" href="/static/repo-refs.css" /> {{ template "head" . }} <link rel="stylesheet" href="/static/repo-refs.css?r={{ .Config.StaticDirRevision }}" /> <title>Refs - {{ .Meta.DisplayName }}</title> <meta name="description" content="Git refs of {{ .Meta.DisplayName }}" /> </head>
-
-
-
@@ -6,14 +6,14 @@ SPDX-License-Identifier: MIT<!DOCTYPE html> <html lang="en"> <head> {{ template "head" }} <link rel="stylesheet" href="/static/repo-top.css" /> <link rel="stylesheet" href="/static/html-content.css" /> {{ template "head" . }} <link rel="stylesheet" href="/static/repo-top.css?r={{ .Config.StaticDirRevision }}" /> <link rel="stylesheet" href="/static/html-content.css?r={{ .Config.StaticDirRevision }}" /> <title>{{ .Meta.DisplayName }} | {{ .Config.Meta.Title }}</title> {{- if .Meta.Description }} <meta name="description" content="{{ .Meta.Description }}" /> {{- end }} <script type="module" src="/static/convert-to-local-datetime.js"></script> <script type="module" src="/static/convert-to-local-datetime.js?r={{ .Config.StaticDirRevision }}"></script> </head> <body> <header class="header">
-
-
-
@@ -6,8 +6,8 @@ SPDX-License-Identifier: MIT<!DOCTYPE html> <html lang="en"> <head> {{ template "head" }} <link rel="stylesheet" href="/static/repo-tree-ref.css" /> {{ template "head" . }} <link rel="stylesheet" href="/static/repo-tree-ref.css?r={{ .Config.StaticDirRevision }}" /> {{- $path := "" -}} {{- range .Path -}} {{- $path = printf "%s/%s" $path . -}}
-
-
-
@@ -15,7 +15,7 @@ SPDX-License-Identifier: MIT{{- end }} <button id="preferences-dialog-trigger" class="footer--preferences script-only" type="button">Preferences</button> <dialog id="preferences-dialog" class="preferences" popover="auto" closedby="any"> <script type="module" src="/static/preferences.js"></script> <script type="module" src="/static/preferences.js?r={{ .Config.StaticDirRevision }}"></script> <div class="preferences--field"> <label for="global-tab-width">Tab width</label> <select id="global-tab-width" aria-describedby="global-tab-width-description">
-