How ganitak/sparky works
Project type and purpose
• This is a static website built with Hugo (a Go-based Static Site Generator).
• It serves as an informational “electrician” site with multiple Markdown-driven pages, custom CSS/JS assets, and a Hugo theme (hugo-initio).
• Deployment target is Netlify; future plans include Grafana for analytics and embedded services (Calendly, Google Analytics).
File structure
• Top-level:
– config.toml – Hugo site configuration
– content/ – Markdown files for each page
– layouts/ – HTML templates (baseof, list, single) + partials (header, footer, analytics)
– assets/ – custom CSS and JS (styles.css, 404.css, template.js, html5shiv.js)
– static/ – static images served as-is
– themes/hugo-initio/ – upstream theme code, its own assets, layouts, exampleSite
• No backend code or database; purely frontend SSG.
• Git submodule (.gitmodules) points to the theme or other external repos.
Key insights from README
• Uses Hugo extended (for SCSS support via CGO_ENABLED).
• Deployed on Netlify (CI/CD pipeline: Git push → Netlify build → CDN publish).
• Integrates analytics via Google Analytics partial; plans for Grafana dashboards.
• Embeds Calendly widget for appointment scheduling.
Main components
a. Developer Environment
– Local machine running hugo server or hugo build
– Git CLI to commit/push code to remote repo (e.g., GitHub)
– Go toolchain & C compiler for Hugo extended
b. Source Repository
– Hugo project & theme submodule
– config.toml, content/, layouts/, assets/, static/
c. CI/CD Pipeline (Netlify)
– Netlify build step runs Hugo → produces /public folder
– Asset optimization, SASS compilation (if any), template rendering
d. Hosting / CDN
– Netlify CDN serves static files (HTML, CSS, JS, images) to end users
e. Browser / End User
– Loads pages, CSS, JS; executes template.js (animations, navigation)
– Runs DarkReader extension (optional)
– Triggers Google Analytics calls
– Clicks “Calendly” embed to schedule
f. External Services
– Google Analytics (via analyticstracking.html partial)
– Calendly widget (embedded via content or shortcode)
– Future Grafana dashboards (consuming site metrics)
Relationships & data flow
• Developer → Git repo (push) → Netlify trigger
• Netlify → Hugo build → artifacts → CDN
• Browser requests page → CDN responds with HTML/CSS/JS/images
• Page JS/media → Google Analytics endpoint
• User interacts with Calendly embed → Calendly servers
• (Future) Hugo logs or Netlify logs → Grafana for dashboards
Architectural patterns & design principles
• Static Site Generation – no runtime backend.
• Template-Content separation – layouts + content/
• Asset pipeline – custom CSS/JS under assets/ processed by Hugo extended.
• Submodule theming – decouples upstream theme updates from customizations.
• CI/CD – automated build and deploy via Git hooks.
– Processes (rounded rectangles)