The open source Alaveteli software provides JSON endpoints for feeds of information about freedom information requests sent through an installation. The following snippet of code is a Hugo partial that I created for my personal website to implement this.
To see this code in action, visit this page.
To implement this code, enter the following into a shortcode HTML file on your Hugo-based website. Call the shortcode on any page you wish.
- Replace 'https://opramachine.com' with the URL of your Alaveteli installation.
- Replace 'YOUR_USER' with your username from your Alaveteli installation.
<ul>
{{ $opra_requests := getJSON "https://opramachine.com/feed/user/YOUR_USER.json" }}
{{ range first 3 $opra_requests }}
<li><a href="https://opramachine.com/request/{{ .info_request.url_title }}" target="">{{ .info_request.title }}</a><p>Requested from: <a href="https://opramachine.com/body/{{ .public_body.url_name }}" target="">{{ .public_body.name }}</a></p><p>Status: <strong>{{ .display_status }}</strong></p> <p><i>{{ .snippet }}</i></p></li>
{{ end }}
</ul>