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" . }} - -
This page doesn't exist.
- - - -{{ 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" . }} + + + +{{ truncate 128 .Content }}
+ +Tags
+