diff --git a/.cz.toml b/.cz.toml new file mode 100644 index 0000000..a45658d --- /dev/null +++ b/.cz.toml @@ -0,0 +1,7 @@ +[tool.commitizen] +name = "cz_conventional_commits" +tag_format = "$version" +version_type = "semver" +version = "0.0.1" +update_changelog_on_bump = true +major_version_zero = true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3599ba1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +--- +name: Build + +on: + - push + - pull_request + +jobs: + build: + runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + steps: + - uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v3 + with: + hugo-version: "0.135.0" + extended: true + + - name: Cache + uses: actions/cache@v4 + with: + path: /tmp/hugo_cache + key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-hugomod- + + - name: Build + run: hugo --minify diff --git a/.github/workflows/releases.yaml b/.github/workflows/releases.yaml new file mode 100644 index 0000000..775c787 --- /dev/null +++ b/.github/workflows/releases.yaml @@ -0,0 +1,31 @@ +name: Bump version + +on: + push: + branches: + - main + +jobs: + bump-version: + if: "!startsWith(github.event.head_commit.message, 'bump:')" + runs-on: ubuntu-latest + name: "Bump version and create changelog with commitizen" + steps: + - name: Check out + uses: actions/checkout@v4 + with: + token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}" + fetch-depth: 0 + - name: Create bump and changelog + uses: commitizen-tools/commitizen-action@master + with: + github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + changelog_increment_filename: body.md + - name: Release + uses: softprops/action-gh-release@v2 + with: + body_path: "body.md" + tag_name: ${{ env.REVISION }} + env: + # Ensure workflow is set to read and write permission in repo + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..86c95ef --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +# Generated files by hugo +/public/ +/resources/_gen/ +/assets/jsconfig.json +hugo_stats.json + +# Executable may be added to repository +hugo.exe +hugo.darwin +hugo.linux + +# Temporary lock file while building +/.hugo_build.lock diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..db75a5e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Shivan Sivakumaran + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/archetypes/default.md b/archetypes/default.md index fdccff8..e662511 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,4 +1,19 @@ --- -title: "{{ replace .Name "-" " " | title }}" -date: {{ .Date }} +title: '{{ replace .File.ContentBaseName "-" " " | title }}' +date: { { .Date | time.Format "2006-01-02" } } +author: Author Name +summary: Summary +categories: [""] +tags: [""] +draft: true +cover: + image: image.jpg + alt: alt text + caption: caption + relative: false + hidden: false +audio: + src: audio.mp3 + caption: caption + hidden: true --- diff --git a/assets/css/main.css b/assets/css/main.css new file mode 100644 index 0000000..6245d25 --- /dev/null +++ b/assets/css/main.css @@ -0,0 +1,421 @@ +/* Global Styling */ + +:root { + /* Colors */ + /* #196680 */ + --primary-color: hsla(195, 67.3%, 30%, 1); + /* #ff9b33 */ + --alternative-color: hsla(31, 100%, 60%, 1); + /* #222222 */ + --text-color: hsla(0, 0%, 13.3%, 1); + /* #bababa */ + --support-color: hsla(0, 0%, 73%, 1); + /* #fefefe */ + --background-color: hsla(0, 0%, 99.6%, 1); + + @media (prefers-color-scheme: dark) { + /* #80dfff; */ + --primary-color: hsla(195, 100%, 75.1%, 1); + /* #ff9b33; */ + --alternative-color: hsla(31, 100%, 60%, 1); + /* #d9d7ce */ + --text-color: hsla(47, 12%, 83%, 1); + /* #bababa */ + --support-color: hsla(0, 0%, 73%, 1); + /* #222222 */ + --background-color: hsla(0, 0%, 13.3%, 1); + } + + /* Spacing */ + --small-gap: 0.5rem; + --normal-gap: 1rem; + --large-gap: 1.5rem; + --letter-gap: 1ch; + --variable-gap: calc(8px + 1.5625vw); + + /* Font Size */ + --small-size: 0.875rem; + --normal-size: 1rem; + --large-size: 1.5rem; + --very-large-size: 2.5rem; + + /* Border */ + --normal-border-radius: 0.25rem; + --large-border-radius: 4rem; +} + +html { + scroll-padding: 1rem; + scroll-behavior: smooth; +} + +p, +small, +em, +strong, +ul, +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 0; + padding: 0; +} + +p { + font-size: var(--normal-size); +} + +small { + color: var(--support-color); + font-size: var(--small-size); + line-height: normal; +} + +* { + transition: all 0.3s ease-in-out; +} + +a { + color: var(--primary-color); + text-decoration: underline dotted; +} + +a:hover { + color: var(--alternative-color); + text-decoration: underline solid; +} + +h1 { + font-size: var(--very-large-size); +} + +h2 { + font-size: var(--large-size); +} + +h1, +h2, +h3 { + font-family: + Optician Sans, + sans-serif; +} + +h1, +h2, +h3 { + color: var(--primary-color); +} + +body>header { + font-family: + Optician Sans, + sans-serif; + + & nav { + padding: 1rem 0; + display: flex; + flex-direction: column; + align-items: center; + + & span.site-title { + font-size: var(--large-size); + } + + a { + display: flex; + align-items: center; + gap: var(--letter-gap); + } + } +} + +div.tags { + font-family: + Optician Sans, + sans-serif; + + & ul { + list-style: none; + display: flex; + flex-wrap: wrap; + gap: var(--small-gap); + + & a:hover { + outline: 2px ridge var(--text-color); + filter: none; + border-radius: var(--large-border-radius); + box-shadow: 0 0 0 2pt var(--text-color); + } + + & li { + padding: calc(var(--small-gap) / 2) var(--small-gap); + list-style: none; + + & a { + padding: calc(var(--small-gap) / 2) var(--small-gap); + } + + & a.active { + outline: 2px ridge var(--text-color); + filter: none; + border-radius: var(--large-border-radius); + } + } + } + + & ul:hover a:not(:hover) { + opacity: 0.8; + filter: blur(1px); + } +} + +section { + display: flex; + flex-direction: column; + gap: var(--small-gap); + padding: calc(var(--small-gap) / 2) var(--small-gap); + + & header { + display: flex; + flex-direction: column; + gap: 0; + } + + & footer { + display: flex; + justify-content: end; + } +} + +section.about { + position: relative; + transform: rotate(-1deg); + flex-direction: column; + border: 2px solid var(--text-color); + border-radius: var(--normal-border-radius); + /* TODO: shadow */ + box-shadow: 1px 1px 1px 1px var(--text-color); + + &:hover { + transform: rotate(0deg); + } +} + +section { + & h2 { + text-align: center; + } +} + +article { + display: flex; + flex-direction: column; + gap: var(--small-gap); + + & header { + & h1 { + transform: rotate(-1deg); + + &:hover { + transform: rotate(0deg); + } + } + } + + & footer { + display: grid; + grid-template-columns: repeat(2, 1fr); + + & a[rel="prev"] { + overflow: hidden; + text-overflow: ellipsis; + text-align: start; + } + + & a[rel="next"] { + overflow: hidden; + text-overflow: ellipsis; + text-align: end; + } + + &:hover a:not(:hover) { + opacity: 0.8; + filter: blur(1px); + } + } +} + +div.posts-groupby { + display: flex; + width: 100%; + gap: var(--large-gap); + border-top: 1px dotted var(--text-color); + padding: var(--small-gap) 0; + + &:hover a:not(:hover) { + opacity: 0.8; + filter: blur(1px); + } + + & ul { + width: 100%; + + & li { + padding: var(--small-gap) 0; + list-style: none; + + & a { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--small-gap); + + & span.post-title { + overflow: hidden; + text-overflow: ellipsis; + } + } + } + + & li:not(:first-child) { + border-top: 1px dotted var(--text-color); + } + } + + & h3 { + padding-top: var(--small-gap); + } +} + +small.post-metadata { + display: flex; + + & span { + white-space: nowrap; + overflow: hidden; + } + + & span:not(:last-child)::after { + padding: 0 calc(var(--letter-gap) / 2); + content: "ยท"; + } +} + +body { + display: flex; + margin: 0; + flex-direction: column; + width: 100dvw; + min-height: 100dvh; + line-height: 1.5; + letter-spacing: 0ch; + color: var(--text-color); + background-color: var(--background-color); + font-family: + Monaspace Xenon, + Cambria, + Cochin, + Georgia, + Times, + "Times New Roman", + serif; +} + +main { + display: flex; + flex-direction: column; + gap: var(--large-gap); + margin-left: auto; + margin-right: auto; + padding: 0 var(--variable-gap); + width: 100%; + max-width: calc(75ch + var(--variable-gap)); + flex-grow: 1; +} + +/* footer */ +body>footer { + padding: 1rem 0rem; + margin-top: 1rem; + border-top: 1px solid var(--text-color); + font-family: + Optician Sans, + sans-serif; + display: flex; + align-items: center; + justify-content: center; + + & p { + text-align: center; + } + + & p:not(:last-child)::after { + padding: 0 calc(var(--letter-gap) / 2); + content: "ยท"; + } +} + +pre:has(code) { + border-radius: calc(var(--normal-border-radius) * 2); + padding: calc(var(--small-gap)) calc(var(--small-gap) / 2); + box-shadow: 0px 0px 2pt var(--text-color); + overflow-x: scroll; +} + +code { + font-family: "Monaspace Radon"; +} + +div.content { + white-space: break-spaces; + word-break: break-word; + + & * { + margin: var(--small-gap) 0rem; + } +} + +@font-face { + font-family: "Optician Sans"; + font-style: normal; + font-weight: 400; + src: url("/fonts/Optiker-K.woff") format("woff"); +} + +@font-face { + font-family: "Monaspace Radon"; + font-style: normal; + src: url("/fonts/MonaspaceRadon-Regular.woff") format("woff"); +} + +@font-face { + font-family: "Monaspace Xenon"; + font-weight: 400; + font-style: normal; + src: url("/fonts/MonaspaceXenon-Light.woff") format("woff"); +} + +@font-face { + font-family: "Monaspace Xenon"; + font-style: normal; + font-weight: 700; + src: url("/fonts/MonaspaceXenon-Bold.woff") format("woff"); +} + +@font-face { + font-family: "Monaspace Xenon"; + font-weight: 400; + font-style: italic; + src: url("/fonts/MonaspaceXenon-Italic.woff") format("woff"); +} + +@font-face { + font-family: "Monaspace Xenon"; + font-weight: 700; + font-style: italic; + src: url("/fonts/MonaspaceXenon-BoldItalic.woff") format("woff"); +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..e2aac52 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1 @@ +console.log('This site was generated by Hugo.'); diff --git a/content/_index.md b/content/_index.md deleted file mode 100644 index 0e6a35a..0000000 --- a/content/_index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "Home" ---- - -# Hi there - -Welcome to your new Hugo site. - -Now go build something great. diff --git a/content/posts/my-first-post.md b/content/posts/my-first-post.md index bc12660..a011128 100644 --- a/content/posts/my-first-post.md +++ b/content/posts/my-first-post.md @@ -1,6 +1,30 @@ --- title: "My First Post" -date: 2020-09-03T17:27:59+07:00 +date: 2020-09-03 +author: Author Name +summary: Summary +tags: ["lorem", "epsum"] +draft: true +cover: + image: image.jpg + alt: alt text + caption: caption + relative: false + hidden: false +audio: + file: audio.mp3 + caption: audio + hidden: true --- Here's an example blog post. + +Lorem **ipsum** **_dolor_** sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis. + +Lorem ipsum _dolor_ sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis. + +```py +# long commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg commentg comment +def main(): + print("Hello World") +``` diff --git a/content/posts/my-second-post.md b/content/posts/my-second-post.md new file mode 100644 index 0000000..af7011c --- /dev/null +++ b/content/posts/my-second-post.md @@ -0,0 +1,29 @@ +--- +title: "My First Post" +date: 2020-09-03 +author: Author Name +summary: Summary +tags: ["lorem"] +draft: false +cover: + image: image.jpg + alt: alt text + caption: caption + relative: false + hidden: false +audio: + file: audio.mp3 + caption: audio + hidden: true +--- + +Here's an example blog post. + +Lorem **ipsum** **_dolor_** sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis. + +Lorem ipsum _dolor_ sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis. + +```py +def main(): + print("Hello World") +``` diff --git a/content/posts/my-third-post.md b/content/posts/my-third-post.md new file mode 100644 index 0000000..af7011c --- /dev/null +++ b/content/posts/my-third-post.md @@ -0,0 +1,29 @@ +--- +title: "My First Post" +date: 2020-09-03 +author: Author Name +summary: Summary +tags: ["lorem"] +draft: false +cover: + image: image.jpg + alt: alt text + caption: caption + relative: false + hidden: false +audio: + file: audio.mp3 + caption: audio + hidden: true +--- + +Here's an example blog post. + +Lorem **ipsum** **_dolor_** sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis. + +Lorem ipsum _dolor_ sit amet, officia excepteur ex fugiat reprehenderit enim labore culpa sint ad nisi Lorem pariatur mollit ex esse exercitation amet. Nisi anim cupidatat excepteur officia. Reprehenderit nostrud nostrud ipsum Lorem est aliquip amet voluptate voluptate dolor minim nulla est proident. Nostrud officia pariatur ut officia. Sit irure elit esse ea nulla sunt ex occaecat reprehenderit commodo officia dolor Lorem duis laboris cupidatat officia voluptate. Culpa proident adipisicing id nulla nisi laboris ex in Lorem sunt duis officia eiusmod. Aliqua reprehenderit commodo ex non excepteur duis sunt velit enim. Voluptate laboris sint cupidatat ullamco ut ea consectetur et est culpa et culpa duis. + +```py +def main(): + print("Hello World") +``` diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md deleted file mode 100644 index 0e6a35a..0000000 --- a/exampleSite/content/_index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -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 deleted file mode 100644 index 6f5bcdb..0000000 --- a/exampleSite/content/about/index.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -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 deleted file mode 100644 index bc12660..0000000 --- a/exampleSite/content/posts/my-first-post.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -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 deleted file mode 100644 index 5e67390..0000000 --- a/exampleSite/hugo.toml +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 5e67390..0000000 --- a/hugo.toml +++ /dev/null @@ -1,16 +0,0 @@ -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.yml b/hugo.yml new file mode 100644 index 0000000..6fc1d98 --- /dev/null +++ b/hugo.yml @@ -0,0 +1,44 @@ +--- +baseURL: https://example.org/ +languageCode: en-US +title: My New Hugo Site + +params: + author: + email: author@email.com + name: Author name + about: + image: image.webp + githubRepo: "http://github.com/shivan-s/shivan.xyz" + +menus: + main: + - name: About + pageRef: /about + weight: 10 + - name: Posts + pageRef: /posts + weight: 20 + - name: Projects + pageRef: /projects + weight: 30 + +module: + hugoVersion: + extended: false + min: "0.116.0" + +pagination: + disableAliases: false + pagerSize: 10 + path: page + +markup: + highlight: + style: catppuccin-mocha + +enableGitInfo: true + +taxonomies: + category: categories + tag: tags diff --git a/i18n/.gitkeep b/i18n/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/layouts/404.html b/layouts/404.html deleted file mode 100644 index 9b100d8..0000000 --- a/layouts/404.html +++ /dev/null @@ -1,9 +0,0 @@ -{{ 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/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..4845c17 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,14 @@ + + + + + {{ partial "head.html" . }} + + + +
{{ partial "header.html" . }}
+
{{ block "main" . }}{{ end }}
+ + + + diff --git a/layouts/_default/home.html b/layouts/_default/home.html new file mode 100644 index 0000000..a015b45 --- /dev/null +++ b/layouts/_default/home.html @@ -0,0 +1,44 @@ +{{ define "main" }} {{ with .GetPage "About" }} +

