diff --git a/cmd/hugothemesitebuilder/build/site/go.mod b/cmd/hugothemesitebuilder/build/site/go.mod index d89fa4e..2e1863f 100644 --- a/cmd/hugothemesitebuilder/build/site/go.mod +++ b/cmd/hugothemesitebuilder/build/site/go.mod @@ -4,7 +4,6 @@ go 1.23 toolchain go1.24.2 -require github.com/gohugoio/hugoThemesSite v0.0.0-20250413153523-218508d22d87 require ( github.com/gohugoio/hugoDocs v0.146.1 // indirect diff --git a/cmd/hugothemesitebuilder/build/site/go.sum b/cmd/hugothemesitebuilder/build/site/go.sum index a91c6e3..eac29a9 100644 --- a/cmd/hugothemesitebuilder/build/site/go.sum +++ b/cmd/hugothemesitebuilder/build/site/go.sum @@ -1,4 +1,2 @@ github.com/gohugoio/hugoDocs v0.146.1 h1:f1q3NrNBLwI1docyPcvR6lIgpXlPg6jXQ/pct2YqBXc= github.com/gohugoio/hugoDocs v0.146.1/go.mod h1:5tw9S3zNniW5wuNPkCHrFhfpIoqXRhBDq7hM9ZbcO7I= -github.com/gohugoio/hugoThemesSite v0.0.0-20250413153523-218508d22d87 h1:e+uvV8oLcYR6a+AAkF5KlD73P71cbZcoXLQ8jgfXcGs= -github.com/gohugoio/hugoThemesSite v0.0.0-20250413153523-218508d22d87/go.mod h1:k8gbZMqjx3U0/aU6MvkO8U3ilp29vZhQImuw9uGKF4I= diff --git a/cmd/hugothemesitebuilder/build/site/hugo.toml b/cmd/hugothemesitebuilder/build/site/hugo.toml index a8bc4c2..11f5c77 100644 --- a/cmd/hugothemesitebuilder/build/site/hugo.toml +++ b/cmd/hugothemesitebuilder/build/site/hugo.toml @@ -16,13 +16,36 @@ googleAnalytics = "G-MBZGKNMDWC" [module] [module.hugoVersion] - min = "0.100.0" + min = "0.145.0" + [[module.mounts]] + source = "layouts" + target = "layouts" + [[module.mounts]] + source = "content" + target = "content" [[module.mounts]] disableWatch = true source = "hugo_stats.json" target = "assets/notwatching/hugo_stats.json" [[module.imports]] - path = "github.com/gohugoio/hugoThemesSite" + path = "github.com/gohugoio/hugoDocs" + # We share the theme with the docs site, but we need to be explicit about + # the mounts to avoid pulling in the content. + [[module.imports.mounts]] + source = "layouts" + target = "layouts" + [[module.imports.mounts]] + source = "assets" + target = "assets" + [[module.imports.mounts]] + source = "static" + target = "static" + [[module.imports.mounts]] + source = "data" + target = "data" + [[module.imports.mounts]] + source = "i18n" + target = "i18n" [markup.goldmark.renderer] # We pull in README.md files from the theme repos, and they can have HTML, diff --git a/cmd/hugothemesitebuilder/build/site/hugo.work b/cmd/hugothemesitebuilder/build/site/hugo.work index ca20da9..c04cda4 100644 --- a/cmd/hugothemesitebuilder/build/site/hugo.work +++ b/cmd/hugothemesitebuilder/build/site/hugo.work @@ -1,4 +1,3 @@ go 1.23 -use ../../../../../hugoThemesSite use ../../../../../hugoDocs diff --git a/cmd/hugothemesitebuilder/build/site/layouts/_partials/breadcrumbs.html b/cmd/hugothemesitebuilder/build/site/layouts/_partials/breadcrumbs.html new file mode 100644 index 0000000..c941617 --- /dev/null +++ b/cmd/hugothemesitebuilder/build/site/layouts/_partials/breadcrumbs.html @@ -0,0 +1,33 @@ + + +{{ define "breadcrumbs-arrow" }} + + + +{{ end }} diff --git a/cmd/hugothemesitebuilder/build/site/layouts/_partials/listtags.html b/cmd/hugothemesitebuilder/build/site/layouts/_partials/listtags.html new file mode 100644 index 0000000..62c6fbe --- /dev/null +++ b/cmd/hugothemesitebuilder/build/site/layouts/_partials/listtags.html @@ -0,0 +1,19 @@ +{{ $tags := site.Taxonomies.tags.ByCount }} +{{ $tags = where $tags "Count" ">=" 3 }} + + + diff --git a/cmd/hugothemesitebuilder/build/site/layouts/_partials/themes.html b/cmd/hugothemesitebuilder/build/site/layouts/_partials/themes.html new file mode 100644 index 0000000..2c405e8 --- /dev/null +++ b/cmd/hugothemesitebuilder/build/site/layouts/_partials/themes.html @@ -0,0 +1,34 @@ + diff --git a/cmd/hugothemesitebuilder/build/site/layouts/home.html b/cmd/hugothemesitebuilder/build/site/layouts/home.html new file mode 100644 index 0000000..64b99d0 --- /dev/null +++ b/cmd/hugothemesitebuilder/build/site/layouts/home.html @@ -0,0 +1,11 @@ +{{ define "main" }} + {{ partial "themes.html" site.RegularPages }} +{{ end }} + +{{ define "rightsidebar_content" }} + {{ partial "listtags.html" . }} +{{ end }} + +{{ define "leftsidebar" }} + {{ printf "%c" '\u00A0' }} +{{ end }} diff --git a/cmd/hugothemesitebuilder/build/site/layouts/list.html b/cmd/hugothemesitebuilder/build/site/layouts/list.html new file mode 100644 index 0000000..e23393c --- /dev/null +++ b/cmd/hugothemesitebuilder/build/site/layouts/list.html @@ -0,0 +1,17 @@ +{{ define "main" }} + {{ partial "themes.html" .RegularPages }} +{{ end }} + +{{ define "subheader" }} +
+ {{ partial "breadcrumbs.html" . }} +
+{{ end }} + +{{ define "rightsidebar" }} + {{ printf "%c" '\u00A0' }} +{{ end }} + +{{ define "leftsidebar" }} + {{ printf "%c" '\u00A0' }} +{{ end }} diff --git a/cmd/hugothemesitebuilder/build/site/layouts/single.html b/cmd/hugothemesitebuilder/build/site/layouts/single.html new file mode 100644 index 0000000..fc0828f --- /dev/null +++ b/cmd/hugothemesitebuilder/build/site/layouts/single.html @@ -0,0 +1,141 @@ +{{ define "hero" }} +
+
+
+

+ {{ .Title }} +

+

+ {{ with .Params.meta.description }}{{ . }}{{ end }} +

+ + {{ template "theme-details" . }} +
+ {{ if not site.Params.hideHTMLLink }} + {{ with .Params.htmlURL }} + Download + {{ end }} + {{ end }} + {{ if not site.Params.hideDemoLink }} + {{ with .Params.meta.demosite }} + Demo + {{ end }} + {{ end }} +
+
+
+ {{ $img := (.Resources.ByType "image").GetMatch "*screen*" }} + {{ if $img }} + {{ partial "helpers/picture.html" (dict + "image" $img + "alt" "Theme Screenshot" + "width" 1280 + "class" "w-[76rem] rounded-md shadow-2xl ring-1 ring-gray-900/10") + }} + {{ end }} + +
+
+
+{{ end }} + +{{ define "main" }} +
+ {{ .Content }} +
+{{ end }} + +{{ define "subheader" }} +
+ {{ partial "breadcrumbs.html" . }} +
+{{ end }} + +{{ define "rightsidebar" }} + {{ printf "%c" '\u00A0' }} +{{ end }} + +{{ define "leftsidebar" }} + {{ printf "%c" '\u00A0' }} +{{ end }} + +{{ define "theme-details" }} +
+
+
+ {{ with .Params.meta.license }} + {{ template "descriptionlist-item" (dict "label" "License" "value" . ) }} + {{ end }} + {{ with .Params.githubInfo }} + {{ template "descriptionlist-item" (dict "label" "GitHub Stars" "value" .Stars ) }} + {{ end }} + {{ with .Params.hugoVersion.min }} + {{ template "descriptionlist-item" (dict "label" "Minimum Hugo Version" "value" . ) }} + {{ end }} + {{ template "descriptionlist-item" (dict "label" "Last Updated" "value" ( .Lastmod.Format "2006-01-02") ) }} + {{ with .Params.meta.author }} + {{ if reflect.IsMap . }} + {{ template "descriptionlist-item" (dict "label" "Author" "value" .name "link" .homepage ) }} + {{ end }} + {{ end }} + {{ with .Params.meta.authors }} + {{ range . }} + {{ template "descriptionlist-item" (dict "label" "Author" "value" .name "link" .homepage ) }} + {{ end }} + {{ end }} + + {{ with (.GetTerms "tags") }} +
+
+ Tags +
+
+ {{ range . }} + + {{ .LinkTitle | title }} + + {{ end }} +
+
+ {{ end }} + +
+
+
+{{ end }} + +{{ define "descriptionlist-item" }} +
+
+ {{ .label }} +
+
+ {{ if .link }} + + {{ .value }} + + {{ else }} + {{ .value }} + {{ end }} +
+
+{{ end }} diff --git a/cmd/hugothemesitebuilder/build/site/layouts/taxonomy.html b/cmd/hugothemesitebuilder/build/site/layouts/taxonomy.html new file mode 100644 index 0000000..d837d92 --- /dev/null +++ b/cmd/hugothemesitebuilder/build/site/layouts/taxonomy.html @@ -0,0 +1,36 @@ +{{ define "main" }} + +
+
+ {{ range .Pages }} + +

+ {{ .LinkTitle }} +

+ +

+ {{ (or .Params.description .Summary) | plainify | safeHTML }} +

+
+ {{ end }} +
+
+{{ end }} + +{{ define "subheader" }} +
+ {{ partial "breadcrumbs.html" . }} +
+{{ end }} + +{{ define "rightsidebar" }} + {{ printf "%c" '\u00A0' }} +{{ end }} + +{{ define "leftsidebar" }} + {{ printf "%c" '\u00A0' }} +{{ end }} diff --git a/cmd/hugothemesitebuilder/build/site/layouts/thumbnail.html b/cmd/hugothemesitebuilder/build/site/layouts/thumbnail.html new file mode 100644 index 0000000..19d2e3f --- /dev/null +++ b/cmd/hugothemesitebuilder/build/site/layouts/thumbnail.html @@ -0,0 +1,16 @@ +{{ $img := (.Resources.ByType "image").GetMatch "*tn*" }} +{{ with $img }} + {{ $big := .Fill "768x512 top" }} + {{ $small := .Fill "384x256 top" }} + + {{ $.Description }} + + + {{ $.Title }} + + +{{ end }} diff --git a/pkg/buildcmd/build.go b/pkg/buildcmd/build.go index 5d396e5..0d094e5 100644 --- a/pkg/buildcmd/build.go +++ b/pkg/buildcmd/build.go @@ -66,6 +66,7 @@ func New(rootConfig *rootcmd.Config) *ffcli.Command { func (c *Config) Exec(ctx context.Context, args []string) error { const configAll = "config.json" contentDir := c.rootConfig.Client.JoinOutPath("site", "content") + contentThemesDir := filepath.Join(contentDir, "themes") staticDir := c.rootConfig.Client.JoinOutPath("site", "static") configFile := c.rootConfig.Client.JoinOutPath(configAll) client.CheckErr(os.Remove(configFile)) @@ -101,9 +102,9 @@ func (c *Config) Exec(ctx context.Context, args []string) error { } if !c.noClean { - client.CheckErr(os.RemoveAll(contentDir)) + client.CheckErr(os.RemoveAll(contentThemesDir)) } - client.CheckErr(os.MkdirAll(contentDir, 0o777)) + client.CheckErr(os.MkdirAll(contentThemesDir, 0o777)) if err := bc.writeThemesContent(); err != nil { return err