2018-09-08 Notes

home / log / 2018-09-08-notes

Pull Request Builder


make it easier to contribute new tracks

adding a track today

The existing google form will accept measurements for a new track. The entry gets saved in a google sheet. There are some calculations which get run in an enriched worksheet in that google sheet.

Generate a new page for the track using the hugo cli. I then move the values from the spreadsheet to front matter yaml in the new page.

desired workflow

one time setup

  1. sign up for free github.com account
  2. fork the laps.run repo
  3. clone your fork to local

for each new track

  1. make measurements on new track
  2. git checkout -b add-uc-berkeley
  3. an undefined one-liner command to generate the new page
  4. git commit -am 'add new track UC Berkeley'
  5. git push -u origin add-uc-berkeley
  6. open pull request on github.com

one-liner command requirements





note: speed rating is pre-computed and saved in track front matter still because of a technical limitation. The inability to sort hugo pages in a list page using a computed field


title: "American River"
date: 2018-05-17T18:58:14-07:00
tags: ["juco"]
latitude: 38.6466618
longitude: -121.34779
elevation_meters: 24.69
distance_meters: 400.00
lap_lanes: 9
home_lanes: 10
surface_type: artificial
surface_color: red
turn_diameter_meters: 68.16
turn_radius_b_meters: 34.16
speed_rating: 14.13
steeple_water_location: inside

ARC Stadium. 4700 College Oak Dr, Sacramento, CA 95841

one liner command


feed raw input values into the command. run calculations. output the complete page.

zoom out

this workflow still requires technical capability and tools in order to contribute a track. it is too complicated.

pure web workflow would be preferable.

desired workflow revisited

one time setup

  1. sign up for free github.com account

for each new track

  1. make measurements on new track on google maps
  2. input measurements into a web form. submit.
  3. copy new track page content to clipboard
  4. on github.com, browse to desired parent directory for new track
  5. click “create new file” (which will automatically create a fork)
  6. paste generated page from clipboard
  7. click radio button for “Create a new branch for this commit and start a pull request.”
  8. name your branch
  9. click “propose changes”

new track content generator

next step is for me to package up the calculations and page generation code in a way somebody can drive on the web. receive the inputs via a web form. output is the complete yaml text of the new page.


more advanced could be to write a github.com integration which would drive the pull request creation when you submit the input form, rather than just dumping out the generated content. it would ask the user to authorize access to their github account to perform the necessary actions