Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to use of a Static Site Generator #98

Open
jamietanna opened this issue Oct 1, 2019 · 11 comments · May be fixed by #112
Open

Move to use of a Static Site Generator #98

jamietanna opened this issue Oct 1, 2019 · 11 comments · May be fixed by #112
Assignees

Comments

@jamietanna
Copy link
Contributor

Something I've been meaning to ask for a while - would we like to move this to use a static site generator which may make it easier to onboard new events?

@jhigman
Copy link
Collaborator

jhigman commented Oct 1, 2019

Hi Jamie, interesting idea - are you thinking of a site generated from some config, where a new event would just be added to a config file, and the site regenerated?
The site was originally conceived as being static - so that it could be hosted on github.io, without a server - but actually, a server is now involved, because the next event dates are pulled from various APIs to allow the events to be sorted (though the calls to do the sorting are done from the client, which has always seemed a bit sub-optimal, as the events rearrange themselves after a delay, while you're looking at them - and every client has to fetch the dates over again..)
In fact, it might make more sense to have a dynamic site on a server, which could fetch the sort dates at regular intervals, and serve the events pre-sorted. Plus, if there was some storage on the server, then new events could maybe be added to the db from a simple admin interface..?

@sdh100shaun
Copy link
Collaborator

sdh100shaun commented Oct 1, 2019

Sounds like an interesting idea to have the site generated at regular intervals, we need to have it regenerate though in my opinion as soon as possible (so regeneration timescales need careful consideration) after a new meet up event is published to ensure it comes out on Nottingham Digital as soon as possible. There is recent changes to the meetup api we probably need to consider, whilst the api was recently refactored by @pavlakis and there is now Oauth2 auth it is not running on a server flow with user creds cos it requires a pro user - I don't think that is a great issue but worth highlighting.

Is easier on-boarding and content generation something we may be able to achieve using github actions ? I am aware of https://github.com/peaceiris/actions-hugo for example

@jhigman
Copy link
Collaborator

jhigman commented Oct 2, 2019

I like the idea of GitHub actions - no server to maintain, just come action to rebuild the index page when new commits are made, e.g. when there's an addition of a new event to a config file.

Also, could potentially use actions to recreate the sort order at intervals (could be a time-based action, https://help.github.com/en/articles/events-that-trigger-workflows#scheduled-events-schedule) - maybe a sort order file which could be used to sort the index page items without further requests to the server..?

@jamietanna
Copy link
Contributor Author

Sorry for the late reply.

interesting idea - are you thinking of a site generated from some config, where a new event would just be added to a config file, and the site regenerated?

My main thought is to convert it to a static site generator, such as Jekyll or Hugo, which as Julian says, will give us the ability to create a file i.e:

# content/events/tech-nottingham.md
---
theme: tech
title: Tech Nottingham
urls:
  event: https://www.technottingham.com/
  twitter: https://twitter.com/technottingham
description: Making Nottingham a better place to live & work in technology - meetups & events, community building, advocacy and education.
when: Second Monday
---

This would allow each file to be theme in-dependent, whereas currently if we need to make a change to i.e. the CSS class that defines the title, we have a tonne of changes to make.

It also allows us to make it easier to add more information more easily, as well as looking at generating other formats

In terms of rebuilding the site on i.e. Pull Request, we can do that fairly easily with GitHub Actions, Netlify, or plain ol' GitHub Pages.

Having a admin interface for the repo could be done with a static site generator too, there are various static site Content Managment Systems i.e. Netlify CMS (which doesn't require using Netlify).

There is recent changes to the meetup api we probably need to consider, whilst the api was recently refactored by @pavlakis and there is now Oauth2 auth it is not running on a server flow with user creds cos it requires a pro user - I don't think that is a great issue but worth highlighting.

That's a good shout re the OAuth2 conversion - it should be OK to authorize as yourself (or not even require authorization)

@pavlakis I'm happy to chat about this offline, as I recently wrote an API for Meetup.com which works with anonymous API requests.

@pavlakis
Copy link
Collaborator

pavlakis commented Oct 2, 2019

@jamietanna This looks good and will definitely reduce the number of moving parts.

In terms of the current setup, I'm using this API Gateway to pull each event from Meetup, and make it available on the page.

@jamietanna
Copy link
Contributor Author

I'm looking to contribute this during this upcoming Hacktoberfest

@jamietanna
Copy link
Contributor Author

Are we happy if I start with a move to Hugo? Maybe using GitHub Actions to publish it to GitHub Pages?

@sdh100shaun
Copy link
Collaborator

Definately put in a PR I say - in terms of the API how would your proposal work with that ?

@jamietanna
Copy link
Contributor Author

We currently hit the API client side don't we? I'd say continue to do that, otherwise we need to keep rebuilding the site

@sdh100shaun
Copy link
Collaborator

sdh100shaun commented Sep 27, 2020

Cool ok then I have updated the js versions - may look at rebuilding the build system there @jamietanna let me know when you have a branch happy to help out - see #111

@jhigman
Copy link
Collaborator

jhigman commented Sep 28, 2020

Yes, I'm happy if you want to move the site to be statically generated using Hugo etc.

I still think the client-side sorting is the least satisfactory bit of the site - the user experience is pretty sketchy, and the api gets called more than is necessary. We really only need to re-order the events a couple of times - when the date rolls over, and when new events are added. Is there a way that we could use actions to do that?

Having said that, we'll be no worse off if the (statically generated) site still does client-side sorting..

jamietanna added a commit to jamietanna/nottinghamdigital.github.io that referenced this issue Oct 1, 2020
As part of nottinghamdigital#98, we decided that we wanted to replace the single HTML
file with a static site generator.

This allows for easier adding/changing of content and theme, as
currently the setup of the site will make it a little difficult to
change the structure of the site in the future, and it also makes it
easier for folks to contribute changes to the events on the site.

We've decided to use Hugo, as a lightweight solution that only requires
a single download to get it working.

To make this work and automagically deploy on merges, we need to use
GitHub Actions.

We no longer need anything Gulp/Node related, as Hugo can minify our
source for us, so we can remove those references.

Closes nottinghamdigital#98.
@jamietanna jamietanna linked a pull request Oct 1, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants