+++ date = "2019-12-11T20:52:38+00:00" publishdate = "2023-12-29T07:08:55+00:00" title = "News Aggregator" slug = "news-aggregator" author = "Thedro" tags = ["golang"] type = "projects" summary = "Here's a site that's been in my personal use for while. It's a local news aggregator that gathers stories from around The Bahamas and creates a tight newspaper esque view." draft = "" syntax = "" toc = "" updated = "" +++ {{< image source="/images/news-aggregator.png" >}} Mobile view of the front page. {{< /image >}} [Demo](https://www.bahrep.com) Here's a site that's been in my personal use for while. It's a local news aggregator that gathers stories from around The Bahamas and creates a tight newspaper esque view. The stories are gathered using old school [`RSS`.](https://en.wikipedia.org/wiki/RSS) This website is generated using a simple {{< sidenote mark="static" set="right" >}}Static site generators are perfect for news sites.{{< /sidenote>}} site generator written in [Go](https://go.dev/doc/). I've hacked together my own static site generator after taking a peek at both [Hugo](https://github.com/gohugoio/hugo) and [Openring's](https://git.sr.ht/~sircmpwn/openring) source code. The frontend does not use any frameworks and is implemented with a nested {{< sidenote mark="[flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox)" set="left" >}}Naturally, this started with a [grid](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Grids) approach, but slowly became worried about cross browser support.{{< /sidenote >}} based approach to obtain a complex {{< sideimage mark="layout." set="right" source="/images/news-aggregator-desktop.png" >}}Desktop Layout{{< /sideimage >}} Automatic deployment happens with a simple [`POSIX`](https://en.wikipedia.org/wiki/POSIX) compliant shell script. The `RSS` fetch process is decoupled from the website generation process, allowing for super fast site regeneration. Internal web pages are generated and passed through [`monolith`](https://github.com/Y2Z/monolith) to {{< sidenote mark="compile" set="left" >}}Monolith is a program written in [Rust](https://www.rust-lang.org/learn) that reduces a web page to a single `HTML` file.{{< /sidenote >}} all assets into a single file. This file is served in one {{< sidenote mark="request." set="right" >}}Encoding everything into a single file is not always a good decision.{{< /sidenote >}} That is crazy --- but here's the result of a speed test. In a practical sense, the grade should be closer to `F` since all data is encoded into an _unoptimized_ document. {{< image source="/images/bahrep-speed-test.png" >}} Speed Test Results {{< /image >}} --- 1. Note: The source is nothing to write home about but I'll be adding a link to it once my laziness subsides.