From 25b1194c62e45b20252d77a54ec632dd8315d3bf Mon Sep 17 00:00:00 2001 From: Shivan Sivakumaran Date: Fri, 11 Oct 2024 14:36:29 +1300 Subject: [PATCH] init --- archetypes/default.md | 4 ++ content/_index.md | 9 ++++ content/about/index.md | 5 ++ content/posts/my-first-post.md | 6 +++ exampleSite/content/_index.md | 9 ++++ exampleSite/content/about/index.md | 5 ++ exampleSite/content/posts/my-first-post.md | 6 +++ exampleSite/hugo.toml | 16 ++++++ hugo.toml | 16 ++++++ layouts/404.html | 9 ++++ layouts/_default/list.html | 18 +++++++ layouts/_default/single.html | 7 +++ layouts/index.html | 5 ++ layouts/partials/footer.html | 8 +++ layouts/partials/header.html | 22 ++++++++ layouts/partials/nav.html | 14 +++++ readme.md | 20 ++++++++ static/css/style.css | 59 ++++++++++++++++++++++ 18 files changed, 238 insertions(+) create mode 100644 archetypes/default.md create mode 100644 content/_index.md create mode 100644 content/about/index.md create mode 100644 content/posts/my-first-post.md create mode 100644 exampleSite/content/_index.md create mode 100644 exampleSite/content/about/index.md create mode 100644 exampleSite/content/posts/my-first-post.md create mode 100644 exampleSite/hugo.toml create mode 100644 hugo.toml create mode 100644 layouts/404.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/nav.html create mode 100644 readme.md create mode 100644 static/css/style.css diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..fdccff8 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,4 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +--- diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..0e6a35a --- /dev/null +++ b/content/_index.md @@ -0,0 +1,9 @@ +--- +title: "Home" +--- + +# Hi there + +Welcome to your new Hugo site. + +Now go build something great. diff --git a/content/about/index.md b/content/about/index.md new file mode 100644 index 0000000..6f5bcdb --- /dev/null +++ b/content/about/index.md @@ -0,0 +1,5 @@ +--- +title: "About" +--- + +Here's a bit about me. diff --git a/content/posts/my-first-post.md b/content/posts/my-first-post.md new file mode 100644 index 0000000..bc12660 --- /dev/null +++ b/content/posts/my-first-post.md @@ -0,0 +1,6 @@ +--- +title: "My First Post" +date: 2020-09-03T17:27:59+07:00 +--- + +Here's an example blog post. diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md new file mode 100644 index 0000000..0e6a35a --- /dev/null +++ b/exampleSite/content/_index.md @@ -0,0 +1,9 @@ +--- +title: "Home" +--- + +# Hi there + +Welcome to your new Hugo site. + +Now go build something great. diff --git a/exampleSite/content/about/index.md b/exampleSite/content/about/index.md new file mode 100644 index 0000000..6f5bcdb --- /dev/null +++ b/exampleSite/content/about/index.md @@ -0,0 +1,5 @@ +--- +title: "About" +--- + +Here's a bit about me. diff --git a/exampleSite/content/posts/my-first-post.md b/exampleSite/content/posts/my-first-post.md new file mode 100644 index 0000000..bc12660 --- /dev/null +++ b/exampleSite/content/posts/my-first-post.md @@ -0,0 +1,6 @@ +--- +title: "My First Post" +date: 2020-09-03T17:27:59+07:00 +--- + +Here's an example blog post. diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml new file mode 100644 index 0000000..5e67390 --- /dev/null +++ b/exampleSite/hugo.toml @@ -0,0 +1,16 @@ +baseURL = "https://mynewhugosite.com" +title = "My New Hugo Site" +theme = "hugo-starter" + +[menu] + [[menu.main]] + identifier = "posts" + name = "Posts" + url = "/posts" + weight = 10 + + [[menu.main]] + identifier = "about" + name = "About" + url = "/about" + weight = 20 diff --git a/hugo.toml b/hugo.toml new file mode 100644 index 0000000..5e67390 --- /dev/null +++ b/hugo.toml @@ -0,0 +1,16 @@ +baseURL = "https://mynewhugosite.com" +title = "My New Hugo Site" +theme = "hugo-starter" + +[menu] + [[menu.main]] + identifier = "posts" + name = "Posts" + url = "/posts" + weight = 10 + + [[menu.main]] + identifier = "about" + name = "About" + url = "/about" + weight = 20 diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..9b100d8 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,9 @@ +{{ partial "header.html" . }} + +

Page Not Found

+ +

This page doesn't exist.

+ +

Go back to the home page

+ +{{ partial "footer.html" . }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..b4d94d4 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,18 @@ +{{ partial "header.html" . }} + +

{{ .Title }}

+ +{{ .Content }} + +{{ range.Data.Pages }} +
+

+ {{ .Title }} +

+ +
+{{ end }} + +{{ partial "footer.html" . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..a903ad6 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,7 @@ +{{ partial "header.html" . }} + +

{{ .Title }}

+ +{{ .Content }} + +{{ partial "footer.html" . }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..de7cc5f --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,5 @@ +{{ partial "header.html" . }} + +{{ .Content }} + +{{ partial "footer.html" . }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..76f737c --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,8 @@ + + + + + + diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..2e6f67e --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,22 @@ + + + + + + + + {{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }} + + + + {{ with .OutputFormats.Get "rss" -}} + {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} + {{ end -}} + + + + + +{{ partial "nav.html" . }} + +
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html new file mode 100644 index 0000000..cf07600 --- /dev/null +++ b/layouts/partials/nav.html @@ -0,0 +1,14 @@ + diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..c411d16 --- /dev/null +++ b/readme.md @@ -0,0 +1,20 @@ +# Hugo Starter Theme + +Dead-simple Hugo theme with everything you need to get started. Intended to be a starter for creating your own theme without including useless bloat like most Hugo themes. + +## Getting started + +Inside your project folder, copy the theme to your `themes` folder. Since you're just using it as a starter for your theme, remove the git history. + +```bash +git clone https://github.com/ericmurphyxyz/hugo-starter-theme themes/your-theme-name +rm -rf themes/your-theme-name/.git +``` + +If you'd like some example content and an example config file to get started, you can copy the `exampleSite` directory into your root Hugo directory. + +```bash +cp -r themes/your-theme-name/exampleSite/* ./ +``` + +To learn more about building themes in Hugo, refer to Hugo's [templating documentation](https://gohugo.io/templates/). diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..4082b2b --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,59 @@ +/* LAYOUT */ + +body { + color: #333; + font-size: 125%; + line-height: 1.5; + max-width: 45rem; + padding: 1rem; + margin: 0 auto; +} + +.content { + margin-bottom: 2rem; +} + +/* NAVIGATION */ + +.site-nav { + display: flex; +} + +.site-nav a { + display: block; + padding: 1rem; +} + +.site-nav .logo { + font-weight: bold; + padding-left: 0; +} + +.main-menu { + display: flex; + list-style: none; + margin: 0; + padding: 0; +} + +@media screen and (max-width: 48rem) { + .site-nav, + .main-menu { + flex-direction: column; + } + + .site-nav a { + padding: 0.5rem; + padding-left: 0; + } +} + +/* LISTS */ + +.post-snippet { + margin-bottom: 1rem; +} + +.post-snippet h3 { + margin-bottom: 0.25rem; +}