├── .eslintrc.yml ├── .github ├── FUNDING.yml └── workflows │ └── hugo.yaml ├── .gitignore ├── .linkinator.config.json ├── .markdownlint.json ├── .prettier.json ├── .prettierignore ├── .stylelintrc.json ├── LICENSE ├── README.md ├── USERS.md ├── archetypes └── posts.md ├── assets ├── scripts │ ├── copy.js │ ├── menu.js │ ├── print.js │ └── theme.js └── styles │ ├── _buttons.scss │ ├── _footer.scss │ ├── _gen_syntax.scss │ ├── _header.scss │ ├── _main.scss │ ├── _menu.scss │ ├── _pagination.scss │ ├── _post.scss │ ├── _slides.scss │ ├── _syntax.scss │ ├── _themes.scss │ ├── _variables.scss │ └── app.scss ├── config.toml ├── exampleSite ├── config │ ├── _default │ │ └── config.toml │ └── production │ │ └── config.toml ├── content │ ├── _index.md │ ├── about.md │ ├── docs │ │ ├── _index.md │ │ └── commands │ │ │ ├── _index.md │ │ │ ├── awk.md │ │ │ ├── column.md │ │ │ ├── grep.md │ │ │ └── irssi.md │ ├── posts │ │ ├── _index.md │ │ ├── markdown-syntax.md │ │ └── rich-content.md │ └── slides │ │ ├── _index.md │ │ └── hugo-xterm-slides.md ├── go.mod ├── go.sum ├── layouts │ └── partials │ │ └── extend_head.html ├── scripts │ └── hugo-env └── static │ └── images │ └── xterm.png ├── go.mod ├── images ├── screenshot.png └── tn.png ├── layouts ├── 404.html ├── _default │ ├── _markup │ │ ├── render-codeblock.html │ │ └── render-heading.html │ ├── baseof.html │ ├── list.html │ ├── rss.xml │ ├── single.html │ └── terms.html ├── cv │ └── single.html ├── partials │ ├── breadcrumbs.html │ ├── comments.html │ ├── footer.html │ ├── gitinfo.html │ ├── head │ │ ├── base.html │ │ └── style.html │ ├── header.html │ ├── navbar.html │ ├── pagination.html │ ├── post-entries.html │ ├── scripts │ │ └── base.html │ ├── site-verification.html │ ├── slides │ │ ├── scripts.html │ │ └── style.html │ └── theme-icon.html ├── shortcodes │ ├── cv │ │ └── experience.html │ ├── figure.html │ └── image.html └── slides │ └── single.html ├── package-lock.json ├── package.json ├── static └── screenshots │ ├── hugo-xterm-ss-01-dark.png │ └── hugo-xterm-ss-02-light.png └── theme.toml /.eslintrc.yml: -------------------------------------------------------------------------------- 1 | env: 2 | browser: true 3 | es2021: true 4 | 5 | extends: 6 | - standard 7 | - prettier 8 | 9 | parserOptions: 10 | ecmaVersion: latest 11 | 12 | rules: 13 | # best practices 14 | arrow-parens: 15 | - 2 16 | - as-needed 17 | semi: 18 | - 2 19 | - always 20 | class-methods-use-this: 0 21 | comma-dangle: 22 | - 2 23 | - always-multiline 24 | no-console: 25 | - 2 26 | no-unused-expressions: 0 27 | no-param-reassign: 28 | - 2 29 | - props: false 30 | no-useless-escape: 0 31 | func-names: 0 32 | quotes: 33 | - 2 34 | - double 35 | - allowTemplateLiterals: true 36 | no-underscore-dangle: 0 37 | object-curly-newline: 0 38 | function-paren-newline: 0 39 | operator-linebreak: 40 | - 2 41 | - after 42 | no-unused-vars: 43 | - 2 44 | - argsIgnorePattern: "^_" 45 | 46 | globals: 47 | document: true 48 | requestAnimationFrame: true 49 | window: true 50 | self: true 51 | fetch: true 52 | Headers: true 53 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: https://buymeacoffee.com/manid2 2 | -------------------------------------------------------------------------------- /.github/workflows/hugo.yaml: -------------------------------------------------------------------------------- 1 | name: GitHub Pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - dev 8 | 9 | # Allows you to run this workflow manually from the Actions tab 10 | workflow_dispatch: 11 | 12 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 13 | permissions: 14 | contents: read 15 | pages: write 16 | id-token: write 17 | 18 | # Allow only one concurrent deployment, skipping runs queued between the run 19 | # in-progress and latest queued. However, do NOT cancel in-progress runs as 20 | # we want to allow these production deployments to complete. 21 | concurrency: 22 | group: "pages" 23 | cancel-in-progress: false 24 | 25 | # Default to bash 26 | defaults: 27 | run: 28 | shell: bash 29 | 30 | env: 31 | TZ: Asia/Kolkata 32 | 33 | jobs: 34 | test: 35 | runs-on: ubuntu-24.04 36 | steps: 37 | - name: Checkout 38 | uses: actions/checkout@v4 39 | with: 40 | submodules: false 41 | fetch-depth: 50 42 | 43 | - name: Install test dependencies 44 | run: | 45 | sudo apt-get update && \ 46 | sudo apt-get -y install npm tzdata && \ 47 | npm ci 48 | 49 | - name: Run tests 50 | run: | 51 | npm run test 52 | 53 | build: 54 | needs: test 55 | runs-on: ubuntu-24.04 56 | env: 57 | HUGO_VERSION: 0.145.0 58 | 59 | steps: 60 | - name: Install Hugo CLI 61 | run: | 62 | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ 63 | && sudo dpkg -i ${{ runner.temp }}/hugo.deb 64 | 65 | - name: Checkout 66 | uses: actions/checkout@v4 67 | with: 68 | submodules: false 69 | fetch-depth: 50 70 | 71 | - name: Setup Pages 72 | id: pages 73 | uses: actions/configure-pages@v5 74 | 75 | - name: Build with Hugo 76 | env: 77 | # For maximum backward compatibility with Hugo modules 78 | HUGO_ENVIRONMENT: production 79 | HUGO_ENV: production 80 | run: | 81 | . ./exampleSite/scripts/hugo-env && \ 82 | hugo --source exampleSite 83 | 84 | - name: Upload artifact 85 | uses: actions/upload-pages-artifact@v3 86 | with: 87 | path: ./exampleSite/public 88 | 89 | - uses: actions/cache@v4 90 | with: 91 | path: /tmp/hugo_cache 92 | key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }} 93 | restore-keys: | 94 | ${{ runner.os }}-hugomod- 95 | 96 | deploy: 97 | needs: build 98 | runs-on: ubuntu-24.04 99 | if: github.ref_name == 'main' 100 | environment: 101 | name: github-pages 102 | url: ${{ steps.deployment.outputs.page_url }} 103 | steps: 104 | - name: Deploy to GitHub Pages 105 | id: deployment 106 | uses: actions/deploy-pages@v4 107 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /public 2 | /resources 3 | /exampleSite/public 4 | /exampleSite/resources 5 | /node_modules 6 | .vscode 7 | .hugo_build.lock 8 | *.swp 9 | 10 | # ctags 11 | tags 12 | *.tags 13 | TAGS 14 | -------------------------------------------------------------------------------- /.linkinator.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "silent": true, 3 | "timeout": 10000, 4 | "retryErrors": false, 5 | "skip": ["^(?!http://localhost)"] 6 | } 7 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": true, 3 | "heading-style": { 4 | "style": "setext_with_atx" 5 | }, 6 | "hr-style": { 7 | "style": "---" 8 | }, 9 | "code-block-style": { 10 | "style": "fenced" 11 | }, 12 | "code-fence-style": { 13 | "style": "backtick" 14 | }, 15 | "no-hard-tabs": { 16 | "code_blocks": false 17 | }, 18 | "fenced-code-language": { 19 | "allowed_languages": [ 20 | "bash", 21 | "c", 22 | "cpp", 23 | "css", 24 | "html", 25 | "js", 26 | "json", 27 | "lua", 28 | "md", 29 | "py", 30 | "scss", 31 | "sh", 32 | "text", 33 | "toml", 34 | "vim", 35 | "xml", 36 | "yml", 37 | "zsh" 38 | ], 39 | "language_only": false 40 | }, 41 | "emphasis-style": { 42 | "style": "underscore" 43 | }, 44 | "strong-style": { 45 | "style": "underscore" 46 | }, 47 | "ul-style": { 48 | "style": "sublist" 49 | }, 50 | "line-length": { 51 | "line_length": 78, 52 | "heading_line_length": 72, 53 | "code_block_line_length": 78, 54 | "tables": false, 55 | "strict": true 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /.prettier.json: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 78, 3 | "trailingComma": "all", 4 | "arrowParens": "avoid", 5 | "overrides": [ 6 | { 7 | "files": ["*.html"], 8 | "options": { 9 | "printWidth": 180, 10 | "parser": "go-template" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # ignore this file as there is an issue with prettier go-template formatter 2 | render-heading.html 3 | -------------------------------------------------------------------------------- /.stylelintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "stylelint-config-standard-scss", 3 | "quiet": true, 4 | "rules": { 5 | "declaration-empty-line-before": [ 6 | "always", 7 | { 8 | "ignore": [ 9 | "after-comment", 10 | "after-declaration", 11 | "first-nested", 12 | "inside-single-line-block" 13 | ] 14 | } 15 | ], 16 | "scss/no-global-function-names": null, 17 | "scss/dollar-variable-pattern": "^([a-z][a-z0-9]*)(-[a-z0-9]+)*(--[a-z0-9]+)?" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | hugo-xterm 2 | ========== 3 | 4 | Hugo theme designed for reading and printing text with dark and light modes. 5 | 6 | It uses Hugo extended version with __>= 0.110__ to build the theme to take 7 | advantage of builtin SCSS compiler and reduce dependency on external 8 | libraries. 9 | 10 | This theme is fully free and open source so it can be used and modified as you 11 | like but redistributing requires attribution to [license][hx_lic_link] and 12 | credits to author [Mani Kumar][md2_gh_link] with link to this repository 13 | [hugo-xterm][hx_gh_link]. 14 | 15 | [![Hugo][hugo_ver_img]][hugo_v0110] 16 | [![LICENSE][hx_lic_img]][hx_lic_link] 17 | [![Build][hx_ci_build_img]][hx_ci_build_link] 18 | 19 | Demo 20 | ---- 21 | 22 | Demo example site [manid2.github.io/hugo-xterm][7]. 23 | 24 | [![Hugo Xterm demo site QR code][hx_demo_qr_img]][7] 25 | 26 | Screenshots 27 | ----------- 28 | 29 | ### Dark mode 30 | 31 | ![Hugo Xterm Dark][hx_ss_dark] 32 | 33 | ### Light mode 34 | 35 | ![Hugo Xterm Light][hx_ss_light] 36 | 37 | Features 38 | -------- 39 | 40 | ### Unique features 41 | 42 | * Designed for __reading__ and __printing__ text. 43 | * __Print:__ any page in light theme mode for readability. 44 | * __Lists__: separate view and pagination for simple list items and post 45 | entries. 46 | * __GitInfo:__ show the latest git commit short hash and subject message for 47 | each page (requires Hugo GitInfo config enabled). 48 | * __Fonts:__ 49 | - __"Roboto Slab (serif)"__ for title (heading) text. 50 | - __"Fira Sans (sans-serif)"__ for normal text. 51 | - __"Ubuntu Mono (monospace)"__ for code. 52 | * __Colors:__ in the theme are derived using a single primary color (blue) 53 | from the [HSL colors][8]. 54 | * Website banner is supported. 55 | 56 | ### Adopted features 57 | 58 | * Minimal configuration. 59 | * Switchable dark and light themes with automatic selection based on system 60 | theme. 61 | * SEO friendly OpenGraph and twitter cards support 62 | * Customizable using configurations for: "full width", "centered". 63 | * Taxonomies and posts RSS. 64 | * Responsive tested on desktop and on smart phones. 65 | * Responsive menus for desktop and mobile screens. 66 | * Accessibility tested using [WAVE Web Accessibility Evaluation Tool][5]. 67 | * Code blocks are highlighted using Hugo built-in blazing fast [Chroma][9]. 68 | * Copy code, see code language and file name (optional). 69 | * Tightly coupled with Hugo extended latest version (v1.110.0) to compile and 70 | generate asset bundles with pipelines, fingerprinting and minification. 71 | * Support for favicon which is displayed in browser tabs and bookmarks bar. 72 | 73 | #### How to add favicon in Hugo-xterm 74 | 75 | * Add your favicon images to `static` directory. 76 | Example: `static/images/xterm.png`. 77 | * Add the favicon image path to `config.toml`. 78 | 79 | ```toml 80 | [params] 81 | favicon="/images/xterm.png" 82 | ``` 83 | 84 | For working example check `exampleSite` directory to know how favicon is 85 | added. 86 | 87 | ### Other features 88 | 89 | These are supported due to [panr/terminal][1] theme base code but not 90 | tested as I don't use them myself: 91 | 92 | * Post cover image. 93 | * Images in post with caption. 94 | * Comments. 95 | 96 | Installation 97 | ------------ 98 | 99 | Follow the steps in any one of these methods to install or update a Hugo 100 | theme. 101 | 102 | ### Method - Using hugo mod 103 | 104 | Add hugo-xterm theme as Hugo module to hide the theme content and let you 105 | focus only on your site content. Let Hugo handle the theme updates 106 | automatically and control the theme as a Hugo module instead of git. 107 | 108 | ```bash 109 | cd 110 | 111 | # initialize your site as a hugo module. 112 | hugo mod init 113 | 114 | # import hugo-xterm theme as hugo module in configuration 115 | $ cat config/_default/config.toml 116 | [module] 117 | [[module.imports]] 118 | path = "github.com/manid2/hugo-xterm" 119 | 120 | # update theme 121 | hugo mod get -u 122 | ``` 123 | 124 | For all below methods your site needs to point to hugo-xterm theme 125 | subdirectory in configuration as below: 126 | 127 | ```bash 128 | $ cat config/_default/config.toml 129 | theme = "hugo-xterm" 130 | ``` 131 | 132 | ### Method - Download and copy theme 133 | 134 | Download the archived (i.e. .zip or tar.gz) theme from github repository 135 | releases page. Extract and copy the contents into `themes/hugo-xterm` 136 | subdirectory in your site directory. 137 | 138 | To update the theme just download a new release and overwrite the same 139 | subdirectory. 140 | 141 | This method is simple, can be automated with script and saves space on disk by 142 | omitting the theme repository history. 143 | 144 | ### Method - Using git clone 145 | 146 | This method clones the theme repository with history into your site's themes 147 | subdirectory which is useful if you want to control the history or make your 148 | own private modifications to the theme. 149 | 150 | ```bash 151 | cd 152 | git clone https://github.com/manid2/hugo-xterm themes/hugo-xterm --depth=1 153 | 154 | # update theme 155 | cd themes/hugo-xterm 156 | git pull 157 | ``` 158 | 159 | ### Method - Using git submodule 160 | 161 | This is similar to cloning the theme into subdirectory except using git 162 | submodule which makes the theme acts a dependency of your site repository. It 163 | lets git to control your site and its dependency this theme. 164 | 165 | ```bash 166 | git submodule add --depth=1 https://github.com/manid2/hugo-xterm \ 167 | themes/hugo-xterm 168 | 169 | # update theme 170 | git submodule update --remote --merge 171 | ``` 172 | 173 | Local development 174 | ----------------- 175 | 176 | ```bash 177 | # add to go.mod for local development 178 | # replace github.com/manid2/hugo-xterm => ../hugo-xterm 179 | hugo server --source exampleSite 180 | 181 | # generate tags 182 | ctags -R assets/ layouts/ config.toml theme.toml 183 | 184 | # generate tags for exampleSite 185 | ctags -R exampleSite/layouts/ exampleSite/scripts/ exampleSite/config 186 | ``` 187 | 188 | Request feature & report bugs 189 | ----------------------------- 190 | 191 | If you find any bugs or need any features then please raise an 192 | [issue][hx_gh_issues_link] so that it can tracked and avoid same requests from 193 | other users. 194 | 195 | You can also fix the bug or implement the feature yourself and raise a [pull 196 | request][hx_gh_pr_link] so I can review and integrate it into this theme with 197 | credits to you as a contributor. 198 | 199 | Use the theme & want to show your site? 200 | --------------------------------------- 201 | 202 | I would be happy to know that you use this theme and want to show your site. 203 | For this please raise a pull request with link to your site, your 204 | name/username, profession/study mentioned in this list [hugo-xterm 205 | users][hx_users_link]. 206 | 207 | Support 208 | ------- 209 | 210 | Kindly support this theme development by donating at [Buy me a 211 | coffee][md2_bmc_link]. 212 | 213 | TODO Add current supporters. 214 | 215 | [![Mani Kumar Buy Me a Coffee QR code][md2_bmc_qr_img]][md2_bmc_link] 216 | 217 | Credits 218 | ------- 219 | 220 | This theme was initially based on [panr/terminal][1] theme but is re-written 221 | from scratch to optimize for reading and print text heavy web pages. 222 | 223 | Parts of the features in this theme are either taken directly or based on the 224 | features from popular themes and websites as listed below: 225 | 226 | * [panr/terminal][1]: most styles, menus and starter code. 227 | * [adityatelange/hugo-PaperMod][2] features: breadcrumbs and copy code. 228 | * [kaitlinmctigue/kaitlinmctigue.github.io][3]: dark and light theme modes. 229 | 230 | License 231 | ------- 232 | 233 | [GNU General Public License v3.0][hx_lic_link] 234 | 235 | [1]: https://github.com/panr/hugo-theme-terminal 236 | [2]: https://github.com/adityatelange/hugo-PaperMod 237 | [3]: https://github.com/kaitlinmctigue/kaitlinmctigue.github.io 238 | [5]: https://wave.webaim.org/ 239 | [7]: https://manid2.github.io/hugo-xterm/ 240 | [8]: https://en.wikipedia.org/wiki/HSL_and_HSV 241 | [9]: https://github.com/alecthomas/chroma/ 242 | 243 | [hx_ci_build_img]: https://img.shields.io/github/actions/workflow/status/manid2/hugo-xterm/hugo.yaml?logo=github "Hugo Xterm build status badge" 244 | [hx_ci_build_link]: https://github.com/manid2/hugo-xterm/actions 245 | 246 | [hx_lic_img]: https://img.shields.io/github/license/manid2/hugo-xterm?logo=gnu&logoColor=black&label=License&labelColor=lightcyan "Hugo Xterm license badge" 247 | [hx_lic_link]: https://github.com/manid2/hugo-xterm/blob/main/LICENSE 248 | 249 | [hugo_ver_img]: https://img.shields.io/badge/Hugo%20Extended-%3E%3D%20v0.110.0-blue.svg?style=flat&logo=hugo&logoColor=white&label=Hugo%20Extended&labelColor=grey "Hugo Extended >= v0.110.0" 250 | [hugo_v0110]: https://github.com/gohugoio/hugo/releases/tag/v0.110.0 251 | 252 | [hx_ss_dark]: https://manid2.github.io/hugo-xterm/screenshots/hugo-xterm-ss-01-dark.png "Hugo Xterm dark mode screenshot" 253 | [hx_ss_light]: https://manid2.github.io/hugo-xterm/screenshots/hugo-xterm-ss-02-light.png "Hugo Xterm light mode screenshot" 254 | 255 | [hx_demo_qr_img]: https://quickchart.io/qr?text=https%3A%2F%2Fmanid2.github.io%2Fhugo-xterm%2F&dark=1a5fb4&size=200 256 | [hx_gh_link]: https://github.com/manid2/hugo-xterm 257 | [hx_gh_issues_link]: https://github.com/manid2/hugo-xterm/issues 258 | [hx_gh_pr_link]: https://github.com/manid2/hugo-xterm/pulls 259 | [hx_users_link]: https://github.com/manid2/hugo-xterm/blob/main/USERS.md 260 | 261 | [md2_bmc_link]: https://www.buymeacoffee.com/manid2 262 | [md2_bmc_qr_img]: https://manid2.github.io/images/md2_bmc_qr.png 263 | [md2_gh_link]: https://github.com/manid2 264 | -------------------------------------------------------------------------------- /USERS.md: -------------------------------------------------------------------------------- 1 | hugo-xterm users 2 | ================ 3 | 4 | * https://manid2.github.io/ __manid2__ - Software Engineer 5 | -------------------------------------------------------------------------------- /archetypes/posts.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "{{ replace .TranslationBaseName "-" " " | title }}" 3 | description = "" 4 | date = "{{ .Date }}" 5 | tags = ["", ""] 6 | categories = ["", ""] 7 | draft = true 8 | +++ 9 | -------------------------------------------------------------------------------- /assets/scripts/copy.js: -------------------------------------------------------------------------------- 1 | const hiTextBlock = document.querySelectorAll(".highlight-wrapper"); 2 | 3 | hiTextBlock.forEach(function (hiTextBlock) { 4 | const hiToolbar = hiTextBlock.querySelector(".highlight-toolbar"); 5 | if (!hiToolbar) return; 6 | 7 | const hiText = hiTextBlock.querySelector(".highlight"); 8 | if (!hiText) return; 9 | 10 | const copyButton = hiToolbar.querySelector(".js-btn-copy-code"); 11 | if (!copyButton) return; 12 | 13 | copyButton.classList.remove("hide"); 14 | 15 | /* Borrowed from adityatelange/hugo-PaperMod theme. */ 16 | function copyingDone() { 17 | copyButton.innerHTML = "Copied!"; 18 | setTimeout(() => { 19 | copyButton.innerHTML = "Copy"; 20 | }, 2000); 21 | } 22 | 23 | /* copy code in pre > code blocks */ 24 | copyButton.addEventListener("click", () => { 25 | // Fallback to selection and copy 26 | const range = document.createRange(); 27 | range.selectNodeContents(hiText); 28 | const selection = window.getSelection(); 29 | selection.removeAllRanges(); 30 | selection.addRange(range); 31 | try { 32 | document.execCommand("copy"); 33 | copyingDone(); 34 | } catch (e) {} 35 | selection.removeRange(range); 36 | }); 37 | }); 38 | -------------------------------------------------------------------------------- /assets/scripts/menu.js: -------------------------------------------------------------------------------- 1 | const container = document.querySelector(".container"); 2 | const allMenus = document.querySelectorAll(".menu"); 3 | 4 | // Hide menus on body click 5 | document.body.addEventListener("click", () => { 6 | allMenus.forEach(menu => { 7 | if (menu.classList.contains("open")) { 8 | menu.classList.remove("open"); 9 | } 10 | }); 11 | }); 12 | 13 | // Reset menus on resize 14 | window.addEventListener("resize", () => { 15 | allMenus.forEach(menu => { 16 | menu.classList.remove("open"); 17 | }); 18 | }); 19 | 20 | // Handle desktop menu 21 | allMenus.forEach(menu => { 22 | const trigger = menu.querySelector(".menu-trigger"); 23 | const dropdown = menu.querySelector(".menu-dropdown"); 24 | 25 | trigger.addEventListener("click", e => { 26 | e.stopPropagation(); 27 | 28 | if (menu.classList.contains("open")) { 29 | menu.classList.remove("open"); 30 | } else { 31 | // Close all menus... 32 | allMenus.forEach(m => m.classList.remove("open")); 33 | // ...before opening the current one 34 | menu.classList.add("open"); 35 | } 36 | 37 | if ( 38 | dropdown.getBoundingClientRect().right > 39 | container.getBoundingClientRect().right 40 | ) { 41 | dropdown.style.left = "auto"; 42 | dropdown.style.right = 0; 43 | } 44 | }); 45 | 46 | dropdown.addEventListener("click", e => e.stopPropagation()); 47 | }); 48 | -------------------------------------------------------------------------------- /assets/scripts/print.js: -------------------------------------------------------------------------------- 1 | /* TODO: Add print button */ 2 | -------------------------------------------------------------------------------- /assets/scripts/theme.js: -------------------------------------------------------------------------------- 1 | const themeDark = "theme--dark"; 2 | const themeLight = "theme--light"; 3 | const bodyClassList = document.body.classList; 4 | const isSystemDark = window.matchMedia( 5 | "(prefers-color-scheme: dark)", 6 | ).matches; 7 | const themeToggle = document.querySelector(".theme-toggle"); 8 | const preferTheme = "prefer-theme"; 9 | 10 | // Set theme from local storage 11 | const localTheme = localStorage.getItem(preferTheme); 12 | if (localTheme === themeDark) { 13 | bodyClassList.add(themeDark); 14 | } else if (localTheme === themeLight) { 15 | bodyClassList.remove(themeDark); 16 | } else if (isSystemDark) { 17 | bodyClassList.add(themeDark); 18 | } 19 | 20 | // Set background for overscroll (or elastic scrolling in OSX) 21 | function setBodyBackground() { 22 | const tc = document.querySelector(".theme-container"); 23 | const cs = window.getComputedStyle(tc); 24 | document.body.style.background = cs.background; 25 | } 26 | setBodyBackground(); 27 | 28 | // Toggle theme on click 29 | themeToggle.addEventListener("click", () => { 30 | if (bodyClassList.contains(themeDark)) { 31 | bodyClassList.remove(themeDark); 32 | localStorage.setItem(preferTheme, themeLight); 33 | } else { 34 | bodyClassList.add(themeDark); 35 | localStorage.setItem(preferTheme, themeDark); 36 | } 37 | setBodyBackground(); 38 | }); 39 | -------------------------------------------------------------------------------- /assets/styles/_buttons.scss: -------------------------------------------------------------------------------- 1 | /* Buttons */ 2 | button, 3 | .button { 4 | align-items: center; 5 | border-radius: $spacer-small; 6 | border: $spacer-1 solid; 7 | cursor: pointer; 8 | display: flex; 9 | font-weight: $font-bold; 10 | padding: $spacer-small $spacer-normal; 11 | text-align: center; 12 | 13 | @include themed { 14 | background: t($button-background); 15 | border-color: t($accent); 16 | 17 | &:hover { 18 | background: transparentize(t($button-background), 0.6); 19 | text-decoration: none; 20 | } 21 | } 22 | 23 | @media print { 24 | display: none; 25 | } 26 | 27 | &:active { 28 | transform: scale(0.95); 29 | transition: transform 0.2s ease; 30 | } 31 | 32 | /* button variants */ 33 | &.outline, 34 | &.transparent { 35 | font-weight: $font-normal; 36 | background: none; 37 | 38 | @include themed { 39 | color: t($text-brighter); 40 | 41 | &:hover { 42 | background: transparentize(t($button-background), 0.1); 43 | } 44 | } 45 | } 46 | 47 | &.transparent { 48 | border: none; 49 | } 50 | 51 | &.outline.brighter { 52 | @include themed { 53 | border-color: t($background-brighter); 54 | } 55 | } 56 | 57 | /* button content align right */ 58 | &.right { 59 | justify-content: flex-end; 60 | } 61 | 62 | /* button label */ 63 | .label { 64 | text-overflow: ellipsis; 65 | white-space: nowrap; 66 | overflow: hidden; 67 | } 68 | 69 | /* button icon */ 70 | .icon { 71 | margin-right: $spacer-smallest; 72 | 73 | &.right { 74 | margin: 0 0 0 $spacer-smallest; 75 | } 76 | } 77 | } 78 | 79 | a.button { 80 | @media print { 81 | display: initial; 82 | white-space: nowrap; 83 | overflow: hidden; 84 | text-overflow: ellipsis; 85 | } 86 | } 87 | 88 | /* Buttons container */ 89 | .buttons { 90 | display: flex; 91 | flex-flow: row wrap; 92 | align-items: center; 93 | column-gap: $spacer-small; 94 | 95 | @media ($phone) { 96 | flex-direction: column; 97 | row-gap: $spacer-small; 98 | } 99 | 100 | /* Buttons filling the container */ 101 | &.fill { 102 | button, 103 | .button { 104 | flex: 1 0 0; 105 | 106 | @media ($phone) { 107 | width: 100%; 108 | justify-content: center; 109 | } 110 | } 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /assets/styles/_footer.scss: -------------------------------------------------------------------------------- 1 | .site-footer { 2 | margin-top: $spacer-large2; 3 | border-top: $spacer-1 solid; 4 | 5 | @include themed { 6 | border-color: t($accent); 7 | color: t($text-duller); 8 | } 9 | 10 | @media print { 11 | display: none; 12 | } 13 | } 14 | 15 | .themeinfo, 16 | .buildinfo { 17 | font-size: $font-size-smaller; 18 | margin: $spacer-small 0; 19 | } 20 | 21 | .copyright { 22 | display: flex; 23 | flex-flow: row wrap; 24 | align-items: center; 25 | justify-content: space-between; 26 | margin: $spacer-normal 0; 27 | 28 | > p { 29 | margin: 0; 30 | } 31 | 32 | .navbar { 33 | &__list { 34 | > li { 35 | border: none; 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /assets/styles/_gen_syntax.scss: -------------------------------------------------------------------------------- 1 | /* Syntax highlighting styles */ 2 | .chroma .ln { 3 | white-space: pre; 4 | user-select: none; 5 | padding: 0 0.4em; 6 | color: #7f7f7f; 7 | } 8 | 9 | .chroma .cl { 10 | padding: 0 0.4em; 11 | } 12 | 13 | .chroma .line { 14 | display: flex; 15 | } 16 | 17 | .chroma .ge { 18 | font-style: italic; 19 | } 20 | 21 | .chroma .gs { 22 | font-weight: $font-bold; 23 | } 24 | 25 | /* Syntax highlighting colors */ 26 | .chroma .err { 27 | color: #960050; 28 | background-color: #1e0010; 29 | } 30 | 31 | .chroma .hl { 32 | background-color: #ffc; 33 | } 34 | 35 | .bg, 36 | .chroma { 37 | @include themed { 38 | color: t($syn-fg); 39 | background-color: t($syn-bg); 40 | } 41 | } 42 | 43 | .chroma .k, 44 | .chroma .kc, 45 | .chroma .kd, 46 | .chroma .kp, 47 | .chroma .kr, 48 | .chroma .kt, 49 | .chroma .no { 50 | @include themed { 51 | color: t($syn-kw); 52 | } 53 | } 54 | 55 | .chroma .kn, 56 | .chroma .nt, 57 | .chroma .o, 58 | .chroma .ow, 59 | .chroma .gd { 60 | color: $syn-op; 61 | } 62 | 63 | .chroma .n { 64 | @include themed { 65 | color: t($syn-n); 66 | } 67 | } 68 | 69 | .chroma .na, 70 | .chroma .nc, 71 | .chroma .nd, 72 | .chroma .ne, 73 | .chroma .nf, 74 | .chroma .nx, 75 | .chroma .gi { 76 | @include themed { 77 | color: t($syn-na); 78 | } 79 | } 80 | 81 | .chroma .ld, 82 | .chroma .s, 83 | .chroma .sa, 84 | .chroma .sb, 85 | .chroma .sc, 86 | .chroma .dl, 87 | .chroma .sd, 88 | .chroma .s2, 89 | .chroma .sh, 90 | .chroma .si, 91 | .chroma .sx, 92 | .chroma .sr, 93 | .chroma .s1, 94 | .chroma .ss { 95 | @include themed { 96 | color: t($syn-ld); 97 | } 98 | } 99 | 100 | .chroma .l, 101 | .chroma .se, 102 | .chroma .m, 103 | .chroma .mb, 104 | .chroma .mf, 105 | .chroma .mh, 106 | .chroma .mi, 107 | .chroma .il, 108 | .chroma .mo { 109 | color: $syn-l; 110 | } 111 | 112 | .chroma .c, 113 | .chroma .ch, 114 | .chroma .cm, 115 | .chroma .c1, 116 | .chroma .cs, 117 | .chroma .cp, 118 | .chroma .cpf, 119 | .chroma .gu { 120 | color: $syn-c; 121 | } 122 | 123 | /* Commented to fix linter errors, uncomment when needed. 124 | .chroma .x, 125 | .chroma .nb, 126 | .chroma .bp, 127 | .chroma .ni, 128 | .chroma .fm, 129 | .chroma .nl, 130 | .chroma .nn, 131 | .chroma .py, 132 | .chroma .nv, 133 | .chroma .vc, 134 | .chroma .vg, 135 | .chroma .vi, 136 | .chroma .vm, 137 | .chroma .p, 138 | .chroma .g, 139 | .chroma .gr, 140 | .chroma .gh, 141 | .chroma .go, 142 | .chroma .gp, 143 | .chroma .gt, 144 | .chroma .gl, 145 | .chroma .w { 146 | } 147 | */ 148 | -------------------------------------------------------------------------------- /assets/styles/_header.scss: -------------------------------------------------------------------------------- 1 | .gitinfo, 2 | .breadcrumbs { 3 | font-size: $font-size-smaller; 4 | font-style: italic; 5 | } 6 | 7 | .breadcrumbs { 8 | width: fit-content; 9 | border-bottom: $spacer-1 solid; 10 | 11 | @include themed { 12 | border-color: t($accent); 13 | } 14 | } 15 | 16 | .gitinfo { 17 | margin: $spacer-normal 0; 18 | border-top: $spacer-1 solid; 19 | 20 | @include themed { 21 | color: t($text-duller); 22 | border-color: t($accent); 23 | } 24 | 25 | @media print { 26 | margin: 0; 27 | 28 | a { 29 | &::after { 30 | display: none; 31 | } 32 | } 33 | 34 | p { 35 | margin: $spacer-small 0 0 0; 36 | font-size: $font-size-smaller; 37 | } 38 | } 39 | } 40 | 41 | .theme-toggle { 42 | cursor: pointer; 43 | padding: 0; 44 | } 45 | 46 | .theme-toggler { 47 | fill: currentcolor; 48 | } 49 | 50 | .navbar { 51 | display: flex; 52 | flex-flow: row wrap; 53 | align-items: flex-start; 54 | justify-content: space-between; 55 | 56 | &__first { 57 | font-weight: $font-bold; 58 | display: block; 59 | } 60 | 61 | &__separator { 62 | flex-grow: 1; 63 | border-top: $spacer-2 dotted; 64 | 65 | @include themed { 66 | border-color: t($accent); 67 | } 68 | } 69 | 70 | &__last { 71 | display: block; 72 | } 73 | 74 | &__list { 75 | list-style: none; 76 | margin: 0; 77 | padding: 0; 78 | display: flex; 79 | 80 | > li { 81 | flex: 0 0 auto; 82 | padding-left: $spacer-small; 83 | display: flex; 84 | justify-content: center; 85 | } 86 | 87 | &.borders { 88 | > li { 89 | padding: $spacer-smallest $spacer-small; 90 | border: $spacer-2 dotted; 91 | margin-right: $spacer-2 * -1; 92 | 93 | @include themed { 94 | border-color: t($accent); 95 | } 96 | } 97 | } 98 | } 99 | } 100 | 101 | .site-header { 102 | .navbar { 103 | margin-bottom: $spacer-large2; 104 | font-size: $font-size-larger; 105 | } 106 | 107 | @media print { 108 | display: none; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /assets/styles/_main.scss: -------------------------------------------------------------------------------- 1 | html { 2 | box-sizing: border-box; 3 | } 4 | 5 | *, 6 | *::before, 7 | *::after { 8 | box-sizing: inherit; 9 | } 10 | 11 | body { 12 | margin: 0; 13 | padding: 0; 14 | font-family: $font-family-normal; 15 | font-weight: $font-normal; 16 | font-size: $font-size; 17 | line-height: 1.54; 18 | letter-spacing: -0.02em; 19 | text-rendering: optimizelegibility; 20 | -webkit-font-smoothing: antialiased; 21 | font-feature-settings: "liga", "tnum", "zero", "ss01", "locl"; 22 | font-variant-ligatures: contextual; 23 | -webkit-overflow-scrolling: touch; 24 | text-size-adjust: 100%; 25 | } 26 | 27 | @media print { 28 | @page { 29 | size: a4 portrait; 30 | margin: 0.5in; 31 | } 32 | } 33 | 34 | .theme-container { 35 | @include themed { 36 | background: t($background); 37 | color: t($text); 38 | } 39 | 40 | @media print { 41 | background: white !important; 42 | color: black !important; 43 | } 44 | } 45 | 46 | .site-main { 47 | margin: 0; 48 | padding: 0; 49 | } 50 | 51 | .hanchor { 52 | float: right; 53 | margin-right: $spacer-large * -1; 54 | 55 | &::after { 56 | content: "#"; 57 | visibility: hidden; 58 | } 59 | 60 | @include themed { 61 | color: t($text-accent); 62 | } 63 | 64 | @media print { 65 | display: none; 66 | } 67 | } 68 | 69 | h1, 70 | h2, 71 | h3 { 72 | @include themed { 73 | border-color: t($accent); 74 | } 75 | } 76 | 77 | h1 { 78 | font-size: $font-size * 2; 79 | border-bottom: $spacer-2 dotted; 80 | } 81 | 82 | h2 { 83 | font-size: $font-size * 1.6; 84 | border-bottom: $spacer-1 solid; 85 | } 86 | 87 | h3 { 88 | font-size: $font-size * 1.25; 89 | border-bottom: $spacer-1 dashed; 90 | } 91 | 92 | h1, 93 | h2, 94 | h3, 95 | h4, 96 | h5, 97 | h6 { 98 | font-family: $font-family-title; 99 | font-weight: $font-bold; 100 | margin: $spacer-large2 0 $spacer-normal 0; 101 | width: fit-content; 102 | 103 | @media print { 104 | break-after: avoid-page; 105 | margin: $spacer-small 0; 106 | } 107 | 108 | > a.hanchor { 109 | text-decoration: none; 110 | } 111 | 112 | > a.hanchor:focus::after { 113 | visibility: visible; 114 | } 115 | 116 | &:hover { 117 | > a.hanchor::after { 118 | visibility: visible; 119 | } 120 | } 121 | } 122 | 123 | @media print { 124 | h1 { 125 | margin-top: 0; 126 | } 127 | } 128 | 129 | a { 130 | text-decoration: none; 131 | 132 | &:hover { 133 | text-decoration: underline; 134 | } 135 | 136 | @include themed { 137 | color: t($text-links); 138 | } 139 | 140 | @media print { 141 | &::after { 142 | margin-left: $spacer-smallest; 143 | content: "(" attr(href) ")"; 144 | text-decoration: underline; 145 | font-style: italic; 146 | 147 | @include themed { 148 | color: t($text); 149 | } 150 | } 151 | } 152 | } 153 | 154 | p { 155 | margin: $spacer-normal 0; 156 | } 157 | 158 | code { 159 | font-family: $font-family-mono; 160 | border-radius: $spacer-2; 161 | padding: $spacer-2 $spacer-smallest; 162 | 163 | @include themed { 164 | color: t($code-text); 165 | background: t($code-background); 166 | } 167 | } 168 | 169 | img { 170 | max-width: 100%; 171 | 172 | &.left { 173 | margin-right: auto; 174 | } 175 | 176 | &.center { 177 | margin-left: auto; 178 | margin-right: auto; 179 | } 180 | 181 | &.right { 182 | margin-left: auto; 183 | } 184 | } 185 | 186 | figure { 187 | display: table; 188 | max-width: 100%; 189 | margin: $spacer-large 0; 190 | 191 | &.left { 192 | margin-right: auto; 193 | } 194 | 195 | &.center { 196 | margin-left: auto; 197 | margin-right: auto; 198 | } 199 | 200 | &.right { 201 | margin-left: auto; 202 | } 203 | 204 | figcaption { 205 | font-size: $font-size-smaller; 206 | padding: $spacer-smallest $spacer-small; 207 | margin-top: $spacer-smallest; 208 | opacity: 0.8; 209 | 210 | &.left { 211 | text-align: left; 212 | } 213 | 214 | &.center { 215 | text-align: center; 216 | } 217 | 218 | &.right { 219 | text-align: right; 220 | } 221 | 222 | @include themed { 223 | background: t($accent); 224 | color: t($background); 225 | } 226 | } 227 | } 228 | 229 | blockquote { 230 | border-left: $spacer-smallest solid; 231 | margin: $spacer-large 0; 232 | padding: $spacer-normal $spacer-normal $spacer-normal $spacer-large; 233 | font-style: italic; 234 | 235 | @include themed { 236 | color: t($text-brighter); 237 | background: t($blockquote-background); 238 | border-color: t($accent); 239 | } 240 | 241 | @media print { 242 | margin: $spacer-large 0; 243 | } 244 | 245 | p { 246 | position: relative; 247 | } 248 | 249 | p:first-of-type { 250 | margin-top: 0; 251 | } 252 | 253 | p:last-of-type { 254 | margin-bottom: 0; 255 | } 256 | 257 | p:first-of-type::before { 258 | content: ">"; 259 | display: block; 260 | position: absolute; 261 | left: $spacer-large * -1; 262 | padding: $spacer-smallest; 263 | } 264 | } 265 | 266 | table { 267 | table-layout: auto; 268 | border-collapse: collapse; 269 | width: 100%; 270 | margin: $spacer-large 0; 271 | } 272 | 273 | table, 274 | th, 275 | td { 276 | border: $spacer-1 dashed; 277 | padding: $spacer-smallest; 278 | 279 | @include themed { 280 | border-color: t($accent); 281 | } 282 | 283 | @media print { 284 | padding: $spacer-smallest; 285 | } 286 | } 287 | 288 | th { 289 | font-weight: $font-bold; 290 | 291 | @include themed { 292 | color: t($text-brighter); 293 | background: t($background-brighter); 294 | } 295 | } 296 | 297 | td { 298 | font-size: $font-size-smaller; 299 | } 300 | 301 | ul, 302 | ol { 303 | margin: 0 0 $spacer-normal $spacer-large; 304 | padding: 0; 305 | 306 | @media print { 307 | margin-bottom: 0; 308 | } 309 | 310 | li { 311 | position: relative; 312 | 313 | @media print { 314 | > p { 315 | margin: 0 0 $spacer-smallest 0; 316 | } 317 | 318 | break-inside: avoid-page; 319 | } 320 | } 321 | } 322 | 323 | ol { 324 | list-style: none; 325 | counter-reset: li; 326 | 327 | li { 328 | counter-increment: li; 329 | } 330 | 331 | li::before { 332 | content: counter(li); 333 | position: absolute; 334 | right: calc(100% + 10px); 335 | display: inline-block; 336 | text-align: right; 337 | 338 | @include themed { 339 | color: $accent; 340 | } 341 | } 342 | 343 | ol { 344 | margin-left: $spacer-large; 345 | 346 | li { 347 | counter-increment: li; 348 | } 349 | 350 | li::before { 351 | content: counters(li, ".") " "; 352 | } 353 | } 354 | } 355 | 356 | li ol, 357 | li ul { 358 | margin: 0 0 0 $spacer-large; 359 | } 360 | 361 | hr { 362 | width: 100%; 363 | border: none; 364 | height: $spacer-1; 365 | 366 | @include themed { 367 | background: t($accent); 368 | } 369 | 370 | @media print { 371 | margin: 0; 372 | } 373 | } 374 | 375 | .container { 376 | display: flex; 377 | flex-direction: column; 378 | padding: $spacer-normal; 379 | max-width: $container-max-width; 380 | min-height: 100vh; 381 | 382 | &.full, 383 | &.center { 384 | border: none; 385 | margin: 0 auto; 386 | } 387 | 388 | &.full { 389 | max-width: 100%; 390 | } 391 | 392 | @media print { 393 | display: initial; 394 | padding: 0; 395 | } 396 | } 397 | 398 | .content { 399 | display: flex; 400 | flex-direction: column; 401 | 402 | @media print { 403 | display: initial; 404 | } 405 | } 406 | 407 | .hide { 408 | display: none; 409 | } 410 | 411 | .row { 412 | display: flex; 413 | flex-flow: row wrap; 414 | align-items: center; 415 | justify-content: space-between; 416 | 417 | &.start { 418 | gap: $spacer-small; 419 | justify-content: flex-start; 420 | } 421 | } 422 | 423 | .col { 424 | display: flex; 425 | flex-flow: column wrap; 426 | } 427 | 428 | .row, 429 | .col { 430 | &.lead { 431 | font-weight: $font-bold; 432 | font-size: $font-size-larger; 433 | } 434 | 435 | &.bold { 436 | font-weight: $font-bold; 437 | } 438 | 439 | &.sub { 440 | font-weight: $font-light; 441 | font-style: italic; 442 | } 443 | } 444 | 445 | .cv-title { 446 | display: block; 447 | border: none; 448 | margin: 0 0 $spacer-smallest 0; 449 | } 450 | 451 | .cv-contacts { 452 | display: block; 453 | text-align: end; 454 | margin: 0 0 $spacer-smallest 0; 455 | } 456 | 457 | .cv-description { 458 | font-style: italic; 459 | font-size: $font-size-smaller; 460 | margin: $spacer-smallest 0; 461 | } 462 | 463 | .cv-experience { 464 | margin: $spacer-small 0; 465 | border-bottom: none; 466 | 467 | @media print { 468 | break-after: avoid-page; 469 | break-inside: avoid-page; 470 | } 471 | } 472 | 473 | .cv-content { 474 | h2 { 475 | font-size: $font-size-larger; 476 | width: 100%; 477 | 478 | .hanchor { 479 | display: none; 480 | } 481 | } 482 | 483 | @media print { 484 | * { 485 | margin-top: $spacer-2; 486 | margin-bottom: 0; 487 | line-height: 1.2; 488 | } 489 | } 490 | } 491 | -------------------------------------------------------------------------------- /assets/styles/_menu.scss: -------------------------------------------------------------------------------- 1 | @mixin menu { 2 | display: none; 3 | flex-direction: column; 4 | position: absolute; 5 | margin: 0; 6 | padding: 0; 7 | top: $spacer-small; 8 | left: 0; 9 | list-style: none; 10 | z-index: 99; 11 | 12 | @include themed { 13 | $shadow-color: transparentize(t($background), 0.2); 14 | $shadow: 0 $spacer-small $shadow-color, 15 | -$spacer-small $spacer-small $shadow-color, 16 | $spacer-small $spacer-small $shadow-color; 17 | 18 | background: t($background); 19 | box-shadow: $shadow; 20 | } 21 | } 22 | 23 | @mixin header-menu-trigger { 24 | font-weight: 700; 25 | padding: $spacer-smallest $spacer-small; 26 | height: 100%; 27 | margin-bottom: 0 !important; 28 | position: relative; 29 | cursor: pointer; 30 | border: $spacer-2 dotted; 31 | 32 | @include themed { 33 | color: t($text); 34 | background: t($background); 35 | border-color: t($accent); 36 | } 37 | } 38 | 39 | .menu { 40 | display: flex; 41 | flex-direction: column; 42 | position: relative; 43 | list-style: none; 44 | padding: 0; 45 | margin: 0; 46 | 47 | &-trigger { 48 | margin-right: 0; 49 | user-select: none; 50 | cursor: pointer; 51 | 52 | @include themed { 53 | color: t($accent); 54 | } 55 | } 56 | 57 | &-dropdown { 58 | @include menu; 59 | 60 | .open & { 61 | display: flex; 62 | } 63 | 64 | > li { 65 | flex: 0 0 auto; 66 | padding: $spacer-smallest $spacer-small; 67 | border: $spacer-2 dotted; 68 | 69 | @include themed { 70 | border-color: t($accent); 71 | } 72 | 73 | a { 74 | display: flex; 75 | text-decoration: none; 76 | 77 | &:hover { 78 | text-decoration: underline; 79 | } 80 | } 81 | } 82 | } 83 | 84 | &--desktop { 85 | @media ($phone) { 86 | display: none; 87 | } 88 | } 89 | 90 | &--mobile { 91 | .menu-trigger { 92 | @include header-menu-trigger; 93 | 94 | display: none; 95 | 96 | @media ($phone) { 97 | display: block; 98 | } 99 | } 100 | 101 | .menu-dropdown { 102 | @media ($phone) { 103 | left: auto; 104 | right: 0; 105 | } 106 | } 107 | 108 | li { 109 | flex: 0 0 auto; 110 | margin-bottom: $spacer-2 * -1; 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /assets/styles/_pagination.scss: -------------------------------------------------------------------------------- 1 | .pagination { 2 | margin: $spacer-largest 0; 3 | 4 | @media print { 5 | display: none; 6 | } 7 | 8 | &-title { 9 | display: flex; 10 | text-align: center; 11 | position: relative; 12 | margin: $spacer-large 0; 13 | 14 | &-h { 15 | text-align: center; 16 | margin: 0 auto; 17 | padding: $spacer-smallest $spacer-normal; 18 | font-size: smaller; 19 | text-transform: uppercase; 20 | text-decoration: none; 21 | letter-spacing: 0.1em; 22 | z-index: 1; 23 | 24 | @include themed { 25 | background: t($background); 26 | color: transparentize(t($text), 0.4); 27 | } 28 | } 29 | 30 | hr { 31 | position: absolute; 32 | left: 0; 33 | right: 0; 34 | width: 100%; 35 | margin-top: $spacer-normal; 36 | z-index: 0; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /assets/styles/_post.scss: -------------------------------------------------------------------------------- 1 | .post { 2 | width: 100%; 3 | text-align: left; 4 | margin: $spacer-normal 0; 5 | 6 | @media print { 7 | margin: 0 0 $spacer-large 0; 8 | } 9 | 10 | &-entries { 11 | .item { 12 | padding-bottom: $spacer-small; 13 | margin-bottom: $spacer-large; 14 | 15 | p { 16 | margin: 0; 17 | } 18 | 19 | h2, 20 | h3 { 21 | border-style: none; 22 | margin: 0; 23 | padding: 0; 24 | } 25 | } 26 | } 27 | 28 | &-header { 29 | margin: $spacer-normal 0; 30 | 31 | @media print { 32 | margin: 0; 33 | } 34 | } 35 | 36 | &-title { 37 | $border-title: $spacer-smallest dotted; 38 | 39 | position: relative; 40 | border-bottom: $border-title; 41 | width: 100%; 42 | padding-bottom: $spacer-smallest; 43 | 44 | @include themed { 45 | border-color: t($accent); 46 | } 47 | 48 | &::after { 49 | content: ""; 50 | position: absolute; 51 | bottom: $spacer-2; 52 | display: block; 53 | width: 100%; 54 | border-bottom: $border-title; 55 | 56 | @include themed { 57 | border-color: t($accent); 58 | } 59 | } 60 | 61 | a { 62 | text-decoration: none; 63 | 64 | @media print { 65 | &::after { 66 | display: none; 67 | } 68 | } 69 | } 70 | } 71 | 72 | &-meta, 73 | &-tags { 74 | font-style: italic; 75 | font-size: $font-size-smaller; 76 | margin: $spacer-small 0; 77 | 78 | @include themed { 79 | color: t($text-accent); 80 | } 81 | 82 | a { 83 | @media print { 84 | &::after { 85 | display: none; 86 | } 87 | } 88 | } 89 | } 90 | 91 | &-description { 92 | font-size: $font-size-larger; 93 | font-weight: $font-light; 94 | 95 | @include themed { 96 | color: t($text-brighter); 97 | } 98 | } 99 | 100 | &-toc { 101 | margin: $spacer-normal 0; 102 | 103 | @media print { 104 | display: none; 105 | } 106 | 107 | ul, 108 | ol { 109 | margin-bottom: 0; 110 | } 111 | } 112 | 113 | &-cover { 114 | border: $spacer-large solid $accent; 115 | background: transparent; 116 | margin: $spacer-largest 0; 117 | padding: $spacer-large; 118 | 119 | @media ($phone) { 120 | padding: $spacer-small; 121 | border-width: $spacer-small; 122 | } 123 | } 124 | 125 | &-footer { 126 | margin: $spacer-largest 0; 127 | 128 | @media print { 129 | margin: $spacer-small 0 0 0; 130 | } 131 | } 132 | 133 | &-support { 134 | font-style: italic; 135 | margin: $spacer-normal 0; 136 | border-top: $spacer-1 solid; 137 | 138 | @include themed { 139 | border-color: t($accent); 140 | } 141 | 142 | @media print { 143 | margin: $spacer-large 0; 144 | } 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /assets/styles/_slides.scss: -------------------------------------------------------------------------------- 1 | :root { 2 | --r-code-font: #{$font-family-mono}; 3 | --r-heading-font: #{$font-family-title}; 4 | --r-main-font-size: #{$font-size}; 5 | --r-main-font: #{$font-family-normal}; 6 | 7 | /* FIXME doesn't work in light theme */ 8 | @include themed { 9 | --r-background-color: t($background); 10 | --r-heading-color: t($text); 11 | --r-main-color: t($text); 12 | --r-link-color: t($text-links); 13 | --r-link-color-dark: t($text-links); 14 | --r-link-color-hover: t($text); 15 | } 16 | } 17 | 18 | /* HACK use this until reveal.js theme colors are fixed */ 19 | .reveal a { 20 | @include themed { 21 | color: t($text-links); 22 | } 23 | } 24 | 25 | .reveal { 26 | width: 100%; 27 | height: $spacer-large * 25; 28 | } 29 | 30 | .reveal .slides { 31 | text-align: left; 32 | } 33 | 34 | .header-left, 35 | .footer-left { 36 | position: absolute; 37 | left: 0%; 38 | margin: $spacer-normal $spacer-normal; 39 | } 40 | 41 | .header-left { 42 | top: 0%; 43 | } 44 | 45 | .footer-left { 46 | bottom: 0%; 47 | } 48 | -------------------------------------------------------------------------------- /assets/styles/_syntax.scss: -------------------------------------------------------------------------------- 1 | /* syntax highlighted code layout */ 2 | div.highlight-wrapper { 3 | margin: $spacer-large 0; 4 | border-radius: $spacer-2; 5 | border: $spacer-1 solid; 6 | 7 | @include themed { 8 | border-color: t($background-brighter); 9 | } 10 | } 11 | 12 | div.highlight-wrapper div.highlight-toolbar { 13 | display: flex; 14 | border-bottom: $spacer-1 solid; 15 | 16 | @include themed { 17 | color: t($text-brighter); 18 | background: t($background-grey); 19 | border-color: t($background-brighter); 20 | } 21 | 22 | .item { 23 | padding: 0 $spacer-small; 24 | 25 | .label { 26 | @include themed { 27 | color: t($text-duller); 28 | } 29 | 30 | @media ($phone) { 31 | display: none; 32 | } 33 | } 34 | 35 | &.right { 36 | margin-left: auto; 37 | } 38 | } 39 | } 40 | 41 | div.highlight .chroma { 42 | margin: 0; 43 | padding: $spacer-smallest 0; 44 | overflow: auto; 45 | } 46 | 47 | div.highlight .chroma code { 48 | color: inherit; 49 | background: inherit; 50 | padding: 0; 51 | margin: 0; 52 | } 53 | 54 | div.highlight .chroma .line span.cl.wrap { 55 | white-space: pre-wrap; 56 | } 57 | 58 | div.highlight .chroma .cl { 59 | padding-right: $spacer-small; 60 | } 61 | -------------------------------------------------------------------------------- /assets/styles/_themes.scss: -------------------------------------------------------------------------------- 1 | /* Shortcuts */ 2 | $accent: "accent"; 3 | $background: "background"; 4 | $text: "text"; 5 | $text-links: "text-links"; 6 | $text-accent: "text-accent"; 7 | $text-brighter: "text-brighter"; 8 | $text-duller: "text-duller"; 9 | $background-brighter: "background-brighter"; 10 | $background-grey: "background-grey"; 11 | $code-text: "code-text"; 12 | $code-background: "code-background"; 13 | $blockquote-background: "blockquote-background"; 14 | $button-text: "button-text"; 15 | $button-background: "button-background"; 16 | 17 | /* Syntax highlighting colors variables */ 18 | $syn-bg: "syn-bg"; 19 | $syn-fg: "syn-fg"; 20 | $syn-kw: "syn-kw"; 21 | $syn-ld: "syn-ld"; 22 | $syn-lse: "syn-lse"; 23 | $syn-n: "syn-n"; 24 | $syn-na: "syn-na"; 25 | 26 | /* Syntax highlighting common colors based on monokailight and monokai */ 27 | $syn-c: #75715e; 28 | $syn-op: #f92672; 29 | $syn-l: #ae81ff; 30 | 31 | /* Themes */ 32 | $themes: ( 33 | light: ( 34 | $accent: $accent--light, 35 | $background: $background--light, 36 | $text: $text--light, 37 | $text-links: $text-links--light, 38 | $text-accent: scale-color($accent--light, $lightness: 30%), 39 | $text-brighter: 40 | scale-color($text--light, $saturation: 40%, $lightness: 20%), 41 | $text-duller: 42 | scale-color($text--light, $saturation: -90%, $lightness: -10%), 43 | $background-brighter: scale-color($background--light, $lightness: -5%), 44 | $background-grey: 45 | scale-color($accent--light, $saturation: -80%, $lightness: 90%), 46 | $code-text: scale-color($accent--light, $hue: -90%, $lightness: -45%), 47 | $code-background: scale-color($background--light, $lightness: 60%), 48 | $blockquote-background: darken($background--light, 2%), 49 | $button-text: darken($text--light, 5%), 50 | $button-background: darken($background--light, 5%), 51 | $syn-bg: #fafafa, 52 | $syn-fg: #272822, 53 | $syn-kw: #00a8c8, 54 | $syn-ld: #d88200, 55 | $syn-lse: #8045ff, 56 | $syn-n: #111, 57 | $syn-na: #75af00, 58 | ), 59 | dark: ( 60 | $accent: $accent--dark, 61 | $background: $background--dark, 62 | $text: $text--dark, 63 | $text-links: $text-links--dark, 64 | $text-accent: scale-color($accent--dark, $lightness: 60%), 65 | $text-brighter: 66 | scale-color($text--dark, $saturation: 60%, $lightness: 60%), 67 | $text-duller: 68 | scale-color($text--dark, $saturation: -90%, $lightness: -20%), 69 | $background-brighter: scale-color($background--dark, $lightness: 20%), 70 | $background-grey: 71 | scale-color($accent--dark, $saturation: -90%, $lightness: -70%), 72 | $code-text: scale-color($accent--dark, $hue: -90%, $lightness: 45%), 73 | $code-background: scale-color($background--dark, $lightness: 20%), 74 | $blockquote-background: lighten($background--dark, 5%), 75 | $button-text: lighten($text--dark, 10%), 76 | $button-background: lighten($background--dark, 15%), 77 | $syn-bg: #272822, 78 | $syn-fg: #f8f8f2, 79 | $syn-kw: #66d9ef, 80 | $syn-ld: #e6db74, 81 | $syn-lse: #ae81ff, 82 | $syn-n: #f8f8f2, 83 | $syn-na: #a6e22e, 84 | ), 85 | ); 86 | 87 | /* Current theme global variable */ 88 | $current-theme: null; 89 | 90 | @mixin themed() { 91 | $current-theme: map-get($themes, "light") !global; 92 | 93 | & { 94 | @content; 95 | } 96 | 97 | @media print { 98 | & { 99 | @content; 100 | } 101 | } 102 | 103 | $themes-local: map-remove($themes, "light"); 104 | 105 | @each $theme-name, $theme-map in $themes-local { 106 | .theme--#{$theme-name} & { 107 | $current-theme: $theme-map !global; 108 | @content; 109 | 110 | $current-theme: null !global; 111 | } 112 | } 113 | } 114 | 115 | @function t($key) { 116 | @return map-get($current-theme, $key); 117 | } 118 | -------------------------------------------------------------------------------- /assets/styles/_variables.scss: -------------------------------------------------------------------------------- 1 | /* Fonts */ 2 | $font-family-title: "Roboto Slab", "Times New Roman", garamond, serif; 3 | $font-family-normal: "Fira Sans", arial, helvetica, sans-serif; 4 | $font-family-mono: "Ubuntu Mono", monaco, consolas, monospace; 5 | 6 | /* Font weights */ 7 | $font-light: 300; 8 | $font-normal: 400; 9 | $font-bold: 500; 10 | 11 | /* Font sizes */ 12 | $font-size: 1rem; 13 | $font-size-smaller: $font-size - 0.125; 14 | $font-size-larger: $font-size + 0.125; 15 | 16 | /* Layouts */ 17 | $container-max-width: 864px; 18 | 19 | /* Spacers */ 20 | $spacer-1: 1px; 21 | $spacer-2: $spacer-1 * 2; 22 | $spacer-smallest: $spacer-2 * 2; 23 | $spacer-small: $spacer-smallest * 2; 24 | $spacer-normal: $spacer-small * 2; 25 | $spacer-large: $spacer-small * 3; 26 | $spacer-large2: $spacer-small * 4; 27 | $spacer-largest: $spacer-small * 6; 28 | 29 | /* Colors */ 30 | $blue: hsl( 31 | $hue: 240deg, 32 | $saturation: 100%, 33 | $lightness: 50%, 34 | ); 35 | 36 | /* Light theme colors */ 37 | $accent--light: $blue; 38 | $background--light: scale-color( 39 | $accent--light, 40 | $saturation: -60%, 41 | $lightness: 90% 42 | ); 43 | $text--light: scale-color( 44 | $accent--light, 45 | $saturation: -60%, 46 | $lightness: -50% 47 | ); 48 | $text-links--light: adjust-color( 49 | $accent--light, 50 | $hue: -90deg, 51 | $lightness: -30% 52 | ); 53 | 54 | /* Dark theme colors */ 55 | $accent--dark: $blue; 56 | $background--dark: scale-color( 57 | $accent--dark, 58 | $saturation: -80%, 59 | $lightness: -80% 60 | ); 61 | $text--dark: scale-color($accent--dark, $lightness: 80%); 62 | $text-links--dark: adjust-color( 63 | $accent--dark, 64 | $hue: -90deg, 65 | $lightness: -10% 66 | ); 67 | 68 | /* Media queries */ 69 | $phone: "max-width: 684px"; 70 | $tablet: "max-width: 900px"; 71 | 72 | :root { 73 | --phone: (#{$phone}); 74 | --tablet: (#{$tablet}); 75 | } 76 | -------------------------------------------------------------------------------- /assets/styles/app.scss: -------------------------------------------------------------------------------- 1 | @import "variables"; 2 | @import "themes"; 3 | 4 | /* components */ 5 | @import "buttons"; 6 | @import "header"; 7 | @import "menu"; 8 | @import "main"; 9 | @import "post"; 10 | @import "pagination"; 11 | @import "footer"; 12 | 13 | /* code syntax highlight */ 14 | @import "gen_syntax"; 15 | @import "syntax"; 16 | @import "slides"; 17 | -------------------------------------------------------------------------------- /config.toml: -------------------------------------------------------------------------------- 1 | [module] 2 | [module.hugoVersion] 3 | extended = true 4 | min = '0.110.0' 5 | -------------------------------------------------------------------------------- /exampleSite/config/_default/config.toml: -------------------------------------------------------------------------------- 1 | title = "Hugo Xterm" 2 | languageCode = "en-us" 3 | baseurl = "https://manid2.github.io/hugo-xterm/" 4 | 5 | [pagination] 6 | pagerSize = 20 7 | 8 | [module] 9 | [[module.imports]] 10 | path = "github.com/manid2/hugo-xterm" 11 | 12 | [params] 13 | centerTheme = true 14 | showMenuItems = true 15 | favicon = "/images/xterm.png" 16 | showBreadCrumbs = true 17 | toc = true 18 | copyrightUserUrl = "https://manid2.github.io/" 19 | copyrightUserText = "Mani Kumar" 20 | 21 | [params.twitter] 22 | creator = "mani_d2" 23 | 24 | [params.site_verification] 25 | google = "dRxlQUCTcreupAiAU9R-WcImzIL5ZkXVFT4PVPDJl6Y" 26 | bing = "F82FFC97299503C8B6340178FE5F1EFA" 27 | yandex = "146d77656fc95385" 28 | naver = "e3b93136c43487a12e31584cf30306a269137968" 29 | 30 | [languages] 31 | [languages.en.params] 32 | copyright = "© Mani Kumar" 33 | readOtherPosts = "Read other posts" 34 | missingContentMessage = "Page not found..." 35 | missingBackButtonLabel = "Back to home page" 36 | 37 | [languages.en.params.logo] 38 | logoText = "Home" 39 | 40 | [languages.en.menu] 41 | [[languages.en.menu.main]] 42 | identifier = "posts" 43 | name = "Posts" 44 | url = "/posts/" 45 | 46 | [[languages.en.menu.main]] 47 | identifier = "about" 48 | name = "About" 49 | url = "/about/" 50 | 51 | [markup] 52 | [markup.tableOfContents] 53 | startLevel = 2 54 | endLevel = 3 55 | ordered = false 56 | 57 | [markup.highlight] 58 | anchorLineNos = false 59 | codeFences = true 60 | guessSyntax = false 61 | hl_Lines = '' 62 | hl_inline = false 63 | lineNoStart = 1 64 | lineNos = true 65 | lineNumbersInTable = false 66 | noClasses = false 67 | -------------------------------------------------------------------------------- /exampleSite/config/production/config.toml: -------------------------------------------------------------------------------- 1 | googleAnalytics = "G-FX00ZBCNBW" 2 | enableGitInfo = true 3 | 4 | [params.git_info] 5 | host = "github" 6 | user = "manid2" 7 | repo = "hugo-xterm" 8 | -------------------------------------------------------------------------------- /exampleSite/content/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Hugo Xterm" 3 | description = """Hugo theme designed for reading and printing text with dark \ 4 | and light modes.""" 5 | date = "2023-07-15" 6 | toc = false 7 | +++ 8 | 9 | This is the demo example site for [manid2/hugo-xterm][1] theme. 10 | 11 | [![Hugo][hugo_ver_img]][hugo_v0110] 12 | [![LICENSE][hx_lic_img]][hx_lic_link] 13 | [![Build][hx_ci_build_img]][hx_ci_build_link] 14 | 15 | Support 16 | ------- 17 | 18 | Kindly support this theme development by donating at [Buy me a 19 | coffee][md2_bmc_link]. 20 | 21 | [![Mani Kumar Buy Me a Coffee QR code][md2_bmc_qr_img]][md2_bmc_link] 22 | 23 | [1]: https://github.com/manid2/hugo-xterm 24 | 25 | [hx_ci_build_img]: https://img.shields.io/github/actions/workflow/status/manid2/hugo-xterm/hugo.yaml?logo=github "Hugo Xterm build status badge" 26 | [hx_ci_build_link]: https://github.com/manid2/hugo-xterm/actions 27 | 28 | [hx_lic_img]: https://img.shields.io/github/license/manid2/hugo-xterm?logo=gnu&logoColor=black&label=License&labelColor=lightcyan "Hugo Xterm license badge" 29 | [hx_lic_link]: https://github.com/manid2/hugo-xterm/blob/main/LICENSE 30 | 31 | [hugo_ver_img]: https://img.shields.io/badge/Hugo%20Extended-%3E%3D%20v0.110.0-blue.svg?style=flat&logo=hugo&logoColor=white&label=Hugo%20Extended&labelColor=grey "Hugo Extended >= v0.110.0" 32 | [hugo_v0110]: https://github.com/gohugoio/hugo/releases/tag/v0.110.0 33 | 34 | [md2_bmc_link]: https://www.buymeacoffee.com/manid2 35 | [md2_bmc_qr_img]: https://manid2.github.io/images/md2_bmc_qr.png 36 | -------------------------------------------------------------------------------- /exampleSite/content/about.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "About" 3 | description = "About hugo-xterm theme." 4 | toc = false 5 | +++ 6 | 7 | Hugo theme designed for reading and printing text with dark and light modes. 8 | 9 | Features 10 | -------- 11 | 12 | ### Distinguishing features 13 | 14 | * Designed for __reading__ and __printing__ text. 15 | * __Print:__ any page in light theme mode for readability. 16 | * __Lists__: separate view and pagination for simple list items and post 17 | entries. 18 | * __GitInfo:__ show the latest git commit short hash and subject message for 19 | each page (requires Hugo GitInfo config enabled). 20 | * __Fonts:__ 21 | - __"Roboto Slab (serif)"__ for title (heading) text. 22 | - __"Fira Sans (sans-serif)"__ for normal text. 23 | - __"Ubuntu Mono (monospace)"__ for code. 24 | * __Colors:__ in the theme are derived using a single primary color (blue) 25 | from the [HSL colors][8]. 26 | * Website banner is supported. 27 | 28 | ### Adopted features 29 | 30 | * Minimal configuration. 31 | * Switchable dark and light themes with automatic selection based on system 32 | theme. 33 | * SEO friendly OpenGraph and twitter cards support 34 | * Customizable using configurations for: "full width", "centered". 35 | * Taxonomies and posts RSS. 36 | * Responsive tested on desktop and on smart phones. 37 | * Responsive menus for desktop and mobile screens. 38 | * Accessibility tested using [WAVE Web Accessibility Evaluation Tool][5]. 39 | * Code blocks are highlighted using Hugo built-in blazing fast [Chroma][9]. 40 | * Copy code, see code language and file name (optional). 41 | * Tightly coupled with Hugo extended latest version (v1.110.0) to compile and 42 | generate asset bundles with pipelines, fingerprinting and minification. 43 | 44 | ### Other features 45 | 46 | These are supported due to [panr/terminal][1] theme base code but not 47 | tested as I don't use them myself: 48 | 49 | * Post cover image. 50 | * Images in post with caption. 51 | * Comments. 52 | 53 | Installation 54 | ------------ 55 | 56 | Follow the steps in any one of these methods to install or update a Hugo 57 | theme. 58 | 59 | ### Method - Using hugo mod 60 | 61 | Add hugo-xterm theme as Hugo module to hide the theme content and let you 62 | focus only on your site content. Let Hugo handle the theme updates 63 | automatically and control the theme as a Hugo module instead of git. 64 | 65 | ```bash 66 | cd 67 | 68 | # initialize your site as a hugo module. 69 | hugo mod init 70 | 71 | # import hugo-xterm theme as hugo module in configuration 72 | $ cat config/_default/config.toml 73 | [module] 74 | [[module.imports]] 75 | path = "github.com/manid2/hugo-xterm" 76 | 77 | # update theme 78 | hugo mod get -u 79 | ``` 80 | 81 | For all below methods your site needs to point to hugo-xterm theme 82 | subdirectory in configuration as below: 83 | 84 | ```bash 85 | $ cat config/_default/config.toml 86 | theme = "hugo-xterm" 87 | ``` 88 | 89 | ### Method - Download and copy theme 90 | 91 | Download the archived (i.e. .zip or tar.gz) theme from github repository 92 | releases page. Extract and copy the contents into `themes/hugo-xterm` 93 | subdirectory in your site directory. 94 | 95 | To update the theme just download a new release and overwrite the same 96 | subdirectory. 97 | 98 | This method is simple, can be automated with script and saves space on disk by 99 | omitting the theme repository history. 100 | 101 | ### Method - Using git clone 102 | 103 | This method clones the theme repository with history into your site's themes 104 | subdirectory which is useful if you want to control the history or make your 105 | own private modifications to the theme. 106 | 107 | ```bash 108 | cd 109 | git clone https://github.com/manid2/hugo-xterm themes/hugo-xterm --depth=1 110 | 111 | # update theme 112 | cd themes/hugo-xterm 113 | git pull 114 | ``` 115 | 116 | ### Method - Using git submodule 117 | 118 | This is similar to cloning the theme into subdirectory except using git 119 | submodule which makes the theme acts a dependency of your site repository. It 120 | lets git to control your site and its dependency this theme. 121 | 122 | ```bash 123 | git submodule add --depth=1 https://github.com/manid2/hugo-xterm \ 124 | themes/hugo-xterm 125 | 126 | # update theme 127 | git submodule update --remote --merge 128 | ``` 129 | 130 | Local development 131 | ----------------- 132 | 133 | ```bash 134 | # add to go.mod for local development 135 | # replace github.com/manid2/hugo-xterm => ../hugo-xterm 136 | hugo server --source exampleSite 137 | ``` 138 | 139 | Credits 140 | ------- 141 | 142 | This theme was initially based on [panr/terminal][1] theme but is re-written 143 | from scratch to optimize for reading and print text heavy web pages. 144 | 145 | Parts of the features in this theme are either taken directly or based on the 146 | features from popular themes and websites as listed below: 147 | 148 | * [panr/terminal][1]: most styles, menus and starter code. 149 | * [adityatelange/hugo-PaperMod][2] features: breadcrumbs and copy code. 150 | * [kaitlinmctigue/kaitlinmctigue.github.io][3]: dark and light theme modes. 151 | 152 | License 153 | ------- 154 | 155 | [GNU General Public License v3.0][11] 156 | 157 | [1]: https://github.com/panr/hugo-theme-terminal 158 | [2]: https://github.com/adityatelange/hugo-PaperMod 159 | [3]: https://github.com/kaitlinmctigue/kaitlinmctigue.github.io 160 | [5]: https://wave.webaim.org/ 161 | [8]: https://en.wikipedia.org/wiki/HSL_and_HSV 162 | [9]: https://github.com/alecthomas/chroma/ 163 | [11]: https://github.com/manid2/hugo-xterm/blob/main/LICENSE 164 | -------------------------------------------------------------------------------- /exampleSite/content/docs/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Docs" 3 | description = "Documents collection" 4 | date = "2023-07-15" 5 | author = "Mani Kumar" 6 | 7 | [cascade] 8 | list_type = "docs_list" 9 | +++ 10 | 11 | This page shows the list of items which are not articles and don't need a 12 | date, author and other meta data associated. They are like simple documents. 13 | -------------------------------------------------------------------------------- /exampleSite/content/docs/commands/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Commands" 3 | description = "Linux developer commands collection" 4 | date = "2023-07-15" 5 | author = "Mani Kumar" 6 | +++ 7 | -------------------------------------------------------------------------------- /exampleSite/content/docs/commands/awk.md: -------------------------------------------------------------------------------- 1 | awk 2 | === 3 | 4 | ```sh 5 | # upper case the first letter 6 | awk '{for(i=1;i<=NF;i++){ $i=toupper(substr($i,1,1)) substr($i,2) }}1' file 7 | ``` 8 | -------------------------------------------------------------------------------- /exampleSite/content/docs/commands/column.md: -------------------------------------------------------------------------------- 1 | column 2 | ====== 3 | 4 | ```sh 5 | # format csv into table 6 | column -s, -t < DebugLogs_2023-01-17-182808.csv >/tmp/t.csv 7 | ``` 8 | -------------------------------------------------------------------------------- /exampleSite/content/docs/commands/grep.md: -------------------------------------------------------------------------------- 1 | grep 2 | ==== 3 | 4 | ```sh 5 | # get all lower case letters 6 | egrep '^[[:lower:]]+$' /usr/share/dict/words >/tmp/t.txt 7 | 8 | # remove duplicate lines 9 | grep -vxF -f /usr/share/dict/words /tmp/t2.txt >/tmp/t.txt 10 | ``` 11 | -------------------------------------------------------------------------------- /exampleSite/content/docs/commands/irssi.md: -------------------------------------------------------------------------------- 1 | Irssi 2 | ===== 3 | 4 | Irssi - a modular IRC client for UNIX 5 | -------------------------------------------------------------------------------- /exampleSite/content/posts/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Posts" 3 | description = "Blog posts" 4 | date = "2023-07-15" 5 | author = "Mani Kumar" 6 | +++ 7 | -------------------------------------------------------------------------------- /exampleSite/content/posts/markdown-syntax.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Markdown Syntax Guide" 3 | description = """Sample article showcasing basic Markdown syntax and \ 4 | formatting for HTML elements.""" 5 | draft = false 6 | date = "2024-05-06T01:22:51+0530" 7 | author = "Hugo Authors" 8 | tags = ["markdown", "xterm", "css", "html"] 9 | categories = ["themes", "syntax"] 10 | +++ 11 | 12 | This article offers a sample of basic Markdown syntax that can be used in Hugo 13 | content files, also it shows whether basic HTML elements are decorated with 14 | CSS in a Hugo theme. 15 | 16 | Headings 17 | -------- 18 | 19 | The following HTML `

