├── .github └── workflows │ └── gh-pages.yml ├── .gitignore ├── LICENSE ├── README.md ├── archetypes └── default.md ├── assets ├── chromastyles.css ├── search.js └── styles.css ├── exampleSite ├── archetypes │ └── default.md ├── config.yml ├── content │ ├── Key0.md │ ├── Key1.md │ ├── _index.md │ ├── code-syntax.md │ ├── markdown-syntax.md │ ├── math-typesetting.md │ ├── new-post-1.md │ ├── new-post-2.md │ ├── new-post-3.md │ ├── placeholder-text.md │ ├── rich-content.md │ └── tags │ │ └── html │ │ └── _index.md └── static │ └── index.png ├── images ├── screenshot.png └── tn.png ├── layouts ├── 404.html ├── _default │ ├── baseof.html │ ├── list.html │ ├── single.html │ └── term.html ├── index.html ├── index.json └── partials │ ├── footer.html │ ├── head.html │ ├── header.html │ ├── searchbox.html │ ├── table-list.html │ └── tags-list.html └── theme.toml /.github/workflows/gh-pages.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Hugo Index Demo to Pages 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - "LICENSE" 7 | - "README.md" 8 | branches: 9 | - main 10 | workflow_dispatch: 11 | # manual run 12 | inputs: 13 | hugoVersion: 14 | description: "Hugo Version" 15 | required: false 16 | default: "0.100.0" 17 | 18 | # Allow one concurrent deployment 19 | concurrency: 20 | group: "pages" 21 | cancel-in-progress: true 22 | 23 | # Default to bash 24 | defaults: 25 | run: 26 | shell: bash 27 | 28 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 29 | permissions: 30 | contents: read 31 | pages: write 32 | id-token: write 33 | 34 | jobs: 35 | # Build job 36 | build: 37 | runs-on: ubuntu-latest 38 | env: 39 | HUGO_VERSION: "0.100.0" 40 | steps: 41 | - name: Check version 42 | if: ${{ github.event.inputs.hugoVersion }} 43 | run: export HUGO_VERSION="${{ github.event.inputs.hugoVersion }}" 44 | - name: Install Hugo CLI 45 | run: | 46 | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.deb \ 47 | && sudo dpkg -i ${{ runner.temp }}/hugo.deb 48 | - name: Checkout 49 | uses: actions/checkout@v3 50 | - name: Setup Pages 51 | id: pages 52 | uses: actions/configure-pages@v1 53 | - name: Build with Hugo 54 | run: | 55 | cd ./exampleSite && \ 56 | hugo \ 57 | --buildDrafts --gc --verbose \ 58 | --baseURL ${{ steps.pages.outputs.base_url }} 59 | - name: Upload artifact 60 | uses: actions/upload-pages-artifact@v1 61 | with: 62 | path: ./exampleSite/public 63 | # Deployment job 64 | deploy: 65 | environment: 66 | name: github-pages 67 | url: ${{ steps.deployment.outputs.page_url }} 68 | runs-on: ubuntu-latest 69 | needs: build 70 | steps: 71 | - name: Deploy to GitHub Pages 72 | id: deployment 73 | uses: actions/deploy-pages@v1 74 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/.hugo_build.lock 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Aditya Telange 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Hugo Index | Demo

2 | 3 |

4 | Mockup image 5 |

