diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..866e8b4 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,28 @@ +{{ define "main" }} +
+
+ {{ if .Params.image }} + + {{ end }} +

{{ .Title }}

+
{{ .Params.subtitle }}
+

+ {{ .Date.Format "2006-01-02" }} + {{ if .Params.tags }} + {{ range .Params.tags }} + + {{ . }} + + {{ end }} + {{ end }} +

+
+
+
+ {{ .TableOfContents }} +
+ {{ .Content }} +
+
+
+{{ end }} diff --git a/layouts/posts/list.html b/layouts/posts/list.html index e7b9d88..5f7ceba 100644 --- a/layouts/posts/list.html +++ b/layouts/posts/list.html @@ -6,9 +6,7 @@ {{ range $paginator.PageGroups }} {{ $month := (print .Key "-01") }}

- {{ if ne .Key "0001-01" }} - - {{ end }} +

{{ range .Pages.ByDate }}
diff --git a/static/src/js/index.js b/static/src/js/index.js index 6baced3..cb21cfd 100644 --- a/static/src/js/index.js +++ b/static/src/js/index.js @@ -27,6 +27,14 @@ $(document).ready(function () { preload: 2, download: false }); + + // HACK: ToC has blank li if no initial header + $('#TableOfContents > ul > li').each(function () { + var ele = $(this); + if (ele.children('a').length === 0) { + ele.parent().replaceWith(ele.find('ul').eq(0)); + } + }); }); $('.navbar-brand').bind('click', function (event) { diff --git a/static/src/scss/style.scss b/static/src/scss/style.scss index 84f7569..fb744d9 100644 --- a/static/src/scss/style.scss +++ b/static/src/scss/style.scss @@ -1,10 +1,11 @@ $fa-font-path: "../fonts"; @import "node_modules/font-awesome/scss/font-awesome"; -@import "node_modules/bootstrap/scss/bootstrap"; @import "highlight"; // Generated by Hugo +@import "node_modules/bootstrap/scss/bootstrap"; + pre code { margin: 0; border: 0; @@ -136,3 +137,13 @@ footer { color: #e89980; } } + +#TableOfContents { + & > ul { + padding-left: $spacer; + } +} + +ul ul, ol ol { + padding-left: $spacer * 1.5; +}