diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-06 09:33:11 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-06 09:34:06 +0800 |
commit | c9b4eee4c589b8b40c02d0c96f887ec991580a24 (patch) | |
tree | 0ab3f2a22e9c4ca430573559d5712a4a7a6903a3 | |
parent | Move the Go stuff to ./forged/ (diff) | |
download | forge-c9b4eee4c589b8b40c02d0c96f887ec991580a24.tar.gz forge-c9b4eee4c589b8b40c02d0c96f887ec991580a24.tar.zst forge-c9b4eee4c589b8b40c02d0c96f887ec991580a24.zip |
Restructure static/templates into forged
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | forged/.golangci.yaml (renamed from .golangci.yaml) | 0 | ||||
-rw-r--r-- | forged/cmd/forge/main.go | 1 | ||||
-rw-r--r-- | forged/internal/embed/.gitignore | 1 | ||||
-rw-r--r-- | forged/internal/embed/embed.go | 2 | ||||
-rw-r--r-- | forged/internal/unsorted/resources.go | 2 | ||||
-rw-r--r-- | forged/internal/unsorted/server.go | 2 | ||||
-rw-r--r-- | forged/static/.gitignore (renamed from static/.gitignore) | 0 | ||||
-rw-r--r-- | forged/static/chroma.css (renamed from static/chroma.css) | 0 | ||||
-rw-r--r-- | forged/static/style.css (renamed from static/style.css) | 0 | ||||
-rw-r--r-- | forged/templates/400.tmpl (renamed from templates/400.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/400_colon.tmpl (renamed from templates/400_colon.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/403.tmpl (renamed from templates/403.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/404.tmpl (renamed from templates/404.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/451.tmpl (renamed from templates/451.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/500.tmpl (renamed from templates/500.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/501.tmpl (renamed from templates/501.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/_footer.tmpl (renamed from templates/_footer.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/_group_path.tmpl (renamed from templates/_group_path.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/_group_view.tmpl (renamed from templates/_group_view.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/_head.tmpl (renamed from templates/_head.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/_header.tmpl (renamed from templates/_header.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/_ref_query.tmpl (renamed from templates/_ref_query.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/group.tmpl (renamed from templates/group.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/index.tmpl (renamed from templates/index.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/login.tmpl (renamed from templates/login.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/repo_branches.tmpl (renamed from templates/repo_branches.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/repo_commit.tmpl (renamed from templates/repo_commit.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/repo_contrib_index.tmpl (renamed from templates/repo_contrib_index.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/repo_contrib_one.tmpl (renamed from templates/repo_contrib_one.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/repo_index.tmpl (renamed from templates/repo_index.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/repo_log.tmpl (renamed from templates/repo_log.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/repo_raw_dir.tmpl (renamed from templates/repo_raw_dir.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/repo_tree_dir.tmpl (renamed from templates/repo_tree_dir.tmpl) | 0 | ||||
-rw-r--r-- | forged/templates/repo_tree_file.tmpl (renamed from templates/repo_tree_file.tmpl) | 0 |
35 files changed, 6 insertions, 4 deletions
@@ -13,7 +13,7 @@ CFLAGS = -Wall -Wextra -pedantic -std=c99 -D_GNU_SOURCE VERSION = $(shell git describe --tags --always --dirty) SOURCE_FILES = $(shell git ls-files) -EMBED = git2d/git2d hookc/hookc source.tar.gz $(wildcard LICENSE*) $(wildcard static/*) $(wildcard templates/*) +EMBED = git2d/git2d hookc/hookc source.tar.gz $(wildcard LICENSE*) $(wildcard forged/static/*) $(wildcard forged/templates/*) EMBED_ = $(EMBED:%=forged/internal/embed/%) forge: $(EMBED_) $(SOURCE_FILES) diff --git a/.golangci.yaml b/forged/.golangci.yaml index 1c8c972..1c8c972 100644 --- a/.golangci.yaml +++ b/forged/.golangci.yaml diff --git a/forged/cmd/forge/main.go b/forged/cmd/forge/main.go index 8785751..fde15d1 100644 --- a/forged/cmd/forge/main.go +++ b/forged/cmd/forge/main.go @@ -1,6 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org> +// The main entry point to the Lindenii Forge daemon. package main import ( diff --git a/forged/internal/embed/.gitignore b/forged/internal/embed/.gitignore index b4db111..e8708b1 100644 --- a/forged/internal/embed/.gitignore +++ b/forged/internal/embed/.gitignore @@ -4,3 +4,4 @@ /static /templates /LICENSE* +/forged diff --git a/forged/internal/embed/embed.go b/forged/internal/embed/embed.go index 68af51d..c9eeeb3 100644 --- a/forged/internal/embed/embed.go +++ b/forged/internal/embed/embed.go @@ -9,6 +9,6 @@ import "embed" //go:embed LICENSE* source.tar.gz var Source embed.FS -//go:embed templates/* static/* +//go:embed forged/templates/* forged/static/* //go:embed hookc/hookc git2d/git2d var Resources embed.FS diff --git a/forged/internal/unsorted/resources.go b/forged/internal/unsorted/resources.go index 9f3a5d0..692b454 100644 --- a/forged/internal/unsorted/resources.go +++ b/forged/internal/unsorted/resources.go @@ -30,7 +30,7 @@ func (s *Server) loadTemplates() (err error) { "minus": misc.Minus, }) - err = fs.WalkDir(embed.Resources, "templates", func(path string, d fs.DirEntry, err error) error { + err = fs.WalkDir(embed.Resources, "forged/templates", func(path string, d fs.DirEntry, err error) error { if err != nil { return err } diff --git a/forged/internal/unsorted/server.go b/forged/internal/unsorted/server.go index f8978a5..c7caa76 100644 --- a/forged/internal/unsorted/server.go +++ b/forged/internal/unsorted/server.go @@ -63,7 +63,7 @@ func NewServer(configPath string) (*Server, error) { "/-/source/", http.FileServer(http.FS(embed.Source)), ) - staticFS, err := fs.Sub(embed.Resources, "static") + staticFS, err := fs.Sub(embed.Resources, "forged/static") if err != nil { return s, err } diff --git a/static/.gitignore b/forged/static/.gitignore index 812b75f..812b75f 100644 --- a/static/.gitignore +++ b/forged/static/.gitignore diff --git a/static/chroma.css b/forged/static/chroma.css index 1f7219a..1f7219a 100644 --- a/static/chroma.css +++ b/forged/static/chroma.css diff --git a/static/style.css b/forged/static/style.css index b1e208f..b1e208f 100644 --- a/static/style.css +++ b/forged/static/style.css diff --git a/templates/400.tmpl b/forged/templates/400.tmpl index 58ce768..58ce768 100644 --- a/templates/400.tmpl +++ b/forged/templates/400.tmpl diff --git a/templates/400_colon.tmpl b/forged/templates/400_colon.tmpl index 470a685..470a685 100644 --- a/templates/400_colon.tmpl +++ b/forged/templates/400_colon.tmpl diff --git a/templates/403.tmpl b/forged/templates/403.tmpl index 86d5518..86d5518 100644 --- a/templates/403.tmpl +++ b/forged/templates/403.tmpl diff --git a/templates/404.tmpl b/forged/templates/404.tmpl index 2eabb06..2eabb06 100644 --- a/templates/404.tmpl +++ b/forged/templates/404.tmpl diff --git a/templates/451.tmpl b/forged/templates/451.tmpl index ed6343c..ed6343c 100644 --- a/templates/451.tmpl +++ b/forged/templates/451.tmpl diff --git a/templates/500.tmpl b/forged/templates/500.tmpl index 3a540e6..3a540e6 100644 --- a/templates/500.tmpl +++ b/forged/templates/500.tmpl diff --git a/templates/501.tmpl b/forged/templates/501.tmpl index b6ab2f0..b6ab2f0 100644 --- a/templates/501.tmpl +++ b/forged/templates/501.tmpl diff --git a/templates/_footer.tmpl b/forged/templates/_footer.tmpl index f71ea3e..f71ea3e 100644 --- a/templates/_footer.tmpl +++ b/forged/templates/_footer.tmpl diff --git a/templates/_group_path.tmpl b/forged/templates/_group_path.tmpl index f5d3bf8..f5d3bf8 100644 --- a/templates/_group_path.tmpl +++ b/forged/templates/_group_path.tmpl diff --git a/templates/_group_view.tmpl b/forged/templates/_group_view.tmpl index 92b6639..92b6639 100644 --- a/templates/_group_view.tmpl +++ b/forged/templates/_group_view.tmpl diff --git a/templates/_head.tmpl b/forged/templates/_head.tmpl index d6d6571..d6d6571 100644 --- a/templates/_head.tmpl +++ b/forged/templates/_head.tmpl diff --git a/templates/_header.tmpl b/forged/templates/_header.tmpl index 340a2ac..340a2ac 100644 --- a/templates/_header.tmpl +++ b/forged/templates/_header.tmpl diff --git a/templates/_ref_query.tmpl b/forged/templates/_ref_query.tmpl index 2f78955..2f78955 100644 --- a/templates/_ref_query.tmpl +++ b/forged/templates/_ref_query.tmpl diff --git a/templates/group.tmpl b/forged/templates/group.tmpl index b15c316..b15c316 100644 --- a/templates/group.tmpl +++ b/forged/templates/group.tmpl diff --git a/templates/index.tmpl b/forged/templates/index.tmpl index ff7c127..ff7c127 100644 --- a/templates/index.tmpl +++ b/forged/templates/index.tmpl diff --git a/templates/login.tmpl b/forged/templates/login.tmpl index 1e26c82..1e26c82 100644 --- a/templates/login.tmpl +++ b/forged/templates/login.tmpl diff --git a/templates/repo_branches.tmpl b/forged/templates/repo_branches.tmpl index 55ea0a6..55ea0a6 100644 --- a/templates/repo_branches.tmpl +++ b/forged/templates/repo_branches.tmpl diff --git a/templates/repo_commit.tmpl b/forged/templates/repo_commit.tmpl index 470bba9..470bba9 100644 --- a/templates/repo_commit.tmpl +++ b/forged/templates/repo_commit.tmpl diff --git a/templates/repo_contrib_index.tmpl b/forged/templates/repo_contrib_index.tmpl index 172a079..172a079 100644 --- a/templates/repo_contrib_index.tmpl +++ b/forged/templates/repo_contrib_index.tmpl diff --git a/templates/repo_contrib_one.tmpl b/forged/templates/repo_contrib_one.tmpl index a5f35d3..a5f35d3 100644 --- a/templates/repo_contrib_one.tmpl +++ b/forged/templates/repo_contrib_one.tmpl diff --git a/templates/repo_index.tmpl b/forged/templates/repo_index.tmpl index d040f3a..d040f3a 100644 --- a/templates/repo_index.tmpl +++ b/forged/templates/repo_index.tmpl diff --git a/templates/repo_log.tmpl b/forged/templates/repo_log.tmpl index 2262902..2262902 100644 --- a/templates/repo_log.tmpl +++ b/forged/templates/repo_log.tmpl diff --git a/templates/repo_raw_dir.tmpl b/forged/templates/repo_raw_dir.tmpl index a33da4a..a33da4a 100644 --- a/templates/repo_raw_dir.tmpl +++ b/forged/templates/repo_raw_dir.tmpl diff --git a/templates/repo_tree_dir.tmpl b/forged/templates/repo_tree_dir.tmpl index fc06646..fc06646 100644 --- a/templates/repo_tree_dir.tmpl +++ b/forged/templates/repo_tree_dir.tmpl diff --git a/templates/repo_tree_file.tmpl b/forged/templates/repo_tree_file.tmpl index 76404a9..76404a9 100644 --- a/templates/repo_tree_file.tmpl +++ b/forged/templates/repo_tree_file.tmpl |