diff --git a/hugo.toml b/hugo.toml index 56be6f4..5c03a0c 100644 --- a/hugo.toml +++ b/hugo.toml @@ -5,6 +5,9 @@ theme = "starless" enableRobotsTXT = true disableHugoGeneratorInject = true +[outputs] +home = ["HTML", "RSS", "JSON"] + [params] description = "Starless is a small Hugo theme for dark, text first sites." sidebarFooter = "Built with Hugo." diff --git a/themes/starless/layouts/_default/baseof.html b/themes/starless/layouts/_default/baseof.html index 3743f4b..72ad318 100644 --- a/themes/starless/layouts/_default/baseof.html +++ b/themes/starless/layouts/_default/baseof.html @@ -91,6 +91,10 @@ font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; } + [hidden] { + display: none !important; + } + .tree-item { position: relative; } @@ -104,6 +108,20 @@ width: 1px; background-color: rgba(234, 228, 226, 0.1); } + + #search-dialog { + margin-top: 6rem; + } + + #search-dialog::backdrop { + background: rgba(12, 11, 10, 0.86); + } + + @media (max-width: 768px) { + #search-dialog { + margin-top: 1rem; + } + } @@ -113,5 +131,235 @@ {{ block "main" . }}{{ end }} + +
+
+ + + +
+ +
+
+ diff --git a/themes/starless/layouts/index.json b/themes/starless/layouts/index.json new file mode 100644 index 0000000..a24d46c --- /dev/null +++ b/themes/starless/layouts/index.json @@ -0,0 +1,8 @@ +{{- $pages := where site.Pages "Kind" "in" (slice "home" "section" "page") -}} +{{- $items := slice -}} +{{- range $pages -}} + {{- $summary := .Params.summary | default .Summary | plainify | htmlUnescape -}} + {{- $content := .Plain | htmlUnescape -}} + {{- $items = $items | append (dict "id" .RelPermalink "title" .Title "url" .RelPermalink "summary" $summary "content" $content) -}} +{{- end -}} +{{- $items | jsonify -}} diff --git a/themes/starless/layouts/partials/sidebar.html b/themes/starless/layouts/partials/sidebar.html index 342bdbb..11647c5 100644 --- a/themes/starless/layouts/partials/sidebar.html +++ b/themes/starless/layouts/partials/sidebar.html @@ -3,10 +3,10 @@ {{ site.Title }} -
- search - -
+