diff --git a/.gitignore b/.gitignore index 3e696c6..3d69dcd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Generated files by hugo /public/ -/resources/_gen/ +/resources/ /assets/jsconfig.json hugo_stats.json diff --git a/.gitmodules b/.gitmodules index d25c869..1fd8da9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ -[submodule "themes/mini"] - path = themes/mini - url = https://github.com/nodejh/hugo-theme-mini.git [submodule "themes/PaperMod"] path = themes/PaperMod url = https://github.com/adityatelange/hugo-PaperMod.git +[submodule "themes/optom-code"] + path = themes/optom-code + url = https://github.com/shivan-s/hugo-optom-code.git diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 973b04a..d010173 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,9 +15,13 @@ repos: - id: check-yaml - id: check-json repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 - hooks: - id: optimize-png - id: optimize-jpg + # FIXME: Keeps endlessly optimising + # - id: optimize-webp + # args: [--threshold=2] + - id: optimize-svg repo: https://github.com/boidolr/pre-commit-images - rev: v1.7.0 + rev: v1.8.2 diff --git a/archetypes/post-bundle/index.md b/archetypes/post-bundle/index.md index 067ece1..676b7ee 100644 --- a/archetypes/post-bundle/index.md +++ b/archetypes/post-bundle/index.md @@ -3,7 +3,6 @@ author: Shivan Sivakumaran title: {{ replace .Name "-" " " | title }} date: {{ .Date | time.Format "2006-01-02" }} summary: summary -categories: [""] tags: [""] draft: true cover: diff --git a/archetypes/project-bundle/index.md b/archetypes/project-bundle/index.md deleted file mode 100644 index 018090e..0000000 --- a/archetypes/project-bundle/index.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -author: Shivan Sivakumaran -title: { { replace .Name "-" " " | title } } -date: { { .Date | time.Format "2006-01-02" } } -summary: summary -categories: ["project"] -tags: [""] -draft: true -cover: - image: image.jpg - alt: alt text - caption: caption - relative: false - hidden: false ---- - -Introductions - -### Technologies - -- - -### Resources - -- Live link: []() -- [Source code]() diff --git a/assets/css/extended/custom.css b/assets/css/extended/custom.css deleted file mode 100644 index 71df04d..0000000 --- a/assets/css/extended/custom.css +++ /dev/null @@ -1,31 +0,0 @@ -:root { - --primary-color: #196680; - --secondary-color: #80DFFF; - --alternative-color: #FF9B33; -} -a { - color: var(--primary-color); -} -.dark a { - color: var(--secondary-color); -} - -a:hover { - color: var(--alternative-color); -} - -h1, -h2, -h3 { - color: var(--primary-color); -} - -.dark h1, -.dark h2, -.dark h3 { - color: var(--secondary-color); -} - -.dark .pagination a { - color: var(--primary-color); -} diff --git a/assets/js/fastsearch.js b/assets/js/fastsearch.js deleted file mode 100644 index 0a154fc..0000000 --- a/assets/js/fastsearch.js +++ /dev/null @@ -1,165 +0,0 @@ -import * as params from "@params"; - -var fuse; // holds our search engine -var resList = document.getElementById("searchResults"); -var sInput = document.getElementById("searchInput"); -var first, - last, - current_elem = null; -var resultsAvailable = false; - -// load our search index -window.onload = function () { - var xhr = new XMLHttpRequest(); - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - if (xhr.status === 200) { - var data = JSON.parse(xhr.responseText); - if (data) { - // fuse.js options; check fuse.js website for details - var options = { - distance: 100, - threshold: 0.4, - ignoreLocation: true, - keys: ["title", "permalink", "summary", "content"], - }; - if (params.fuseOpts) { - options = { - isCaseSensitive: params.fuseOpts.iscasesensitive - ? params.fuseOpts.iscasesensitive - : false, - includeScore: params.fuseOpts.includescore - ? params.fuseOpts.includescore - : false, - includeMatches: params.fuseOpts.includematches - ? params.fuseOpts.includematches - : false, - minMatchCharLength: params.fuseOpts.minmatchcharlength - ? params.fuseOpts.minmatchcharlength - : 1, - shouldSort: params.fuseOpts.shouldsort - ? params.fuseOpts.shouldsort - : true, - findAllMatches: params.fuseOpts.findallmatches - ? params.fuseOpts.findallmatches - : false, - keys: params.fuseOpts.keys - ? params.fuseOpts.keys - : ["title", "permalink", "summary", "content"], - location: params.fuseOpts.location ? params.fuseOpts.location : 0, - threshold: params.fuseOpts.threshold - ? params.fuseOpts.threshold - : 0.4, - distance: params.fuseOpts.distance - ? params.fuseOpts.distance - : 100, - ignoreLocation: params.fuseOpts.ignorelocation - ? params.fuseOpts.ignorelocation - : true, - }; - } - fuse = new Fuse(data, options); // build the index from the json file - } - } else { - console.log(xhr.responseText); - } - } - }; - xhr.open("GET", "https://shivan.xyz/index.json"); - xhr.send(); -}; - -function activeToggle(ae) { - document.querySelectorAll(".focus").forEach(function (element) { - // rm focus class - element.classList.remove("focus"); - }); - if (ae) { - ae.focus(); - document.activeElement = current_elem = ae; - ae.parentElement.classList.add("focus"); - } else { - document.activeElement.parentElement.classList.add("focus"); - } -} - -function reset() { - resultsAvailable = false; - resList.innerHTML = sInput.value = ""; // clear inputbox and searchResults - sInput.focus(); // shift focus to input box -} - -// execute search as each character is typed -sInput.onkeyup = function (e) { - // run a search query (for "term") every time a letter is typed - // in the search box - if (fuse) { - const results = fuse.search(this.value.trim()); // the actual query being run using fuse.js - if (results.length !== 0) { - // build our html if result exists - let resultSet = ""; // our results bucket - - for (let item in results) { - resultSet += - `