`—`

` elements represent six levels of section 20 | headings. `

` is the highest section level while `

` is the lowest. 21 | 22 | 23 | # H1 24 | 25 | ## H2 26 | 27 | 28 | ### H3 29 | 30 | #### H4 31 | 32 | ##### H5 33 | 34 | ###### H6 35 | 36 | Paragraph 37 | --------- 38 | 39 | Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, 40 | voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma 41 | dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as 42 | cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? 43 | Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, 44 | sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos 45 | evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, 46 | ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores 47 | editium rerore eost, temped molorro ratiae volorro te reribus dolorer 48 | sperchicium faceata tiustia prat. 49 | 50 | Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne 51 | sapicia is sinveli squiatum, core et que aut hariosam ex eat. 52 | 53 | Blockquotes 54 | ----------- 55 | 56 | The blockquote element represents content that is quoted from another source, 57 | optionally with a citation which must be within a `footer` or `cite` element, 58 | and optionally with in-line changes such as annotations and abbreviations. 59 | 60 | ### Blockquote without attribution 61 | 62 | > Tiam, ad mint andaepu dandae nostion secatur sequo quae. 63 | > __Note__ that you can use _Markdown syntax_ within a blockquote. 64 | 65 | Tables 66 | ------ 67 | 68 | Tables aren't part of the core Markdown spec, but Hugo supports them 69 | out-of-the-box. 70 | 71 | | Name | Age | 72 | | ----- | --- | 73 | | Bob | 27 | 74 | | Alice | 23 | 75 | 76 | ### Inline Markdown within tables 77 | 78 | | Italics | Bold | Code | 79 | | --------- | -------- | ------ | 80 | | _italics_ | __bold__ | `code` | 81 | 82 | Code Blocks 83 | ----------- 84 | 85 | ### Inline Code 86 | 87 | `This is Inline Code` 88 | 89 | ### Code block with backticks 90 | 91 | 92 | ``` 93 | 94 | 95 | 96 | 97 | Example HTML5 Document 98 | 99 | 100 |

