From 6087df309a934a1da66b7b490d3b12d66f476b82 Mon Sep 17 00:00:00 2001 From: dd84ai Date: Fri, 29 Mar 2024 21:27:37 +0100 Subject: [PATCH] feat: custom any heading --- .github/workflows/deploy.yml | 1 + .vscode/settings.json | 1 + darkstat/builder/builder.go | 1 + darkstat/common/types/types.go | 1 + darkstat/front/shared.templ | 40 +++++++++++++++++++++++++++++----- 5 files changed, 39 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2bec245..b28a7b4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -51,6 +51,7 @@ jobs: env: SITE_ROOT: "/fl-darkstat/" FLDARKSTAT_FREELANCER_FOLDER: ${{ github.workspace }}/fl-data + FLDARKSTAT_HEADING: "Dev server for darkstat | Github" - uses: actions/upload-pages-artifact@v1 with: diff --git a/.vscode/settings.json b/.vscode/settings.json index e65165a..52985d1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,5 +12,6 @@ "FLDARKSTAT_FREELANCER_FOLDER": "/home/naa/windows10shared/Discovery/DiscoveryFreelancer", "DARKSTAT_LOG_LEVEL": "DEBUG", "UTILS_LOG_LEVEL": "DEBUG", + "FLDARKSTAT_HEADING": "Dev server for darkstat | Github", } } \ No newline at end of file diff --git a/darkstat/builder/builder.go b/darkstat/builder/builder.go index d1d1241..1a3a9d2 100644 --- a/darkstat/builder/builder.go +++ b/darkstat/builder/builder.go @@ -97,6 +97,7 @@ func (b *Builder) BuildAll() *Filesystem { SiteRoot: siteRoot, StaticRoot: siteRoot + staticPrefix, OppositeThemeRoot: siteRoot + "dark/", + Heading: os.Getenv("FLDARKSTAT_HEADING"), }, filesystem) // Implement dark theme later diff --git a/darkstat/common/types/types.go b/darkstat/common/types/types.go index e7b0a73..66e3cc4 100644 --- a/darkstat/common/types/types.go +++ b/darkstat/common/types/types.go @@ -26,6 +26,7 @@ type GlobalParams struct { StaticRoot string OppositeThemeRoot string Pagepath string + Heading string } func GetCtx(ctx context.Context) GlobalParams { diff --git a/darkstat/front/shared.templ b/darkstat/front/shared.templ index da52294..cfc513e 100644 --- a/darkstat/front/shared.templ +++ b/darkstat/front/shared.templ @@ -77,19 +77,49 @@ templ TabContent() { } +templ Heading() { + +
+
+ { children... } +
+
+ @templ.Raw(types.GetCtx(ctx).Heading) +
+
+} + templ TabMenu(url utils_types.FilePath) { -
- - - -
+ @Heading() { +
+ + + +
+ }
}