diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..47760ed --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +theme-details +public +.hugo_build.lock diff --git a/README.md b/README.md index e69de29..2ddf340 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,21 @@ +# starless + +Minimal Hugo theme and demo site. + +## Run + +```bash +hugo server +``` + +## Build + +```bash +hugo +``` + +## Shape + +- `themes/starless`: the theme +- `content/`: the site about the theme +- `theme-details/`: reference material diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..83273cc --- /dev/null +++ b/content/_index.md @@ -0,0 +1,13 @@ ++++ +title = "Starless" ++++ + +Starless is a small Hugo theme for dark, text first sites. + +I built it to keep one shape and get out of the way: a left rail, a narrow reading column, and simple navigation. + +There is no asset pipeline here. No client side framework either. Just Hugo templates and enough styling to hold the page together. + +This site is both the demo and the docs. If something feels too clever, it probably does not belong in the theme. + +Start with the guide if you want to use it. It is short on purpose. diff --git a/content/docs/_index.md b/content/docs/_index.md new file mode 100644 index 0000000..cc3d9bf --- /dev/null +++ b/content/docs/_index.md @@ -0,0 +1,11 @@ ++++ +title = "Guide" +summary = "The short version of what Starless gives you and what it skips." +weight = 10 ++++ + +Starless gives you a homepage, section pages, single pages, and a sidebar menu. That is the whole pitch. + +It is meant for people who want a dark shell and plain content, not a huge pile of options. If you want every part configurable from front matter, you will outgrow this fast. + +The rest of this section covers setup, the few things worth changing, and the files that actually matter. diff --git a/content/docs/customize.md b/content/docs/customize.md new file mode 100644 index 0000000..739db79 --- /dev/null +++ b/content/docs/customize.md @@ -0,0 +1,13 @@ ++++ +title = "Customize" +summary = "Change the title, menu, and footer strings first. Leave the rest alone until it bothers you." +weight = 12 ++++ + +The fast path is to change four things in `hugo.toml`: `baseURL`, `title`, `params.sidebarFooter`, and `params.homeFooter`. + +Then adjust `menus.main`. The sidebar shape comes from the menu, so you do not need a special data file or extra config layer. + +If you want a different voice on the homepage, edit `content/_index.md`. If you want layout changes, start in `themes/starless/layouts/_default/baseof.html`. + +That is enough for most forks. The theme stays easier to live with if you change one obvious file at a time. diff --git a/content/docs/files.md b/content/docs/files.md new file mode 100644 index 0000000..7acbd07 --- /dev/null +++ b/content/docs/files.md @@ -0,0 +1,16 @@ ++++ +title = "Files" +summary = "The theme is small enough that you can learn it in one pass." +weight = 13 ++++ + +The files that matter are not hard to find. + +- `hugo.toml` sets the theme, site title, footer text, and sidebar menu. +- `content/` holds the homepage and this short guide. +- `themes/starless/layouts/_default/baseof.html` builds the page shell and the shared styling. +- `themes/starless/layouts/partials/sidebar.html` renders the left rail. +- `themes/starless/layouts/partials/menu-tree.html` renders the nested menu links. +- `themes/starless/layouts/_default/home.html`, `list.html`, and `single.html` handle the main content area. + +If you are trying to understand the theme, read those files in that order. There is not much else hiding off to the side. diff --git a/content/docs/install.md b/content/docs/install.md new file mode 100644 index 0000000..2e37a8c --- /dev/null +++ b/content/docs/install.md @@ -0,0 +1,13 @@ ++++ +title = "Install" +summary = "Start a Hugo site, copy the theme, and point the config at it." +weight = 11 ++++ + +If you fork this repo, you already have the theme and the demo site in one place. + +If you want to drop Starless into another Hugo site, copy the `themes/starless/` folder into that project and set `theme = "starless"` in `hugo.toml`. + +After that, add a small `menus.main` block so the sidebar has something to render. The current config in this repo is enough to copy and trim. + +Run `hugo server` and edit from there. The theme is simple enough that most changes show up where you expect. diff --git a/hugo.toml b/hugo.toml new file mode 100644 index 0000000..56be6f4 --- /dev/null +++ b/hugo.toml @@ -0,0 +1,34 @@ +baseURL = "https://example.org/" +locale = "en-us" +title = "Starless" +theme = "starless" +enableRobotsTXT = true +disableHugoGeneratorInject = true + +[params] +description = "Starless is a small Hugo theme for dark, text first sites." +sidebarFooter = "Built with Hugo." +homeFooter = "Small on purpose." + +[[menus.main]] +name = "Guide" +pageRef = "/docs" +weight = 10 + +[[menus.main]] +name = "Install" +pageRef = "/docs/install" +parent = "Guide" +weight = 11 + +[[menus.main]] +name = "Customize" +pageRef = "/docs/customize" +parent = "Guide" +weight = 12 + +[[menus.main]] +name = "Files" +pageRef = "/docs/files" +parent = "Guide" +weight = 13 diff --git a/themes/starless/layouts/_default/baseof.html b/themes/starless/layouts/_default/baseof.html new file mode 100644 index 0000000..4e08ad5 --- /dev/null +++ b/themes/starless/layouts/_default/baseof.html @@ -0,0 +1,116 @@ + + + + + + {{ if .IsHome }}{{ site.Title }}{{ else }}{{ .Title }} | {{ site.Title }}{{ end }} + + + + + + + + + + +
+ {{ partial "sidebar.html" . }} +
+ {{ block "main" . }}{{ end }} +
+
+ + diff --git a/themes/starless/layouts/_default/home.html b/themes/starless/layouts/_default/home.html new file mode 100644 index 0000000..5926c3e --- /dev/null +++ b/themes/starless/layouts/_default/home.html @@ -0,0 +1,14 @@ +{{ define "main" }} +
+ {{ .Content }} +
+
+ + Read the guide arrow_forward + +
+
+
+ {{ site.Params.homeFooter }} +
+{{ end }} diff --git a/themes/starless/layouts/_default/list.html b/themes/starless/layouts/_default/list.html new file mode 100644 index 0000000..904ee90 --- /dev/null +++ b/themes/starless/layouts/_default/list.html @@ -0,0 +1,27 @@ +{{ define "main" }} +
+