6 | 7 | --- 8 | 9 | ## Docs 10 | 11 | ### Variables 12 | 13 | | Variable | Value | Description | 14 | | ------------------------------ | ----------- | ----------- | 15 | | `params.showDescriptioninHome` | `true` | | 16 | | `params.hideAllTagsinHome` | `true` | | 17 | | `params.titleIcon` | `index.png` | | 18 | | `params.headers.key` | `Title` | | 19 | | `params.headers.value` | `Tags` | | 20 | | `permalinks.tags` | `@:slug` | | 21 | 22 | ### Powered by 23 | 24 | - [Hugo](https://github.com/gohugoio/hugo) - The world’s fastest framework for building websites. 25 | - [Fuse.js](https://github.com/krisk/Fuse) - Lightweight fuzzy-search, in JavaScript 26 | - [Quicklink](https://github.com/GoogleChromeLabs/quicklink/) - Faster subsequent page-loads by prefetching in-viewport links during idle time 27 | -------------------------------------------------------------------------------- /archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | tags: 5 | - default 6 | draft: true 7 | --- 8 | -------------------------------------------------------------------------------- /assets/chromastyles.css: -------------------------------------------------------------------------------- 1 | /* Background */ .bg { background-color: #f0f0f0; } 2 | /* PreWrapper */ .chroma { background-color: #f0f0f0; } 3 | /* Other */ .chroma .x { } 4 | /* Error */ .chroma .err { } 5 | /* CodeLine */ .chroma .cl { } 6 | /* LineLink */ .chroma .lnlinks { outline: none; text-decoration: none; color: inherit } 7 | /* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } 8 | /* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; } 9 | /* LineHighlight */ .chroma .hl { background-color: #ffffcc } 10 | /* LineNumbersTable */ .chroma .lnt { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } 11 | /* LineNumbers */ .chroma .ln { white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } 12 | /* Line */ .chroma .line { display: flex; } 13 | /* Keyword */ .chroma .k { color: #007020; font-weight: bold } 14 | /* KeywordConstant */ .chroma .kc { color: #007020; font-weight: bold } 15 | /* KeywordDeclaration */ .chroma .kd { color: #007020; font-weight: bold } 16 | /* KeywordNamespace */ .chroma .kn { color: #007020; font-weight: bold } 17 | /* KeywordPseudo */ .chroma .kp { color: #007020 } 18 | /* KeywordReserved */ .chroma .kr { color: #007020; font-weight: bold } 19 | /* KeywordType */ .chroma .kt { color: #902000 } 20 | /* Name */ .chroma .n { } 21 | /* NameAttribute */ .chroma .na { color: #4070a0 } 22 | /* NameBuiltin */ .chroma .nb { color: #007020 } 23 | /* NameBuiltinPseudo */ .chroma .bp { } 24 | /* NameClass */ .chroma .nc { color: #0e84b5; font-weight: bold } 25 | /* NameConstant */ .chroma .no { color: #60add5 } 26 | /* NameDecorator */ .chroma .nd { color: #555555; font-weight: bold } 27 | /* NameEntity */ .chroma .ni { color: #d55537; font-weight: bold } 28 | /* NameException */ .chroma .ne { color: #007020 } 29 | /* NameFunction */ .chroma .nf { color: #06287e } 30 | /* NameFunctionMagic */ .chroma .fm { } 31 | /* NameLabel */ .chroma .nl { color: #002070; font-weight: bold } 32 | /* NameNamespace */ .chroma .nn { color: #0e84b5; font-weight: bold } 33 | /* NameOther */ .chroma .nx { } 34 | /* NameProperty */ .chroma .py { } 35 | /* NameTag */ .chroma .nt { color: #062873; font-weight: bold } 36 | /* NameVariable */ .chroma .nv { color: #bb60d5 } 37 | /* NameVariableClass */ .chroma .vc { } 38 | /* NameVariableGlobal */ .chroma .vg { } 39 | /* NameVariableInstance */ .chroma .vi { } 40 | /* NameVariableMagic */ .chroma .vm { } 41 | /* Literal */ .chroma .l { } 42 | /* LiteralDate */ .chroma .ld { } 43 | /* LiteralString */ .chroma .s { color: #4070a0 } 44 | /* LiteralStringAffix */ .chroma .sa { color: #4070a0 } 45 | /* LiteralStringBacktick */ .chroma .sb { color: #4070a0 } 46 | /* LiteralStringChar */ .chroma .sc { color: #4070a0 } 47 | /* LiteralStringDelimiter */ .chroma .dl { color: #4070a0 } 48 | /* LiteralStringDoc */ .chroma .sd { color: #4070a0; font-style: italic } 49 | /* LiteralStringDouble */ .chroma .s2 { color: #4070a0 } 50 | /* LiteralStringEscape */ .chroma .se { color: #4070a0; font-weight: bold } 51 | /* LiteralStringHeredoc */ .chroma .sh { color: #4070a0 } 52 | /* LiteralStringInterpol */ .chroma .si { color: #70a0d0 } 53 | /* LiteralStringOther */ .chroma .sx { color: #c65d09 } 54 | /* LiteralStringRegex */ .chroma .sr { color: #235388 } 55 | /* LiteralStringSingle */ .chroma .s1 { color: #4070a0 } 56 | /* LiteralStringSymbol */ .chroma .ss { color: #517918 } 57 | /* LiteralNumber */ .chroma .m { color: #40a070 } 58 | /* LiteralNumberBin */ .chroma .mb { color: #40a070 } 59 | /* LiteralNumberFloat */ .chroma .mf { color: #40a070 } 60 | /* LiteralNumberHex */ .chroma .mh { color: #40a070 } 61 | /* LiteralNumberInteger */ .chroma .mi { color: #40a070 } 62 | /* LiteralNumberIntegerLong */ .chroma .il { color: #40a070 } 63 | /* LiteralNumberOct */ .chroma .mo { color: #40a070 } 64 | /* Operator */ .chroma .o { color: #666666 } 65 | /* OperatorWord */ .chroma .ow { color: #007020; font-weight: bold } 66 | /* Punctuation */ .chroma .p { } 67 | /* Comment */ .chroma .c { color: #60a0b0; font-style: italic } 68 | /* CommentHashbang */ .chroma .ch { color: #60a0b0; font-style: italic } 69 | /* CommentMultiline */ .chroma .cm { color: #60a0b0; font-style: italic } 70 | /* CommentSingle */ .chroma .c1 { color: #60a0b0; font-style: italic } 71 | /* CommentSpecial */ .chroma .cs { color: #60a0b0; background-color: #fff0f0 } 72 | /* CommentPreproc */ .chroma .cp { color: #007020 } 73 | /* CommentPreprocFile */ .chroma .cpf { color: #007020 } 74 | /* Generic */ .chroma .g { } 75 | /* GenericDeleted */ .chroma .gd { color: #a00000 } 76 | /* GenericEmph */ .chroma .ge { font-style: italic } 77 | /* GenericError */ .chroma .gr { color: #ff0000 } 78 | /* GenericHeading */ .chroma .gh { color: #000080; font-weight: bold } 79 | /* GenericInserted */ .chroma .gi { color: #00a000 } 80 | /* GenericOutput */ .chroma .go { color: #888888 } 81 | /* GenericPrompt */ .chroma .gp { color: #c65d09; font-weight: bold } 82 | /* GenericStrong */ .chroma .gs { font-weight: bold } 83 | /* GenericSubheading */ .chroma .gu { color: #800080; font-weight: bold } 84 | /* GenericTraceback */ .chroma .gt { color: #0044dd } 85 | /* GenericUnderline */ .chroma .gl { text-decoration: underline } 86 | /* TextWhitespace */ .chroma .w { color: #bbbbbb } 87 | -------------------------------------------------------------------------------- /assets/search.js: -------------------------------------------------------------------------------- 1 | import * as params from '@params'; 2 | 3 | let fuse; 4 | let searchBox = document.getElementById('search'); 5 | let resList = document.getElementById('tableListBody'); 6 | 7 | window.onload = () => { 8 | fetch(params.BaseURL + 'index.json') 9 | .then(res => res.json()) 10 | .then(data => { 11 | const options = { 12 | distance: 100, 13 | threshold: 0.0, 14 | ignoreLocation: true, 15 | keys: [ 16 | 'title', 17 | 'tags.title', 18 | ] 19 | }; 20 | const myIndex = Fuse.createIndex(options.keys, data) 21 | fuse = new Fuse(data, options, myIndex); 22 | }); 23 | } 24 | 25 | searchBox.addEventListener('input', () => { 26 | let resultSet = ''; 27 | let results = fuse.search(searchBox.value); 28 | if (results.length !== 0) { 29 | for (let item in results) { 30 | let tagList = ''; 31 | if (results[item].item.tags) { 32 | results[item].item.tags.forEach(tag => { 33 | tagList += `
  • ${tag.title}
  • ` 34 | }); 35 | } 36 | resultSet += `${results[item].item.title}` 37 | } 38 | } else { 39 | for (let item of fuse.getIndex().docs) { 40 | let tagList = ''; 41 | if (item.tags) { 42 | item.tags.forEach(tag => { 43 | tagList += `
  • ${tag.title}
  • ` 44 | }); 45 | } 46 | resultSet += `${item.title}` 47 | } 48 | } 49 | resList.innerHTML = resultSet; 50 | }) 51 | -------------------------------------------------------------------------------- /assets/styles.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: rgba(0, 0, 0); 3 | --secondary: rgba(191, 7, 7); 4 | --secondary-hover: rgba(191, 7, 7, 0.1); 5 | --max-width: 50rem; 6 | } 7 | 8 | * { 9 | box-sizing: border-box; 10 | } 11 | 12 | body, 13 | header h1 a { 14 | color: var(--primary); 15 | } 16 | 17 | body { 18 | font-family: sans, sans-serif; 19 | -webkit-text-size-adjust: 100%; 20 | text-align: left; 21 | margin: 1rem; 22 | } 23 | 24 | .main, 25 | header, 26 | footer { 27 | margin: auto; 28 | max-width: var(--max-width); 29 | line-height: 1.3; 30 | } 31 | 32 | header { 33 | margin-bottom: 1rem; 34 | } 35 | 36 | header h1 a { 37 | text-decoration: none; 38 | } 39 | 40 | a, 41 | header .desc, 42 | header h1 .hl { 43 | color: var(--secondary); 44 | } 45 | 46 | header .desc, 47 | header h1 { 48 | margin: 0; 49 | } 50 | 51 | footer { 52 | margin-top: 1rem; 53 | font-size: 0.9rem; 54 | } 55 | 56 | footer hr { 57 | border: 1px solid var(--secondary-hover); 58 | } 59 | 60 | footer .footer-text { 61 | display: flex; 62 | justify-content: space-between; 63 | flex-wrap: wrap; 64 | } 65 | 66 | table { 67 | width: 100%; 68 | margin-top: 2rem; 69 | border-spacing: 0; 70 | border-collapse: collapse; 71 | overflow-x: auto; 72 | } 73 | 74 | .all-tags { 75 | text-align: center; 76 | } 77 | 78 | .tagsList { 79 | padding: 0; 80 | margin: 0; 81 | display: flex; 82 | gap: 0.3rem; 83 | flex-wrap: wrap; 84 | } 85 | 86 | :not(td)>.tagsList:not(.single) { 87 | justify-content: center; 88 | } 89 | 90 | :not(td)>.tagsList { 91 | margin: 1rem 0; 92 | } 93 | 94 | .tagTitle, 95 | .tagsList li { 96 | display: inline-block; 97 | color: var(--secondary); 98 | border: 0.1em solid var(--secondary); 99 | padding: 0.1em 0.4rem; 100 | border-radius: 0.2em; 101 | } 102 | 103 | .tagsList li a { 104 | text-decoration: none; 105 | } 106 | 107 | .chroma { 108 | border-radius: 0.2rem; 109 | margin: 0; 110 | } 111 | 112 | :not(.lntd)>.chroma { 113 | padding: 0.3rem; 114 | } 115 | 116 | pre { 117 | overflow-x: auto; 118 | position: relative; 119 | } 120 | 121 | blockquote { 122 | margin: 0; 123 | padding: 0 1em; 124 | border-left: .25em solid var(--secondary); 125 | } 126 | 127 | .tableList td, 128 | .tableList th { 129 | padding: 0.2rem 0.4rem; 130 | width: 50%; 131 | } 132 | 133 | .tableList tr:hover td { 134 | background-color: var(--secondary-hover); 135 | } 136 | 137 | :not(pre)>code { 138 | background-color: #f0f0f0; 139 | padding: 0.1rem 0.2rem; 140 | border-radius: 0.2rem; 141 | } 142 | 143 | .searchBox input { 144 | width: 100%; 145 | border-radius: 0.2em; 146 | border: 0.1em solid var(--secondary); 147 | padding: 0.5rem; 148 | font-size: 1rem; 149 | } 150 | 151 | .searchBox input:focus { 152 | outline: 0.1em solid var(--secondary); 153 | } 154 | 155 | .searchBox { 156 | margin: 1rem 0; 157 | } 158 | 159 | header h1 img { 160 | height: 1.5rem; 161 | } 162 | 163 | .content table td, 164 | .content table th { 165 | border: 1px solid var(--primary); 166 | padding: 0.2rem 0.4rem; 167 | } 168 | 169 | .content .gist table td { 170 | border: initial; 171 | } 172 | 173 | .content table th { 174 | background: var(--secondary-hover); 175 | } 176 | 177 | img { 178 | max-width: 100%; 179 | } 180 | 181 | .chroma .hl { 182 | display: flex; 183 | } 184 | 185 | .chroma table.lntable { 186 | display: block; 187 | 188 | } 189 | 190 | .chroma .lntable .lntd:last-of-type { 191 | width: 100%; 192 | } 193 | 194 | .four-o-four { 195 | text-align: center; 196 | font-size: 2rem; 197 | } 198 | -------------------------------------------------------------------------------- /exampleSite/archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | tags: 5 | - default 6 | draft: true 7 | --- 8 | -------------------------------------------------------------------------------- /exampleSite/config.yml: -------------------------------------------------------------------------------- 1 | baseURL: https://adityatelange.github.io/hugo-index/ 2 | languageCode: en-us 3 | title: Index 4 | theme: ../../ 5 | pygmentsUseClasses: true 6 | enableInlineShortcodes: true 7 | # Copyright: © hugo-index authors | [Privacy Policy](#) 8 | 9 | markup: 10 | highlight: 11 | codeFences: true 12 | guessSyntax: true 13 | lineNos: false 14 | goldmark: 15 | renderer: 16 | unsafe: true 17 | 18 | params: 19 | # showDescriptioninHome: true 20 | # hideAllTagsinHome: true 21 | # searchBoxPlaceholder: "Type here to search..." 22 | titleIcon: index.png 23 | headers: 24 | key: Title 25 | value: Tags 26 | # value: Description 27 | 28 | permalinks: 29 | tags: "@:slug" 30 | 31 | taxonomies: 32 | tag: "tags" 33 | 34 | outputs: 35 | home: 36 | - HTML 37 | - RSS 38 | - JSON # for search 39 | 40 | privacy: 41 | vimeo: 42 | disabled: false 43 | simple: true 44 | twitter: 45 | disabled: false 46 | enableDNT: true 47 | simple: true 48 | instagram: 49 | disabled: false 50 | simple: true 51 | youtube: 52 | disabled: false 53 | privacyEnhanced: true 54 | 55 | services: 56 | instagram: 57 | disableInlineCSS: true 58 | twitter: 59 | disableInlineCSS: true 60 | -------------------------------------------------------------------------------- /exampleSite/content/Key0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Key0 3 | description: Key0's description 4 | tags: 5 | - Tag I 6 | - Tag II 7 | --- 8 | 9 | ## Header A 10 | 11 | Cursus nisi fames at class integer volutpat sem phasellus, pharetra rutrum proin imperdiet aenean a ac, mollis dapibus id morbi accumsan eleifend magna. Habitant vitae pharetra consequat vulputate cras varius luctus feugiat laoreet, lacus eleifend cursus aptent purus quisque nam netus, mus quis interdum ligula et vel sagittis magna. Enim sodales cubilia ad fames mi faucibus quisque risus, ultrices massa libero interdum congue nec imperdiet nostra, himenaeos nunc magna potenti augue ac sagittis. 12 | 13 | ``` 14 | const animals = ['pigs', 'goats', 'sheep']; 15 | 16 | const count = animals.push('cows'); 17 | console.log(count); 18 | // Expected output: 4 19 | console.log(animals); 20 | // Expected output: Array ["pigs", "goats", "sheep", "cows"] 21 | 22 | animals.push('chickens', 'cats', 'dogs'); 23 | console.log(animals); 24 | // Expected output: Array ["pigs", "goats", "sheep", "cows", "chickens", "cats", "dogs"] 25 | ``` 26 | 27 | ## Header B 28 | 29 | Lorem Ipsum was reintroduced in the 1980s by the Aldus Corporation, a company that developed Desktop Publishing Software. Their most well known product PageMaker came with pre-installed graphics and word-processing templates containing a version of the faux latin language. 30 | -------------------------------------------------------------------------------- /exampleSite/content/Key1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Key1 3 | description: Key1's description 4 | tags: 5 | - Tag I 6 | - Tag II 7 | - Tag III 8 | --- 9 | 10 | ## Header A 11 | 12 | Lorem ipsum dolor sit amet consectetur adipiscing, elit lobortis felis magnis ullamcorper placerat elementum, donec auctor nisi nunc facilisis. Porttitor curabitur eros inceptos senectus aptent vel facilisi dignissim, pharetra suspendisse volutpat vitae molestie semper vivamus, ut sapien risus cursus leo nulla habitasse. Massa volutpat nibh semper urna ligula hendrerit torquent, venenatis phasellus magnis inceptos diam pharetra maecenas accumsan, erat per elementum pretium laoreet sagittis. 13 | 14 | ``` 15 | 16 | 17 | 18 | {{ partial "head.html" . }} 19 | 20 | 21 | {{- partial "header.html" . -}} 22 |
    {{- block "main" . }}{{- end }}
    23 | {{- partial "footer.html" . -}} 24 | 25 | 26 | ``` 27 | 28 | ## Header B 29 | 30 | Lorem ipsum was conceived as filler text, formatted in a certain way to enable the presentation of graphic elements in documents, without the need for formal copy. Using Lorem Ipsum allows designers to put together layouts and the form of the content before the content has been created, giving the design and production process more freedom. 31 | -------------------------------------------------------------------------------- /exampleSite/content/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Index 3 | description: Index's description 4 | --- 5 | 6 | **Index** is a hugo theme inspired by [GTFOBins](https://gtfobins.github.io/). 7 | 8 | This theme is designed to be simple and straightforward, with a focus on providing quick and easy access to useful information. 9 | 10 | If you're someone who likes to jot down quick notes or tips this theme is perfect for you. 11 | We encourage you to give us a [star on GitHub](https://github.com/adityatelange/hugo-index/). 12 | -------------------------------------------------------------------------------- /exampleSite/content/code-syntax.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Code Syntax Guide" 3 | date: "2019-03-11" 4 | description: "Sample article showcasing basic code syntax and formatting for HTML elements." 5 | tags: ["markdown", "css", "html"] 6 | --- 7 | 8 | ### Inline Code 9 | 10 | `This is Inline Code` 11 | 12 | ### Only `pre` 13 | 14 |
    15 | This is pre text
    16 | 
    17 | 18 | ### Code block with backticks 19 | 20 | ``` 21 | 22 | 23 | 24 | 25 | Example HTML5 Document 26 | 30 | 31 | 32 |

    Test

    33 | 34 | 35 | ``` 36 | 37 | ### Code block with backticks and language specified 38 | 39 | ```html {linenos=true,hl_lines=8} 40 | 41 | 42 | 43 | 44 | Example HTML5 Document 45 | 49 | 50 | 51 |

    Test

    52 | 53 | 54 | ``` 55 | 56 | ### Code block indented with four spaces 57 | 58 | 59 | 60 | 61 | 62 | Example HTML5 Document 63 | 64 | 65 |

    Test

    66 | 67 | 68 | 69 | ### Code block with Hugo's internal highlight shortcode 70 | 71 | {{< highlight html >}} 72 | 73 | 74 | 75 | 76 | 77 | Example HTML5 Document 78 | 79 | 80 |

    Test

    81 | 82 | 83 | {{< /highlight >}} 84 | 85 | ### Gist 86 | 87 | {{< gist spf13 7896402 >}} 88 | -------------------------------------------------------------------------------- /exampleSite/content/markdown-syntax.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: "Hugo Authors" 3 | title: "Markdown Syntax Guide" 4 | date: "2019-03-11" 5 | description: "Sample article showcasing basic Markdown syntax and formatting for HTML elements." 6 | tags: [ 7 | "markdown", 8 | "css", 9 | "html", 10 | ] 11 | categories: [ 12 | "themes", 13 | "syntax", 14 | ] 15 | series: ["Themes Guide"] 16 | aliases: ["migrate-from-jekyl"] 17 | --- 18 | 19 | This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. 20 | 21 | 22 | ## Headings 23 | 24 | The following HTML `

    `—`

    ` elements represent six levels of section headings. `

    ` is the highest section level while `

    ` is the lowest. 25 | 26 | # H1 27 | ## H2 28 | ### H3 29 | #### H4 30 | ##### H5 31 | ###### H6 32 | 33 | ## Paragraph 34 | 35 | Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat. 36 | 37 | Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat. 38 | 39 | ## Blockquotes 40 | 41 | The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations. 42 | 43 | #### Blockquote without attribution 44 | 45 | > Tiam, ad mint andaepu dandae nostion secatur sequo quae. 46 | > **Note** that you can use *Markdown syntax* within a blockquote. 47 | 48 | #### Blockquote with attribution 49 | 50 | > Don't communicate by sharing memory, share memory by communicating.
    51 | > — Rob Pike[^1] 52 | 53 | [^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015. 54 | 55 | ## Tables 56 | 57 | Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. 58 | 59 | Name | Age 60 | --------|------ 61 | Bob | 27 62 | Alice | 23 63 | 64 | #### Inline Markdown within tables 65 | 66 | | Italics | Bold | Code | 67 | | -------- | -------- | ------ | 68 | | *italics* | **bold** | `code` | 69 | 70 | ## Code Blocks 71 | 72 | #### Code block with backticks 73 | 74 | ```html 75 | 76 | 77 | 78 | 79 | Example HTML5 Document 80 | 81 | 82 |

    Test

    83 | 84 | 85 | ``` 86 | 87 | #### Code block indented with four spaces 88 | 89 | 90 | 91 | 92 | 93 | Example HTML5 Document 94 | 95 | 96 |

    Test

    97 | 98 | 99 | 100 | #### Code block with Hugo's internal highlight shortcode 101 | {{< highlight html >}} 102 | 103 | 104 | 105 | 106 | Example HTML5 Document 107 | 108 | 109 |

    Test

    110 | 111 | 112 | {{< /highlight >}} 113 | 114 | ## List Types 115 | 116 | #### Ordered List 117 | 118 | 1. First item 119 | 2. Second item 120 | 3. Third item 121 | 122 | #### Unordered List 123 | 124 | * List item 125 | * Another item 126 | * And another item 127 | 128 | #### Nested list 129 | 130 | * Fruit 131 | * Apple 132 | * Orange 133 | * Banana 134 | * Dairy 135 | * Milk 136 | * Cheese 137 | 138 | ## Other Elements — abbr, sub, sup, kbd, mark 139 | 140 | GIF is a bitmap image format. 141 | 142 | H2O 143 | 144 | Xn + Yn: Zn 145 | 146 | Press CTRL+ALT+Delete to end the session. 147 | 148 | Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. 149 | -------------------------------------------------------------------------------- /exampleSite/content/math-typesetting.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: Hugo Authors 3 | title: Math Typesetting 4 | date: 2019-03-08 5 | description: A brief guide to setup KaTeX 6 | math: true 7 | --- 8 | 9 | Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. 10 | 11 | 12 | In this example we will be using [KaTeX](https://katex.org/) 13 | 14 | - Create a partial under `/layouts/partials/math.html` 15 | - Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally. 16 | - Include the partial in your templates like so: 17 | 18 | ```bash 19 | {{ if or .Params.math .Site.Params.math }} 20 | {{ partial "math.html" . }} 21 | {{ end }} 22 | ``` 23 | 24 | - To enable KaTex globally set the parameter `math` to `true` in a project's configuration 25 | - To enable KaTex on a per page basis include the parameter `math: true` in content files 26 | 27 | **Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html) 28 | 29 | {{< math.inline >}} 30 | {{ if or .Page.Params.math .Site.Params.math }} 31 | 32 | 33 | 34 | 35 | {{ end }} 36 | {{}} 37 | 38 | ### Examples 39 | 40 | {{< math.inline >}} 41 |

    42 | Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\) 43 |

    44 | {{}} 45 | 46 | Block math: 47 | $$ 48 | \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } 49 | $$ 50 | -------------------------------------------------------------------------------- /exampleSite/content/new-post-1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Markdown?" 3 | date: 2023-05-21 4 | tags: ["markdown", "css", "html", "chatgpt"] 5 | --- 6 | 7 | # Introduction 8 | 9 | Welcome to my first post! In this post, I will discuss various Markdown features and show you how to use them effectively. 10 | 11 | ## Headings 12 | 13 | You can use headings to structure your content. Here's an example: 14 | 15 | ### Subheading 16 | 17 | ## Lists 18 | 19 | Markdown supports both ordered and unordered lists. Here are examples of both: 20 | 21 | 1. Item 1 22 | 2. Item 2 23 | 3. Item 3 24 | 25 | - Unordered item 1 26 | - Unordered item 2 27 | - Unordered item 3 28 | 29 | ## Links 30 | 31 | You can create links to external websites or internal pages. Here's an example: 32 | 33 | [Visit my website](https://github.com/adityatelange/hugo-index) 34 | 35 | ## Code Blocks 36 | 37 | Markdown allows you to include code blocks. Here's an example of a code block in JavaScript: 38 | 39 | ```javascript 40 | function greet(name) { 41 | console.log("Hello, " + name + "!"); 42 | } 43 | 44 | greet("John"); 45 | ``` 46 | -------------------------------------------------------------------------------- /exampleSite/content/new-post-2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Markdown Formatting" 3 | date: 2023-05-21 4 | tags: ["markdown", "css", "html", "chatgpt"] 5 | --- 6 | 7 | In this post, we'll explore various formatting options available in Markdown. 8 | 9 | ## Emphasis 10 | 11 | You can emphasize text using _italic_ or **bold** styles. 12 | 13 | ## Quotes 14 | 15 | Markdown allows you to include block quotes. Here's an example: 16 | 17 | > "The only way to do great work is to love what you do." - Steve Jobs 18 | 19 | ## Images/Figures 20 | 21 | You can include images as figure in your posts. Here's an example: 22 | 23 | {{< figure src="https://images.unsplash.com/photo-1571328565610-56f07b8bf3ce" link="https://unsplash.com/photos/s9KlC-kMFtU?utm_source=unsplash&utm_medium=referral&utm_content=creditShareLink" caption="Emergence of Mandakini river from kedar peak" >}} 24 | 25 | ## Tables 26 | 27 | Markdown supports tables. Here's an example: 28 | 29 | | Name | Age | 30 | | ------- | --- | 31 | | John | 25 | 32 | | Jane | 30 | 33 | | Michael | 35 | 34 | 35 | That's all for now. Happy formatting with Markdown! 36 | -------------------------------------------------------------------------------- /exampleSite/content/new-post-3.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Advanced Markdown" 3 | date: 2023-05-21 4 | tags: ["markdown", "css", "html", "chatgpt"] 5 | --- 6 | 7 | In this post, we'll dive into some advanced Markdown features. 8 | 9 | ## Task Lists 10 | 11 | You can create task lists with checkboxes. Here's an example: 12 | 13 | - [x] Task 1 14 | - [ ] Task 2 15 | - [ ] Task 3 16 | 17 | ## Footnotes 18 | 19 | Markdown supports footnotes. Here's an example: 20 | 21 | Here is some text with a footnote[^1]. 22 | 23 | [^1]: This is the footnote content. 24 | 25 | ## Horizontal Rule 26 | 27 | You can insert a horizontal rule to separate sections. Here's an example: 28 | 29 | --- 30 | 31 | That's all for now. I hope you find these advanced Markdown features helpful! 32 | -------------------------------------------------------------------------------- /exampleSite/content/placeholder-text.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: "Hugo Authors" 3 | title: "Placeholder Text" 4 | date: "2019-03-09" 5 | description: "Lorem Ipsum Dolor Si Amet" 6 | tags: [ 7 | "markdown", 8 | "text", 9 | ] 10 | --- 11 | 12 | Lorem est tota propiore conpellat pectoribus de pectora summo. Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum. 13 | 14 | 1. Exierant elisi ambit vivere dedere 15 | 2. Duce pollice 16 | 3. Eris modo 17 | 4. Spargitque ferrea quos palude 18 | 19 | Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria tractus malis. 20 | 21 | 1. Comas hunc haec pietate fetum procerum dixit 22 | 2. Post torum vates letum Tiresia 23 | 3. Flumen querellas 24 | 4. Arcanaque montibus omnes 25 | 5. Quidem et 26 | 27 | # Vagus elidunt 28 | 29 | 30 | 31 | [The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon) 32 | 33 | ## Mane refeci capiebant unda mulcebat 34 | 35 | Victa caducifer, malo vulnere contra dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis. 36 | 37 | Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae vulnus haerentia iuste et exercebat, sui et. 38 | 39 | Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem Propoetides **parte**. 40 | 41 | {{< css.inline >}} 42 | 45 | {{< /css.inline >}} 46 | -------------------------------------------------------------------------------- /exampleSite/content/rich-content.md: -------------------------------------------------------------------------------- 1 | --- 2 | author: "Hugo Authors" 3 | title: "Rich Content" 4 | date: "2019-03-10" 5 | description: "A brief description of Hugo Shortcodes" 6 | tags: [ 7 | "shortcodes", 8 | "privacy", 9 | ] 10 | --- 11 | 12 | Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes) for rich content, along with a [Privacy Config](https://gohugo.io/about/hugo-and-gdpr/) and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds. 13 | 14 | --- 15 | 16 | ## YouTube Privacy Enhanced Shortcode 17 | 18 | {{< youtube ZJthWmvUzzc >}} 19 | 20 |
    21 | 22 | --- 23 | 24 | ## Twitter Simple Shortcode 25 | 26 | {{< twitter_simple adityatelange 1650152371014586369 >}} 27 | 28 |
    29 | 30 | --- 31 | 32 | ## Vimeo Simple Shortcode 33 | 34 | {{< vimeo_simple 48912912 >}} 35 | -------------------------------------------------------------------------------- /exampleSite/content/tags/html/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: html 3 | description: Contains posts about HTML 4 | --- 5 | 6 | > The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It is often assisted by technologies such as Cascading Style Sheets and scripting languages such as JavaScript. [Wikipedia](https://en.wikipedia.org/wiki/HTML) 7 | -------------------------------------------------------------------------------- /exampleSite/static/index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityatelange/hugo-index/4234dddf8c525919077615b6cf7a3a89c384d8b6/exampleSite/static/index.png -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityatelange/hugo-index/4234dddf8c525919077615b6cf7a3a89c384d8b6/images/screenshot.png -------------------------------------------------------------------------------- /images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityatelange/hugo-index/4234dddf8c525919077615b6cf7a3a89c384d8b6/images/tn.png -------------------------------------------------------------------------------- /layouts/404.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 | 3 |
    {{ .Title }}!
    4 | 5 | {{- end }}{{- /* end main */ -}} 6 | -------------------------------------------------------------------------------- /layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ partial "head.html" . }} 5 | 6 | 7 | {{- partial "header.html" . -}} 8 |
    {{- block "main" . }}{{- end }}
    9 | {{- partial "footer.html" . -}} 10 | 11 | 12 | -------------------------------------------------------------------------------- /layouts/_default/list.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adityatelange/hugo-index/4234dddf8c525919077615b6cf7a3a89c384d8b6/layouts/_default/list.html -------------------------------------------------------------------------------- /layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 | 3 | 8 | 9 |
    {{ .Content }}
    10 | 11 | {{- end }}{{- /* end main */ -}} 12 | -------------------------------------------------------------------------------- /layouts/_default/term.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 | 3 |
    {{ .Content }}
    4 | 5 | {{- partial "table-list.html" . }} 6 | 7 | {{- end }}{{- /* end main */ -}} 8 | -------------------------------------------------------------------------------- /layouts/index.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 | 3 |
    {{ .Content }}
    4 | 5 | {{- partial "tags-list.html" . }} 6 | 7 | {{- partial "searchbox.html" . }} 8 | 9 | {{- partial "table-list.html" . }} 10 | 11 | {{- end }}{{- /* end main */ -}} 12 | -------------------------------------------------------------------------------- /layouts/index.json: -------------------------------------------------------------------------------- 1 | {{ $scratch := newScratch }} 2 | {{- $scratch.Add "index" slice -}} 3 | {{- range site.RegularPages -}} 4 | {{- $scratch.Add "tags" slice -}} 5 | {{- range (.GetTerms "tags") }} 6 | {{- $scratch.Add "tags" (dict "title" .LinkTitle "permalink" .RelPermalink) }} 7 | {{- end }} 8 | {{- $scratch.Add "index" (dict "title" .Title "tags" ($scratch.Get "tags") "description" .Description "permalink" .RelPermalink) -}} 9 | {{- $scratch.Delete "tags" }} 10 | {{- end -}} 11 | {{- $scratch.Get "index" | jsonify -}} 12 | -------------------------------------------------------------------------------- /layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /layouts/partials/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ if not .IsHome }}{{ with .Title }}{{ . }} | {{ end }}{{ end }}{{ site.Title }} 5 | 6 | 7 | 8 | 9 | {{- $styles := (resources.Get "styles.css") | minify }} 10 | {{- $chromastyles := (resources.Get "chromastyles.css") | minify }} 11 | {{- $combo := (slice $styles $chromastyles) | resources.Concat "assets/stylesheet.css" }} 12 | 13 | 14 | {{- if .IsHome }} 15 | {{- $search := (resources.Get "search.js") | js.Build (dict "params" (dict "BaseURL" site.BaseURL)) | resources.Minify }} 16 | {{- $fuse := (resources.GetRemote "https://cdn.jsdelivr.net/npm/fuse.js@6.6.2/dist/fuse.basic.min.js" )}} 17 | {{- $searchcombo := (slice $fuse $search ) | resources.Concat "assets/search.js" }} 18 | 19 | 20 | {{- end }} 21 | 22 | {{- $quicklink := (slice (resources.GetRemote 23 | "https://cdnjs.cloudflare.com/ajax/libs/quicklink/2.3.0/quicklink.umd.js")) | 24 | resources.Concat "assets/quicklink.js" }} 25 | 26 | 31 | -------------------------------------------------------------------------------- /layouts/partials/header.html: -------------------------------------------------------------------------------- 1 |
    2 |

    3 | 4 | {{ with site.Params.TitleIcon }}{{ site.Title }}{{ end }} 5 | {{ site.Title }} 6 | 7 | {{- $is404 := eq .Kind "404" }} 8 | {{- if and (not .IsHome) (not $is404) }} 9 | / 10 | 11 | {{- if eq .Kind "term" }} 12 | {{ .Title }} 13 | {{- else }} 14 | {{ .Title }} 15 | {{- end }} 16 | 17 | {{- end }} 18 |

    19 |

    {{ .Description }}

    20 |
    21 | -------------------------------------------------------------------------------- /layouts/partials/searchbox.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /layouts/partials/table-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{- with site.Params.headers }} 5 | 6 | 7 | {{- end }} 8 | 9 | 10 | 11 | {{- range .RegularPages}} 12 | 13 | 14 | 25 | 26 | {{- end }} 27 | 28 |
    {{.key}}{{.value}}
    {{ .Title }} 15 | {{- if site.Params.showDescriptioninHome }} 16 | {{ .Description }} 17 | {{- else }} 18 |
      19 | {{- range (.GetTerms "tags") }} 20 |
    • {{ .LinkTitle }}
    • 21 | {{- end }} 22 |
    23 | {{- end }} 24 |
    29 | -------------------------------------------------------------------------------- /layouts/partials/tags-list.html: -------------------------------------------------------------------------------- 1 | {{- if not site.Params.hideAllTagsinHome }} 2 |
    3 | 8 |
    9 | {{- end }} 10 | -------------------------------------------------------------------------------- /theme.toml: -------------------------------------------------------------------------------- 1 | # theme.toml template for a Hugo theme 2 | # See https://github.com/gohugoio/hugoThemes#themetoml for an example 3 | 4 | name = "Index" 5 | license = "MIT" 6 | licenselink = "https://github.com/adityatelange/hugo-index/blob/main/LICENSE" 7 | description = "" 8 | homepage = "https://github.com/adityatelange/hugo-index" 9 | tags = [] 10 | features = [] 11 | min_version = "0.100.0" 12 | 13 | [author] 14 | name = "Aditya Telange" 15 | homepage = "https://github.com/adityatelange" 16 | 17 | # If porting an existing theme 18 | [original] 19 | name = "" 20 | homepage = "" 21 | repo = "" 22 | --------------------------------------------------------------------------------