1
0
mirror of https://github.com/avinal/avinal.github.io.git synced 2026-07-04 07:40:09 +05:30

2 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 64557b013a Initial plan 2026-02-25 14:20:56 +00:00
avinal f90901ef65 feat: redesign my webiste from scratch
- remove hugo and paper box theme
- inspiration https://jay.fish
- use astro based system

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
2026-02-25 19:49:38 +05:30
47 changed files with 4143 additions and 7345 deletions
+3 -7
View File
@@ -1,7 +1,3 @@
# No environment variables required.
# All external data is fetched from public APIs or configured in src/config/theme.ts.
#
# WakaTime: public share URL (configured in src/lib/wakatime.ts)
# GitHub: public API (configured in src/lib/github.ts)
# ListenBrainz: public API, username in src/config/theme.ts
# Cal.com: embedded via CDN script (configured in src/pages/meeting.astro)
# WakaTime API key — used to fetch coding activity stats for the homepage
# Get yours at https://wakatime.com/settings/api-key
WAKATIME_API_KEY=
+2 -5
View File
@@ -1,9 +1,10 @@
name: CI
name: Check build
on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:
jobs:
@@ -20,10 +21,6 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Audit dependencies
run: npm audit --audit-level=high
continue-on-error: true
- name: Check types
run: npm run check
+2 -2
View File
@@ -17,5 +17,5 @@ dist/
# OS
.DS_Store
# Personal files
Profile.pdf
# Legacy Hugo
public/
+367 -21
View File
@@ -1,27 +1,373 @@
MIT License
Mozilla Public License Version 2.0
==================================
Copyright (c) 2024-present Avinal Kumar
1. Definitions
--------------
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1.3. "Contribution"
means Covered Software of a particular Contributor.
---
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
Note: Blog posts and written content (src/content/posts/) are licensed under
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0).
See LICENSE-CONTENT for details.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
-31
View File
@@ -1,31 +0,0 @@
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
Copyright (c) 2024-present Avinal Kumar
This license applies to all blog posts and written content located in
src/content/posts/ and any other prose content on this website.
You are free to:
Share — copy and redistribute the material in any medium or format for
any purpose, even commercially.
Adapt — remix, transform, and build upon the material for any purpose,
even commercially.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the
license, and indicate if changes were made. You may do so in any
reasonable manner, but not in any way that suggests the licensor
endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you
must distribute your contributions under the same license as the
original.
No additional restrictions — You may not apply legal terms or
technological measures that legally restrict others from doing anything
the license permits.
Full license text: https://creativecommons.org/licenses/by-sa/4.0/legalcode
+10 -8
View File
@@ -13,12 +13,11 @@ Personal website and blog built with [Astro](https://astro.build). Minimal, fast
| Route | Description |
|-------|-------------|
| `/` | Homepage with hero card, GitHub/WakaTime activity graph, ListenBrainz music widget, recent posts, and pinned repos |
| `/` | Homepage with hero card, GitHub/WakaTime activity graph, Game of Life widget, recent posts, and pinned repos |
| `/posts/` | Blog index with category filters and featured images |
| `/posts/<category>/` | Category-filtered post listings |
| `/posts/<category>/<slug>/` | Individual blog posts |
| `/resume/` | Resume page (data driven from `src/data/resume.json`) |
| `/events/` | Conferences and events timeline |
| `/meeting/` | Book a meeting via [Cal.com](https://cal.com) embed |
| `/setup/` | Hardware and software setup |
| `/rss.xml` | RSS feed |
@@ -36,12 +35,15 @@ cd avinal.github.io
make install
```
No environment variables are required. All external data is fetched from public APIs:
Copy the example env file and add your keys:
- **GitHub** — contributions graph and user info (public API)
- **WakaTime** — coding stats via public share URL
- **ListenBrainz** — music listening activity (public API, username in `src/config/theme.ts`)
- **Cal.com** — meeting booking (embedded via CDN)
```bash
cp .env.example .env
```
| Variable | Required | Description |
|----------|----------|-------------|
| `WAKATIME_API_KEY` | No | Enables WakaTime coding stats on the homepage activity graph. Get yours at [wakatime.com/settings/api-key](https://wakatime.com/settings/api-key) |
## Development
@@ -62,7 +64,7 @@ src/
├── components/ # Reusable Astro components
├── config/ # Theme tokens and site config
├── content/posts/ # Blog posts (Markdown)
├── data/ # JSON data (resume, repos, events)
├── data/ # JSON data (resume, repos)
├── layouts/ # Page layouts
├── lib/ # Utilities and rehype plugins
├── pages/ # Route pages
-1
View File
@@ -8,7 +8,6 @@ export default defineConfig({
site: "https://avinal.space",
output: "static",
integrations: [sitemap()],
prefetch: true,
markdown: {
shikiConfig: {
theme: "github-dark-default",
-15
View File
@@ -4,18 +4,3 @@
[build.environment]
NODE_VERSION = "22"
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-Content-Type-Options = "nosniff"
Referrer-Policy = "strict-origin-when-cross-origin"
Permissions-Policy = "camera=(), microphone=(), geolocation=()"
X-XSS-Protection = "1; mode=block"
Content-Security-Policy = "default-src 'self'; script-src 'self' 'unsafe-inline' https://cal.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' https: data:; font-src 'self' https://fonts.gstatic.com; connect-src 'self' https://api.listenbrainz.org https://coverartarchive.org https://itunes.apple.com https://api.github.com https://wakatime.com; frame-src https://cal.com;"
[[headers]]
for = "/talks/*"
[headers.values]
Content-Security-Policy = "default-src 'self'; script-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://fonts.googleapis.com; img-src 'self' https: data:; font-src 'self' https://fonts.gstatic.com https://fonts.googleapis.com; connect-src 'self';"
+2962 -1895
View File
File diff suppressed because it is too large Load Diff
+3 -5
View File
@@ -21,11 +21,9 @@
},
"homepage": "https://github.com/avinal/avinal.github.io#readme",
"dependencies": {
"@astrojs/rss": "^4.0.18",
"@astrojs/sitemap": "^3.7.2",
"@fontsource/iosevka": "^5.2.5",
"@fontsource/iosevka-aile": "^5.2.5",
"astro": "^7.0.0",
"@astrojs/rss": "^4.0.15",
"@astrojs/sitemap": "^3.7.0",
"astro": "^5.17.3",
"rehype-autolink-headings": "^7.1.0",
"rehype-slug": "^6.0.0",
"unist-util-visit": "^5.1.0"
+2 -2
View File
@@ -2,8 +2,8 @@
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/logo-static.svg"/>
<TileColor>#2563eb</TileColor>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

-1
View File
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="630"><rect width="1200" height="630" fill="#111"/><rect width="1120" height="550" x="40" y="40" fill="#1a1a1a" stroke="#2e2e2e" stroke-width="2" rx="16"/><text x="600" y="270" fill="#e5e5e5" font-family="Inter, system-ui, sans-serif" font-size="72" font-weight="800" text-anchor="middle">avinal.space</text><text x="600" y="340" fill="#a3a3a3" font-family="Inter, system-ui, sans-serif" font-size="28" text-anchor="middle">Software Engineer Open Source Contributor</text><line x1="500" x2="700" y1="380" y2="380" stroke="#60a5fa" stroke-linecap="round" stroke-width="3"/><text x="600" y="430" fill="#737373" font-family="Inter, system-ui, sans-serif" font-size="22" text-anchor="middle">avinal.space</text></svg>

Before

Width:  |  Height:  |  Size: 777 B

+1 -1
View File
@@ -1,4 +1,4 @@
User-agent: *
Allow: /
Sitemap: https://avinal.space/sitemap-index.xml
Sitemap: https://www.example.com/sitemap.xml
+17 -19
View File
@@ -1,21 +1,19 @@
{
"name": "Avinal's Personal Website",
"short_name": "avinal.space",
"start_url": "/",
"icons": [
{
"src": "/logo-static.svg",
"sizes": "any",
"type": "image/svg+xml"
},
{
"src": "/logo-static.svg",
"sizes": "any",
"type": "image/svg+xml",
"purpose": "maskable"
}
],
"theme_color": "#2563eb",
"background_color": "#fafafa",
"display": "standalone"
"name": "Avinal's Personal Website",
"short_name": "Fedoraemon",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
-342
View File
@@ -1,342 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lost in Transliteration: Why strlen("Dvořák") Returns 8</title>
<meta name="description" content="DevConf.CZ 2026 talk by Avinal Kumar — character encoding, Unicode, and glibc's iconv internals" />
<meta name="author" content="Avinal Kumar" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.1.0/reveal.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.1.0/theme/black.min.css" id="theme" />
<style>
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');
/* ============================================
IBM Carbon Design System — Color Tokens
============================================ */
:root {
/* Carbon Gray 80 background */
--r-background-color: #2f2f2f;
/* Carbon typography */
--r-main-font: 'IBM Plex Sans', system-ui, sans-serif;
--r-main-font-size: 34px;
--r-heading-font: 'IBM Plex Sans', system-ui, sans-serif;
--r-heading-color: #f4f4f4;
--r-heading-font-weight: 600;
--r-main-color: #c6c6c6;
--r-link-color: #78a9ff;
--r-link-color-hover: #a6c8ff;
--r-code-font: 'IBM Plex Mono', monospace;
--r-heading-text-transform: none;
--r-heading-letter-spacing: -0.01em;
/* Carbon color palette */
--carbon-blue-40: #78a9ff;
--carbon-blue-60: #0f62fe;
--carbon-purple-40: #be95ff;
--carbon-teal-20: #9ef0f0;
--carbon-teal-40: #08bdba;
--carbon-magenta-40: #ff7eb6;
--carbon-red-40: #ff8389;
--carbon-green-40: #42be65;
--carbon-yellow-30: #f1c21b;
--carbon-gray-10: #f4f4f4;
--carbon-gray-30: #c6c6c6;
--carbon-gray-50: #8d8d8d;
--carbon-gray-60: #6f6f6f;
--carbon-gray-70: #525252;
--carbon-gray-80: #393939;
--carbon-gray-90: #262626;
--carbon-gray-100: #161616;
}
.reveal {
font-weight: 400;
letter-spacing: 0;
}
.reveal h1, .reveal h2, .reveal h3 {
line-height: 1.2;
margin-bottom: 0.6em;
}
.reveal h2 { font-size: 2em; font-weight: 600; }
.reveal h3 { font-size: 1.4em; font-weight: 600; }
/* ---- Code blocks: Carbon snippet style ---- */
.reveal pre {
width: 100%;
font-size: 0.52em;
box-shadow: none;
border-radius: 0;
border: none;
background: var(--carbon-gray-100);
}
.reveal pre code {
padding: 1.2em 1.4em;
border-radius: 0;
max-height: 480px;
line-height: 1.65;
background: var(--carbon-gray-100);
color: #fff;
font-weight: 400;
}
.reveal code {
font-family: var(--r-code-font);
font-weight: 500;
}
.reveal p code, .reveal li code {
background: var(--carbon-gray-80);
border: none;
padding: 0.15em 0.45em;
border-radius: 0;
font-size: 0.88em;
color: var(--carbon-magenta-40);
}
/* ---- Carbon syntax highlighting (overrides highlight.js) ---- */
.reveal pre code .hljs-keyword,
.reveal pre code .hljs-type,
.reveal pre code .hljs-built_in { color: var(--carbon-purple-40); }
.reveal pre code .hljs-string,
.reveal pre code .hljs-doctag { color: var(--carbon-magenta-40); }
.reveal pre code .hljs-number,
.reveal pre code .hljs-literal { color: var(--carbon-blue-40); }
.reveal pre code .hljs-comment { color: var(--carbon-gray-60); font-style: normal; }
.reveal pre code .hljs-function,
.reveal pre code .hljs-title { color: var(--carbon-teal-20); }
.reveal pre code .hljs-variable,
.reveal pre code .hljs-attr { color: #fff; }
.reveal pre code .hljs-params { color: var(--carbon-gray-30); }
.reveal pre code .hljs-meta,
.reveal pre code .hljs-preprocessor { color: #569CD6; }
.reveal pre code .hljs-regexp { color: #D16969; }
.reveal pre code .hljs-symbol,
.reveal pre code .hljs-template-variable { color: var(--carbon-red-40); }
.hljs { background: var(--carbon-gray-100); color: #fff; }
/* ---- Utility classes: Carbon palette ---- */
.reveal .dim { opacity: 0.45; }
.reveal .accent { color: var(--carbon-blue-40); }
.reveal .green { color: var(--carbon-green-40); }
.reveal .yellow { color: var(--carbon-yellow-30); }
.reveal .orange { color: #f0883e; }
.reveal .red { color: var(--carbon-red-40); }
.reveal .purple { color: var(--carbon-purple-40); }
.reveal .teal { color: var(--carbon-teal-20); }
.reveal .magenta { color: var(--carbon-magenta-40); }
.reveal .big { font-size: 1.6em; font-weight: 600; letter-spacing: -0.02em; }
.reveal .medium { font-size: 1.15em; font-weight: 500; }
.reveal .small { font-size: 0.7em; }
.reveal .tiny {
font-size: 0.45em;
color: var(--carbon-gray-60);
font-family: var(--r-code-font);
letter-spacing: 0.02em;
}
/* ---- Tables ---- */
.reveal table { font-size: 0.72em; border-collapse: collapse; border-spacing: 0; }
.reveal table th {
color: var(--carbon-gray-10);
font-weight: 600;
background: var(--carbon-gray-80);
padding: 0.6em 1em;
border-bottom: 2px solid var(--carbon-gray-70);
text-align: left;
}
.reveal table td {
padding: 0.5em 1em;
border-bottom: 1px solid var(--carbon-gray-70);
}
.reveal table tr:hover td { background: rgba(255,255,255,0.04); }
/* ---- Custom blocks: Carbon surface style ---- */
.reveal .hex-display {
font-family: var(--r-code-font);
font-size: 0.62em;
background: var(--carbon-gray-100);
padding: 1em 1.4em;
border-radius: 0;
border: none;
display: inline-block;
line-height: 1.9;
color: #fff;
}
.reveal .diagram {
background: var(--carbon-gray-100);
border: none;
border-radius: 0;
padding: 1.2em 1.4em;
font-family: var(--r-code-font);
font-size: 0.58em;
line-height: 1.7;
color: #fff;
}
/* ---- Section label ---- */
.reveal .slide-title {
font-size: 0.45em;
color: var(--carbon-blue-40);
text-transform: uppercase;
letter-spacing: 0.2em;
font-weight: 600;
margin-bottom: 0.3em;
opacity: 0.8;
}
/* ---- Blockquotes ---- */
.reveal blockquote {
background: var(--carbon-gray-80);
border-left: 4px solid var(--carbon-blue-60);
padding: 0.8em 1.2em;
font-style: italic;
width: 85%;
border-radius: 0;
}
/* ---- Grid layouts ---- */
.reveal .two-col {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2em;
text-align: left;
}
.reveal .three-col {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 1.5em;
text-align: left;
font-size: 0.8em;
}
/* ---- Cards: Carbon tile style ---- */
.reveal .card {
background: var(--carbon-gray-80);
border: none;
border-radius: 0;
padding: 1.2em;
}
.reveal .card h4 {
margin-bottom: 0.5em;
}
/* ---- Lists ---- */
.reveal ul, .reveal ol { display: block; }
.reveal li {
margin-bottom: 0.5em;
line-height: 1.5;
}
.reveal ul li::marker { color: var(--carbon-blue-40); }
.reveal ol li::marker { color: var(--carbon-blue-40); font-weight: 600; }
/* ---- Glow effects for emphasis ---- */
.reveal .glow-blue {
text-shadow: 0 0 40px rgba(120,169,255,0.4), 0 0 80px rgba(120,169,255,0.15);
color: var(--carbon-blue-40);
}
.reveal .glow-red {
text-shadow: 0 0 40px rgba(255,131,137,0.4), 0 0 80px rgba(255,131,137,0.15);
color: var(--carbon-red-40);
}
.reveal .glow-green {
text-shadow: 0 0 40px rgba(66,190,101,0.4), 0 0 80px rgba(66,190,101,0.15);
color: var(--carbon-green-40);
}
/* ---- Badges: Carbon tag style ---- */
.reveal .badge {
display: inline-block;
font-size: 0.55em;
font-weight: 500;
padding: 0.15em 0.7em;
border-radius: 0;
text-transform: uppercase;
letter-spacing: 0.06em;
}
.reveal .badge-blue { background: rgba(120,169,255,0.2); color: var(--carbon-blue-40); }
.reveal .badge-red { background: rgba(255,131,137,0.2); color: var(--carbon-red-40); }
.reveal .badge-green { background: rgba(66,190,101,0.2); color: var(--carbon-green-40); }
.reveal .badge-yellow { background: rgba(241,194,27,0.2); color: var(--carbon-yellow-30); }
.reveal .badge-purple { background: rgba(190,149,255,0.2); color: var(--carbon-purple-40); }
/* ---- HR ---- */
.reveal hr {
border: none;
height: 1px;
background: var(--carbon-gray-70);
margin: 1em 0;
}
/* ---- Progress bar ---- */
.reveal .progress span { background: var(--carbon-blue-60); }
/* ---- Auto-animate transitions ---- */
.reveal [data-auto-animate] .hex-display,
.reveal [data-auto-animate] .diagram,
.reveal [data-auto-animate] pre {
transition: all 0.6s ease;
}
/* ---- Slide number ---- */
.reveal .slide-number {
font-family: var(--r-code-font);
font-size: 0.5em;
color: var(--carbon-gray-60);
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section
data-markdown="slides.md"
data-separator="^---$"
data-separator-vertical="^--$"
data-separator-notes="^Note:"
data-charset="utf-8">
</section>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.1.0/reveal.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.1.0/plugin/markdown/markdown.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.1.0/plugin/notes/notes.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.1.0/plugin/highlight/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.1.0/plugin/zoom/zoom.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/reveal.js-mermaid-plugin@11.15.0/plugin/mermaid/mermaid.js"></script>
<script>
Reveal.initialize({
mermaid: {
theme: 'dark',
themeVariables: {
darkMode: true,
background: '#2f2f2f',
primaryColor: '#393939',
primaryTextColor: '#c6c6c6',
primaryBorderColor: '#525252',
lineColor: '#78a9ff',
secondaryColor: '#262626',
tertiaryColor: '#161616',
fontFamily: "'IBM Plex Sans', system-ui, sans-serif",
fontSize: '18px',
},
},
hash: true,
slideNumber: 'c/t',
showSlideNumber: 'speaker',
transition: 'fade',
transitionSpeed: 'default',
backgroundTransition: 'fade',
center: true,
width: 1280,
height: 720,
margin: 0.08,
autoAnimateEasing: 'ease-in-out',
autoAnimateDuration: 0.8,
autoAnimateUnmatched: true,
zoomKey: 'alt',
plugins: [RevealMarkdown, RevealHighlight, RevealNotes, RevealZoom, RevealMermaid],
});
</script>
</body>
</html>
-923
View File
@@ -1,923 +0,0 @@
<!-- ===================================================== -->
<!-- SECTION 1: THE PROBLEM (mystery opening) -->
<!-- ===================================================== -->
<!-- .slide: data-auto-animate data-background-color="#2f2f2f" -->
```bash
$ printf 'Dvořák' | wc -c
```
<!-- .element: data-id="mystery-code" -->
Note:
**Do:** Walk on stage, put terminal on screen, no output yet. Pause 3-4 seconds. Ask: "What do you think this prints?"
- **wc** = word count; **-c** = count bytes (not characters)
- Dvořák = Czech composer surname, pronounced "DVOR-zhahk"
--
<!-- .slide: data-auto-animate data-background-color="#2f2f2f" -->
```bash
$ printf 'Dvořák' | wc -c
8
```
<!-- .element: data-id="mystery-code" -->
Note:
**Do:** Reveal the 8. Pause. Dvořák has 6 visible letters — why 8? Don't explain yet.
- wc -c counts bytes, not characters — this is POSIX behavior, not a bug
--
<!-- .slide: data-auto-animate data-background-color="#2f2f2f" -->
```bash
$ printf 'Dvořák' | wc -c
8
```
<!-- .element: data-id="mystery-code" -->
<br />
How many people think this is **wrong**?
<!-- .element: class="medium" -->
Note:
**Do:** Ask the question. Wait 5 seconds. Let hands go up. Do NOT answer yet.
--
<!-- .slide: data-auto-animate data-background-color="#2f2f2f" -->
```bash
$ printf 'Dvořák' | wc -c
8
$ python3 -c "print(len('Dvořák'))"
6
```
<!-- .element: data-id="mystery-code" -->
Note:
Two different answers for the same string. Let the confusion build.
- Python 3 len() counts Unicode code points, not bytes
- *Exception:* Python 2 len() counted bytes — this changed in 2→3
--
<!-- .slide: data-auto-animate data-background-color="#2f2f2f" -->
```bash
$ printf '😀' | wc -c
4
$ python3 -c "print(len('😀'))"
1
```
<!-- .element: data-id="mystery-code" -->
Note:
An emoji: 4 bytes vs 1 character.
- 😀 = U+1F600 "Grinning Face." Needs 4 bytes in UTF-8 (F0 9F 98 80) because it's above the **BMP** (Basic Multilingual Plane, U+0000U+FFFF)
- *Exception:* On macOS, `echo` appends a newline — use `printf` to avoid off-by-one
--
<!-- .slide: data-background-color="#2f2f2f" -->
Which one is **correct**?
<!-- .element: class="big" -->
All of them.
<!-- .element: class="fragment zoom-in glow-blue big" -->
Understanding why is basically the entire talk.
<!-- .element: class="fragment fade-up small dim" -->
Note:
**Do:** Pause before "All of them." Then: *"They're counting different things. wc counts bytes. Python counts code points. Both correct."*
**Key thesis:** bytes ≠ characters ≠ code points
---
<!-- ===================================================== -->
<!-- SECTION 2: INTRODUCTION -->
<!-- ===================================================== -->
<!-- .slide: data-background-color="#2f2f2f" data-transition="zoom" -->
## Lost in Transliteration
Why `strlen("Dvořák")` Returns **8**
<!-- .element: class="medium" style="opacity: 0.9" -->
<br />
Avinal Kumar · glibc contributor
<!-- .element: style="font-weight: 500" -->
<span class="badge badge-blue">DevConf.CZ 2026</span>
<!-- .element: class="small dim" -->
Note:
**Do:** Brief intro, under 30 seconds:
*"I'm Avinal. I contribute to glibc — the GNU C Library. I got into character encodings through an iconv bug at the glibc workshop here at DevConf. Today I'll take you through that journey."*
- **glibc** = GNU C Library — the standard C library on most Linux distros
- **iconv** = POSIX API for converting text between character encodings
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
### Today we'll answer
1. Why does `strlen("Dvořák")` return 8?
2. Why does Unicode exist?
3. How does the C library handle text?
4. How does `iconv` convert between encodings?
5. Does any of this still matter in 2026?
Note:
**Do:** Read out loud. Give the audience a roadmap. Don't linger.
- **strlen** = "string length" — counts bytes before the null terminator, NOT characters
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="fade" -->
<span class="glow-blue big">There is no such thing as plain text.</span>
<br />
If you remember one thing from this talk, remember that sentence.
<!-- .element: class="fragment fade-up small dim" -->
Note:
**Do:** Say this slowly. Pause. *"If you remember one thing, remember that sentence."*
- "Plain text" implies no encoding — but every byte sequence *has* an encoding. If you don't know it, you're guessing. Wrong guess = **mojibake** (文字化け, Japanese for garbled text, pronounced "mo-ji-ba-keh")
---
<!-- ===================================================== -->
<!-- SECTION 3: HISTORY -->
<!-- ===================================================== -->
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">How we ended up with this mess</p>
### ASCII: The 7-bit world
<div class="two-col">
<div>
- 128 characters (0127)
- 7 bits per character
- English letters, digits, punctuation
- Bit 8 was "spare"
</div>
<div>
```text
0x41 = A
0x61 = a
0x30 = 0
0x20 = (space)
0x0A = (newline)
```
</div>
</div>
*"And all was good — if you spoke English."*
<!-- .element: class="fragment fade-up" -->
Note:
- **ASCII** = American Standard Code for Information Interchange (1963)
- 7 bits = 128 values. The 8th bit was for parity checking on noisy telegraph lines
- Only covers English — no accented chars, no Cyrillic, no CJK, no Arabic
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">How we ended up with this mess</p>
### Code Pages: Everyone fills bit 8 differently
If I send byte `0xE9` from Paris to Moscow, what character arrives?
<!-- .element: class="medium" -->
| Byte | CP-1252 (Western) | CP-866 (Russian) | CP-862 (Hebrew) |
|------|-------------------|-------------------|------------------|
| `0xE9` | é | щ | ט |
| `0xC4` | Ä | ─ | ד |
| `0xF1` | ñ | ё | ס |
<!-- .element: class="fragment fade-in" -->
CJK needed **thousands** — multi-byte encodings (Shift-JIS, EUC-KR, GB2312) where you can't even move backward in a string.
<!-- .element: class="fragment fade-up small" -->
Note:
**Do:** Ask *"If I send byte 0xE9 from Paris to Moscow, what character arrives?"* before revealing the table.
- **CP** = Code Page. CP-1252 = Windows Western. CP-866 = DOS Russian. CP-862 = DOS Hebrew
- Same byte, different characters — the bytes are correct, the *interpretation* is wrong
- **CJK** = Chinese, Japanese, Korean
- **Shift-JIS** = Shift Japanese Industrial Standards. **EUC-KR** = Extended Unix Code for Korean. **GB2312** = Chinese National Standard
- *Exception:* Multi-byte encodings have a "forward-only" problem — you can't tell if a byte is byte 1 or byte 2 of a character
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">How we ended up with this mess</p>
### Unicode: One number per character
```text
U+0041 = A U+00E9 = é U+010D = č
U+0639 = ع U+4E16 = 世 U+1F600 = 😀
```
- Code points are **abstract numbers**, not bytes <!-- .element: class="fragment fade-up" -->
- <span class="red">Not</span> "16-bit characters" — that's the myth <!-- .element: class="fragment fade-up" -->
- 154,998 characters across 168 scripts <!-- .element: class="fragment fade-up" -->
Unicode separated the *idea* of a character from how it's stored.
<!-- .element: class="fragment zoom-in accent" -->
Note:
- **Unicode** = Universal Coded Character Set (1991, Unicode Consortium)
- Code points are abstract numbers — how you *store* them is a separate question (that's what encodings answer)
- *Exception:* "Unicode is 16-bit" myth comes from Unicode 1.0 (1991) which only planned 65,536 chars. Unicode 2.0 (1996) expanded beyond 16 bits. Java and Windows adopted UTF-16 before that expansion, and are now stuck with it
- **BMP** = Basic Multilingual Plane (U+0000U+FFFF). Characters above it (emoji, rare scripts) are in supplementary planes
---
<!-- .slide: data-auto-animate data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">How we ended up with this mess</p>
### Encodings: Serialization formats
<div class="three-col">
<div class="card fragment fade-up" data-fragment-index="1">
<h4 class="glow-blue">UTF-8</h4>
- 14 bytes
- ASCII-compatible
- <span class="badge badge-blue">98% of the web</span>
</div>
<div class="card fragment fade-up" data-fragment-index="2">
<h4 class="yellow">UTF-16</h4>
- 2 or 4 bytes
- Needs BOM
- <span class="badge badge-yellow">Windows, Java</span>
</div>
<div class="card fragment fade-up" data-fragment-index="3">
<h4 class="green">UTF-32</h4>
- Fixed 4 bytes
- Simple but wasteful
- <span class="badge badge-green">glibc internal</span>
</div>
</div>
Note:
- **UTF** = Unicode Transformation Format
- **UTF-8:** Designed 1992 by Ken Thompson & Rob Pike. ASCII bytes are identical — this is why it won. 98.2% of websites (W3Techs, 2024)
- **UTF-16:** Uses surrogate pairs above U+FFFF. **BOM** = Byte Order Mark (U+FEFF) — indicates endianness
- **UTF-32:** Also called **UCS-4** (Universal Coded Character Set, 4-byte). "hello" = 20 bytes instead of 5
- *Exception:* UTF-32 and UCS-4 are technically from different standards (ISO 10646 vs Unicode), but identical in practice
--
<!-- .slide: data-auto-animate data-background-color="#2f2f2f" -->
<p class="slide-title">How we ended up with this mess</p>
### Encodings: Serialization formats
<div class="hex-display" data-id="encoding-hex">
"Dvořák" in UTF-8: &nbsp;44 76 6F <span class="red" style="font-weight:700;">C5 99</span> C3 A1 6B &nbsp;&nbsp;&nbsp;<span class="badge badge-blue">8 bytes</span><br />
"Dvořák" in UTF-32: 00000044 00000076 0000006F <span class="red" style="font-weight:700;">00000159</span> 000000E1 0000006B &nbsp;<span class="badge badge-green">24 bytes</span>
</div>
<span class="glow-blue big">There is no such thing as plain text.</span>
<!-- .element: class="fragment zoom-in" -->
Note:
UTF-8 breakdown:
- D, v, o, k = 1 byte each (ASCII range)
- ř = C5 99 (2 bytes, U+0159)
- á = C3 A1 (2 bytes, U+00E1)
- Total: 4×1 + 2×2 = **8 bytes** for 6 characters
UTF-32: every char = 4 bytes → 6×4 = **24 bytes**. Same string, 3× the size.
---
<!-- ===================================================== -->
<!-- SECTION 4: INTO C — real examples, not code -->
<!-- ===================================================== -->
<!-- .slide: data-background-color="#2f2f2f" data-transition="zoom" -->
<span class="badge badge-blue" style="font-size: 0.6em;">Part 2</span>
## Text in C: What actually happens
Note:
**Do:** *"Now we understand WHY bytes and characters differ. Let's see how C deals with it."*
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">Text in C</p>
### C has two ways to see a string
<div class="two-col">
<div class="card">
#### `char` — bytes
- 1 byte per element, no encoding info
- `strlen("Dvořák")`**8**
- `strlen("😀")`**4**
- Indexing gives you bytes, not characters
</div>
<div class="card">
#### `wchar_t` — code points
- 4 bytes on Linux, <span class="red">2 on Windows</span>
- `wcslen(L"Dvořák")`**6**
- `wcslen(L"😀")`**1**
- Indexing gives you characters
</div>
</div>
<br />
`mbrtowc()` bridges between them. `setlocale()` tells it which encoding to expect.
<!-- .element: class="fragment fade-up small" -->
Note:
- **wchar_t** = "wide character type." Linux: 4 bytes (UCS-4). Windows: 2 bytes (UTF-16)
- **wcslen** = "wide character string length"
- **L"..."** prefix = wide string literal
- **mbrtowc** = "multibyte restartable to wide character" — converts one multibyte char to one wchar_t
- **setlocale** with LC_CTYPE tells mbrtowc the encoding. Without it → "C" locale = ASCII only
- *Exception:* On Windows, wcslen(L"😀") returns **2** (surrogate pair), not 1
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">Text in C</p>
### What does "Dvořák" look like in memory?
```text
Character: D v o ř á k
UTF-8 hex: 44 76 6F C5 99 C3 A1 6B
Bytes: 1 1 1 2 2 1 = 8 bytes
Code points: 1 1 1 1 1 1 = 6 characters
```
`strlen` counts the top row. `wcslen` counts the bottom row.
<!-- .element: class="fragment fade-up small" -->
Now you know why `strlen("Dvořák")` returns 8.
<!-- .element: class="fragment fade-up accent" -->
Note:
**Do:** Point at the diagram: *"strlen counts bytes: 1+1+1+2+2+1 = 8. wcslen counts characters: always 1 each = 6. Both correct."*
This is the answer to the opening mystery.
---
<!-- .slide: data-auto-animate data-background-color="#2f2f2f" -->
<p class="slide-title">Text in C</p>
### `iconv` — converting between encodings
```bash
$ echo 'Dvořák' | iconv -f UTF-8 -t ASCII
iconv: illegal input sequence at position 3
```
<!-- .element: data-id="iconv-demo" -->
Note:
- **iconv** = both a C API (iconv_open/iconv/iconv_close in `<iconv.h>`) and a CLI tool
- **-f** = from, **-t** = to
- Position 3 = 4th byte (0-indexed) = where ř starts. ASCII only has 0127; C5 = 197 → fails
- **EILSEQ** = "illegal sequence" errno value
--
<!-- .slide: data-auto-animate data-background-color="#2f2f2f" -->
<p class="slide-title">Text in C</p>
### `iconv` — converting between encodings
```bash
$ echo 'Dvořák' | iconv -f UTF-8 -t ASCII
iconv: illegal input sequence at position 3
$ echo 'Dvořák' | iconv -f UTF-8 -t ASCII//TRANSLIT
Dvorak
$ echo 'Dvořák' | iconv -f UTF-8 -t ASCII//IGNORE
Dvok
```
<!-- .element: data-id="iconv-demo" -->
- **`//TRANSLIT`** — approximate: ř→r, á→a
- **`//IGNORE`** — drop what doesn't fit
Note:
- **//TRANSLIT** = transliteration. Appended to target encoding. Finds closest match: ř→r, á→a, ö→o, ñ→n
- **//IGNORE** = silently drop unconvertible chars. Notice "Dvok" — both ř AND á dropped
- *Exception:* //TRANSLIT is glibc-specific, not POSIX. musl libc (Alpine Linux) doesn't support it
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">Text in C</p>
### Real encoding pairs from across the world
```bash
$ echo '東京' | iconv -f UTF-8 -t SHIFT_JIS | hexdump -C
00000000 93 8c 8b 9e 0a |.....|
$ echo 'こんにちは世界' | iconv -f UTF-8 -t EUC-JP | hexdump -C
00000000 a4 b3 a4 f3 a4 cb a4 c1 a4 cf c0 a4 b3 a6 0a |...............|
$ echo 'Ελληνικά κείμενο' | iconv -f UTF-8 -t ISO-8859-7 | hexdump -C
00000000 c5 eb eb e7 ed e9 ea dc 20 ea e5 df ec e5 ed ef |........ .......|
```
Same characters, completely different bytes — depending on the encoding.
<!-- .element: class="fragment fade-up small" -->
Note:
- 東京 = Tōkyō (Tokyo)
- こんにちは世界 = "Konnichiwa Sekai" = "Hello World"
- Ελληνικά κείμενο = "Elliniká keímeno" = "Greek text"
- **hexdump -C** = canonical hex+ASCII dump. Non-ASCII shows as dots
- Same text in Shift-JIS vs EUC-JP → completely different bytes. Without knowing the encoding, unreadable
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">Text in C</p>
### When conversion fails
```bash
$ echo 'مرحبا' | iconv -f UTF-8 -t ISO-8859-1
iconv: illegal input sequence at position 0
$ echo 'Résumé' | iconv -f UTF-8 -t CP866
iconv: illegal input sequence at position 1
$ echo -ne '\xEF\xBB\xBFhello' | hexdump -C
00000000 ef bb bf 68 65 6c 6c 6f |...hello|
$ echo -ne '\xEF\xBB\xBFhello' | iconv -f UTF-8 -t ASCII//TRANSLIT
hello
```
- Arabic → Latin-1: impossible — the encoding can't hold it
- French Résumé → Russian CP866: `é` doesn't exist in that code page
- BOM: 3 invisible bytes at the start — your first "character" is garbage
Note:
- مرحبا = "marhaba" = "hello" in Arabic
- **ISO-8859-1** = Latin-1. Zero Arabic chars → fails at position 0
- **CP866** = DOS Cyrillic. é doesn't map → fails at position 1 (R is fine, é isn't)
- **BOM** = Byte Order Mark (U+FEFF, encoded EF BB BF in UTF-8). Windows Notepad adds it. Breaks JSON parsers, shell shebangs, and string comparisons
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">Text in C</p>
### Longer text, bigger difference
```bash
$ printf 'Příliš žluťoučký kůň úpěl ďábelské ódy' | wc -c
53
$ python3 -c "print(len('Příliš žluťoučký kůň úpěl ďábelské ódy'))"
38
$ echo 'Příliš žluťoučký kůň úpěl ďábelské ódy' \
| iconv -f UTF-8 -t ASCII//TRANSLIT
Prilis zlutoucky kun upel dabelske ody
```
A Czech pangram: **38 characters**, **53 bytes** — a 40% difference.
<!-- .element: class="fragment fade-up" -->
`//TRANSLIT` strips all diacritics and produces valid ASCII.
<!-- .element: class="fragment fade-up small" -->
Note:
- **Translation:** "Too yellow a horse groaned devilish odes" — a Czech pangram (like "The quick brown fox" but for testing diacritics)
- 15 extra bytes from accented characters: each adds 1 byte in UTF-8
- Czech diacritics: **háček** (ˇ) = caron (ř, š, č, ž, ň, ď, ť, ě), **čárka** (´) = acute (á, é, í, ó, ú), **kroužek** (°) = ring (ů)
- **Do:** DevConf is in Brno — the audience will recognize this pangram
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">Text in C</p>
### How many encodings?
```bash
$ iconv -l | wc -l
1180
$ find /usr/lib64/gconv -name '*.so' | wc -l
253
```
**1180** encoding names served by **253** shared libraries.
<!-- .element: class="fragment fade-up" -->
How does glibc manage this without writing thousands of converters?
<!-- .element: class="fragment fade-up accent" -->
Note:
**Do:** LIVE DEMO if possible.
- **iconv -l** = list all encodings. 1180 includes aliases (SHIFT-JIS, SJIS, MS_KANJI = same encoding)
- **/usr/lib64/gconv/** = where glibc stores converter .so files (Fedora/RHEL). Debian: /usr/lib/x86_64-linux-gnu/gconv/
- **.so** = shared object (dynamically loaded library)
- 1180 names, 253 plugins — far fewer than the 39,800 needed for N×N
---
<!-- ===================================================== -->
<!-- SECTION 5: HOW IT WORKS INSIDE -->
<!-- ===================================================== -->
<!-- .slide: data-background-color="#2f2f2f" data-transition="zoom" -->
<span class="badge badge-blue" style="font-size: 0.6em;">Part 3</span>
## Inside glibc's iconv
Note:
**Do:** *"We've seen what iconv does from the outside. Now let's look under the hood."*
- **gconv** = glibc's internal conversion framework ("g" = GNU, "conv" = conversion)
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">Inside glibc</p>
### The naive approach: N×N converters
Suppose I support 200 encodings. How many converters do I need?
<!-- .element: class="medium" -->
```text
Shift-JIS → UTF-8 UTF-8 → Shift-JIS
Shift-JIS → EUC-KR EUC-KR → Shift-JIS
UTF-8 → EUC-KR EUC-KR → UTF-8
...
```
<!-- .element: class="fragment fade-in" -->
5 encodings = 20 converters. 200 encodings?
<!-- .element: class="fragment fade-up" -->
200 × 199 = <span class="red">39,800 converters</span>. That's not going to work.
<!-- .element: class="fragment zoom-in" -->
Note:
**Do:** Ask *"How many converters do I need?"* before revealing. Let them guess.
- Formula: N × (N-1) for directed pairs
- Nobody will write 39,800 converters
---
<!-- .slide: data-auto-animate data-background-color="#2f2f2f" -->
<p class="slide-title">Inside glibc</p>
### The smart approach: one universal pivot
What if every encoding just learned to convert to **one common format**?
<!-- .element: class="medium" -->
```text
Shift-JIS → ??? → UTF-8
```
<!-- .element: data-id="hub-text" class="fragment fade-in" -->
Note:
Hub-and-spoke architecture — same principle as airline routing through hub airports.
--
<!-- .slide: data-auto-animate data-background-color="#2f2f2f" -->
<p class="slide-title">Inside glibc</p>
### The smart approach: one universal pivot
glibc's gconv framework uses an internal **UCS-4 based representation** as the pivot.
```text
Shift-JIS → UCS-4 → UTF-8
```
<!-- .element: data-id="hub-text" -->
Now you need just **2 converters per encoding** (to UCS-4 and from UCS-4).
<!-- .element: class="fragment fade-up" -->
200 encodings × 2 = <span class="green">400 converters</span> instead of 39,800.
<!-- .element: class="fragment zoom-in" -->
Note:
- **UCS-4** = Universal Coded Character Set, 4-byte form (ISO 10646). Essentially UTF-32
- glibc calls it **INTERNAL** in gconv-modules config
- 2 converters per encoding → 400 total. 99% reduction
- *Exception:* glibc says "UCS-4 *based*" — the internal representation has nuances around stateful encodings
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">Inside glibc</p>
### The lookup table: `gconv-modules`
<pre><code class="language-text" data-line-numbers data-ln-start-from="47"># iconvdata/gconv-modules
# from to module cost
module ISO-8859-1// INTERNAL ISO8859-1 1
module INTERNAL ISO-8859-1// ISO8859-1 1</code></pre>
<pre><code class="language-text" data-line-numbers data-ln-start-from="415"># iconvdata/gconv-modules-extra.conf
module SJIS// INTERNAL SJIS 1
module INTERNAL SJIS// SJIS 1</code></pre>
`INTERNAL` = the UCS-4 pivot
<!-- .element: class="fragment fade-up accent" -->
Each line maps an encoding to a `.so` plugin. `iconv_open` reads this file, loads the right plugins, and chains them.
<!-- .element: class="fragment fade-up small" -->
Note:
These are actual files from the glibc source tree.
- Format: `module FROM// TO MODULE_NAME COST`
- **INTERNAL** = glibc's name for UCS-4
- **Cost** = routing weight when multiple paths exist (lower = preferred)
- Each encoding has exactly 2 lines — one each direction. Hub-and-spoke in practice
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">Inside glibc</p>
### The conversion pipeline
<div class="mermaid">
<pre>
flowchart TB
A["Shift-JIS bytes"] --> B["SJIS.so\n(gconv module)"]
B --> C["UCS-4\n(internal pivot)"]
C --> D["UTF-8 converter\n(built-in)"]
D --> E["UTF-8 bytes"]
style C fill:#0f62fe,stroke:#78a9ff,color:#fff
style B fill:#393939,stroke:#78a9ff,color:#c6c6c6
style D fill:#393939,stroke:#78a9ff,color:#c6c6c6
style A fill:#262626,stroke:#525252,color:#f1c21b
style E fill:#262626,stroke:#525252,color:#42be65
</pre>
</div>
Adding a new encoding = writing **one** `.so` plugin.
<!-- .element: class="fragment fade-up small" -->
Note:
**Do:** THIS IS THE MONEY SLIDE. Spend time here. Point at each box:
1. *"Shift-JIS bytes come in"*
2. *"SJIS.so converts to UCS-4"*
3. *"UTF-8 converter turns UCS-4 into UTF-8"*
4. *"UTF-8 bytes come out"*
Adding a new encoding = one .so that converts to/from UCS-4. People will photograph this.
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">Inside glibc</p>
### The iconv flow
<div class="mermaid">
<pre>
sequenceDiagram
participant App as Your Code
participant glibc as glibc internals
App->>glibc: iconv_open("UTF-8", "SJIS")
Note right of glibc: look up gconv-modules
Note right of glibc: load SJIS.so + UTF-8
Note right of glibc: build step chain
glibc-->>App: return descriptor
App->>glibc: iconv(cd, &in, ...)
Note right of glibc: step[0]: SJIS → UCS-4
Note right of glibc: step[1]: UCS-4 → UTF-8
glibc-->>App: advance pointers
App->>glibc: iconv_close(cd)
Note right of glibc: free chain, unload modules
</pre>
</div>
Three calls. That's the entire API.
<!-- .element: class="fragment fade-up small" -->
Note:
The API in three calls:
1. **iconv_open** → returns descriptor (pointer to gconv_info struct with step chain)
2. **iconv** → walks the chain. Both in/out pointers advance. Errors: **EILSEQ** (illegal sequence), **E2BIG** (output buffer full — flush and retry, not a real error), **EINVAL** (incomplete sequence)
3. **iconv_close** → free chain, unload modules
- *Highlight:* E2BIG is the #1 mistake — people call iconv once and assume it's done
---
<!-- ===================================================== -->
<!-- SECTION 6: RELEVANCE TODAY -->
<!-- ===================================================== -->
<!-- .slide: data-background-color="#2f2f2f" data-transition="zoom" -->
<span class="badge badge-red" style="font-size: 0.6em;">Part 4</span>
## Does this still matter?
Note:
**Do:** *"Modern languages have Unicode strings by default. So why should anyone care about iconv in 2026?"*
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">Relevance today</p>
### How modern languages handle encoding
| Language | Strings are... | Encoding conversion |
|----------|----------------|---------------------|
| **Python 3** | Unicode internally | Built-in codecs |
| **Go** | UTF-8 by definition | `golang.org/x/text` |
| **Rust** | Always valid UTF-8 | `encoding_rs` crate |
| **Java** | UTF-16 internally | `java.nio.charset` |
| **C/C++** | Just bytes — no encoding | **`iconv`** |
Modern languages solved this by making strings Unicode-native. C didn't — and can't, because it would break 50 years of code.
<!-- .element: class="fragment fade-up small" -->
Note:
- C can't change because `char = 1 byte` is baked into the language spec and **ABI** (Application Binary Interface)
- Even modern languages need encoding conversion at **I/O boundaries** — files, sockets, C library calls via **FFI** (Foreign Function Interface)
- Python's codecs, Go's x/text, Rust's encoding_rs all exist because the outside world isn't always UTF-8
---
<!-- .slide: data-background-color="#2f2f2f" data-transition="slide" -->
<p class="slide-title">Relevance today</p>
### Encoding bugs are alive and well
<div class="two-col">
<div class="card">
#### The Turkish İ problem
| Locale | `toupper('i')` |
|--------|----------------|
| en_US | I |
| tr_TR | <span class="red">İ</span> (dotted!) |
Tests pass in English, break in Turkish.
</div>
<div class="card">
#### `//IGNORE` inconsistency
```bash
$ echo 'héllo' | iconv \
-f UTF-8 -t ASCII//IGNORE
```
Some modules skip the bad byte. Some stop with an error.
**Same flag, different behavior.**
</div>
</div>
<br />
Every time a language reads a file, parses a socket, or calls a C library — encoding conversion still happens. These bugs still bite.
<!-- .element: class="fragment fade-up accent small" -->
Note:
**Turkish İ:**
- Turkish has 4 i's: i, İ, ı, I. toupper('i') → İ (U+0130), not I
- Any case-insensitive comparison using toupper/tolower is locale-dependent
**//IGNORE:**
- Behavior depends on *which* gconv module runs — inconsistent across encodings
- This is a real unfixed glibc bug. This is what got me into the codebase
---
<!-- ===================================================== -->
<!-- SECTION 7: GLIBC WORKSHOP -->
<!-- ===================================================== -->
<!-- .slide: data-background-color="#2f2f2f" data-transition="fade" -->
### glibc Development Workshop — Third Edition
Led by **Arjun Shankar** (Red Hat, glibc developer)
<span class="accent medium">Tomorrow, Friday June 19 · 10:15 AM · Room A218</span>
Pick a bug, get a cheat sheet, ship a patch.
6 patches in 2024 · 15+ in 2025 · **yours in 2026?**
Note:
**Do:** Tell the personal story:
*"Two years ago I walked into this workshop at DevConf. Arjun gave me a small iconv task. I got curious, fell down the rabbit hole, and that became this talk. That one task turned into 14 patches in glibc."*
- **Arjun Shankar** = Red Hat engineer, glibc developer. Runs this workshop yearly at DevConf.CZ
- Format: show up, get a cheat sheet with a small bug + pointers, experienced contributors help you submit
- Room A218, capacity 20. First come, first served
- *"If anything in this talk made you curious, room A218 tomorrow morning."*
---
<!-- ===================================================== -->
<!-- SECTION 8+9: REFERENCES + QUESTIONS -->
<!-- ===================================================== -->
<!-- .slide: data-background-color="#2f2f2f" data-transition="fade" -->
### Questions? · Resources
- **Joel Spolsky** — "The Absolute Minimum Every Software Developer Must Know About Unicode" <!-- .element: class="small" -->
- **GNU C Library Manual** — "Character Set Handling" chapter <!-- .element: class="small" -->
- **unicode.org** — the specification <!-- .element: class="small" -->
<span class="badge badge-blue">avinal.space</span> · <span class="badge badge-purple">@avinal</span>
Attendance at DevConf.CZ 2026 was supported by the **[GNU Toolchain Fund](https://my.fsf.org/civicrm/contribute/transact?reset=1&id=57)**, a part of the FSF's Working Together for Free Software Fund.
<!-- .element: class="small" -->
Note:
**Do:** Leave this up during Q&A.
- Joel Spolsky's article (2003) — the classic intro, entertaining
- glibc manual — authoritative API reference (sourceware.org/glibc/manual)
- **GNU Toolchain Fund** = part of the **FSF's** (Free Software Foundation) "Working Together for Free Software" fund
+22 -235
View File
@@ -18,15 +18,10 @@ const hasWaka = activity.wakatime.available;
<div class="activity-card card">
<div class="activity-header">
<h3 class="widget-title">
<span class="icon-trigger" id="gol-trigger">
<svg class="icon-heart" width="24" height="24" viewBox="0 0 24 24" fill="#e11d48" xmlns="http://www.w3.org/2000/svg">
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
</svg>
<svg class="icon-signal" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>
</span>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>
Activity
</h3>
<span class="text-muted text-xs" id="activity-subtitle">past year</span>
<span class="text-muted text-xs">past year</span>
</div>
{activity.weeks.length > 0 ? (
@@ -48,18 +43,18 @@ const hasWaka = activity.wakatime.available;
const hasGh = ghLevel > 0;
const hasWk = wakaLvl > 0;
const isSplit = hasGh && hasWk;
let color: string;
if (hasGh && hasWk) {
const ghPct = Math.round((ghLevel / (ghLevel + wakaLvl)) * 100);
color = `color-mix(in oklch, var(--graph-${ghLevel}) ${ghPct}%, var(--waka-${wakaLvl}))`;
} else if (hasWk) {
color = `var(--waka-${wakaLvl})`;
} else {
color = `var(--graph-${ghLevel})`;
if (isSplit) {
return (
<div class="graph-cell split-cell" title={tip}>
<div class="cell-gh" style={`background-color: var(--graph-${ghLevel})`}></div>
<div class="cell-waka" style={`background-color: var(--waka-${wakaLvl})`}></div>
</div>
);
}
const isAlive = hasGh || hasWk;
return <div class="graph-cell" style={`background-color: ${color}`} title={tip} data-alive={isAlive ? "1" : "0"}></div>;
const color = hasWk ? `var(--waka-${wakaLvl})` : `var(--graph-${ghLevel})`;
return <div class="graph-cell" style={`background-color: ${color}`} title={tip}></div>;
})}
</div>
))}
@@ -73,13 +68,6 @@ const hasWaka = activity.wakatime.available;
<div class="legend-cell" style="background-color: var(--graph-3)"></div>
<div class="legend-cell" style="background-color: var(--graph-4)"></div>
</span>
{hasWaka && (
<span class="legend-group">
<span class="text-xs text-muted">Both</span>
<div class="legend-cell" style="background-color: color-mix(in oklch, var(--graph-2) 50%, var(--waka-2))"></div>
<div class="legend-cell" style="background-color: color-mix(in oklch, var(--graph-3) 50%, var(--waka-3))"></div>
</span>
)}
{hasWaka && (
<span class="legend-group">
<div class="legend-cell" style="background-color: var(--waka-1)"></div>
@@ -112,7 +100,7 @@ const hasWaka = activity.wakatime.available;
{hasWaka && (
<Fragment>
<div class="stat-item waka">
<dt>Tracked (year)</dt>
<dt>Coded (year)</dt>
<dd>{activity.wakatime.totalText}</dd>
</div>
<div class="stat-item waka">
@@ -174,6 +162,15 @@ const hasWaka = activity.wakatime.available;
cursor: default;
}
.split-cell {
display: flex;
overflow: hidden;
background: none;
}
.cell-gh { width: 50%; height: 11px; border-radius: 2px 0 0 2px; }
.cell-waka { width: 50%; height: 11px; border-radius: 0 2px 2px 0; }
.graph-legend {
display: flex;
align-items: center;
@@ -232,214 +229,4 @@ const hasWaka = activity.wakatime.available;
.stat-item.waka dd {
color: var(--waka-3);
}
/* Easter egg: heart icon trigger */
.icon-trigger {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
width: 26px;
height: 26px;
}
.icon-heart {
position: absolute;
opacity: 0;
transform: scale(0.6);
transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
pointer-events: none;
}
.icon-signal {
position: relative;
z-index: 1;
transition: opacity 0.3s var(--ease-out);
}
.icon-trigger:hover .icon-heart {
opacity: 0.4;
transform: scale(1);
animation: heart-pulse 1.2s ease-in-out infinite;
}
.icon-trigger:hover .icon-signal {
opacity: 0.6;
}
:global(.gol-active) .icon-heart {
opacity: 0.5;
transform: scale(1);
animation: heart-pulse 1.2s ease-in-out infinite;
}
:global(.gol-active) .icon-signal {
opacity: 0.5;
}
@keyframes heart-pulse {
0%, 100% { opacity: 0.3; transform: scale(0.88); }
50% { opacity: 0.6; transform: scale(1.12); }
}
:global(.gol-active) .graph-cell {
cursor: crosshair;
}
</style>
<script>
const trigger = document.getElementById("gol-trigger");
const card = document.querySelector(".activity-card");
const graphGrid = document.querySelector(".graph-grid") as HTMLElement | null;
const subtitle = document.getElementById("activity-subtitle");
if (trigger && graphGrid && card) {
let active = false;
let tickId: number | null = null;
let grid: number[][] = [];
let saved: { bg: string; title: string }[][] = [];
const columns = () => graphGrid.querySelectorAll(".graph-col");
function readGrid(): number[][] {
return Array.from(columns()).map((col) =>
Array.from(col.querySelectorAll(".graph-cell")).map((c) => {
if (c.getAttribute("data-alive") !== "1") return 0;
return Math.random() < 0.45 ? 1 : 0;
}),
);
}
function saveState() {
saved = Array.from(columns()).map((col) =>
Array.from(col.querySelectorAll(".graph-cell")).map((c) => ({
bg: (c as HTMLElement).style.backgroundColor,
title: c.getAttribute("title") || "",
})),
);
}
function restoreState() {
const cols = columns();
cols.forEach((col, ci) => {
col.querySelectorAll(".graph-cell").forEach((c, ri) => {
const el = c as HTMLElement;
el.style.backgroundColor = saved[ci]?.[ri]?.bg || "";
el.setAttribute("title", saved[ci]?.[ri]?.title || "");
});
});
}
function countAlive(): number {
return grid.reduce((s, col) => s + col.reduce((a, v) => a + v, 0), 0);
}
function step() {
const numC = grid.length;
const numR = grid[0]?.length || 0;
const out = grid.map((col) => col.map(() => 0));
for (let c = 0; c < numC; c++) {
for (let r = 0; r < numR; r++) {
let n = 0;
for (let dc = -1; dc <= 1; dc++) {
for (let dr = -1; dr <= 1; dr++) {
if (dc === 0 && dr === 0) continue;
n += grid[(c + dc + numC) % numC][(r + dr + numR) % numR];
}
}
const a = grid[c][r];
out[c][r] = a ? (n === 2 || n === 3 ? 1 : 0) : n === 3 ? 1 : 0;
}
}
grid = out;
}
function render() {
const style = getComputedStyle(document.documentElement);
const deadColor = style.getPropertyValue("--graph-0").trim();
const fallbackAlive = style.getPropertyValue("--accent").trim();
const cols = columns();
cols.forEach((col, ci) => {
col.querySelectorAll(".graph-cell").forEach((c, ri) => {
const el = c as HTMLElement;
const alive = grid[ci]?.[ri];
const origColor = saved[ci]?.[ri]?.bg;
const isOrigAlive = origColor && origColor !== deadColor;
el.style.backgroundColor = alive
? (isOrigAlive ? origColor : fallbackAlive)
: deadColor;
el.setAttribute("title", "");
});
});
}
function tick() {
step();
if (countAlive() === 0) {
stop();
return;
}
render();
tickId = window.setTimeout(tick, 280);
}
function start() {
saveState();
grid = readGrid();
if (countAlive() < 10) {
for (let c = 0; c < grid.length; c++) {
for (let r = 0; r < (grid[0]?.length || 0); r++) {
if (Math.random() < 0.3) grid[c][r] = 1;
}
}
}
active = true;
card.classList.add("gol-active");
if (subtitle) subtitle.textContent = "hover to bring cells alive";
render();
tickId = window.setTimeout(tick, 280);
}
function stop() {
if (tickId !== null) clearTimeout(tickId);
tickId = null;
active = false;
card.classList.remove("gol-active");
if (subtitle) subtitle.textContent = "past year";
restoreState();
}
trigger.addEventListener("click", () => {
active ? stop() : start();
});
graphGrid.addEventListener("mousemove", (e) => {
if (!active) return;
const target = e.target as HTMLElement;
if (!target.classList.contains("graph-cell")) return;
const col = target.parentElement;
if (!col) return;
const allCols = Array.from(columns());
const ci = allCols.indexOf(col);
const cells = Array.from(col.querySelectorAll(".graph-cell"));
const ri = cells.indexOf(target);
if (ci < 0 || ri < 0) return;
for (let dc = -1; dc <= 1; dc++) {
for (let dr = -1; dr <= 1; dr++) {
const nc = ci + dc;
const nr = ri + dr;
if (nc >= 0 && nc < grid.length && nr >= 0 && nr < (grid[0]?.length || 0)) {
grid[nc][nr] = 1;
}
}
}
});
}
</script>
+19 -22
View File
@@ -5,14 +5,15 @@ const year = new Date().getFullYear();
<footer class="footer">
<div class="footer-inner">
<p class="footer-copy">
&copy; {year} Avinal Kumar &middot;
Code <a href="https://opensource.org/licenses/MIT">MIT</a> &middot;
Content <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>
&copy; {year} Avinal Kumar
</p>
<a href="https://github.com/avinal/avinal.github.io/issues/new" class="footer-report" target="_blank" rel="noopener noreferrer">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
Report an issue
</a>
<div class="footer-links">
<a href="https://github.com/avinal" target="_blank" rel="noopener noreferrer">GitHub</a>
<span class="footer-sep" aria-hidden="true">&middot;</span>
<a href="https://linkedin.com/in/avinal" target="_blank" rel="noopener noreferrer">LinkedIn</a>
<span class="footer-sep" aria-hidden="true">&middot;</span>
<a href="/posts">Posts</a>
</div>
</div>
</footer>
@@ -38,28 +39,24 @@ const year = new Date().getFullYear();
color: var(--text-muted);
}
.footer-copy a {
color: var(--text-muted);
text-decoration: underline;
text-underline-offset: 2px;
transition: color var(--duration-fast) var(--ease-out);
}
.footer-copy a:hover {
color: var(--text);
}
.footer-report {
display: inline-flex;
.footer-links {
display: flex;
align-items: center;
gap: var(--space-2);
font-size: var(--text-sm);
color: var(--text-muted);
}
.footer-links a {
color: var(--text-secondary);
text-decoration: none;
transition: color var(--duration-fast) var(--ease-out);
}
.footer-report:hover {
.footer-links a:hover {
color: var(--text);
}
.footer-sep {
color: var(--text-muted);
}
</style>
+209
View File
@@ -0,0 +1,209 @@
---
/**
* Conway's Game of Life widget.
* Runs continuously; hovering over the canvas brings cells to life.
* Resumes simulation after hover interaction.
*/
---
<div class="gol-card card">
<h3 class="widget-title">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/></svg>
Game of Life
</h3>
<canvas id="gol-canvas"></canvas>
<p class="gol-hint text-muted text-xs">hover to bring cells alive</p>
</div>
<style>
.gol-card {
display: flex;
flex-direction: column;
gap: var(--space-2);
height: 100%;
min-height: 220px;
overflow: hidden;
}
#gol-canvas {
flex: 1;
width: 100%;
min-height: 180px;
border-radius: var(--radius-sm);
cursor: crosshair;
image-rendering: pixelated;
}
@media (max-width: 900px) {
.gol-card {
min-height: 200px;
}
}
.gol-hint {
text-align: center;
font-style: italic;
}
</style>
<script>
const canvas = document.getElementById("gol-canvas") as HTMLCanvasElement;
if (canvas) {
const ctx = canvas.getContext("2d")!;
const CELL = 8;
const GAP = 1;
const STEP = CELL + GAP;
let cols = 0;
let rows = 0;
let grid: Uint8Array;
let next: Uint8Array;
function resize() {
const rect = canvas.getBoundingClientRect();
const dpr = window.devicePixelRatio || 1;
canvas.width = rect.width * dpr;
canvas.height = rect.height * dpr;
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
const newCols = Math.floor(rect.width / STEP);
const newRows = Math.floor(rect.height / STEP);
if (newCols !== cols || newRows !== rows) {
const oldGrid = grid;
const oldCols = cols;
const oldRows = rows;
cols = newCols;
rows = newRows;
grid = new Uint8Array(cols * rows);
next = new Uint8Array(cols * rows);
if (oldGrid) {
const mc = Math.min(oldCols, cols);
const mr = Math.min(oldRows, rows);
for (let r = 0; r < mr; r++) {
for (let c = 0; c < mc; c++) {
grid[r * cols + c] = oldGrid[r * oldCols + c];
}
}
} else {
seed();
}
}
}
function seed() {
for (let i = 0; i < grid.length; i++) {
grid[i] = Math.random() < 0.3 ? 1 : 0;
}
}
function idx(r: number, c: number) {
return ((r + rows) % rows) * cols + ((c + cols) % cols);
}
function step() {
for (let r = 0; r < rows; r++) {
for (let c = 0; c < cols; c++) {
let neighbors = 0;
for (let dr = -1; dr <= 1; dr++) {
for (let dc = -1; dc <= 1; dc++) {
if (dr === 0 && dc === 0) continue;
neighbors += grid[idx(r + dr, c + dc)];
}
}
const alive = grid[r * cols + c];
next[r * cols + c] =
alive ? (neighbors === 2 || neighbors === 3 ? 1 : 0) : (neighbors === 3 ? 1 : 0);
}
}
[grid, next] = [next, grid];
}
function getColors() {
const style = getComputedStyle(document.documentElement);
return {
bg: style.getPropertyValue("--bg-surface").trim() || "#f8f9fa",
alive: style.getPropertyValue("--accent").trim() || "#2563eb",
dim: style.getPropertyValue("--border").trim() || "#e5e7eb",
};
}
function draw() {
const colors = getColors();
const rect = canvas.getBoundingClientRect();
ctx.clearRect(0, 0, rect.width, rect.height);
for (let r = 0; r < rows; r++) {
for (let c = 0; c < cols; c++) {
const x = c * STEP;
const y = r * STEP;
ctx.fillStyle = grid[r * cols + c] ? colors.alive : colors.dim;
ctx.globalAlpha = grid[r * cols + c] ? 0.85 : 0.15;
ctx.fillRect(x, y, CELL, CELL);
}
}
ctx.globalAlpha = 1;
}
let animId: number;
let lastTick = 0;
const TICK_MS = 300;
function loop(ts: number) {
if (ts - lastTick >= TICK_MS) {
step();
draw();
lastTick = ts;
}
animId = requestAnimationFrame(loop);
}
function paintCells(e: MouseEvent | TouchEvent) {
const rect = canvas.getBoundingClientRect();
let clientX: number, clientY: number;
if ("touches" in e) {
clientX = e.touches[0].clientX;
clientY = e.touches[0].clientY;
} else {
clientX = e.clientX;
clientY = e.clientY;
}
const x = clientX - rect.left;
const y = clientY - rect.top;
const c = Math.floor(x / STEP);
const r = Math.floor(y / STEP);
for (let dr = -1; dr <= 1; dr++) {
for (let dc = -1; dc <= 1; dc++) {
const nr = r + dr;
const nc = c + dc;
if (nr >= 0 && nr < rows && nc >= 0 && nc < cols) {
grid[nr * cols + nc] = 1;
}
}
}
}
let isDrawing = false;
canvas.addEventListener("mouseenter", () => { isDrawing = true; });
canvas.addEventListener("mouseleave", () => { isDrawing = false; });
canvas.addEventListener("mousemove", (e) => {
if (isDrawing) paintCells(e);
});
canvas.addEventListener("touchmove", (e) => {
e.preventDefault();
paintCells(e);
}, { passive: false });
canvas.addEventListener("click", (e) => paintCells(e));
const resizeObs = new ResizeObserver(() => {
resize();
draw();
});
resizeObs.observe(canvas);
resize();
animId = requestAnimationFrame(loop);
}
</script>
+8 -7
View File
@@ -27,16 +27,17 @@ interface Props {
const { name, role, bio, avatarUrl } = Astro.props;
const about: Skill[] = [
{ icon: "cloud", title: "Cloud Native", desc: "Leading Builds for OpenShift at Red Hat", svgPath: '<path d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"/>' },
{ icon: "cpu", title: "Kernel & Toolchain", desc: "Linux kernel, GCC & glibc contributor", svgPath: '<rect x="4" y="4" width="16" height="16" rx="2" ry="2"/><rect x="9" y="9" width="6" height="6"/><line x1="9" y1="1" x2="9" y2="4"/><line x1="15" y1="1" x2="15" y2="4"/><line x1="9" y1="20" x2="9" y2="23"/><line x1="15" y1="20" x2="15" y2="23"/><line x1="20" y1="9" x2="23" y2="9"/><line x1="20" y1="14" x2="23" y2="14"/><line x1="1" y1="9" x2="4" y2="9"/><line x1="1" y1="14" x2="4" y2="14"/>' },
{ icon: "code", title: "Open Source", desc: "GSoC alumnus & mentor, Campus Expert", svgPath: '<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>' },
{ icon: "server", title: "Self-hosting", desc: "Fedora daily driver, homelab everything", svgPath: '<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/><rect x="2" y="14" width="20" height="8" rx="2" ry="2"/><line x1="6" y1="6" x2="6.01" y2="6"/><line x1="6" y1="18" x2="6.01" y2="18"/>' },
{ icon: "cloud", title: "Hybrid Cloud", desc: "Building infrastructure at Red Hat", svgPath: '<path d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"/>' },
{ icon: "monitor", title: "Linux Enthusiast", desc: "Fedora daily driver, Arch tinkerer", svgPath: '<rect x="2" y="3" width="20" height="14" rx="2" ry="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>' },
{ icon: "code", title: "Open Source", desc: "GSoC/GSoD mentor and contributor", svgPath: '<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>' },
{ icon: "server", title: "Homelab", desc: "Self-hosting on Raspberry Pi", svgPath: '<rect x="2" y="2" width="20" height="8" rx="2" ry="2"/><rect x="2" y="14" width="20" height="8" rx="2" ry="2"/><line x1="6" y1="6" x2="6.01" y2="6"/><line x1="6" y1="18" x2="6.01" y2="18"/>' },
];
const tools: Skill[] = [
{ icon: "terminal", title: "Languages", desc: "C/C++, Go, Bash", svgPath: '<polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/>' },
{ icon: "pen-tool", title: "Editor", desc: "Helix, Zellij, lazygit", svgPath: '<path d="M12 19l7-7 3 3-7 7-3-3z"/><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"/><path d="M2 2l7.586 7.586"/><circle cx="11" cy="11" r="2"/>' },
{ icon: "settings", title: "Platforms", desc: "Fedora, Git, CMake, GitHub Actions", svgPath: '<circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>' },
{ icon: "terminal", title: "Languages", desc: "Go, Python, Elm, C/C++", svgPath: '<polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/>' },
{ icon: "pen-tool", title: "Editors", desc: "Neovim, VS Code", svgPath: '<path d="M12 19l7-7 3 3-7 7-3-3z"/><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"/><path d="M2 2l7.586 7.586"/><circle cx="11" cy="11" r="2"/>' },
{ icon: "database", title: "Infra", desc: "Kubernetes, OpenShift, Tekton", svgPath: '<ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/>' },
{ icon: "flask", title: "Learning", desc: "Elm, functional programming", svgPath: '<path d="M9 3h6v7l5 8a2 2 0 0 1-1.7 3H5.7a2 2 0 0 1-1.7-3l5-8V3z"/><line x1="8" y1="3" x2="16" y2="3"/>' },
];
const links: SocialLink[] = [
-479
View File
@@ -1,479 +0,0 @@
---
import type { LBData } from "@/lib/listenbrainz";
interface Props {
lb: LBData;
}
const { lb } = Astro.props;
const profileUrl = `https://listenbrainz.org/user/${lb.username}`;
function timeAgo(ts?: number): string {
if (!ts) return "";
const diff = Math.floor(Date.now() / 1000) - ts;
if (diff < 60) return "just now";
if (diff < 3600) return `${Math.floor(diff / 60)}m ago`;
if (diff < 86400) return `${Math.floor(diff / 3600)}h ago`;
return `${Math.floor(diff / 86400)}d ago`;
}
const isLive = !!lb.nowPlaying;
const hero = lb.nowPlaying ?? lb.recentTracks[0] ?? null;
---
<div class="mc card" id="music-widget" data-user={lb.username} data-live={isLive ? "1" : "0"}>
<div class="mc-header"></div>
<div class="mc-body" id="mc-body">
{hero ? (
<>
<a href={profileUrl} target="_blank" rel="noopener noreferrer" class="mc-hero" id="mc-hero">
<div class="mc-art-wrap">
<img
class="mc-art"
src={hero.coverArtUrl ?? ""}
alt=""
onerror="this.style.display='none'"
/>
<div class="mc-art-ph">
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" opacity="0.25"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>
</div>
</div>
<div class="mc-overlay">
<span class="mc-badge" id="mc-badge">
{isLive ? (<><span class="mc-dot"></span>playing</>) : "last played"}
</span>
<div class="mc-marquee-wrap">
<span class="mc-marquee" id="mc-marquee">{hero.trackName} &mdash; {hero.artistName}</span>
</div>
</div>
</a>
<ul class="mc-recent" id="mc-recent">
{lb.recentTracks.slice(0, 4).map((t) => (
<li class="mc-track">
<img
class="mc-thumb"
src={t.coverArtUrl ?? ""}
alt=""
loading="lazy"
onerror="this.classList.add('mc-thumb-hide')"
/>
<div class="mc-track-info">
<span class="mc-track-name">{t.trackName}</span>
<span class="mc-track-artist">{t.artistName}</span>
</div>
<span class="mc-track-time">{timeAgo(t.listenedAt)}</span>
</li>
))}
</ul>
</>
) : (
<div class="mc-empty">
<span class="text-muted text-xs">No listening data yet</span>
</div>
)}
</div>
<a href="https://listenbrainz.org" class="mc-powered" target="_blank" rel="noopener noreferrer">powered by ListenBrainz</a>
</div>
<style is:global>
.mc {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}
.mc-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 0;
}
.mc-header .widget-title {
margin-bottom: 0;
}
.mc-link { color: inherit; text-decoration: none; }
.mc-link:hover { color: var(--accent); }
.mc-body {
flex: 1;
display: flex;
flex-direction: column;
gap: var(--space-2);
overflow: hidden;
}
/* ---- Hero: art + overlay ---- */
.mc-hero {
display: block;
text-decoration: none;
color: inherit;
position: relative;
overflow: hidden;
border-radius: var(--radius-sm);
cursor: pointer;
flex-shrink: 0;
}
.mc-art-wrap {
position: relative;
width: 100%;
aspect-ratio: 1;
max-height: 200px;
background: linear-gradient(135deg, var(--bg-surface-hover) 0%, var(--border) 100%);
overflow: hidden;
}
.mc-art {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
position: relative;
z-index: 1;
}
.mc-art-ph {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 0;
}
.mc-overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: var(--space-3) var(--space-2) var(--space-2);
background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.3) 65%, transparent 100%);
display: flex;
flex-direction: column;
gap: 3px;
z-index: 2;
}
.mc-badge {
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.08em;
font-weight: 600;
color: rgba(255,255,255,0.7);
display: flex;
align-items: center;
gap: 5px;
}
.mc-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: #22c55e;
animation: mc-pulse 2s ease-in-out infinite;
}
@keyframes mc-pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.35; }
}
.mc-marquee-wrap {
overflow: hidden;
white-space: nowrap;
mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
-webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}
.mc-marquee {
display: inline-block;
font-size: var(--text-sm);
font-weight: 600;
color: #fff;
animation: mc-scroll 12s linear infinite;
padding-right: 3em;
}
@keyframes mc-scroll {
0% { transform: translateX(0); }
100% { transform: translateX(-50%); }
}
.mc[data-live="0"] .mc-marquee {
animation: none;
}
/* ---- Recent list ---- */
.mc-recent {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: 2px;
flex: 1;
overflow: hidden;
}
.mc-track {
display: flex;
align-items: center;
gap: var(--space-2);
padding: 3px 0;
}
.mc-thumb {
width: 28px;
height: 28px;
border-radius: 3px;
object-fit: cover;
flex-shrink: 0;
background: var(--border);
}
.mc-thumb-hide { display: none; }
.mc-track-info {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
}
.mc-track-name {
font-size: var(--text-xs);
font-weight: 500;
color: var(--text-secondary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.mc-track-artist {
font-size: 11px;
color: var(--text-muted);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.mc-track-time {
font-size: 11px;
color: var(--text-muted);
white-space: nowrap;
flex-shrink: 0;
}
.mc-empty {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.mc-powered {
display: block;
text-align: center;
font-size: 10px;
color: var(--text-muted);
text-decoration: none;
opacity: 0.6;
padding-top: var(--space-2);
margin-top: auto;
transition: opacity var(--duration-fast) var(--ease-out);
}
.mc-powered:hover {
opacity: 1;
color: var(--accent);
}
/* ---- Mid-size: side-by-side (art left, recents right) ---- */
@media (min-width: 600px) and (max-width: 1100px) {
.mc-body {
flex-direction: row;
align-items: flex-start;
}
.mc-hero {
width: 150px;
flex-shrink: 0;
}
.mc-art-wrap {
width: 150px;
height: 150px;
max-height: none;
aspect-ratio: 1;
}
.mc-recent {
flex: 1;
justify-content: center;
}
}
/* ---- Mobile: column, smaller art ---- */
@media (max-width: 599px) {
.mc-art-wrap {
max-height: 160px;
}
}
</style>
<script>
const API = "https://api.listenbrainz.org/1";
const widget = document.getElementById("music-widget");
if (widget) {
const user = widget.dataset.user;
const body = document.getElementById("mc-body")!;
function timeAgo(ts: number): string {
const diff = Math.floor(Date.now() / 1000) - ts;
if (diff < 60) return "just now";
if (diff < 3600) return `${Math.floor(diff / 60)}m ago`;
if (diff < 86400) return `${Math.floor(diff / 3600)}h ago`;
return `${Math.floor(diff / 86400)}d ago`;
}
function coverUrl(listen: any): string {
const mbids = listen.track_metadata?.mbid_mapping ?? {};
const info = listen.track_metadata?.additional_info ?? {};
const rid = mbids.release_mbid ?? mbids.caa_release_mbid ?? info.release_mbid;
if (rid) return `https://coverartarchive.org/release/${rid}/front-250`;
const rgid = mbids.release_group_mbid;
if (rgid) return `https://coverartarchive.org/release-group/${rgid}/front-250`;
return "";
}
async function fetchItunesArt(track: string, artist: string): Promise<string> {
try {
const q = encodeURIComponent(`${track} ${artist}`);
const res = await fetch(`https://itunes.apple.com/search?term=${q}&media=music&limit=1`);
if (!res.ok) return "";
const data = await res.json();
const url = data.results?.[0]?.artworkUrl100;
return url ? url.replace("100x100", "250x250") : "";
} catch { return ""; }
}
function attachArtFallback(img: HTMLImageElement, track: string, artist: string) {
img.addEventListener("error", async () => {
if (img.dataset.fallbackTried) { img.style.display = "none"; return; }
img.dataset.fallbackTried = "1";
const alt = await fetchItunesArt(track, artist);
if (alt) { img.src = alt; } else { img.style.display = "none"; }
}, { once: false });
}
function esc(s: string): string {
const d = document.createElement("div");
d.textContent = s;
return d.innerHTML;
}
function renderHero(listen: any, isLive: boolean): string {
const meta = listen.track_metadata ?? {};
const cover = coverUrl(listen);
const track = esc(meta.track_name ?? "Unknown");
const artist = esc(meta.artist_name ?? "Unknown");
const marqueeText = `${track} &mdash; ${artist}`;
const badge = isLive
? `<span class="mc-dot"></span>playing`
: "last played";
const profileHref = `https://listenbrainz.org/user/${widget.dataset.user}`;
return `
<a class="mc-hero" href="${profileHref}" target="_blank" rel="noopener noreferrer">
<div class="mc-art-wrap">
${cover ? `<img class="mc-art" src="${cover}" alt="" data-track="${track}" data-artist="${artist}" />` : `<img class="mc-art" src="" alt="" data-track="${track}" data-artist="${artist}" data-no-cover="1" style="display:none" />`}
<div class="mc-art-ph">
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" opacity="0.25"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>
</div>
</div>
<div class="mc-overlay">
<span class="mc-badge">${badge}</span>
<div class="mc-marquee-wrap">
<span class="mc-marquee">${marqueeText}${isLive ? `&nbsp;&nbsp;&nbsp;&nbsp;${marqueeText}` : ""}</span>
</div>
</div>
</a>`;
}
function renderRecent(listens: any[]): string {
return listens.slice(0, 4).map((l) => {
const meta = l.track_metadata ?? {};
const cover = coverUrl(l);
const ago = l.listened_at ? timeAgo(l.listened_at) : "";
const thumb = `<img class="mc-thumb" src="${cover || ""}" alt="" loading="lazy" data-track="${esc(meta.track_name ?? "")}" data-artist="${esc(meta.artist_name ?? "")}" ${!cover ? 'data-no-cover="1" style="display:none"' : ""} />`;
return `<li class="mc-track">
${thumb}
<div class="mc-track-info">
<span class="mc-track-name">${esc(meta.track_name ?? "Unknown")}</span>
<span class="mc-track-artist">${esc(meta.artist_name ?? "Unknown")}</span>
</div>
<span class="mc-track-time">${ago}</span>
</li>`;
}).join("");
}
async function refresh() {
try {
const [npRes, recRes] = await Promise.all([
fetch(`${API}/user/${user}/playing-now`),
fetch(`${API}/user/${user}/listens?count=5`),
]);
let np: any = null;
if (npRes.ok) {
const d = await npRes.json();
np = d?.payload?.listens?.[0] ?? null;
}
let listens: any[] = [];
if (recRes.ok) {
const d = await recRes.json();
listens = d?.payload?.listens ?? [];
}
const isLive = !!np;
const hero = np ?? listens[0] ?? null;
widget.setAttribute("data-live", isLive ? "1" : "0");
if (!hero) {
body.innerHTML = `<div class="mc-empty"><span class="text-muted text-xs">No listening data yet</span></div>`;
return;
}
body.innerHTML = renderHero(hero, isLive)
+ `<ul class="mc-recent">${renderRecent(listens)}</ul>`;
body.querySelectorAll<HTMLImageElement>("img[data-track]").forEach((img) => {
const t = img.dataset.track ?? "";
const a = img.dataset.artist ?? "";
if (img.dataset.noCover === "1") {
fetchItunesArt(t, a).then((url) => {
if (url) { img.src = url; img.style.display = ""; }
});
} else {
attachArtFallback(img, t, a);
}
});
} catch {
// keep existing content on error
}
}
refresh();
setInterval(refresh, 30_000);
}
</script>
+2 -2
View File
@@ -3,9 +3,9 @@ const navLinks: { href: string; label: string; external?: boolean }[] = [
{ href: "/", label: "Home" },
{ href: "/posts", label: "Posts" },
{ href: "/resume", label: "Resume" },
{ href: "/events", label: "Events" },
{ href: "/contributions", label: "Contributions" },
{ href: "/meeting", label: "Meet" },
{ href: "https://todo.avinal.space/explore", label: "Memos", external: true },
{ href: "/setup", label: "Setup" },
];
const currentPath = Astro.url.pathname;
+1 -12
View File
@@ -31,7 +31,7 @@ const fmtDate = (d: Date) =>
<a href={`/posts/${post.id}/`} class="post-link">
<div class="post-thumb">
{post.data.image ? (
<img src={post.data.image} alt={post.data.title} class="thumb-img" loading="lazy" decoding="async" />
<img src={post.data.image} alt="" class="thumb-img" loading="lazy" />
) : (
<span class="thumb-placeholder">{post.data.title.charAt(0)}</span>
)}
@@ -115,17 +115,6 @@ const fmtDate = (d: Date) =>
background-color: var(--bg-surface-hover);
}
@media (max-width: 600px) {
.post-link {
grid-template-columns: 1fr;
gap: var(--space-3);
}
.post-thumb {
aspect-ratio: 16 / 9;
}
}
.thumb-img {
width: 100%;
height: 100%;
-157
View File
@@ -1,157 +0,0 @@
---
import type { CollectionEntry } from "astro:content";
interface Props {
posts: CollectionEntry<"posts">[];
}
const { posts } = Astro.props;
const fmtDate = (d: Date) =>
d.toLocaleDateString("en-US", {
year: "numeric",
month: "short",
day: "numeric",
});
---
<aside class="related" aria-label="Related posts">
<h2 class="related-heading">Related Posts</h2>
<ul class="related-list">
{posts.map((post) => (
<li class="related-item">
<a href={`/posts/${post.id}/`} class="related-link">
<div class="related-thumb">
{post.data.image ? (
<img src={post.data.image} alt={post.data.title} class="thumb-img" loading="lazy" decoding="async" />
) : (
<span class="thumb-placeholder">{post.data.title.charAt(0)}</span>
)}
</div>
<div class="related-info">
<div class="related-meta">
<span class="badge">{post.data.category}</span>
<span class="text-muted text-xs">{fmtDate(post.data.date)}</span>
</div>
<strong class="related-title">{post.data.title}</strong>
{post.data.description && (
<p class="related-desc">{post.data.description}</p>
)}
</div>
</a>
</li>
))}
</ul>
</aside>
<style>
.related {
border-top: 1px solid var(--border);
padding-top: var(--space-8);
margin-top: var(--space-10);
}
.related-heading {
font-size: var(--text-lg);
margin-bottom: var(--space-4);
}
.related-list {
display: flex;
flex-direction: column;
gap: 1px;
}
.related-item {
border-top: 1px solid var(--border);
}
.related-item:first-child {
border-top: none;
}
.related-link {
display: grid;
grid-template-columns: 140px 1fr;
gap: var(--space-4);
padding: var(--space-3) var(--space-2);
text-decoration: none;
color: inherit;
transition: background-color var(--duration-fast) var(--ease-out);
}
.related-link:hover {
background-color: var(--bg-surface-hover);
}
.related-thumb {
aspect-ratio: 3 / 2;
overflow: hidden;
background-color: var(--bg-surface-hover);
}
.thumb-img {
width: 100%;
height: 100%;
object-fit: cover;
filter: grayscale(100%);
transition: filter var(--duration-normal) var(--ease-out);
}
.related-link:hover .thumb-img {
filter: grayscale(0%);
}
.thumb-placeholder {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
font-size: var(--text-lg);
font-weight: 700;
color: var(--text-muted);
opacity: 0.3;
}
.related-info {
min-width: 0;
display: flex;
flex-direction: column;
justify-content: center;
}
.related-meta {
display: flex;
align-items: center;
gap: var(--space-3);
margin-bottom: var(--space-2);
}
.related-title {
font-size: var(--text-base);
color: var(--text);
display: block;
}
.related-desc {
font-size: var(--text-sm);
color: var(--text-muted);
margin-top: var(--space-1);
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
@media (max-width: 600px) {
.related-link {
grid-template-columns: 1fr;
gap: var(--space-3);
}
.related-thumb {
aspect-ratio: 16 / 9;
}
}
</style>
-88
View File
@@ -1,88 +0,0 @@
---
interface Props {
headings: { depth: number; slug: string; text: string }[];
}
const { headings } = Astro.props;
---
<details class="toc">
<summary class="toc-toggle">
<span class="toc-label">Table of Contents</span>
<svg class="toc-chevron" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>
</summary>
<nav class="toc-nav" aria-label="Table of contents">
<ol class="toc-list">
{headings.map((h) => (
<li class:list={[`toc-depth-${h.depth}`]}>
<a href={`#${h.slug}`} class="toc-link">{h.text}</a>
</li>
))}
</ol>
</nav>
</details>
<style>
.toc {
border: 1px solid var(--border);
padding: var(--space-4) var(--space-5);
margin-bottom: var(--space-8);
background-color: var(--bg-surface);
}
.toc-toggle {
display: flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
list-style: none;
font-size: var(--text-sm);
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--accent);
}
.toc-toggle::-webkit-details-marker {
display: none;
}
.toc-chevron {
transform: rotate(-90deg);
transition: transform var(--duration-fast) var(--ease-out);
}
.toc[open] .toc-chevron {
transform: rotate(0deg);
}
.toc-nav {
margin-top: var(--space-3);
padding-top: var(--space-3);
border-top: 1px solid var(--border);
}
.toc-list {
list-style: none;
padding: 0;
}
.toc-list li {
padding: var(--space-1) 0;
}
.toc-depth-3 {
padding-left: var(--space-4);
}
.toc-link {
font-size: var(--text-sm);
color: var(--text-secondary);
text-decoration: none;
transition: color var(--duration-fast) var(--ease-out);
}
.toc-link:hover {
color: var(--accent);
}
</style>
+7 -9
View File
@@ -43,7 +43,6 @@ export interface ThemeConfig {
url: string;
author: string;
logoText: string;
listenBrainzUser?: string;
};
fonts: {
@@ -103,12 +102,11 @@ const theme: ThemeConfig = {
url: "https://avinal.space",
author: "Avinal Kumar",
logoText: "avinal.space",
listenBrainzUser: "avinal",
},
fonts: {
sans: '"Iosevka Aile", system-ui, sans-serif',
mono: '"Iosevka", ui-monospace, monospace',
sans: '"Inter", "Segoe UI", system-ui, -apple-system, sans-serif',
mono: '"JetBrains Mono", "Fira Code", ui-monospace, monospace',
},
colors: {
@@ -171,17 +169,17 @@ const theme: ThemeConfig = {
spacing: {
base: "0.25rem",
navHeight: "3.5rem",
maxProse: "48rem",
maxProse: "42rem",
maxPage: "64rem",
sectionGap: "4rem",
cardPadding: "1.5rem",
},
radius: {
sm: "0",
md: "0",
lg: "0",
full: "0",
sm: "0.375rem",
md: "0.5rem",
lg: "0.75rem",
full: "9999px",
},
typography: {
File diff suppressed because it is too large Load Diff
-82
View File
@@ -1,82 +0,0 @@
[
{
"name": "DevConf.CZ 2026",
"date": "2026-06-18",
"location": "Brno, Czech Republic",
"role": "speaker",
"talk": "Lost in Transliteration: Why strlen(\"Dvořák\") Returns 8",
"description": "A deep dive into character encoding, Unicode, and how glibc's iconv handles text conversion internally — from the ASCII era through code pages to the gconv pipeline.",
"links": [
{
"label": "Slides",
"url": "/talks/devconf-2026/"
},
{
"label": "Event Page",
"url": "https://pretalx.devconf.info/devconf-cz-2026/talk/review/JVY7TPFMDDAPWUKHAPDH3MDKVZUXLDEW"
}
]
},
{
"name": "Opportunity Open Source Conference 2024",
"date": "2024-08-25",
"location": "IIT Kanpur, India",
"role": "speaker",
"talk": "From First Commit to Mentor: Climbing the Open Source Ladder",
"description": "Presented at the Canonical/Ubuntu conference on the journey from first-time contributor to mentor in open source. Covered practical advice on starting out, staying motivated, transitioning to mentorship, and fostering stronger communities. Included a deep-dive into my GSoC experience at FOSSology.",
"links": [
{
"label": "Event Page",
"url": "https://events.canonical.com/event/89/contributions/485/"
},
{
"label": "Slides",
"url": "https://www.canva.com/design/DAGNthYwrck/Gt7mv99p6zH-aVbx2AtEuQ/view"
}
]
},
{
"name": "Google Summer of Code Mentor Summit 2023",
"date": "2023-10-13",
"location": "Google, Sunnyvale, USA",
"role": "mentor",
"description": "Represented the FOSSology project at the annual GSoC Mentor Summit hosted at Google's Sunnyvale campus. Participated in unconference sessions on mentoring practices, community building, and project sustainability.",
"links": [
{
"label": "GSoC",
"url": "https://summerofcode.withgoogle.com/"
},
{
"label": "FOSSology",
"url": "https://www.fossology.org"
}
]
},
{
"name": "Open Source Month (OSM)",
"date": "2021-10-09",
"location": "NIT Hamirpur, India",
"role": "organizer",
"description": "Organized and led a month-long series of talks and workshops as a GitHub Campus Expert. Topics ranged from introduction to open source, Git workflows, and writing GSoC proposals to lightning talks by contributors from projects like Julia and VideoLAN. Over 200 students participated across 7 sessions.",
"links": [
{
"label": "Campus Expert Profile",
"url": "https://githubcampus.expert/avinal/"
}
]
},
{
"name": "GCE Live India",
"date": "2021-08-27",
"location": "Banmankhi, India",
"role": "speaker",
"talk": "Campus Experts: Preparation, Application Tips, Perks & Benefits",
"description": "Delivered a live session on how to become a GitHub Campus Expert — covering the application process, preparation tips, community benefits, and what to expect from the program.",
"links": [
{
"label": "Campus Expert Profile",
"url": "https://githubcampus.expert/avinal/"
}
]
}
]
+43 -64
View File
@@ -2,94 +2,73 @@
{
"name": "Profile-Readme-WakaTime",
"owner": "avinal",
"description": "Generate coding activity graph tracked by WakaTime to embed in Readme(s) and webpages. 90+ stars, 500+ active users worldwide.",
"description": "Generate coding activity graph tracked by WakaTime to embed in Readme(s) and webpages.",
"url": "https://github.com/avinal/Profile-Readme-WakaTime",
"stars": 91,
"forks": 43,
"stars": 86,
"forks": 30,
"languages": [
{ "name": "Python", "color": "#3572A5" },
{ "name": "Shell", "color": "#89e051" }
]
},
{
"name": "resume",
"owner": "avinal",
"description": "Compact and minimal LaTeX resume template with custom commands, XeLaTeX support, and Roboto fonts. 76 stars.",
"url": "https://github.com/avinal/resume",
"stars": 76,
"forks": 29,
"name": "builds",
"owner": "shipwright-io",
"description": "Shipwright - a framework for building container images on Kubernetes.",
"url": "https://github.com/shipwright-io/builds",
"stars": 550,
"forks": 110,
"languages": [
{ "name": "TeX", "color": "#3D6117" }
{ "name": "Go", "color": "#00ADD8" },
{ "name": "Shell", "color": "#89e051" }
]
},
{
"name": "Blowfish",
"name": "cmake-tutorial",
"owner": "avinal",
"description": "C++ implementation of Blowfish and Blowfish 2 symmetric block cipher with tests and APIs. Drop-in replacement for DES or IDEA.",
"url": "https://github.com/avinal/blowfish",
"stars": 8,
"forks": 6,
"languages": [
{ "name": "C++", "color": "#f34b7d" },
{ "name": "CMake", "color": "#DA3434" }
]
},
{
"name": "sciezka",
"owner": "avinal",
"description": "A browser extension for fuzzy searching tabs, history and bookmarks.",
"url": "https://github.com/avinal/sciezka",
"stars": 0,
"forks": 0,
"languages": [
{ "name": "TypeScript", "color": "#3178C6" }
]
},
{
"name": "xeus-basic",
"owner": "avinal",
"description": "Jupyter Kernel for the BASIC language built using the Xeus Framework, C, and C++. Run BASIC programs in Jupyter Notebook.",
"url": "https://github.com/avinal/xeus-basic",
"stars": 1,
"forks": 2,
"languages": [
{ "name": "C", "color": "#555555" },
{ "name": "C++", "color": "#f34b7d" }
]
},
{
"name": "badger2040-boilerplate",
"owner": "avinal",
"description": "Boilerplate project for developing Badger 2040 C++ programs with Pimoroni libraries, Pico SDK, and devcontainer support.",
"url": "https://github.com/avinal/badger2040-boilerplate",
"stars": 6,
"forks": 0,
"description": "A comprehensive guide to learning CMake — from basics to advanced packaging.",
"url": "https://github.com/avinal/cmake-tutorial",
"stars": 12,
"forks": 5,
"languages": [
{ "name": "CMake", "color": "#DA3434" },
{ "name": "C++", "color": "#f34b7d" }
]
},
{
"name": "The-Icosian-Game",
"name": "avinal.github.io",
"owner": "avinal",
"description": "Icosian Game developed from scratch in the JACK programming language (Nand2Tetris).",
"url": "https://github.com/avinal/The-Icosian-Game",
"stars": 1,
"forks": 0,
"description": "Personal website and blog — built with Astro, minimal HTML & CSS.",
"url": "https://github.com/avinal/avinal.github.io",
"stars": 5,
"forks": 2,
"languages": [
{ "name": "JACK", "color": "#2c2c2c" }
{ "name": "Astro", "color": "#ff5a03" },
{ "name": "TypeScript", "color": "#3178c6" }
]
},
{
"name": "FITS-Image",
"owner": "avinal",
"description": "Extract images from FITS astronomy files using Boost.GIL and CFITSIO. Supports BITPIX 8, 16, and 32.",
"url": "https://github.com/avinal/FITS-Image",
"stars": 0,
"forks": 0,
"name": "fossology",
"owner": "fossology",
"description": "Open source license compliance software system and toolkit.",
"url": "https://github.com/fossology/fossology",
"stars": 1100,
"forks": 500,
"languages": [
{ "name": "C++", "color": "#f34b7d" },
{ "name": "CMake", "color": "#DA3434" }
{ "name": "PHP", "color": "#4F5D95" },
{ "name": "C++", "color": "#f34b7d" }
]
},
{
"name": "dotfiles",
"owner": "avinal",
"description": "My personal configuration files — Neovim, Zsh, Tmux, and more.",
"url": "https://github.com/avinal/dotfiles",
"stars": 3,
"forks": 1,
"languages": [
{ "name": "Shell", "color": "#89e051" },
{ "name": "Lua", "color": "#000080" }
]
}
]
+42 -210
View File
@@ -38,15 +38,9 @@
"summary": "Builds for OpenShift & Developer Tools",
"location": "Bengaluru, India",
"highlights": [
"Leading the Builds for OpenShift team — managing a group of engineers, owning sprint planning, backlog grooming, and cross-functional alignment with product and QE",
"Architecting and shipping features for Builds for OpenShift (based on the upstream Shipwright project) from design proposals through implementation, testing, and GA releases",
"Driving Tekton Results upstream as a maintainer — improving observability, long-term storage, and query performance for Tekton pipeline results at scale",
"Representing the team in OpenShift-wide architecture discussions, coordinating with platform, CLI, and console teams on build-related integrations",
"Mentoring junior engineers through 1:1s, design reviews, and pair programming sessions to grow team capability"
],
"links": [
{ "label": "Shipwright", "url": "https://shipwright.io" },
{ "label": "Tekton Results", "url": "https://github.com/tektoncd/results" }
"Serving as Team Lead for Builds for OpenShift — managing engineers, driving sprint planning, code reviews, and cross-functional collaboration",
"Working on Builds for OpenShift based on the upstream Shipwright project — designing, maintaining, and releasing build features",
"Maintainer of Tekton Results — contributing upstream to enhance observability and results storage for Tekton pipelines"
]
},
{
@@ -58,14 +52,9 @@
"summary": "Hybrid Cloud Engineering — Pipeline Service",
"location": "Bengaluru, India",
"highlights": [
"Built and maintained Pipeline Service — a multi-tenant SaaS pipeline platform leveraging kcp, Kubernetes/OpenShift, Tekton, and Argo CD for managed CI/CD",
"Contributed to Tekton Results for efficient long-term storage of PipelineRuns and TaskRuns, improving query latency and reliability for large-scale clusters",
"Maintained Source-to-Image (S2I) and Shared Resource CSI Driver components in OpenShift, triaging bugs and shipping quarterly releases",
"Participated in on-call rotations, resolving production incidents across the pipeline stack and authoring runbooks for recurring issues",
"Collaborated with upstream Tekton community on design proposals and contributed patches accepted into the core project"
],
"links": [
{ "label": "Tekton", "url": "https://tekton.dev" }
"Worked on Pipeline Service — a SaaS for pipelines leveraging kcp, Kubernetes/OpenShift, Tekton, and Argo CD",
"Contributed to Tekton Results for long-term, efficient storage of PipelineRuns and TaskRuns",
"Maintained Source-to-Image (S2I) and Shared Resource CSI Driver components in OpenShift"
]
},
{
@@ -77,9 +66,8 @@
"summary": "Pipeline Service Team",
"location": "Bengaluru, India",
"highlights": [
"Designed and implemented the Minimal Tekton Server (MKS) from scratch — a lightweight server that creates and manages Tekton resources on Kubernetes/OpenShift clusters",
"Built the MKS CLI and MKS Dashboard in Golang, providing a developer-friendly interface for pipeline operations backed by Redis for state management",
"Wrote comprehensive unit and integration tests achieving high coverage, following test-driven development practices across the full stack"
"Designed and implemented the Minimal Tekton Server with unit tests — creates Tekton resources on Kubernetes/OpenShift clusters using the Tekton API",
"Built MKS Server, MKS CLI, and MKS Dashboard using Golang, Kubernetes, Tekton, and Redis"
]
},
{
@@ -91,29 +79,22 @@
"summary": "Developer Documentation",
"location": "Shenzhen, Remote",
"highlights": [
"Redesigned the developer and user documentation for Apache APISIX, improving information architecture and discoverability for a fast-growing API gateway project",
"Created interactive Katacoda tutorials that guided users through real APISIX deployments, collaborating closely with the community and incorporating feedback from maintainers"
],
"links": [
{ "label": "Apache APISIX", "url": "https://apisix.apache.org" }
"Redesigned developer and user documentation for the Apache APISIX project",
"Created Katacoda tutorials for APISIX, collaborating with the community and integrating feedback"
]
},
{
"name": "The FOSSology Project",
"position": "Google Summer of Code Student",
"name": "The FOSSology Project — Google Summer of Code 2021",
"position": "DevOps & Software Development Engineer Intern",
"url": "https://www.fossology.org",
"startDate": "2021-05-01",
"endDate": "2021-08-31",
"summary": "Build System & CI/CD Modernization",
"location": "Remote",
"highlights": [
"Migrated the entire build system from legacy Unix Makefiles to modern CMake — cutting build time from 1015 minutes down to 57 minutes (2× improvement)",
"Replaced Travis CI with GitHub Actions for the CI/CD pipeline — reducing CI run time from 12 hours to 2025 minutes with parallel job execution and caching",
"Refactored and fixed years-old unit and functional testing code across C/C++ and PHP, restoring test suites that had been broken or skipped for multiple releases"
],
"links": [
{ "label": "GSoC Project", "url": "https://summerofcode.withgoogle.com" },
{ "label": "Blog Series", "url": "https://avinal.space/posts/gsoc/gsoc-fossology" }
"Upgraded the build system from Unix Makefile to CMake — build time reduced to 57 minutes (2× faster)",
"Migrated CI/CD from Travis CI to GitHub Actions — CI time reduced from 12 hours to 2025 minutes",
"Refactored and fixed years-old unit and functional testing code in C/C++ and PHP"
]
},
{
@@ -125,8 +106,8 @@
"summary": "Inventory & Billing Management",
"location": "Bengaluru, Remote",
"highlights": [
"Designed and developed a full-stack Inventory and Billing Management application using Spring Boot, PostgreSQL, and Thymeleaf for a small-business client",
"Implemented RESTful API endpoints for CRUD operations on inventory items, invoices, and customer records according to functional specifications"
"Designed and developed an Inventory and Billing Management App using Spring Boot and PostgreSQL",
"Created REST API endpoints according to functional requirements"
]
},
{
@@ -138,63 +119,26 @@
"summary": "VLC for Android Documentation",
"location": "Paris, Remote",
"highlights": [
"Authored comprehensive documentation for VLC for Android using Sphinx and reStructuredText, covering build instructions, architecture overview, and contributor guidelines",
"Produced step-by-step tutorials with annotated screenshots, making the project accessible to new contributors and end users alike"
],
"links": [
{ "label": "Docs Website", "url": "https://docs.videolan.me/vlc-user/android/3.X/en/index.html" },
{ "label": "Docs Repository", "url": "https://code.videolan.org/docs/vlc-user/-/tree/android/3.X?ref_type=heads" },
{ "label": "GSoD Report", "url": "/posts/blogs/gsod2020-report" }
]
},
{
"name": "The FOSSology Project",
"position": "Google Summer of Code Mentor",
"url": "https://www.fossology.org",
"startDate": "2022-05-01",
"summary": "Mentoring & Open Source",
"location": "Remote",
"highlights": [
"Mentoring Google Summer of Code students since 2022 — guiding contributors on open-source license compliance tooling, code review practices, and upstream collaboration",
"Helping students navigate the FOSSology codebase, define project milestones, and deliver production-quality patches accepted by the maintainer community"
],
"links": [
{ "label": "FOSSology", "url": "https://www.fossology.org" }
]
},
{
"name": "GNU Toolchain",
"position": "Contributor",
"url": "https://gcc.gnu.org/",
"startDate": "2024-05-01",
"summary": "GNU Project — GCC & GNU C Library",
"location": "Remote",
"highlights": [
"Contributing patches to GCC and GNU C Library — two of the most critical pieces of the GNU/Linux ecosystem, used by virtually every Linux distribution",
"Working on compiler internals (tree-ssa-strlen optimizations) and C library bug fixes submitted via Sourceware and reviewed by core maintainers"
],
"links": [
{ "label": "GNU C Library Patches", "url": "https://sourceware.org/cgit/glibc/log/?qt=author&q=avinal" },
{ "label": "GCC Patches", "url": "https://gitlab.com/gnutools/gcc/-/commits/master?author=Avinal%20Kumar" }
]
},
{
"name": "Linux Kernel",
"position": "Contributor",
"url": "https://kernel.org/",
"startDate": "2026-04-01",
"summary": "DRM Subsystem",
"location": "Remote",
"highlights": [
"Contributing patches to the Linux kernel DRM subsystem — adding new MIPI DSI helper functions and migrating panel drivers to improved APIs",
"Patches reviewed and merged via the freedesktop.org GitLab DRM tree"
],
"links": [
{ "label": "Patches", "url": "https://gitlab.freedesktop.org/drm/misc/kernel/-/commits/drm-misc-next?author=Avinal%20Kumar" }
"Documented VLC for Android using Sphinx, reStructuredText, Markdown, and shell scripting",
"Delivered user-friendly documentation with supporting screenshots and step-by-step tutorials"
]
}
],
"volunteer": [
{
"organization": "The FOSSology Project",
"position": "Google Summer of Code Mentor",
"url": "https://www.fossology.org",
"startDate": "2022-05-01",
"summary": "Mentoring GSoC students since 2022, guiding open source license compliance tooling projects"
},
{
"organization": "GNU C Library",
"position": "Contributor",
"url": "https://www.gnu.org/software/libc/",
"startDate": "2024-05-01",
"summary": "Submitting patches to the GNU C Library (glibc)"
},
{
"organization": "GitHub Education",
"position": "GitHub Campus Expert",
@@ -211,14 +155,6 @@
"endDate": "2021-05-31",
"summary": "Guided beginners getting started with open source development"
},
{
"organization": "Script Winter of Code",
"position": "Participant",
"url": "",
"startDate": "2020-12-01",
"endDate": "2021-02-28",
"summary": "Contributed to open source projects during the winter program"
},
{
"organization": "VideoLAN",
"position": "Open Source Contributor",
@@ -235,77 +171,13 @@
"endDate": "2022-06-30",
"summary": "Led the Computer Science Engineers Club — organized hackathons, workshops, and coding competitions"
},
{
"organization": "CSEC, NIT Hamirpur",
"position": "Coordinator",
"url": "https://csec.nith.ac.in",
"startDate": "2020-09-01",
"endDate": "2021-06-30",
"summary": "Coordinated events and activities for the Computer Science Engineers Club"
},
{
"organization": "CSEC, NIT Hamirpur",
"position": "Executive Member",
"url": "https://csec.nith.ac.in",
"startDate": "2019-08-01",
"endDate": "2020-08-31",
"summary": "Active executive member contributing to club events and technical initiatives"
},
{
"organization": "CSEC, NIT Hamirpur",
"position": "Volunteer",
"url": "https://csec.nith.ac.in",
"startDate": "2019-01-01",
"endDate": "2019-07-31",
"summary": "Volunteered for club events and technical workshops"
},
{
"organization": "SRIJAN, NIT Hamirpur",
"position": "Hindi Head Editor",
"url": "",
"startDate": "2022-02-01",
"endDate": "2022-09-30",
"summary": "Led the Hindi editorial team for the college's literary and technical magazine"
},
{
"organization": "SRIJAN, NIT Hamirpur",
"position": "Executive Editor",
"url": "",
"startDate": "2020-07-01",
"endDate": "2022-01-31",
"endDate": "2022-09-30",
"summary": "Editorial work for the college's literary and technical magazine"
},
{
"organization": "SRIJAN, NIT Hamirpur",
"position": "Associate Editor",
"url": "",
"startDate": "2019-07-01",
"endDate": "2020-06-30",
"summary": "Associate editorial work for the college magazine"
},
{
"organization": "SRIJAN, NIT Hamirpur",
"position": "Hindi Editor",
"url": "",
"startDate": "2018-11-01",
"endDate": "2019-06-30",
"summary": "Hindi section editorial work for the college magazine"
},
{
"organization": "GNU/Linux Users Group, NIT Hamirpur",
"position": "Volunteer",
"url": "",
"startDate": "2018-11-01",
"endDate": "2022-07-31",
"summary": "Open-source community at NIT Hamirpur — shared knowledge about GNU/Linux and FOSS"
},
{
"organization": "SPIC MACAY, NIT Hamirpur",
"position": "Volunteer",
"url": "",
"startDate": "2018-09-01",
"endDate": "2022-05-31",
"summary": "Organized arts and culture events on campus"
}
],
"education": [
@@ -347,7 +219,7 @@
"skills": [
{
"name": "Languages",
"keywords": ["C++", "Go", "C", "Python", "Bash"]
"keywords": ["C++", "Go", "C", "Python", "Bash", "Elm"]
},
{
"name": "Cloud & DevOps",
@@ -374,45 +246,13 @@
],
"certificates": [
{
"name": "A Beginner's Guide to Linux Kernel Development (LFD103)",
"issuer": "The Linux Foundation"
},
{
"name": "Introduction to Artificial Intelligence",
"issuer": "IBM"
},
{
"name": "Google IT Support Professional Certificate",
"issuer": "Google"
"name": "Career Edge - Knockdown the Lockdown",
"issuer": "TCS iON"
},
{
"name": "IT Security: Defense against the digital dark arts",
"issuer": "Google"
},
{
"name": "System Administration and IT Infrastructure Services",
"issuer": "Google"
},
{
"name": "Operating Systems and You: Becoming a Power User",
"issuer": "Google"
},
{
"name": "The Bits and Bytes of Computer Networking",
"issuer": "Google"
},
{
"name": "Technical Support Fundamentals",
"issuer": "Google"
},
{
"name": "Build a Modern Computer from First Principles: Nand to Tetris",
"issuer": "Coursera"
},
{
"name": "Accelerated Computer Science Fundamentals",
"issuer": "Coursera"
},
{
"name": "Unordered Data Structures",
"issuer": "University of Illinois"
@@ -422,16 +262,8 @@
"issuer": "University of Illinois"
},
{
"name": "Ordered Data Structures",
"issuer": "Coursera"
},
{
"name": "Workshop on Basic Programming using Python",
"issuer": "FOSSEE"
},
{
"name": "Career Edge - Knockdown the Lockdown",
"issuer": "TCS iON"
"name": "Introduction to Artificial Intelligence",
"issuer": "IBM"
}
],
"projects": [
@@ -450,9 +282,9 @@
"description": "C++ implementation of the Blowfish and Blowfish 2 symmetric block cipher with tests and APIs. Drop-in replacement for DES or IDEA."
},
{
"name": "Sciezka",
"url": "https://github.com/avinal/sciezka",
"description": "Browser extension for fuzzy searching tabs, history and bookmarks. Built with TypeScript."
"name": "Xeus-BASIC",
"url": "https://github.com/avinal/xeus-basic",
"description": "Jupyter Kernel for the BASIC language built using the Xeus Framework, C, and C++. Executes BASIC programs line by line in Jupyter Notebook."
}
],
"meta": {
+3 -26
View File
@@ -3,32 +3,22 @@ import Nav from "@/components/Nav.astro";
import Footer from "@/components/Footer.astro";
import theme, { generateThemeCSS } from "@/config/theme";
import "@/styles/global.css";
import "@fontsource/iosevka-aile/400.css";
import "@fontsource/iosevka-aile/500.css";
import "@fontsource/iosevka-aile/600.css";
import "@fontsource/iosevka-aile/700.css";
import "@fontsource/iosevka-aile/800.css";
import "@fontsource/iosevka/400.css";
import "@fontsource/iosevka/500.css";
interface Props {
title: string;
description?: string;
ogImage?: string;
jsonLd?: Record<string, unknown>;
}
const {
title,
description = theme.site.description,
ogImage,
jsonLd,
} = Astro.props;
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
const siteName = theme.site.title;
const themeCSS = generateThemeCSS(theme);
const resolvedOgImage = ogImage || new URL("/og-default.svg", Astro.site).href;
---
<!doctype html>
@@ -48,28 +38,16 @@ const resolvedOgImage = ogImage || new URL("/og-default.svg", Astro.site).href;
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:site_name" content={siteName} />
<meta property="og:image" content={resolvedOgImage} />
{ogImage && <meta property="og:image" content={ogImage} />}
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<meta name="twitter:image" content={resolvedOgImage} />
<meta name="twitter:site" content="@Avinal_" />
<!-- Favicon & Manifest -->
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="/logo-static.svg" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="sitemap" href="/sitemap-index.xml" />
<link rel="alternate" type="application/rss+xml" title="Avinal Kumar" href="/rss.xml" />
<!-- Design tokens generated from theme config -->
<style set:html={themeCSS} />
<!-- JSON-LD structured data -->
{jsonLd && <script type="application/ld+json" set:html={JSON.stringify(jsonLd)} />}
<!-- Theme: prevent flash by reading preference before paint -->
<script is:inline>
(function () {
@@ -83,10 +61,9 @@ const resolvedOgImage = ogImage || new URL("/og-default.svg", Astro.site).href;
</script>
</head>
<body>
<a href="#main-content" class="skip-link">Skip to content</a>
<div class="page-wrapper">
<Nav />
<main id="main-content" class="main-content">
<main class="main-content">
<slot />
</main>
<Footer />
+3 -60
View File
@@ -1,8 +1,5 @@
---
import BaseLayout from "./BaseLayout.astro";
import TableOfContents from "@/components/TableOfContents.astro";
import RelatedPosts from "@/components/RelatedPosts.astro";
import type { CollectionEntry } from "astro:content";
interface Props {
title: string;
@@ -13,8 +10,7 @@ interface Props {
tags?: string[];
image?: string;
readingTime: string;
headings?: { depth: number; slug: string; text: string }[];
relatedPosts?: CollectionEntry<"posts">[];
headings: { depth: number; slug: string; text: string }[];
}
const {
@@ -26,8 +22,6 @@ const {
tags = [],
image,
readingTime,
headings = [],
relatedPosts = [],
} = Astro.props;
const fmtDate = (d: Date) =>
@@ -36,31 +30,13 @@ const fmtDate = (d: Date) =>
month: "long",
day: "numeric",
});
const canonicalURL = new URL(Astro.url.pathname, Astro.site).href;
const blogPostingLd = {
"@context": "https://schema.org",
"@type": "BlogPosting",
headline: title,
description: description ?? "",
datePublished: date.toISOString(),
...(modified && { dateModified: modified.toISOString() }),
...(image && { image }),
url: canonicalURL,
author: {
"@type": "Person",
name: "Avinal Kumar",
url: "https://avinal.space",
},
};
---
<BaseLayout title={title} description={description} ogImage={image || undefined} jsonLd={blogPostingLd}>
<div class="reading-progress" aria-hidden="true"></div>
<BaseLayout title={title} description={description} ogImage={image || undefined}>
<article class="post-page">
{image && (
<div class="post-hero-img">
<img src={image} alt={title} decoding="async" />
<img src={image} alt={title} />
</div>
)}
@@ -91,13 +67,9 @@ const blogPostingLd = {
)}
</header>
{headings.length > 0 && <TableOfContents headings={headings} />}
<div class="prose">
<slot />
</div>
{relatedPosts.length > 0 && <RelatedPosts posts={relatedPosts} />}
</article>
</BaseLayout>
@@ -126,7 +98,6 @@ const blogPostingLd = {
margin-bottom: var(--space-10);
padding-bottom: var(--space-6);
border-bottom: 1px solid var(--border);
text-align: center;
}
.post-category {
@@ -149,7 +120,6 @@ const blogPostingLd = {
.post-meta-row {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
gap: var(--space-2);
font-size: var(--text-sm);
@@ -167,7 +137,6 @@ const blogPostingLd = {
.post-tags {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: var(--space-2);
margin-top: var(--space-3);
}
@@ -180,30 +149,4 @@ const blogPostingLd = {
border-radius: var(--radius-sm);
border: 1px solid var(--border);
}
.reading-progress {
position: fixed;
top: 0;
left: 0;
height: 3px;
width: 0%;
background-color: var(--accent);
z-index: 200;
pointer-events: none;
}
</style>
<script>
const bar = document.querySelector<HTMLElement>('.reading-progress');
const article = document.querySelector('.post-page');
if (bar && article) {
const update = () => {
const total = article.scrollHeight - window.innerHeight;
const scrolled = window.scrollY - (article as HTMLElement).offsetTop;
const pct = Math.min(100, Math.max(0, (scrolled / total) * 100));
bar.style.width = `${pct}%`;
};
window.addEventListener('scroll', update, { passive: true });
update();
}
</script>
+1 -1
View File
@@ -1,4 +1,4 @@
import type { ContributionData } from "./github";
import type { ContributionData, ContributionDay } from "./github";
import type { WakaTimeData } from "./wakatime";
export interface ActivityDay {
-92
View File
@@ -1,92 +0,0 @@
import theme from "@/config/theme";
const LB_API = "https://api.listenbrainz.org/1";
const USERNAME = theme.site.listenBrainzUser ?? "avinal";
export interface LBTrack {
trackName: string;
artistName: string;
releaseName?: string;
listenedAt?: number;
coverArtUrl?: string;
listenUrl?: string;
}
export interface LBData {
available: boolean;
username: string;
nowPlaying: LBTrack | null;
recentTracks: LBTrack[];
}
function parseTrack(listen: any): LBTrack {
const meta = listen.track_metadata ?? {};
const info = meta.additional_info ?? {};
const mbids = meta.mbid_mapping ?? {};
const releaseMbid = mbids.release_mbid ?? mbids.caa_release_mbid ?? info.release_mbid;
let coverArtUrl: string | undefined;
if (releaseMbid) {
coverArtUrl = `https://coverartarchive.org/release/${releaseMbid}/front-250`;
} else if (mbids.release_group_mbid) {
coverArtUrl = `https://coverartarchive.org/release-group/${mbids.release_group_mbid}/front-250`;
}
const listenUrl =
info.origin_url ??
info.spotify_id ??
(mbids.recording_mbid
? `https://listenbrainz.org/player?recording_mbids=${mbids.recording_mbid}`
: undefined);
return {
trackName: meta.track_name ?? "Unknown",
artistName: meta.artist_name ?? "Unknown",
releaseName: meta.release_name,
listenedAt: listen.listened_at,
coverArtUrl,
listenUrl,
};
}
export async function fetchListenBrainzData(): Promise<LBData> {
const empty: LBData = {
available: false,
username: USERNAME,
nowPlaying: null,
recentTracks: [],
};
if (!USERNAME) return empty;
try {
const [nowRes, listensRes] = await Promise.all([
fetch(`${LB_API}/user/${USERNAME}/playing-now`),
fetch(`${LB_API}/user/${USERNAME}/listens?count=5`),
]);
let nowPlaying: LBTrack | null = null;
if (nowRes.ok) {
const nowData = await nowRes.json();
const np = nowData?.payload?.listens?.[0];
if (np) nowPlaying = parseTrack(np);
}
let recentTracks: LBTrack[] = [];
if (listensRes.ok) {
const listensData = await listensRes.json();
const listens = listensData?.payload?.listens ?? [];
recentTracks = listens.map(parseTrack);
}
return {
available: true,
username: USERNAME,
nowPlaying,
recentTracks,
};
} catch (e) {
console.warn("ListenBrainz fetch failed:", e);
return empty;
}
}
+49 -44
View File
@@ -1,6 +1,3 @@
const SHARE_URL =
"https://wakatime.com/share/@Avinal/13174f97-2646-484b-9644-bc3c07315068.json";
export interface WakaTimeDaySummary {
date: string;
totalSeconds: number;
@@ -16,21 +13,6 @@ export interface WakaTimeData {
topLangs: string[];
}
interface RawCategory {
name: string;
total: number;
}
interface RawDay {
date: string;
total: number;
categories?: RawCategory[];
}
function totalSeconds(day: RawDay): number {
return day.total ?? 0;
}
function formatSeconds(s: number): string {
const h = Math.floor(s / 3600);
const m = Math.floor((s % 3600) / 60);
@@ -39,42 +21,65 @@ function formatSeconds(s: number): string {
return `${h}h ${m}m`;
}
export async function fetchWakaTimeData(): Promise<WakaTimeData | null> {
function wakaAuth(): string | null {
const key = import.meta.env.WAKATIME_API_KEY;
if (!key) return null;
return `Basic ${btoa(key)}`;
}
async function fetchStats(auth: string) {
const res = await fetch(
"https://wakatime.com/api/v1/users/current/stats/last_year",
{ headers: { Authorization: auth } },
);
if (!res.ok) return null;
return (await res.json()).data;
}
async function fetchSummaries(auth: string): Promise<Map<string, WakaTimeDaySummary>> {
const end = new Date();
const start = new Date();
start.setDate(end.getDate() - 14);
const fmt = (d: Date) => d.toISOString().slice(0, 10);
const days = new Map<string, WakaTimeDaySummary>();
try {
const res = await fetch(SHARE_URL);
if (!res.ok) return null;
const res = await fetch(
`https://wakatime.com/api/v1/users/current/summaries?start=${fmt(start)}&end=${fmt(end)}`,
{ headers: { Authorization: auth } },
);
if (!res.ok) return days;
const json = await res.json();
const rawDays: RawDay[] = json.days ?? [];
if (rawDays.length === 0) return null;
const days = new Map<string, WakaTimeDaySummary>();
let total = 0;
let bestDay = 0;
let activeDays = 0;
for (const d of rawDays) {
const secs = totalSeconds(d);
total += secs;
if (secs > bestDay) bestDay = secs;
if (secs > 0) activeDays++;
days.set(d.date, {
date: d.date,
for (const day of json.data ?? []) {
const secs = day.grand_total?.total_seconds ?? 0;
days.set(day.range.date, {
date: day.range.date,
totalSeconds: secs,
text: secs > 0 ? formatSeconds(secs) : "0m",
});
}
} catch { /* graceful degrade */ }
return days;
}
const dailyAvg = activeDays > 0 ? total / activeDays : 0;
export async function fetchWakaTimeData(): Promise<WakaTimeData | null> {
const auth = wakaAuth();
if (!auth) return null;
try {
const [stats, days] = await Promise.all([
fetchStats(auth),
fetchSummaries(auth),
]);
if (!stats) return null;
return {
totalSeconds: total,
totalText: formatSeconds(total),
dailyAvgText: formatSeconds(dailyAvg),
bestDayText: formatSeconds(bestDay),
totalSeconds: stats.total_seconds ?? 0,
totalText: stats.human_readable_total ?? "—",
dailyAvgText: stats.human_readable_daily_average ?? "—",
bestDayText: stats.best_day?.text ?? "—",
days,
topLangs: [],
topLangs: (stats.languages ?? []).slice(0, 5).map((l: { name: string }) => l.name),
};
} catch {
return null;
-45
View File
@@ -1,45 +0,0 @@
---
import BaseLayout from "@/layouts/BaseLayout.astro";
---
<BaseLayout title="404 — Page Not Found" description="The page you're looking for doesn't exist.">
<div class="not-found">
<span class="nf-code">404</span>
<h1>Page not found</h1>
<p>The page you're looking for doesn't exist or has been moved.</p>
<a href="/" class="btn btn-accent">Back to home</a>
</div>
</BaseLayout>
<style>
.not-found {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
min-height: 50vh;
gap: var(--space-4);
}
.nf-code {
font-size: clamp(5rem, 15vw, 10rem);
font-weight: 800;
letter-spacing: -0.04em;
line-height: 1;
color: var(--border);
}
.not-found h1 {
font-size: var(--text-2xl);
}
.not-found p {
color: var(--text-muted);
max-width: 40ch;
}
.not-found .btn {
margin-top: var(--space-4);
}
</style>
-606
View File
@@ -1,606 +0,0 @@
---
import BaseLayout from "@/layouts/BaseLayout.astro";
import contribData from "@/data/contributions.json";
interface Contribution {
project: string;
projectUrl: string;
platform: string;
type: string;
kind: string;
title: string;
url: string;
date: string;
status?: string;
description?: string;
relatedIssue?: string;
}
const contributions = (contribData as Contribution[]).sort(
(a, b) => new Date(b.date).getTime() - new Date(a.date).getTime(),
);
const totalCount = contributions.length;
const projects = [...new Set(contributions.map((c) => c.project))];
const types = [...new Set(contributions.map((c) => c.type))];
const kinds = [...new Set(contributions.map((c) => c.kind))];
const platforms = [...new Set(contributions.map((c) => c.platform))];
const mergedCount = contributions.filter((c) => c.status === "merged").length;
function fmtDate(iso: string) {
const d = new Date(iso);
return `${d.getDate()} ${d.toLocaleString("en-US", { month: "short" })} ${d.getFullYear()}`;
}
const typeLabels: Record<string, string> = {
code: "Code",
docs: "Docs",
infra: "Infra",
};
const kindLabels: Record<string, string> = {
pr: "PR",
issue: "Issue",
commit: "Commit",
patch: "Patch",
};
const statusColors: Record<string, string> = {
merged: "badge-merged",
open: "badge-open",
closed: "badge-closed",
};
const platformIcons: Record<string, string> = {
github: `<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/>`,
gitlab: `<path d="M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z"/>`,
sourceware: `<circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>`,
gerrit: `<path d="M12 2L2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5"/><path d="M2 12l10 5 10-5"/>`,
other: `<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>`,
};
function platformIcon(p: string): string {
return platformIcons[p] ?? platformIcons.other;
}
const collectionLd = {
"@context": "https://schema.org",
"@type": "CollectionPage",
name: "Open Source Contributions",
description: "Open source contributions across GitHub, GitLab, Sourceware, and other platforms.",
url: "https://avinal.space/contributions",
author: {
"@type": "Person",
name: "Avinal Kumar",
url: "https://avinal.space",
},
};
---
<BaseLayout
title="Contributions"
description="Open source contributions across GitHub, GitLab, Sourceware, and other platforms"
jsonLd={collectionLd}
>
<div class="contrib-page">
<header class="contrib-header">
<h1>Contributions</h1>
<p class="contrib-desc">
A curated selection of my open source contributions across projects and platforms. This list represents only a portion of my overall work — PRs, patches, commits, and issues that I consider meaningful.
</p>
</header>
<div class="stats-bar" id="stats-bar">
<div class="stat stat-contributions">
<svg class="stat-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><line x1="1.05" y1="12" x2="7" y2="12"/><line x1="17.01" y1="12" x2="22.96" y2="12"/></svg>
<span class="stat-value" id="stat-showing">{totalCount}</span>
<span class="stat-label">contributions</span>
</div>
<div class="stat stat-projects">
<svg class="stat-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>
<span class="stat-value">{projects.length}</span>
<span class="stat-label">projects</span>
</div>
<div class="stat stat-merged">
<svg class="stat-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="18" cy="18" r="3"/><circle cx="6" cy="6" r="3"/><path d="M6 21V9a9 9 0 0 0 9 9"/></svg>
<span class="stat-value">{mergedCount}</span>
<span class="stat-label">merged</span>
</div>
<div class="stat stat-platforms">
<svg class="stat-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>
<span class="stat-value">{platforms.length}</span>
<span class="stat-label">platforms</span>
</div>
</div>
<div class="filter-bar" id="filter-bar">
<select class="filter-select" data-filter="project" aria-label="Filter by project">
<option value="">All projects</option>
{projects.sort().map((p) => (
<option value={p}>{p}</option>
))}
</select>
<select class="filter-select" data-filter="type" aria-label="Filter by type">
<option value="">All types</option>
{types.map((t) => (
<option value={t}>{typeLabels[t] ?? t}</option>
))}
</select>
<select class="filter-select" data-filter="kind" aria-label="Filter by kind">
<option value="">All kinds</option>
{kinds.map((k) => (
<option value={k}>{kindLabels[k] ?? k}</option>
))}
</select>
<select class="filter-select" data-filter="platform" aria-label="Filter by platform">
<option value="">All platforms</option>
{platforms.map((p) => (
<option value={p}>{p}</option>
))}
</select>
<button class="filter-clear" id="clear-filters" style="display:none;">Clear</button>
</div>
<div class="timeline" id="timeline">
{contributions.map((c) => (
<div
class={`tl-entry ct-${c.type}`}
data-project={c.project}
data-type={c.type}
data-kind={c.kind}
data-platform={c.platform}
>
<div class="tl-label-cell">
<span class="tl-type-label">{typeLabels[c.type] ?? c.type}</span>
</div>
<div class="tl-rail-cell">
<div class="tl-dot" />
</div>
<div class="tl-card">
<div class="tl-card-header">
<div class="tl-dates">
{fmtDate(c.date)}
<span class="tl-platform">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><Fragment set:html={platformIcon(c.platform)} /></svg>
<a href={c.projectUrl} class="project-link" target="_blank" rel="noopener noreferrer">{c.project}</a>
</span>
</div>
<h3 class="tl-title">
<a href={c.url} class="contrib-link" target="_blank" rel="noopener noreferrer">{c.title}</a>
</h3>
</div>
<div class="badge-row">
{c.status && (
<span class={`badge ${statusColors[c.status] ?? ""}`}>{c.status}</span>
)}
<span class="badge badge-kind">{kindLabels[c.kind] ?? c.kind}</span>
</div>
{c.description && <p class="contrib-description">{c.description}</p>}
{c.relatedIssue && (
<a href={c.relatedIssue} class="related-issue-link" target="_blank" rel="noopener noreferrer">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
Related issue
</a>
)}
</div>
</div>
))}
</div>
<p class="empty-state" id="empty-state" style="display:none;">
No contributions match the current filters.
</p>
</div>
</BaseLayout>
<style>
.contrib-page {
max-width: var(--max-w-page);
margin-inline: auto;
}
.contrib-header {
margin-bottom: var(--space-8);
}
.contrib-header h1 {
margin-bottom: var(--space-3);
}
.contrib-desc {
font-size: var(--text-lg);
color: var(--text-secondary);
line-height: var(--leading-relaxed);
max-width: var(--max-w-prose);
}
/* ---- Stats ---- */
.stats-bar {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--space-3);
margin-bottom: var(--space-6);
}
.stat {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-2);
padding: var(--space-4) var(--space-3);
border: 1px solid var(--border);
background: var(--bg-surface);
transition: border-color var(--duration-fast) var(--ease-out),
box-shadow var(--duration-fast) var(--ease-out);
}
.stat:hover {
border-color: var(--stat-color);
box-shadow: var(--shadow);
}
.stat-icon {
opacity: 0.4;
transition: opacity var(--duration-fast) var(--ease-out),
color var(--duration-fast) var(--ease-out);
}
.stat:hover .stat-icon {
opacity: 1;
color: var(--stat-color);
}
.stat-contributions { --stat-color: var(--accent); }
.stat-projects { --stat-color: #8b5cf6; }
.stat-merged { --stat-color: #10b981; }
.stat-platforms { --stat-color: #f59e0b; }
.stat-value {
font-size: var(--text-2xl);
font-weight: 800;
font-variant-numeric: tabular-nums;
color: var(--text);
line-height: 1;
transition: color var(--duration-fast) var(--ease-out);
}
.stat:hover .stat-value {
color: var(--stat-color);
}
.stat-label {
font-size: var(--text-xs);
font-weight: 500;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.06em;
}
/* ---- Filters ---- */
.filter-bar {
display: flex;
align-items: center;
gap: var(--space-3);
flex-wrap: wrap;
margin-bottom: var(--space-8);
}
.filter-select {
font-family: inherit;
font-size: var(--text-sm);
font-weight: 500;
color: var(--text-secondary);
background: var(--bg-surface);
border: 1px solid var(--border);
padding: var(--space-2) var(--space-3);
padding-right: var(--space-6);
cursor: pointer;
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 8px center;
transition: border-color var(--duration-fast) var(--ease-out);
}
.filter-select:hover,
.filter-select:focus-visible {
border-color: var(--accent);
outline: none;
}
.filter-select.has-value {
color: var(--text);
border-color: var(--accent);
}
.filter-clear {
font-family: inherit;
font-size: var(--text-xs);
font-weight: 500;
color: var(--text-muted);
background: transparent;
border: 1px solid var(--border);
padding: var(--space-2) var(--space-3);
cursor: pointer;
transition: all var(--duration-fast) var(--ease-out);
}
.filter-clear:hover {
color: var(--text);
border-color: var(--text-muted);
}
/* ---- Timeline ---- */
.timeline {
display: flex;
flex-direction: column;
gap: var(--space-1);
position: relative;
}
.tl-entry {
display: grid;
grid-template-columns: 64px 24px 1fr;
gap: 0 var(--space-2);
position: relative;
}
.tl-entry[data-hidden] {
display: none;
}
.tl-label-cell {
display: flex;
align-items: flex-start;
justify-content: flex-end;
padding-top: var(--space-5);
padding-right: var(--space-2);
}
.tl-type-label {
font-size: 9px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
white-space: nowrap;
}
.ct-code .tl-type-label { color: var(--accent); }
.ct-docs .tl-type-label { color: #10b981; }
.ct-infra .tl-type-label { color: #f59e0b; }
.tl-rail-cell {
display: flex;
flex-direction: column;
align-items: center;
position: relative;
}
.tl-dot {
width: 12px;
height: 12px;
border-radius: 50%;
border: 2px solid var(--accent);
background: var(--bg);
position: relative;
z-index: 2;
margin-top: var(--space-5);
flex-shrink: 0;
}
.ct-code .tl-dot { border-color: var(--accent); }
.ct-docs .tl-dot { border-color: #10b981; }
.ct-infra .tl-dot { border-color: #f59e0b; }
.tl-rail-cell::after {
content: "";
position: absolute;
top: calc(var(--space-5) + 12px);
bottom: 0;
left: 50%;
width: 2px;
background: var(--border);
transform: translateX(-50%);
z-index: 1;
}
.tl-entry:last-child .tl-rail-cell::after { display: none; }
.tl-card {
padding: var(--space-4) var(--space-5);
border: 1px solid var(--border);
background: var(--bg-surface);
transition: border-color var(--duration-fast) var(--ease-out),
box-shadow var(--duration-fast) var(--ease-out);
}
.tl-card:hover {
border-color: var(--border-strong);
box-shadow: var(--shadow);
}
.tl-dates {
display: flex;
align-items: center;
gap: var(--space-3);
font-size: var(--text-xs);
font-weight: 500;
color: var(--text-muted);
margin-bottom: var(--space-1);
font-variant-numeric: tabular-nums;
flex-wrap: wrap;
}
.tl-platform {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: var(--text-xs);
color: var(--text-muted);
}
.project-link {
color: var(--text-muted);
text-decoration: none;
transition: color var(--duration-fast) var(--ease-out);
}
.project-link:hover {
color: var(--accent);
}
.tl-title {
font-size: var(--text-base);
font-weight: 600;
margin-bottom: var(--space-2);
}
.contrib-link {
color: var(--text);
text-decoration: none;
transition: color var(--duration-fast) var(--ease-out);
}
.contrib-link:hover {
color: var(--accent);
}
.badge-row {
display: flex;
gap: var(--space-2);
margin-bottom: var(--space-2);
}
.badge {
display: inline-flex;
align-items: center;
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
padding: 2px var(--space-2);
border: 1px solid var(--border);
color: var(--text-muted);
}
.badge-merged {
color: #10b981;
border-color: #10b981;
background: color-mix(in srgb, #10b981 10%, transparent);
}
.badge-open {
color: #f59e0b;
border-color: #f59e0b;
background: color-mix(in srgb, #f59e0b 10%, transparent);
}
.badge-closed {
color: var(--text-muted);
border-color: var(--border);
background: var(--bg-surface);
}
.badge-kind {
color: var(--text-secondary);
}
.contrib-description {
font-size: var(--text-sm);
color: var(--text-secondary);
line-height: var(--leading-relaxed);
}
.related-issue-link {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: var(--text-xs);
font-weight: 500;
color: var(--text-muted);
text-decoration: none;
transition: color var(--duration-fast) var(--ease-out);
}
.related-issue-link:hover {
color: var(--accent);
}
.empty-state {
text-align: center;
padding: var(--space-10) 0;
font-size: var(--text-lg);
color: var(--text-muted);
}
/* ---- Responsive ---- */
@media (max-width: 768px) {
.stats-bar {
grid-template-columns: repeat(2, 1fr);
}
.tl-entry {
grid-template-columns: 48px 16px 1fr;
}
.tl-type-label { font-size: 8px; }
.tl-dot {
width: 10px;
height: 10px;
}
.tl-dates {
flex-direction: column;
align-items: flex-start;
gap: var(--space-1);
}
}
</style>
<script>
const selects = document.querySelectorAll<HTMLSelectElement>(".filter-select");
const entries = document.querySelectorAll<HTMLElement>(".tl-entry[data-project]");
const clearBtn = document.getElementById("clear-filters") as HTMLButtonElement;
const showingStat = document.getElementById("stat-showing");
const emptyState = document.getElementById("empty-state");
const timeline = document.getElementById("timeline");
function applyFilters() {
const filters: Record<string, string> = {};
selects.forEach((s) => {
if (s.value) filters[s.dataset.filter!] = s.value;
s.classList.toggle("has-value", !!s.value);
});
let visible = 0;
entries.forEach((el) => {
const match = Object.entries(filters).every(
([dim, val]) => el.dataset[dim] === val,
);
if (match) {
el.removeAttribute("data-hidden");
visible++;
} else {
el.setAttribute("data-hidden", "");
}
});
if (showingStat) showingStat.textContent = String(visible);
if (emptyState) emptyState.style.display = visible === 0 ? "" : "none";
if (timeline) timeline.style.display = visible === 0 ? "none" : "";
if (clearBtn) clearBtn.style.display = Object.keys(filters).length > 0 ? "" : "none";
}
selects.forEach((s) => s.addEventListener("change", applyFilters));
if (clearBtn) {
clearBtn.addEventListener("click", () => {
selects.forEach((s) => { s.value = ""; s.classList.remove("has-value"); });
applyFilters();
});
}
</script>
-322
View File
@@ -1,322 +0,0 @@
---
import BaseLayout from "@/layouts/BaseLayout.astro";
import eventsData from "@/data/events.json";
interface EventLink {
label: string;
url: string;
}
interface EventEntry {
name: string;
date: string;
location: string;
role: "speaker" | "attendee" | "organizer" | "mentor";
talk?: string;
description?: string;
blog?: string;
links?: EventLink[];
}
const events = (eventsData as EventEntry[]).sort(
(a, b) => new Date(b.date).getTime() - new Date(a.date).getTime(),
);
function fmtDate(iso: string) {
const d = new Date(iso);
return `${d.getDate()} ${d.toLocaleString("en-US", { month: "short" })} ${d.getFullYear()}`;
}
const roleLabels: Record<string, string> = {
speaker: "Speaker",
attendee: "Attendee",
organizer: "Organizer",
mentor: "Mentor",
};
const linkIcons: Record<string, string> = {
slides: `<rect x="2" y="3" width="20" height="14" rx="2" ry="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>`,
recording: `<polygon points="5 3 19 12 5 21 5 3"/>`,
video: `<polygon points="5 3 19 12 5 21 5 3"/>`,
photos: `<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/>`,
github: `<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/>`,
website: `<circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>`,
default: `<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/>`,
};
function iconForLabel(label: string): string {
const key = label.toLowerCase();
for (const [k, v] of Object.entries(linkIcons)) {
if (key.includes(k)) return v;
}
return linkIcons.default;
}
---
<BaseLayout title="Events" description="Conferences, meetups, and events attended or spoken at">
<div class="events-page">
<header class="events-header">
<h1>Events</h1>
<p class="events-desc">
Conferences, summits, and meetups I've attended or spoken at.
</p>
</header>
<div class="timeline">
{events.map((ev) => (
<div class={`tl-entry ev-${ev.role}`}>
<div class="tl-label-cell">
<span class="tl-type-label">{roleLabels[ev.role]}</span>
</div>
<div class="tl-rail-cell">
<div class="tl-dot" />
</div>
<div class="tl-card">
<div class="tl-card-header">
<div class="tl-dates">
{fmtDate(ev.date)}
<span class="tl-location">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>
{ev.location}
</span>
</div>
<h3 class="tl-title">{ev.name}</h3>
</div>
{ev.talk && <p class="event-talk">{ev.talk}</p>}
{ev.description && <p class="event-description">{ev.description}</p>}
{((ev.links && ev.links.length > 0) || ev.blog) && (
<div class="event-links">
{ev.links?.map((link) => (
<a href={link.url} class="event-link" target="_blank" rel="noopener noreferrer">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><Fragment set:html={iconForLabel(link.label)} /></svg>
{link.label}
</a>
))}
{ev.blog && (
<a href={ev.blog} class="event-link blog-link">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg>
Blog Post
</a>
)}
</div>
)}
</div>
</div>
))}
</div>
</div>
</BaseLayout>
<style>
.events-page {
max-width: var(--max-w-page);
margin-inline: auto;
}
.events-header {
margin-bottom: var(--space-10);
}
.events-header h1 {
margin-bottom: var(--space-3);
}
.events-desc {
font-size: var(--text-lg);
color: var(--text-secondary);
line-height: var(--leading-relaxed);
max-width: var(--max-w-prose);
}
/* ---- Timeline ---- */
.timeline {
display: flex;
flex-direction: column;
gap: var(--space-1);
position: relative;
}
.tl-entry {
display: grid;
grid-template-columns: 64px 24px 1fr;
gap: 0 var(--space-2);
position: relative;
}
.tl-label-cell {
display: flex;
align-items: flex-start;
justify-content: flex-end;
padding-top: var(--space-5);
padding-right: var(--space-2);
}
.tl-type-label {
font-size: 9px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
white-space: nowrap;
}
.ev-speaker .tl-type-label { color: var(--accent); }
.ev-attendee .tl-type-label { color: #10b981; }
.ev-organizer .tl-type-label { color: #f59e0b; }
.ev-mentor .tl-type-label { color: #8b5cf6; }
.tl-rail-cell {
display: flex;
flex-direction: column;
align-items: center;
position: relative;
}
.tl-dot {
width: 12px;
height: 12px;
border-radius: 50%;
border: 2px solid var(--accent);
background: var(--bg);
position: relative;
z-index: 2;
margin-top: var(--space-5);
flex-shrink: 0;
}
.ev-speaker .tl-dot { border-color: var(--accent); }
.ev-attendee .tl-dot { border-color: #10b981; }
.ev-organizer .tl-dot { border-color: #f59e0b; }
.ev-mentor .tl-dot { border-color: #8b5cf6; }
.tl-rail-cell::after {
content: "";
position: absolute;
top: calc(var(--space-5) + 12px);
bottom: 0;
left: 50%;
width: 2px;
background: var(--border);
transform: translateX(-50%);
z-index: 1;
}
.tl-entry:last-child .tl-rail-cell::after { display: none; }
.tl-card {
padding: var(--space-4) var(--space-5);
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-surface);
transition: border-color var(--duration-fast) var(--ease-out),
box-shadow var(--duration-fast) var(--ease-out);
}
.tl-card:hover {
border-color: var(--border-strong);
box-shadow: var(--shadow);
}
.tl-dates {
display: flex;
align-items: center;
gap: var(--space-3);
font-size: var(--text-xs);
font-weight: 500;
color: var(--text-muted);
margin-bottom: var(--space-1);
font-variant-numeric: tabular-nums;
flex-wrap: wrap;
}
.tl-location {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: var(--text-xs);
color: var(--text-muted);
}
.tl-title {
font-size: var(--text-base);
font-weight: 600;
margin-bottom: var(--space-1);
}
.event-talk {
font-size: var(--text-sm);
font-weight: 500;
font-style: italic;
color: var(--accent);
margin-bottom: var(--space-2);
}
.event-talk::before {
content: "\201C";
}
.event-talk::after {
content: "\201D";
}
.event-description {
font-size: var(--text-sm);
color: var(--text-secondary);
line-height: var(--leading-relaxed);
}
.event-links {
display: flex;
flex-wrap: wrap;
gap: var(--space-3);
margin-top: var(--space-4);
padding-top: var(--space-3);
border-top: 1px solid var(--border);
}
.event-link {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: var(--text-xs);
font-weight: 500;
color: var(--text-muted);
text-decoration: none;
padding: var(--space-1) var(--space-2);
border: 1px solid var(--border);
border-radius: var(--radius-full);
transition: all var(--duration-fast) var(--ease-out);
}
.event-link:hover {
border-color: var(--accent);
color: var(--accent);
background-color: var(--accent-subtle);
}
.blog-link {
color: var(--accent);
border-color: var(--accent);
}
/* ---- Responsive ---- */
@media (max-width: 768px) {
.tl-entry {
grid-template-columns: 48px 16px 1fr;
}
.tl-type-label { font-size: 8px; }
.tl-dot {
width: 10px;
height: 10px;
}
.tl-dates {
flex-direction: column;
align-items: flex-start;
gap: var(--space-1);
}
}
</style>
+6 -23
View File
@@ -2,7 +2,7 @@
import { getCollection } from "astro:content";
import BaseLayout from "@/layouts/BaseLayout.astro";
import HeroCard from "@/components/HeroCard.astro";
import MusicPlayer from "@/components/MusicPlayer.astro";
import GameOfLife from "@/components/GameOfLife.astro";
import ActivityRow from "@/components/ActivityRow.astro";
import RepoList from "@/components/RepoList.astro";
import RecentPosts from "@/components/RecentPosts.astro";
@@ -10,15 +10,13 @@ import RecentPosts from "@/components/RecentPosts.astro";
import { fetchGitHubUser, fetchGitHubRepos, fetchContributions } from "@/lib/github";
import { fetchWakaTimeData } from "@/lib/wakatime";
import { mergeActivity } from "@/lib/activity";
import { fetchListenBrainzData } from "@/lib/listenbrainz";
const [user, repos, contributions, wakatime, allPosts, listenBrainz] = await Promise.all([
const [user, repos, contributions, wakatime, allPosts] = await Promise.all([
fetchGitHubUser(),
fetchGitHubRepos(),
fetchContributions(),
fetchWakaTimeData(),
getCollection("posts", ({ data }) => !data.draft),
fetchListenBrainzData(),
]);
const activity = mergeActivity(contributions, wakatime);
@@ -26,37 +24,22 @@ const activity = mergeActivity(contributions, wakatime);
const recentPosts = allPosts
.sort((a, b) => b.data.date.getTime() - a.data.date.getTime())
.slice(0, 5);
const personLd = {
"@context": "https://schema.org",
"@type": "Person",
name: "Avinal Kumar",
url: "https://avinal.space",
image: user?.avatar_url,
jobTitle: "Software Engineer II (Team Lead)",
worksFor: { "@type": "Organization", name: "Red Hat", url: "https://www.redhat.com" },
sameAs: [
"https://github.com/avinal",
"https://linkedin.com/in/avinal",
"https://twitter.com/Avinal_",
],
};
---
<BaseLayout title="Home" jsonLd={personLd}>
<BaseLayout title="Home">
<div class="bento">
<!-- Row 1: Hero (profile+about+skills+links) | Now Playing widget -->
<!-- Row 1: Hero (profile+about+skills+links) | Game of Life widget -->
<div class="bento-8">
<HeroCard
name="Avinal Kumar"
role="Software Engineer II at Red Hat"
bio="Leading OpenShift Builds at Red Hat by day, contributing to the Linux kernel and GNU toolchain by night. Free software advocate, self-hoster, and GSoC mentor."
bio="I build things for hybrid cloud, contribute to open source, and self-host everything I can. GNU/Linux and free software are two of my favorite things."
avatarUrl={user?.avatar_url}
/>
</div>
<div class="bento-4">
<MusicPlayer lb={listenBrainz} />
<GameOfLife />
</div>
<!-- Row 2: Activity graph + stats (side by side in one card) -->
+1 -17
View File
@@ -12,25 +12,10 @@ export async function getStaticPaths() {
const { post } = Astro.props;
const { Content, headings } = await render(post);
const tocHeadings = headings.filter((h) => h.depth === 2 || h.depth === 3);
const wordCount = post.body?.split(/\s+/).length ?? 0;
const minutes = Math.max(1, Math.round(wordCount / 220));
const readingTime = `${minutes} min read`;
const allPosts = await getCollection("posts", ({ data }) => !data.draft);
const relatedPosts = allPosts
.filter((p) => p.id !== post.id)
.map((p) => {
let score = 0;
if (p.data.category === post.data.category) score += 10;
score += p.data.tags.filter((t) => post.data.tags.includes(t)).length * 3;
return { post: p, score };
})
.filter((s) => s.score > 0)
.sort((a, b) => b.score - a.score || b.post.data.date.getTime() - a.post.data.date.getTime())
.slice(0, 3)
.map((s) => s.post);
---
<PostLayout
@@ -42,8 +27,7 @@ const relatedPosts = allPosts
tags={post.data.tags}
image={post.data.image}
readingTime={readingTime}
headings={tocHeadings}
relatedPosts={relatedPosts}
headings={headings}
>
<Content />
</PostLayout>
+2 -6
View File
@@ -75,7 +75,7 @@ const excerpt = (body?: string, len = 140) => {
<a href={`/posts/${post.id}/`} class="post-row">
<div class="post-thumb">
{post.data.image ? (
<img src={post.data.image} alt={post.data.title} class="thumb-img" loading="lazy" decoding="async" />
<img src={post.data.image} alt="" class="thumb-img" loading="lazy" />
) : (
<span class="thumb-placeholder">{post.data.title.charAt(0)}</span>
)}
@@ -243,14 +243,10 @@ const excerpt = (body?: string, len = 140) => {
@media (max-width: 600px) {
.post-row {
grid-template-columns: 1fr;
grid-template-columns: 100px 1fr;
gap: var(--space-3);
}
.post-thumb {
aspect-ratio: 16 / 9;
}
.post-title {
font-size: var(--text-base);
}
+2 -6
View File
@@ -52,7 +52,7 @@ const excerpt = (body?: string, len = 140) => {
<a href={`/posts/${post.id}/`} class="post-row">
<div class="post-thumb">
{post.data.image ? (
<img src={post.data.image} alt={post.data.title} class="thumb-img" loading="lazy" decoding="async" />
<img src={post.data.image} alt="" class="thumb-img" loading="lazy" />
) : (
<span class="thumb-placeholder">{post.data.title.charAt(0)}</span>
)}
@@ -212,14 +212,10 @@ const excerpt = (body?: string, len = 140) => {
@media (max-width: 600px) {
.post-row {
grid-template-columns: 1fr;
grid-template-columns: 100px 1fr;
gap: var(--space-3);
}
.post-thumb {
aspect-ratio: 16 / 9;
}
.post-title {
font-size: var(--text-base);
}
+46 -323
View File
@@ -2,24 +2,13 @@
import BaseLayout from "@/layouts/BaseLayout.astro";
import resume from "@/data/resume.json";
const { basics, work, volunteer, education, skills, projects } = resume as any;
const { basics, work, volunteer, education, skills, projects, languages, certificates } = resume as any;
function fmtDate(iso: string) {
const d = new Date(iso);
return d.toLocaleDateString("en-US", { month: "short", year: "numeric" });
}
type ExtLink = { label: string; url: string };
type Role = {
title: string;
startDate: string;
endDate?: string;
summary?: string;
highlights?: string[];
links?: ExtLink[];
};
type TimelineEntry = {
type: "work" | "education" | "volunteer";
title: string;
@@ -30,109 +19,20 @@ type TimelineEntry = {
endDate?: string;
summary?: string;
highlights?: string[];
links?: ExtLink[];
roles?: Role[];
};
type FlatEntry = {
key: string;
type: TimelineEntry["type"];
title: string;
subtitle: string;
url?: string;
location?: string;
startDate: string;
endDate?: string;
summary?: string;
highlights?: string[];
links?: ExtLink[];
};
/**
* Groups flat entries by their `key` (organization/company name).
* Single-entry orgs stay flat; multi-entry orgs become grouped cards
* with nested roles sorted reverse-chronologically.
*/
function groupToTimeline(entries: FlatEntry[]): TimelineEntry[] {
const byKey = new Map<string, FlatEntry[]>();
for (const e of entries) {
if (!byKey.has(e.key)) byKey.set(e.key, []);
byKey.get(e.key)!.push(e);
}
const result: TimelineEntry[] = [];
for (const [, items] of byKey) {
const sorted = [...items].sort(
(a, b) => new Date(b.startDate).getTime() - new Date(a.startDate).getTime(),
);
const latest = sorted[0];
if (sorted.length === 1) {
result.push({
type: latest.type,
title: latest.title,
subtitle: latest.subtitle,
url: latest.url,
location: latest.location,
startDate: latest.startDate,
endDate: latest.endDate,
summary: latest.summary,
highlights: latest.highlights,
links: latest.links,
});
} else {
result.push({
type: latest.type,
title: latest.subtitle,
subtitle: latest.subtitle,
url: latest.url,
location: latest.location,
startDate: latest.startDate,
endDate: latest.endDate,
roles: sorted.map((e) => ({
title: e.title,
startDate: e.startDate,
endDate: e.endDate,
summary: e.summary,
highlights: e.highlights,
links: e.links,
})),
});
}
}
return result;
}
const workFlat: FlatEntry[] = work.map((w: any) => ({
key: w.name,
type: "work" as const,
title: w.position,
subtitle: w.name,
url: w.url || undefined,
location: w.location,
startDate: w.startDate,
endDate: w.endDate,
summary: w.summary,
highlights: w.highlights,
links: w.links,
}));
const volunteerFlat: FlatEntry[] = volunteer.map((v: any) => ({
key: v.organization,
type: "volunteer" as const,
title: v.position,
subtitle: v.organization,
url: v.url || undefined,
location: undefined,
startDate: v.startDate,
endDate: v.endDate,
summary: v.summary,
highlights: undefined as string[] | undefined,
}));
const timeline: TimelineEntry[] = [
...groupToTimeline(workFlat),
...groupToTimeline(volunteerFlat),
...work.map((w) => ({
type: "work" as const,
title: w.position,
subtitle: w.name,
url: w.url || undefined,
location: (w as any).location,
startDate: w.startDate,
endDate: w.endDate,
summary: w.summary,
highlights: w.highlights,
})),
...education.map((e: any) => ({
type: "education" as const,
title: e.area ? `${e.studyType} in ${e.area}` : e.studyType,
@@ -144,8 +44,24 @@ const timeline: TimelineEntry[] = [
summary: e.score ? `CGPA: ${e.score}` : undefined,
highlights: undefined as string[] | undefined,
})),
...volunteer.map((v) => ({
type: "volunteer" as const,
title: v.position,
subtitle: v.organization,
url: v.url || undefined,
startDate: v.startDate || "2022-01-01",
endDate: v.endDate,
summary: v.summary,
highlights: undefined as string[] | undefined,
})),
].sort((a, b) => new Date(b.startDate).getTime() - new Date(a.startDate).getTime());
const typeIcons: Record<string, string> = {
work: "briefcase",
education: "graduation",
volunteer: "heart",
};
const typeLabels: Record<string, string> = {
work: "Work",
education: "Education",
@@ -185,92 +101,34 @@ const typeLabels: Record<string, string> = {
<section class="timeline-section">
<h2>Experience & Education</h2>
<div class="timeline">
{timeline.map((entry) => {
const isActive = !entry.endDate;
return (
{timeline.map((entry) => (
<div class={`tl-entry tl-${entry.type}`}>
<div class="tl-label-cell">
<span class="tl-type-label">{typeLabels[entry.type]}</span>
</div>
<div class="tl-rail-cell">
<div class:list={["tl-dot", { "tl-dot-active": isActive }]} />
<div class="tl-dot" />
</div>
<div class="tl-card">
{entry.roles ? (
/* Grouped card: multiple roles at the same org */
<Fragment>
<div class="tl-card-header">
<div class="tl-dates">
{fmtDate(entry.roles[entry.roles.length - 1].startDate)} — {entry.endDate ? fmtDate(entry.endDate) : "Present"}
</div>
<h3 class="tl-title tl-org-title">
{entry.url ? <a href={entry.url}>{entry.subtitle}</a> : entry.subtitle}
</h3>
{entry.location && <p class="tl-subtitle"><span class="tl-location">{entry.location}</span></p>}
</div>
<div class="tl-roles">
{entry.roles.map((role, i) => (
<div class:list={["tl-role", { "tl-role-current": i === 0 }]}>
<div class="tl-role-header">
<h4 class="tl-role-title">{role.title}</h4>
<span class="tl-role-dates">
{fmtDate(role.startDate)} — {role.endDate ? fmtDate(role.endDate) : "Present"}
</span>
</div>
{role.summary && <p class="tl-summary">{role.summary}</p>}
{role.highlights && role.highlights.length > 0 && (
<ul class="tl-highlights">
{role.highlights.map((h) => <li>{h}</li>)}
</ul>
)}
{role.links && role.links.length > 0 && (
<div class="tl-links">
{role.links.map((lnk) => (
<a href={lnk.url} class="tl-ext-link" target="_blank" rel="noopener noreferrer">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
{lnk.label}
</a>
))}
</div>
)}
</div>
))}
</div>
</Fragment>
) : (
/* Single card */
<Fragment>
<div class="tl-card-header">
<div class="tl-dates">
{fmtDate(entry.startDate)} — {entry.endDate ? fmtDate(entry.endDate) : "Present"}
</div>
<h3 class="tl-title">{entry.title}</h3>
<p class="tl-subtitle">
{entry.url ? <a href={entry.url}>{entry.subtitle}</a> : entry.subtitle}
{entry.location && <span class="tl-location"> · {entry.location}</span>}
</p>
</div>
{entry.summary && <p class="tl-summary">{entry.summary}</p>}
{entry.highlights && entry.highlights.length > 0 && (
<ul class="tl-highlights">
{entry.highlights.map((h) => <li>{h}</li>)}
</ul>
)}
{entry.links && entry.links.length > 0 && (
<div class="tl-links">
{entry.links.map((lnk) => (
<a href={lnk.url} class="tl-ext-link" target="_blank" rel="noopener noreferrer">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
{lnk.label}
</a>
))}
</div>
)}
</Fragment>
<div class="tl-card-header">
<div class="tl-dates">
{fmtDate(entry.startDate)} — {entry.endDate ? fmtDate(entry.endDate) : "Present"}
</div>
<h3 class="tl-title">{entry.title}</h3>
<p class="tl-subtitle">
{entry.url ? <a href={entry.url}>{entry.subtitle}</a> : entry.subtitle}
{entry.location && <span class="tl-location"> · {entry.location}</span>}
</p>
</div>
{entry.summary && <p class="tl-summary">{entry.summary}</p>}
{entry.highlights && entry.highlights.length > 0 && (
<ul class="tl-highlights">
{entry.highlights.map((h) => <li>{h}</li>)}
</ul>
)}
</div>
</div>
)})}
))}
</div>
</section>
@@ -491,40 +349,6 @@ const typeLabels: Record<string, string> = {
.tl-education .tl-dot { border-color: #10b981; background: #10b981; }
.tl-volunteer .tl-dot { border-color: #f59e0b; }
.tl-dot-active {
animation: pulse-dot 2s ease-out infinite;
}
.tl-work .tl-dot-active {
background: var(--accent);
border-color: var(--accent);
--pulse-color: var(--accent);
}
.tl-education .tl-dot-active {
background: #10b981;
border-color: #10b981;
--pulse-color: #10b981;
}
.tl-volunteer .tl-dot-active {
background: #f59e0b;
border-color: #f59e0b;
--pulse-color: #f59e0b;
}
@keyframes pulse-dot {
0% {
box-shadow: 0 0 0 0 color-mix(in srgb, var(--pulse-color) 50%, transparent);
}
70% {
box-shadow: 0 0 0 8px color-mix(in srgb, var(--pulse-color) 0%, transparent);
}
100% {
box-shadow: 0 0 0 0 color-mix(in srgb, var(--pulse-color) 0%, transparent);
}
}
.tl-card {
padding: var(--space-4) var(--space-5);
border: 1px solid var(--border);
@@ -602,107 +426,6 @@ const typeLabels: Record<string, string> = {
font-weight: 700;
}
/* ---- External links ---- */
.tl-links {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
margin-top: var(--space-3);
}
.tl-ext-link {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: var(--text-xs);
font-weight: 500;
color: var(--accent);
text-decoration: none;
padding: 2px var(--space-2);
border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
border-radius: var(--radius-full);
transition: all var(--duration-fast) var(--ease-out);
}
.tl-ext-link:hover {
background: var(--accent-subtle);
border-color: var(--accent);
}
.tl-ext-link svg {
flex-shrink: 0;
opacity: 0.7;
}
/* ---- Grouped roles ---- */
.tl-org-title {
font-size: var(--text-lg);
}
.tl-org-title a {
color: var(--accent);
text-decoration: none;
}
.tl-org-title a:hover {
text-decoration: underline;
}
.tl-roles {
display: flex;
flex-direction: column;
gap: 0;
margin-top: var(--space-4);
}
.tl-role {
padding: var(--space-3) 0 var(--space-3) var(--space-4);
border-left: 2px solid var(--border);
position: relative;
}
.tl-role::before {
content: "";
position: absolute;
left: -5px;
top: calc(var(--space-3) + 6px);
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--border);
}
.tl-role-current::before {
background: var(--accent);
}
.tl-role-current {
border-left-color: var(--accent);
}
.tl-role-header {
display: flex;
align-items: baseline;
gap: var(--space-3);
flex-wrap: wrap;
}
.tl-role-title {
font-size: var(--text-sm);
font-weight: 600;
}
.tl-role-current .tl-role-title {
font-size: var(--text-base);
color: var(--text);
}
.tl-role-dates {
font-size: var(--text-xs);
color: var(--text-muted);
font-variant-numeric: tabular-nums;
}
/* ---- Two column: Skills + Projects ---- */
.two-col {
display: grid;
+308
View File
@@ -0,0 +1,308 @@
---
import BaseLayout from "@/layouts/BaseLayout.astro";
const hardware = [
{
category: "Servers",
items: [
{ name: "Raspberry Pi 5 8GB", url: "https://www.raspberrypi.com/products/raspberry-pi-5/", detail: "Primary server — runs most self-hosted services" },
{ name: "Raspberry Pi 4B 8GB", url: "https://www.raspberrypi.org/products/raspberry-pi-4-model-b/", detail: "Secondary server — backup and lighter workloads" },
],
},
{
category: "Storage",
items: [
{ name: "Samsung SSD 970 EVO Plus 500GB", url: "https://www.samsung.com/us/computing/memory-storage/solid-state-drives/ssd-970-evo-plus-nvme-m-2-500gb-mz-v7s500b-am/", detail: "NVMe on the Pi 5 via Pimoroni NVMe Base" },
{ name: "WD Blue SA510 SATA SSD M.2 500GB", url: "https://www.westerndigital.com/en-in/products/internal-drives/wd-blue-sa510-sata-m-2-ssd", detail: "Connected via USB enclosure to the Pi 4B" },
],
},
{
category: "Accessories",
items: [
{ name: "Raspberry Pi 27W USB-C PSU", url: "https://www.raspberrypi.com/products/27w-power-supply/", detail: "For the Pi 5" },
{ name: "Raspberry Pi 15W USB-C PSU", url: "https://www.raspberrypi.com/products/type-c-power-supply/", detail: "For the Pi 4B" },
{ name: "Pimoroni NVMe Base", url: "https://shop.pimoroni.com/products/nvme-base", detail: "NVMe SSD HAT for Pi 5" },
{ name: "PiBOX NVMe SSD Enclosure", url: "https://pibox.in/", detail: "USB 3.2 10Gbps enclosure" },
],
},
];
const selfHosted = [
{ name: "Immich", url: "https://immich.app/", desc: "Photo and video backup — Google Photos replacement", category: "Media" },
{ name: "Paisa", url: "https://paisa.fyi/", desc: "Personal finance and budget manager using plain text accounting", category: "Finance" },
{ name: "Vikunja", url: "https://vikunja.io/", desc: "Todo lists and kanban boards with CalDAV support", category: "Productivity" },
{ name: "Atuin", url: "https://atuin.sh/", desc: "Encrypted shell history sync across all machines", category: "Dev Tools" },
{ name: "Gitea", url: "https://about.gitea.com/", desc: "Self-hosted Git service — personal project mirror", category: "Dev Tools" },
{ name: "Paperless-ngx", url: "https://docs.paperless-ngx.com/", desc: "Document management with built-in OCR", category: "Documents" },
{ name: "Shiori", url: "https://github.com/go-shiori/shiori", desc: "Simple bookmark manager — Pocket alternative", category: "Bookmarks" },
{ name: "Memos", url: "https://usememos.com/", desc: "Lightweight note-taking — quick thoughts and snippets", category: "Notes" },
];
const networking = [
{ name: "Tailscale", url: "https://tailscale.com/", desc: "Mesh VPN connecting all devices securely" },
{ name: "RunTipi", url: "https://runtipi.io/", desc: "Docker Compose app manager for server administration" },
];
const softwareStack = [
{ category: "Editor", items: ["Neovim", "VS Code / Cursor"] },
{ category: "Terminal", items: ["Kitty", "Zsh", "Starship prompt", "Tmux"] },
{ category: "OS", items: ["Fedora (daily driver)", "Raspberry Pi OS (servers)"] },
{ category: "Browser", items: ["Firefox"] },
];
---
<BaseLayout title="Setup" description="Hardware, software, and self-hosted services powering Avinal's workflow">
<div class="setup-page">
<header class="setup-header">
<h1>Setup</h1>
<p class="setup-desc">
The hardware, software, and self-hosted services that power my workflow.
Heavily inspired by the homelab and self-hosting community.
</p>
</header>
<section class="setup-section">
<h2>Hardware</h2>
{hardware.map((group) => (
<div class="hw-group">
<h3 class="hw-category">{group.category}</h3>
<div class="hw-items">
{group.items.map((item) => (
<div class="hw-card">
<h4><a href={item.url}>{item.name}</a></h4>
<p>{item.detail}</p>
</div>
))}
</div>
</div>
))}
</section>
<section class="setup-section">
<h2>Self-Hosted Services</h2>
<p class="section-intro">
All services run on the Raspberry Pis, connected via Tailscale VPN.
Most are deployed using Docker Compose via RunTipi.
</p>
<div class="service-grid">
{selfHosted.map((svc) => (
<div class="service-card">
<span class="service-category">{svc.category}</span>
<h3><a href={svc.url}>{svc.name}</a></h3>
<p>{svc.desc}</p>
</div>
))}
</div>
</section>
<section class="setup-section">
<h2>Networking</h2>
<div class="service-grid service-grid-half">
{networking.map((svc) => (
<div class="service-card">
<h3><a href={svc.url}>{svc.name}</a></h3>
<p>{svc.desc}</p>
</div>
))}
</div>
</section>
<section class="setup-section">
<h2>Software Stack</h2>
<div class="sw-grid">
{softwareStack.map((group) => (
<div class="sw-group">
<h3 class="sw-category">{group.category}</h3>
<ul class="sw-list">
{group.items.map((item) => <li>{item}</li>)}
</ul>
</div>
))}
</div>
</section>
<div class="setup-footer">
<p class="text-muted text-sm">
For a deeper dive into my Raspberry Pi setup, check out
<a href="/posts/raspi/everything-on-my-pi/">Everything on my Pi</a>.
</p>
</div>
</div>
</BaseLayout>
<style>
.setup-page {
max-width: var(--max-w-page);
margin-inline: auto;
}
.setup-header {
margin-bottom: var(--space-10);
}
.setup-header h1 {
margin-bottom: var(--space-3);
}
.setup-desc {
font-size: var(--text-lg);
color: var(--text-secondary);
line-height: var(--leading-relaxed);
max-width: var(--max-w-prose);
}
.setup-section {
margin-bottom: var(--space-12);
}
.setup-section > h2 {
font-size: var(--text-xl);
margin-bottom: var(--space-6);
padding-bottom: var(--space-2);
border-bottom: 2px solid var(--accent);
display: inline-block;
}
.section-intro {
color: var(--text-secondary);
margin-bottom: var(--space-6);
line-height: var(--leading-relaxed);
}
/* Hardware */
.hw-group {
margin-bottom: var(--space-6);
}
.hw-category {
font-size: var(--text-sm);
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--text-muted);
margin-bottom: var(--space-3);
}
.hw-items {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: var(--space-4);
}
.hw-card {
padding: var(--space-4);
border: 1px solid var(--border);
border-radius: var(--radius-md);
background-color: var(--bg-surface);
}
.hw-card h4 {
font-size: var(--text-sm);
font-weight: 600;
margin-bottom: var(--space-1);
}
.hw-card h4 a {
color: var(--accent);
text-decoration: none;
}
.hw-card h4 a:hover {
text-decoration: underline;
}
.hw-card p {
font-size: var(--text-xs);
color: var(--text-muted);
}
/* Services */
.service-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: var(--space-4);
}
.service-grid-half {
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
max-width: 640px;
}
.service-card {
padding: var(--space-5);
border: 1px solid var(--border);
border-radius: var(--radius-md);
background-color: var(--bg-surface);
transition: border-color var(--duration-fast) var(--ease-out),
box-shadow var(--duration-fast) var(--ease-out);
}
.service-card:hover {
border-color: var(--border-strong);
box-shadow: var(--shadow);
}
.service-category {
display: inline-block;
font-size: var(--text-xs);
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--accent);
margin-bottom: var(--space-2);
}
.service-card h3 {
font-size: var(--text-base);
font-weight: 600;
margin-bottom: var(--space-2);
}
.service-card h3 a {
color: var(--text);
text-decoration: none;
}
.service-card h3 a:hover {
color: var(--accent);
}
.service-card p {
font-size: var(--text-sm);
color: var(--text-secondary);
line-height: var(--leading-relaxed);
}
/* Software stack */
.sw-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: var(--space-6);
}
.sw-category {
font-size: var(--text-sm);
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--text-muted);
margin-bottom: var(--space-3);
}
.sw-list {
list-style: disc;
padding-left: 1.2em;
font-size: var(--text-sm);
color: var(--text-secondary);
display: flex;
flex-direction: column;
gap: var(--space-1);
}
.setup-footer {
margin-top: var(--space-8);
padding-top: var(--space-6);
border-top: 1px solid var(--border);
text-align: center;
}
</style>
-19
View File
@@ -404,23 +404,4 @@
white-space: nowrap;
border-width: 0;
}
.skip-link {
position: absolute;
top: -100%;
left: var(--space-4);
z-index: 9999;
padding: var(--space-2) var(--space-4);
font-size: var(--text-sm);
font-weight: 600;
color: white;
background: var(--accent);
border-radius: 0;
text-decoration: none;
transition: top var(--duration-fast) var(--ease-out);
}
.skip-link:focus {
top: 0;
}
}