{{ .Title }}

+ {{ .Content }} +
+
+ + Home arrow_back + +
+
+
+ {{ range .Pages.ByWeight }} +
+

{{ .Title }}

+ {{ with .Params.summary }} +

{{ . }}

+ {{ else }} + {{ with .Summary }}

{{ . | plainify }}

{{ end }} + {{ end }} +
+ {{ end }} +
+
+ {{ site.Params.homeFooter }} +
+{{ end }} diff --git a/themes/starless/layouts/_default/single.html b/themes/starless/layouts/_default/single.html new file mode 100644 index 0000000..330eff3 --- /dev/null +++ b/themes/starless/layouts/_default/single.html @@ -0,0 +1,15 @@ +{{ define "main" }} +
+

{{ .Title }}

+ {{ .Content }} +
+
+ + {{ .Section }} arrow_back + +
+
+
+ {{ site.Params.homeFooter }} +
+{{ end }} diff --git a/themes/starless/layouts/partials/menu-tree.html b/themes/starless/layouts/partials/menu-tree.html new file mode 100644 index 0000000..af4fb2f --- /dev/null +++ b/themes/starless/layouts/partials/menu-tree.html @@ -0,0 +1,29 @@ +{{- range .ByWeight -}} +
+ + {{ if .HasChildren }}expand_more{{ else }}chevron_right{{ end }} + {{ .Name }} + + {{- with .Children -}} +
+ {{- range .ByWeight -}} + {{- if .HasChildren -}} +
+ + expand_more + {{ .Name }} + +
+ {{ range .Children.ByWeight }} + {{ .Name }} + {{ end }} +
+
+ {{- else -}} + {{ .Name }} + {{- end -}} + {{- end -}} +
+ {{- end -}} +
+{{- end -}} diff --git a/themes/starless/layouts/partials/sidebar.html b/themes/starless/layouts/partials/sidebar.html new file mode 100644 index 0000000..342bdbb --- /dev/null +++ b/themes/starless/layouts/partials/sidebar.html @@ -0,0 +1,24 @@ + diff --git a/themes/starless/theme.toml b/themes/starless/theme.toml new file mode 100644 index 0000000..f7416da --- /dev/null +++ b/themes/starless/theme.toml @@ -0,0 +1,12 @@ +name = "starless" +license = "MIT" +licenselink = "https://opensource.org/licenses/MIT" +description = "A minimal dark editorial Hugo theme." +homepage = "https://example.org/" +demosite = "https://example.org/" +tags = ["blog", "minimal", "dark", "editorial"] +features = ["blog", "docs", "responsive", "no-javascript"] +min_version = "0.161.0" + +[author] +name = "ruinivist"