Online course plan with Hugo + TOML

Hi all!

I want to develop an online course plan for a big school.

Presenting the data statically and programming shortcodes for individual outputs (display by categories, display by ID, sort by date) is no problem.

The only problem is that non-technical staff (but only a few people) should be able to edit the data.

My idea is this: They edit a data file on GitHub/GitLab:

  • Copy a course or course template,
  • increment its ID,
  • update its other data, and
  • open a pull-request.

TOML seems the best data format, because

  • it looks clean,
  • indentation is not necessary, and
  • comments (to deactivate a course) are possible (unlike JSON).

What do you think: Is this a manageable, future proof concept? Any other ideas?

By the way: We have worked with PHP+MySQL for this; but as data do not change frequently Hugo + TOML seems a better fit. Moreover, git versioning is excellent for this.

Thank you!

I have no data to back this, but I think you are spot on picking TOML as the “friendliest” data format for this. Even I cannot edit YAML without proper editor support.

Thank you very much, bep. As you don’t scream ‚NO!‘ I will take the step in that direction :wink:

I am really looking forward to Hugo Modules. Your proposal looks amazing!

All the best.

That said, even if you pick TOML there are severaly roads to Rome.

I assume that every course needs an URL, so one way would be:

  • Create a bundle per course
  • Put whatever data that does not fit in front matter into TOML files loaded with transform.Unmarshal
  • Put common data in /data

With that you can even create an arhchetype to make it easy to create a new course.

1 Like

Thank you for pointing me to transform.Unmarshal. That will make things easier.

We have many courses, but few categories/kinds of courses. Therefore not every course needs a URL. That will make things even easier.

If possible later building pages from data files will be a perfect addition.