Test

101 | 102 | 103 | ``` 104 | 105 | 106 | ### Code block with backticks, language & attributes (lineno) specified 107 | 108 | ```html {linenos=true} 109 | 110 | 111 | 112 | 113 | Example HTML5 Document 114 | 116 | 117 | 118 |

Test

119 | 120 | 121 | ``` 122 | 123 | 124 | 125 | ### Code block indented with four spaces 126 | 127 | 128 | 129 | 130 | 131 | Example HTML5 Document 132 | 133 | 134 |

Test

135 | 136 | 137 | 138 | ### Code block with Hugo's internal highlight shortcode 139 | 140 | {{< highlight html >}} 141 | 142 | 143 | 144 | 145 | 146 | Example HTML5 Document 147 | 148 | 149 |

Test

150 | 151 | 152 | 153 | {{< /highlight >}} 154 | 155 | 156 | 157 | List Types 158 | ---------- 159 | 160 | ### Ordered List 161 | 162 | 1. First item 163 | 2. Second item 164 | 3. Third item 165 | 166 | ### Unordered List 167 | 168 | - List item 169 | - Another item 170 | - And another item 171 | 172 | ### Nested list 173 | 174 | - Fruit 175 | + Apple 176 | + Orange 177 | + Banana 178 | - Dairy 179 | + Milk 180 | + Cheese 181 | -------------------------------------------------------------------------------- /exampleSite/content/posts/rich-content.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Rich Content" 3 | description = "A brief description of Hugo Shortcodes." 4 | draft = false 5 | date = "2023-07-28" 6 | author = "Hugo Authors" 7 | tags = ["xterm", "shortcodes", "css", "html"] 8 | categories = ["themes", "syntax"] 9 | +++ 10 | 11 | Hugo ships with several [Built-in Shortcodes][hg-sc1] for rich content, along 12 | with a [Privacy Config][hg-l1] and a set of simple Shortcodes that enable 13 | static and no-JS versions of various social media embeds. 14 | 15 | YouTube Privacy Enhanced Shortcode 16 | ---------------------------------- 17 | 18 | {{< youtube ZJthWmvUzzc >}} 19 | 20 | Vimeo Simple Shortcode 21 | ---------------------- 22 | 23 | {{< vimeo_simple 48912912 >}} 24 | 25 | [hg-sc1]: https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes 26 | [hg-l1]: https://gohugo.io/about/hugo-and-gdpr/ 27 | -------------------------------------------------------------------------------- /exampleSite/content/slides/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Slides" 3 | description = "hugo-xterm slides using reveal.js" 4 | date = "2022-07-15" 5 | author = "Mani Kumar" 6 | +++ 7 | -------------------------------------------------------------------------------- /exampleSite/content/slides/hugo-xterm-slides.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "hugo-xterm slides with reveal.js" 3 | description = """Slides created using reveal.js.""" 4 | date = "2023-07-15" 5 | author = "Mani Kumar" 6 | +++ 7 | 8 | Introduction 9 | ------------ 10 | 11 | * Hugo theme for terminal users. 12 | 13 | --- 14 | 15 | Features 16 | -------- 17 | 18 | * Slides using [reveal.js][1]. 19 | * Designed for blog and personal websites for professionals. 20 | * Support for online CV and documentation. 21 | 22 | [1]: https://revealjs.com/ 23 | -------------------------------------------------------------------------------- /exampleSite/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/manid2/hugo-xterm/exampleSite 2 | 3 | go 1.18 4 | 5 | require github.com/manid2/hugo-xterm v1.5.0 // indirect 6 | 7 | replace github.com/manid2/hugo-xterm => ../ 8 | -------------------------------------------------------------------------------- /exampleSite/go.sum: -------------------------------------------------------------------------------- 1 | github.com/manid2/hugo-xterm v0.0.0-20230715095800-5e6c59a4014f h1:rqkJPX0cOjWuXBxuUaWC6yzou0E+Gzw2HHb6/M4kOSY= 2 | github.com/manid2/hugo-xterm v0.0.0-20230715095800-5e6c59a4014f/go.mod h1:okco5bnHP7wAs4wCdFM1CGqvOZf5Wpj39kHDIZT4Vds= 3 | github.com/manid2/hugo-xterm v0.0.0-20230715205645-468f278c002c h1:SjaKPRMTk/kZ2amsVNLiCqp73z2QU8whOYIC2C6C/7w= 4 | github.com/manid2/hugo-xterm v0.0.0-20230715205645-468f278c002c/go.mod h1:GfVYdHvhSC/U07C3fOHLl/k2hzc+uQh0oRuy4q7Or3A= 5 | github.com/manid2/hugo-xterm v1.0.1 h1:s+uFQxPsA2lj20ZoQ2nUWqjW99E+uCsccuJL4UVWXQM= 6 | github.com/manid2/hugo-xterm v1.0.1/go.mod h1:GfVYdHvhSC/U07C3fOHLl/k2hzc+uQh0oRuy4q7Or3A= 7 | -------------------------------------------------------------------------------- /exampleSite/layouts/partials/extend_head.html: -------------------------------------------------------------------------------- 1 | {{- if hugo.IsProduction -}} 2 | 14 | {{- end -}} 15 | -------------------------------------------------------------------------------- /exampleSite/scripts/hugo-env: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | HUGOxPARAMSxGITxLAST_COMMITxHASH=$(git log -1 --format=%H) 4 | HUGOxPARAMSxGITxLAST_COMMITxSHORT_HASH=$(git log -1 --format=%h) 5 | HUGOxPARAMSxGITxLAST_COMMITxSUBJECT=$(git log -1 --format=%s) 6 | 7 | export HUGOxPARAMSxGITxLAST_COMMITxHASH 8 | export HUGOxPARAMSxGITxLAST_COMMITxSHORT_HASH 9 | export HUGOxPARAMSxGITxLAST_COMMITxSUBJECT 10 | 11 | export TZ='Asia/Kolkata' 12 | -------------------------------------------------------------------------------- /exampleSite/static/images/xterm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manid2/hugo-xterm/46d40a9aa1416351596adab5eb91bed167ef7f61/exampleSite/static/images/xterm.png -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/manid2/hugo-xterm 2 | 3 | go 1.18 4 | -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manid2/hugo-xterm/46d40a9aa1416351596adab5eb91bed167ef7f61/images/screenshot.png -------------------------------------------------------------------------------- /images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manid2/hugo-xterm/46d40a9aa1416351596adab5eb91bed167ef7f61/images/tn.png -------------------------------------------------------------------------------- /layouts/404.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 | 10 | {{- end }} 11 | -------------------------------------------------------------------------------- /layouts/_default/_markup/render-codeblock.html: -------------------------------------------------------------------------------- 1 | {{- $lang := .Attributes.lang | default .Type -}} 2 | {{- $file := .Attributes.file -}} 3 | 4 | {{- /* TODO: Add div toolbar */}} 5 |
6 |
7 | 8 | Lang: 9 | {{ $lang }} 10 | 11 | 12 | {{- with $file }} 13 | 14 | File: 15 | {{ . }} 16 | 17 | {{- end }} 18 | 19 | 20 | 21 |
22 | {{- highlight .Inner $lang -}} 23 |
24 | -------------------------------------------------------------------------------- /layouts/_default/_markup/render-heading.html: -------------------------------------------------------------------------------- 1 | {{- /* Anchorized headings */}} 2 | 3 | {{ .Text | safeHTML }} 4 | 5 | 6 | -------------------------------------------------------------------------------- /layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{- partial "head/base.html" . -}} 5 | {{- partial "head/style.html" . -}} 6 | {{- if templates.Exists "partials/extend_head.html" -}} 7 | {{- partial "extend_head.html" . -}} 8 | {{- end -}} 9 | 10 | 11 | 12 | {{- $container := "container" -}} 13 | {{- if site.Params.fullWidthTheme -}} 14 | {{- $container = print $container " full" -}} 15 | {{- else if site.Params.centerTheme -}} 16 | {{- $container = print $container " center" -}} 17 | {{- end -}} 18 | 19 | {{- /* theme container */}} 20 |
21 | {{- /* container */}} 22 |
23 | {{- /* site header */}} 24 | 29 | 30 | {{- /* site main */}} 31 |
32 | {{- block "main" . -}} 33 | {{ if .Title -}} 34 |

{{ .Title | plainify }}

35 | {{- end -}} 36 | 37 | {{- /* site main content */}} 38 | {{ .Content }} 39 | {{- end -}} 40 | {{- /* end main content */}} 41 |
42 | 43 | {{- /* site footer */}} 44 |
45 | {{- block "footer" . -}} 46 | {{- partial "footer.html" . -}} 47 | {{- end -}} 48 |
49 |
50 |
51 | 52 | {{- partial "scripts/base.html" . -}} 53 | {{- if templates.Exists "partials/extend_footer.html" -}} 54 | {{- partial "extend_footer.html" . -}} 55 | {{- end -}} 56 | 57 | 58 | -------------------------------------------------------------------------------- /layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 |
3 |
4 | {{- if .Title }} 5 |

{{ .Title | plainify }}

6 | {{- end }} 7 | 8 | {{- with .Params.Description -}} 9 |

{{ . }}

10 | {{- end -}} 11 |
12 | 13 |
14 | {{- with .Content }} 15 | {{ . }} 16 | {{- end }} 17 | 18 | {{- /* list content */}} 19 |

See

20 | 21 | {{- /* list items */}} 22 | {{- if eq .Params.list_type "docs_list" }} 23 | {{- $paginator := .Paginate .Pages -}} 24 | 38 | {{- else }} 39 | {{- partial "post-entries.html" . -}} 40 | {{- end }} 41 |
42 | 43 |
44 | {{- partial "pagination.html" . -}} 45 |
46 |
47 | {{- end }} 48 | -------------------------------------------------------------------------------- /layouts/_default/rss.xml: -------------------------------------------------------------------------------- 1 | {{- $pctx := . -}} 2 | {{- if .IsHome -}} 3 | {{ $pctx = .Site }} 4 | {{- end -}} 5 | 6 | {{- $pages := slice -}} 7 | {{- if or $.IsHome $.IsSection -}} 8 | {{- $pages = $pctx.RegularPages -}} 9 | {{- else -}} 10 | {{- $pages = $pctx.Pages -}} 11 | {{- end -}} 12 | 13 | {{- $limit := .Site.Config.Services.RSS.Limit -}} 14 | {{- if ge $limit 1 -}} 15 | {{- $pages = $pages | first $limit -}} 16 | {{- end -}} 17 | 18 | {{- printf "" | safeHTML }} 19 | 20 | 21 | {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} 22 | {{ .Permalink }} 23 | Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} 24 | Hugo -- gohugo.io 25 | 26 | {{- with .Site.LanguageCode }} 27 | {{.}} 28 | {{- end }} 29 | 30 | {{- with .Site.Author.email }} 31 | {{.}}{{with $.Site.Author.name}} ({{.}}){{end}} 32 | {{.}}{{with $.Site.Author.name}} ({{.}}){{end}} 33 | {{- end}} 34 | 35 | {{- with .Site.Params.Copyright }} 36 | {{.}} 37 | {{- end}} 38 | 39 | {{- if not .Date.IsZero }} 40 | {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} 41 | {{- end }} 42 | 43 | {{- with .OutputFormats.Get "RSS" -}} 44 | {{ printf "" .Permalink .MediaType | safeHTML }} 45 | {{- end -}} 46 | 47 | {{- range $pages }} 48 | 49 | {{ .Title }} 50 | {{ .Permalink }} 51 | {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} 52 | 53 | {{- with .Site.Author.email }} 54 | {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}} 55 | {{- end}} 56 | 57 | {{ .Permalink }} 58 | {{ .Summary | html }} 59 | {{ .Content | html }} 60 | 61 | {{- end }} 62 | 63 | 64 | -------------------------------------------------------------------------------- /layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{- define "main" -}} 2 |
3 |
4 | {{- if .Title }} 5 |

{{ .Title | markdownify }}

6 | {{- end }} 7 | 8 | {{- if or (.Params.Date) (.Params.Author) }} 9 | 25 | {{- end }} 26 | 27 | {{- if .Params.tags }} 28 | 29 | {{- end }} 30 | 31 | {{- with .Params.Description }} 32 |

{{ . }}

33 | {{- end }} 34 |
35 | 36 | {{- if .Params.Cover }} 37 | 38 | {{- end }} 39 | 40 | {{- if and (.Param "toc") (ne .TableOfContents "") }} 41 |
42 |

{{ "Table of Contents" | markdownify }}

43 | {{ .TableOfContents }} 44 |
45 | {{- end }} 46 | 47 | {{- with .Content }} 48 |
49 | {{ . }} 50 |
51 | {{- end }} 52 | 53 | 54 |
55 | {{- if .GitInfo -}} 56 | {{- partial "gitinfo.html" . -}} 57 | {{- end -}} 58 | 59 | {{- if eq .Type "posts" }} 60 | {{- if templates.Exists "partials/support-me.html" -}} 61 | {{- partial "support-me.html" . -}} 62 | {{- end -}} 63 | {{- partial "pagination.html" . -}} 64 | {{- partial "comments.html" . -}} 65 | {{- end }} 66 |
67 |
68 | {{- end -}} 69 | -------------------------------------------------------------------------------- /layouts/_default/terms.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 | {{- if .Title }} 3 |

4 | {{ .Title | plainify }} 5 |

6 | {{- end }} 7 | 8 | 9 |
10 |
    11 | {{- $type := .Type }} 12 | {{- range $key, $value := .Data.Terms.Alphabetical }} 13 | {{- $name := .Name }} 14 | {{- $count := .Count }} 15 | {{- with $.Site.GetPage (printf "/%s/%s" $type $name) }} 16 |
  • 17 | {{ .Name }} ({{ $count }}) 18 |
  • 19 | {{- end }} 20 | {{- end }} 21 |
22 |
23 | {{- end }} 24 | -------------------------------------------------------------------------------- /layouts/cv/single.html: -------------------------------------------------------------------------------- 1 | {{- define "main" -}} 2 |
3 |
4 |
5 |

6 | 7 | {{- if .Params.name }} 8 | {{- .Params.name }} 9 | {{- else if .Title }} 10 | {{- .Title }} 11 | {{- else }} 12 | {{- .File.TranslationBaseName }} 13 | {{- end }} 14 | 15 |

16 | 17 | {{- with .Params.contact }} 18 |
19 |
20 |
{{ .phone }}
21 |
{{ .email }}
22 |
23 |
24 | {{- end }} 25 |
26 | 27 | {{- with .Params.Description }} 28 |

{{ . }}

29 | {{- end }} 30 |
31 | 32 | {{- with .Content }} 33 |
34 | {{ . }} 35 |
36 | {{- end }} 37 | 38 | {{- if .GitInfo -}} 39 |
40 | {{- partial "gitinfo.html" . -}} 41 |
42 | {{- end -}} 43 |
44 | {{- end -}} 45 | -------------------------------------------------------------------------------- /layouts/partials/breadcrumbs.html: -------------------------------------------------------------------------------- 1 | {{- if not .IsHome -}} 2 | 23 | {{- end }} 24 | -------------------------------------------------------------------------------- /layouts/partials/comments.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 | {{- /* site build info */}} 2 |

3 | {{- /* site build timestamp */}} 4 | 5 | 6 | {{- with site.Params.git.last_commit -}} 7 | {{- $commitUrl := "" -}} 8 | {{- if (isset site.Params "git_info") -}} 9 | {{- $git_host := site.Params.git_info.host -}} 10 | {{- $git_user := site.Params.git_info.user -}} 11 | {{- $git_repo := site.Params.git_info.repo -}} 12 | {{ $commitUrl = printf "https://%s.com/%s/%s/-/commit/%s" $git_host $git_user $git_repo .hash }} 13 | {{- end -}} 14 | from commit: 15 | 16 | {{- /* code */}} 17 | 18 | {{- if eq $commitUrl "" }} 19 | #{{ .short_hash }} | 20 | {{ .subject }} 21 | {{- else }} 22 | 23 | #{{ .short_hash }} | 24 | {{ .subject }} 25 | 26 | {{- end }} 27 | 28 | {{- end -}} 29 | {{/* gitinfo */}} 30 |

31 | 32 | {{- /* site copyright */}} 33 | 72 | 73 | {{- /* site theme info */}} 74 |

Powered by Hugo, using theme Hugo Xterm.

75 | -------------------------------------------------------------------------------- /layouts/partials/gitinfo.html: -------------------------------------------------------------------------------- 1 | {{- $pageName := "Page" -}} 2 | {{- if eq .Type "posts" -}} 3 | {{- $pageName = print "Article" | plainify -}} 4 | {{- else -}} 5 | {{- with .File -}} 6 | {{- if eq .TranslationBaseName "cv" -}} 7 | {{- $pageName = print .TranslationBaseName | upper -}} 8 | {{- end -}} 9 | {{- end -}} 10 | {{- end -}} 11 | 12 | {{- with .GitInfo -}} 13 | {{- $commitUrl := "" -}} 14 | {{- if (isset site.Params "git_info") -}} 15 | {{- $git_host := site.Params.git_info.host -}} 16 | {{- $git_user := site.Params.git_info.user -}} 17 | {{- $git_repo := site.Params.git_info.repo -}} 18 | {{ $commitUrl = printf "https://%s.com/%s/%s/-/commit/%s" $git_host $git_user $git_repo .Hash }} 19 | {{- end -}} 20 | 21 | {{- /* gitinfo */}} 22 |
23 |

24 | {{- /* page name */}} 25 | {{ $pageName }} last updated on {{ .AuthorDate }} by commit 26 | {{- /* code */}} 27 | 28 | {{- if eq $commitUrl "" }} 29 | #{{ .AbbreviatedHash }} | 30 | {{ .Subject }} 31 | {{- else }} 32 | 33 | #{{ .AbbreviatedHash }} | 34 | {{ .Subject }} 35 | 36 | {{- end }} 37 | 38 |

39 |
40 | {{- end -}} 41 | {{/* gitinfo */}} 42 | -------------------------------------------------------------------------------- /layouts/partials/head/base.html: -------------------------------------------------------------------------------- 1 | {{- $title := site.Title -}} 2 | {{- $ogImage := site.Params.favicon -}} 3 | {{- if not .IsHome -}} 4 | {{- if .Title -}} 5 | {{- $title = .Title -}} 6 | {{- else -}} 7 | {{- $title = .File.TranslationBaseName -}} 8 | {{- end -}} 9 | {{- $title = printf "%s %s %s" $title "::" site.Title -}} 10 | {{- end -}} 11 | 12 | {{- $description := "" -}} 13 | {{- if .Description -}} 14 | {{- $description = .Description | plainify -}} 15 | {{- else -}} 16 | {{- $description = .Summary | plainify -}} 17 | {{- end -}} 18 | 19 | {{- $keywords := site.Params.Keywords -}} 20 | {{- with .Params.Keywords -}} 21 | {{- $keywords = delimit . ", " -}} 22 | {{- end -}} 23 | 24 | {{- /* title */}} 25 | {{ $title }} 26 | 27 | {{- /* meta */}} 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | {{- if (isset site.Params "twitter") -}} 36 | {{- $twitterCreator := .Params.Twitter.creator | default site.Params.Twitter.creator -}} 37 | {{- /* Twitter Card */}} 38 | 39 | 40 | {{- end -}} 41 | 42 | {{- /* OpenGraph data */}} 43 | 44 | 45 | 46 | {{- if .IsPage }} 47 | 48 | {{- range .Params.categories }} 49 | 50 | {{- end }} 51 | {{- if isset .Params "date" }} 52 | 53 | {{- end }} 54 | {{- with .Params.LastMod }} 55 | 56 | {{- end }} 57 | 58 | {{- if .Params.cover -}} 59 | {{- $ogImage = .Params.Cover }} 60 | {{- end -}} 61 | {{- else }} 62 | 63 | {{- end }} 64 | 65 | {{- /* OpenGraph data */}} 66 | 67 | 68 | 69 | 70 | 71 | 72 | {{- /* Analytics */}} 73 | {{- template "_internal/google_analytics.html" . -}} 74 | {{- partial "site-verification.html" . -}} 75 | 76 | {{- /* Icons */}} 77 | 78 | 79 | {{- /* Fonts */}} 80 | 81 | 82 | 86 | 87 | {{- /* RSS Feed */}} 88 | 89 | -------------------------------------------------------------------------------- /layouts/partials/head/style.html: -------------------------------------------------------------------------------- 1 | {{- if and (not .IsSection) (eq .Type "slides") -}} 2 | {{- partial "slides/style.html" . -}} 3 | {{- end }} 4 | 5 | {{- /* styles */}} 6 | {{- if hugo.IsProduction -}} 7 | {{- $options := (dict "targetPath" "styles.css" "outputStyle" "compressed") -}} 8 | {{- $styles := resources.Get "styles/app.scss" | toCSS $options | resources.Fingerprint -}} 9 | 10 | {{- else -}} 11 | {{- $options := (dict "targetPath" "styles.css" "outputStyle" "compressed" "enableSourceMap" true) -}} 12 | {{- $styles := resources.Get "styles/app.scss" | toCSS $options -}} 13 | 14 | {{- end -}} 15 | 16 | {{- /* Custom CSS to override theme properties (/static/style.css) */}} 17 | {{- if (fileExists "static/style.css") }} 18 | 19 | {{- end }} 20 | -------------------------------------------------------------------------------- /layouts/partials/header.html: -------------------------------------------------------------------------------- 1 | {{- if and (site.Params.banner) (templates.Exists "banner.html") -}} 2 | 5 | {{- end -}} 6 | 7 | {{- partial "navbar.html" . -}} 8 | 9 | {{- if and (site.Params.showBreadCrumbs) (not .IsHome) -}} 10 | {{- partial "breadcrumbs.html" . -}} 11 | {{- end -}} 12 | -------------------------------------------------------------------------------- /layouts/partials/navbar.html: -------------------------------------------------------------------------------- 1 | {{- $logoText := site.Params.Logo.logoText | default "Home" -}} 2 | {{- $logoLink := site.Params.Logo.logoHomeLink | default "" -}} 3 | 4 | {{- /* navbar */}} 5 | 44 | -------------------------------------------------------------------------------- /layouts/partials/pagination.html: -------------------------------------------------------------------------------- 1 | {{- /* pagination */}} 2 | {{- $pgTitle := "See more" -}} 3 | {{- $pgNext := "Next" -}} 4 | {{- $pgPrev := "Previous" -}} 5 | {{- $pgNextLink := false -}} 6 | {{- $pgPrevLink := false -}} 7 | 8 | {{- if .IsPage -}} 9 | {{- $pgTitle = site.Params.ReadOtherPosts | default "Read other posts" -}} 10 | 11 | {{- with .NextInSection -}} 12 | {{- $pgNext = .Title -}} 13 | {{- $pgNextLink = .Permalink -}} 14 | {{- end -}} 15 | 16 | {{- with .PrevInSection -}} 17 | {{- $pgPrev = .Title -}} 18 | {{- $pgPrevLink = .Permalink -}} 19 | {{- end -}} 20 | {{- else -}} 21 | {{- if .Paginator.HasNext -}} 22 | {{- $pgNextLink = .Paginator.Next.URL -}} 23 | {{- end -}} 24 | 25 | {{- if .Paginator.HasPrev -}} 26 | {{- $pgPrevLink = .Paginator.Prev.URL -}} 27 | {{- end -}} 28 | {{- end -}} 29 | 30 | {{- if or $pgNextLink $pgPrevLink -}} 31 | 51 | {{- end -}} 52 | -------------------------------------------------------------------------------- /layouts/partials/post-entries.html: -------------------------------------------------------------------------------- 1 | {{- $paginator := .Paginate .Pages -}} 2 |
3 | {{- range $paginator.Pages }} 4 |
5 | {{- /* list item */ -}} 6 | 7 | {{- if .Title -}} 8 |

9 | {{- .Title | markdownify -}} 10 |

11 | {{- else -}} 12 | {{- .File.TranslationBaseName | markdownify -}} 13 | {{- end -}} 14 |
15 | 16 | {{- if and (not .IsSection) (or .Date .Params.Author) -}} 17 | 26 | {{- end -}} 27 | 28 | {{- with .Params.Description -}} 29 |

{{ . }}

30 | {{- end -}} 31 |
32 | {{- end }} 33 |
34 | -------------------------------------------------------------------------------- /layouts/partials/scripts/base.html: -------------------------------------------------------------------------------- 1 | {{- $copy := resources.Get "scripts/copy.js" | js.Build -}} 2 | {{- $menu := resources.Get "scripts/menu.js" | js.Build -}} 3 | {{- $print := resources.Get "scripts/print.js" | js.Build -}} 4 | {{- $theme := resources.Get "scripts/theme.js" | js.Build -}} 5 | {{- $bundle := slice $menu $theme $copy $print | resources.Concat "bundle.js" -}} 6 | 7 | {{- if hugo.IsProduction -}} 8 | {{- $bundle = $bundle | resources.Minify -}} 9 | {{- end -}} 10 | 11 | 12 | {{- if and (not .IsSection) (eq .Type "slides") -}} 13 | {{- partial "slides/scripts.html" . -}} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /layouts/partials/site-verification.html: -------------------------------------------------------------------------------- 1 | {{- if site.Params.site_verification.google }} 2 | 3 | {{- end }} 4 | 5 | {{- if site.Params.site_verification.bing }} 6 | 7 | {{- end }} 8 | 9 | {{- if site.Params.site_verification.yandex }} 10 | 11 | {{- end }} 12 | 13 | {{- if site.Params.site_verification.naver }} 14 | 15 | {{- end -}} 16 | -------------------------------------------------------------------------------- /layouts/partials/slides/scripts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | 27 | -------------------------------------------------------------------------------- /layouts/partials/slides/style.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /layouts/partials/theme-icon.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /layouts/shortcodes/cv/experience.html: -------------------------------------------------------------------------------- 1 | {{- $name := .Get "name" -}} 2 | {{- $date := .Get "date" -}} 3 | {{- $title := .Get "title" -}} 4 | {{- $location := .Get "location" -}} 5 | 6 | 7 |
8 |
9 | {{ $name }} 10 | {{ $date }} 11 |
12 | 13 |
14 | {{ $title }} 15 | {{ $location }} 16 |
17 |
18 | -------------------------------------------------------------------------------- /layouts/shortcodes/figure.html: -------------------------------------------------------------------------------- 1 | {{- if .Get "src" }} 2 |
3 | 4 | {{- if .Get "caption" }} 5 |
6 | {{ .Get "caption" | safeHTML }} 7 |
8 | {{- end }} 9 |
10 | {{- end }} 11 | -------------------------------------------------------------------------------- /layouts/shortcodes/image.html: -------------------------------------------------------------------------------- 1 | {{ if .Get "src" }} 2 | 12 | {{ end }} 13 | -------------------------------------------------------------------------------- /layouts/slides/single.html: -------------------------------------------------------------------------------- 1 | {{- define "main" -}} 2 | 3 |
4 | 12 |
13 | 14 |
15 | {{- if .Title }} 16 |

{{ .Title | markdownify }}

17 | {{- end }} 18 | 19 | {{- if or (.Params.Date) (.Params.Author) }} 20 | 36 | {{- end }} 37 | 38 | {{- with .Params.Description }} 39 |

{{ . }}

40 | {{- end }} 41 |
42 | 43 |
44 |
45 |
46 | 47 | {{- if .Title }} 48 |
49 |

{{ .Title }}

50 | {{- if or .Date .Params.Author }} 51 |

52 | {{- with .Date -}} 53 | {{ .Format "2006-01-02" }} 54 | {{- end -}} 55 | 56 | {{- with .Params.Author -}} 57 |  | {{ . }} 58 | {{- end -}} 59 |

60 | {{- end }} 61 | 62 | {{- with .Description }} 63 |

{{ . }}

64 | {{- end }} 65 |
66 | {{- end }} 67 | 68 | 69 | 70 |
71 | {{ .RawContent }} 72 |
73 | 74 | 75 |
76 |

Thank you

77 |
78 |
79 |
80 |
81 | {{- end -}} 82 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hugo-xterm", 3 | "version": "1.0.0", 4 | "description": "Hugo theme for terminal users.", 5 | "main": "index.js", 6 | "scripts": { 7 | "g-fmt": "prettier --config '.prettier.json' --write 'layouts/**/*.html' 'exampleSite/layouts/**/*.html'", 8 | "g-fmt-check": "prettier --config '.prettier.json' --check 'layouts/**/*.html' 'exampleSite/layouts/**/*.html'", 9 | "j-fmt": "prettier --config '.prettier.json' --write 'assets/scripts/*.js'", 10 | "j-fmt-check": "prettier --config '.prettier.json' --check 'assets/scripts/*.js'", 11 | "j-lint": "eslint 'assets/scripts/*.js'", 12 | "j-lint-fix": "eslint --fix 'assets/scripts/*.js'", 13 | "m-links-check": "linkinator --config '.linkinator.config.json' 'README.md' 'exampleSite/content/**/*.md'", 14 | "m-lint": "markdownlint --config '.markdownlint.json' 'README.md' 'exampleSite/content/**/*.md'", 15 | "s-fmt": "prettier --config '.prettier.json' --write 'assets/styles/*.scss'", 16 | "s-fmt-check": "prettier --config '.prettier.json' --check 'assets/styles/*.scss'", 17 | "s-lint": "stylelint --config '.stylelintrc.json' 'assets/styles/*.scss'", 18 | "s-lint-fix": "stylelint --config '.stylelintrc.json' --fix 'assets/styles/*.scss'", 19 | "format": "npm run g-fmt && npm run j-fmt && npm run s-fmt", 20 | "format-check": "npm run g-fmt-check && npm run j-fmt-check && npm run s-fmt-check", 21 | "lint": "npm run j-lint && npm run m-lint && npm run s-lint", 22 | "lint-fix": "npm run j-lint-fix && npm run s-lint-fix", 23 | "test": "npm run format-check && npm run lint && npm run m-links-check" 24 | }, 25 | "repository": { 26 | "type": "git", 27 | "url": "https://github.com/manid2/hugo-xterm/" 28 | }, 29 | "keywords": [ 30 | "blog", 31 | "cv", 32 | "dark-theme", 33 | "docs", 34 | "hugo", 35 | "hugo-theme", 36 | "light-theme", 37 | "minimal", 38 | "personal-website", 39 | "portfolio-website", 40 | "slides" 41 | ], 42 | "author": "Mani Kumar", 43 | "license": "GPL-3.0", 44 | "bugs": { 45 | "url": "https://github.com/manid2/hugo-xterm/issues" 46 | }, 47 | "homepage": "https://manid2.github.io/hugo-xterm/", 48 | "devDependencies": { 49 | "eslint": "^8.57.1", 50 | "eslint-config-prettier": "^8.10.0", 51 | "eslint-config-standard": "^17.1.0", 52 | "eslint-plugin-import": "^2.31.0", 53 | "eslint-plugin-n": "^15.7.0", 54 | "eslint-plugin-promise": "^6.6.0", 55 | "linkinator": "^4.1.3", 56 | "markdownlint-cli": "^0.33.0", 57 | "prettier": "^2.8.8", 58 | "prettier-plugin-go-template": "^0.0.13", 59 | "stylelint": "^15.11.0", 60 | "stylelint-config-standard-scss": "^9.0.0" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /static/screenshots/hugo-xterm-ss-01-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manid2/hugo-xterm/46d40a9aa1416351596adab5eb91bed167ef7f61/static/screenshots/hugo-xterm-ss-01-dark.png -------------------------------------------------------------------------------- /static/screenshots/hugo-xterm-ss-02-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manid2/hugo-xterm/46d40a9aa1416351596adab5eb91bed167ef7f61/static/screenshots/hugo-xterm-ss-02-light.png -------------------------------------------------------------------------------- /theme.toml: -------------------------------------------------------------------------------- 1 | name = "xterm" 2 | license = "GPL-3.0" 3 | licenselink = "https://github.com/manid2/hugo-xterm/blob/main/LICENSE" 4 | description = "Hugo theme designed for reading and printing text with dark and light modes." 5 | 6 | # The home page of the theme, where the source can be found. 7 | homepage = "https://github.com/manid2/hugo-xterm/" 8 | 9 | # Demo site. 10 | demosite = "https://manid2.github.io/hugo-xterm/" 11 | 12 | tags = [ 13 | "blog", 14 | "contact", 15 | "cv", 16 | "slides", 17 | "dark", 18 | "light", 19 | "minimal", 20 | "personal", 21 | "portfolio", 22 | "responsive" 23 | ] 24 | 25 | features = [ 26 | "blog", 27 | "clean", 28 | "minimal", 29 | "portfolio" 30 | ] 31 | 32 | min_version = 0.110 33 | 34 | [author] 35 | name = "Mani Kumar" 36 | homepage = "https://manid2.github.io/" 37 | twitter = "https://twitter.com/mani_d2" 38 | 39 | # Starter code taken from this theme 40 | [original] 41 | name = "terminal" 42 | author = "panr" 43 | homepage = "https://radoslawkoziel.pl" 44 | repo = "https://github.com/panr/hugo-theme-terminal" 45 | --------------------------------------------------------------------------------