{{ .Page.Title }}

+
+
+ +

About

+
+
+

{{ truncate 128 .Content }}

+ +
+{{ end }} +
+
+

Posts

+
+ {{ $pages := where site.RegularPages "Type" "posts" }} {{ range + $pages.GroupByPublishDate "2006" }} +
+

{{ .Key }}

+ +
+ {{ end }} +
+{{ end }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index b4d94d4..4c07b2f 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,18 +1,26 @@ -{{ partial "header.html" . }} +{{ define "main" }} +
+

{{ .Title }}

+
-

{{ .Title }}

- -{{ .Content }} - -{{ range.Data.Pages }} -
-

- {{ .Title }} -

- -
-{{ end }} - -{{ partial "footer.html" . }} +{{ range .Pages.GroupByPublishDate "2006" }} +
+

{{ .Key }}

+ +
+{{ end }} {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a903ad6..6382a37 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,7 +1,8 @@ -{{ partial "header.html" . }} - -

{{ .Title }}

- -{{ .Content }} - -{{ partial "footer.html" . }} +{{ define "main" }} +
+
+

{{ .Title }}

+
+
{{ .Content }}
+
+{{ end }} diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html new file mode 100644 index 0000000..c045ff8 --- /dev/null +++ b/layouts/_default/taxonomy.html @@ -0,0 +1,5 @@ +{{ define "main" }} +

{{ .Title }}

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

{{ .LinkTitle }}

+{{ end }} {{ end }} diff --git a/layouts/index.html b/layouts/index.html deleted file mode 100644 index de7cc5f..0000000 --- a/layouts/index.html +++ /dev/null @@ -1,5 +0,0 @@ -{{ partial "header.html" . }} - -{{ .Content }} - -{{ partial "footer.html" . }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 76f737c..967e766 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,8 +1,12 @@ - - - - - - +

+ Made with ๐Ÿ’— by + {{ .Site.Params.author.name + }} +

+

+ โšก by + Hugo in + +

+

Back to Top

diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..02c2240 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,5 @@ + + +{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }} +{{ partialCached "head/css.html" . }} +{{ partialCached "head/js.html" . }} diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html new file mode 100644 index 0000000..91b928d --- /dev/null +++ b/layouts/partials/head/css.html @@ -0,0 +1,9 @@ +{{- with resources.Get "css/main.css" }} + {{- if eq hugo.Environment "development" }} + + {{- else }} + {{- with . | minify | fingerprint }} + + {{- end }} + {{- end }} +{{- end }} diff --git a/layouts/partials/head/js.html b/layouts/partials/head/js.html new file mode 100644 index 0000000..18fe842 --- /dev/null +++ b/layouts/partials/head/js.html @@ -0,0 +1,12 @@ +{{- with resources.Get "js/main.js" }} + {{- if eq hugo.Environment "development" }} + {{- with . | js.Build }} + + {{- end }} + {{- else }} + {{- $opts := dict "minify" true }} + {{- with . | js.Build $opts | fingerprint }} + + {{- end }} + {{- end }} +{{- end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 2e6f67e..0a83db8 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,22 +1,7 @@ - - - - - - - - {{ 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 deleted file mode 100644 index cf07600..0000000 --- a/layouts/partials/nav.html +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html new file mode 100644 index 0000000..30897b0 --- /dev/null +++ b/layouts/partials/tags.html @@ -0,0 +1,13 @@ +{{- /* For a given taxonomy, renders a list of terms assigned to the page. +@context {page} page The current page. @context {string} taxonomy The taxonomy. +@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }} */}} {{- +$page := .page }} {{- $taxonomy := .taxonomy }} {{- with $page.GetTerms +$taxonomy }} {{- $label := (index . 0).Parent.LinkTitle }} +
+ +
+{{- end }} diff --git a/layouts/partials/time.html b/layouts/partials/time.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/posts/single.html b/layouts/posts/single.html new file mode 100644 index 0000000..5b6c027 --- /dev/null +++ b/layouts/posts/single.html @@ -0,0 +1,24 @@ +{{ define "main" }} +
+
+

{{ .Title }}

+ +
+
{{ .Content }}
+ {{ partial "tags.html" (dict "taxonomy" "tags" "page" .) }} + +
+{{ end }} diff --git a/layouts/shortcodes/audio.html b/layouts/shortcodes/audio.html new file mode 100644 index 0000000..cb5088a --- /dev/null +++ b/layouts/shortcodes/audio.html @@ -0,0 +1 @@ +{{ partials "audio.html" . }} diff --git a/readme.md b/readme.md index c411d16..d2ac6b5 100644 --- a/readme.md +++ b/readme.md @@ -1,20 +1,20 @@ -# Hugo Starter Theme +
+

Optom Code (WIP) ๐Ÿšง

+
-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. +[![Build](https://github.com/shivan-s/hugo-optom-code/actions/workflows/build.yml/badge.svg)](https://github.com/shivan-s/hugo-optom-code/actions/workflows/build.yml) -## Getting started +A theme for [Hugo](https://gohugo.io/). -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. +## Installation & Updating -```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. +Installation into you hugo site: ```bash -cp -r themes/your-theme-name/exampleSite/* ./ +git submodule add --depth=1 git@github.com:shivan-s/hugo-optom-code.git themes/optom-code +git submodule update --init --recursive ``` -To learn more about building themes in Hugo, refer to Hugo's [templating documentation](https://gohugo.io/templates/). +## Acknowledgements + +Inspiration from [Papermod](https://github.com/adityatelange/hugo-PaperMod). diff --git a/static/css/style.css b/static/css/style.css deleted file mode 100644 index 4082b2b..0000000 --- a/static/css/style.css +++ /dev/null @@ -1,59 +0,0 @@ -/* 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; -} diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..67f8b77 Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/fonts/MonaspaceRadon-Regular.woff b/static/fonts/MonaspaceRadon-Regular.woff new file mode 100644 index 0000000..9b9d8b5 Binary files /dev/null and b/static/fonts/MonaspaceRadon-Regular.woff differ diff --git a/static/fonts/MonaspaceXenon-Bold.woff b/static/fonts/MonaspaceXenon-Bold.woff new file mode 100644 index 0000000..05c0ba0 Binary files /dev/null and b/static/fonts/MonaspaceXenon-Bold.woff differ diff --git a/static/fonts/MonaspaceXenon-BoldItalic.woff b/static/fonts/MonaspaceXenon-BoldItalic.woff new file mode 100644 index 0000000..86697f4 Binary files /dev/null and b/static/fonts/MonaspaceXenon-BoldItalic.woff differ diff --git a/static/fonts/MonaspaceXenon-ExtraBold.woff b/static/fonts/MonaspaceXenon-ExtraBold.woff new file mode 100644 index 0000000..90fc861 Binary files /dev/null and b/static/fonts/MonaspaceXenon-ExtraBold.woff differ diff --git a/static/fonts/MonaspaceXenon-ExtraLight.woff b/static/fonts/MonaspaceXenon-ExtraLight.woff new file mode 100644 index 0000000..3425b66 Binary files /dev/null and b/static/fonts/MonaspaceXenon-ExtraLight.woff differ diff --git a/static/fonts/MonaspaceXenon-Italic.woff b/static/fonts/MonaspaceXenon-Italic.woff new file mode 100644 index 0000000..3cb3473 Binary files /dev/null and b/static/fonts/MonaspaceXenon-Italic.woff differ diff --git a/static/fonts/MonaspaceXenon-Light.woff b/static/fonts/MonaspaceXenon-Light.woff new file mode 100644 index 0000000..2df19d2 Binary files /dev/null and b/static/fonts/MonaspaceXenon-Light.woff differ diff --git a/static/fonts/MonaspaceXenon-Medium.woff b/static/fonts/MonaspaceXenon-Medium.woff new file mode 100644 index 0000000..86f495c Binary files /dev/null and b/static/fonts/MonaspaceXenon-Medium.woff differ diff --git a/static/fonts/MonaspaceXenon-Regular.woff b/static/fonts/MonaspaceXenon-Regular.woff new file mode 100644 index 0000000..e89a0cd Binary files /dev/null and b/static/fonts/MonaspaceXenon-Regular.woff differ diff --git a/static/fonts/MonaspaceXenon-SemiBold.woff b/static/fonts/MonaspaceXenon-SemiBold.woff new file mode 100644 index 0000000..f758218 Binary files /dev/null and b/static/fonts/MonaspaceXenon-SemiBold.woff differ diff --git a/static/fonts/Optiker-K.woff b/static/fonts/Optiker-K.woff new file mode 100644 index 0000000..dd12166 Binary files /dev/null and b/static/fonts/Optiker-K.woff differ diff --git a/theme.yml b/theme.yml new file mode 100644 index 0000000..106095b --- /dev/null +++ b/theme.yml @@ -0,0 +1,20 @@ +--- +name: "Optom Code" +license: "MIT" +licenselink: "https://github.com/shivan/hugo-optom-code/LICENSE" +description: "A theme for optometrists who code" +homepage: "https://github.com/shivan-s/hugo-optom-code" + +# If you have a running demo of the theme +demosite: "https://shivan.xyz" + +# Taxonomy terms +tags: + - blog + - company + +features: + +author: + name: "Shivan Sivakumaran" + homepage: "https://shivan.xyz"