This is the blog aggregator of the Open Astronomy community. For now it's only been used for SoC programmes (GSoC/SoCiS).
There are three branches: main, run and gh-pages.
mainincludes only commits made by people and not automatically.runruns on GH actions and updates the posts and everythinggh-pagesis the built version of the page, also done automatically.
We could keep main and run in the same branch but this makes it easier to
search the commits that we care about.
This blog aggregator is generated as a static site using Nikola.
The configuration file for the site is conf.py. Refer to Nikola's documentation for details on how to use it.
The blog aggregator is controlled by two files: gsoc.yml and gsoc_times.yml and executed by grab.py script.
gsoc.ymlkeeps a list of all the gsoc editions, the gsoc participants, their rss feed and the organisation they are working for.gsoc_times.ymlkeeps a key-value record of the date from the last contribution for each participant.grab.pyreads from the files above and updates them after a new blog entry has been found. The entry is downloaded and added as an entry in the aggregator.
A little widget is shown in the top of the website to track the blog posts of each participant. With our SoC rules, we require one post every fortnight.
The widget is created using a Nikola plugin.
Its source is under plugins/sidebar/sidebar.py.
It uses the logos and dates set in organisations.yml and dates_posts.yml load through the conf.py.
The plugin looks whether there are posts in the ranges between the dates provided, and places a symbol for each of the GSoC participants.
-
Update
gsoc_times.ymlfromrunintomaingit restore --source run gsoc_times.ymlThis brings the latest updates to
gsoc_times.yml. -
Add properties on
gsoc.ymland ongsoc_times.ymlfor new students. For names we are using their github handles.gsocYYYY: gh_student_a: rss_feed: "rss-url" # TODO (add blog with gsoc tag) project: 'suborg' # TODO (add project as named on ..)
Then, once completed that file you can run this snippet to fill
gsoc_times.ymlyear=$(date +"%Y") lastyear=$(( ${year} - 1)) sed -n "/^gsoc${year}/,/gsoc${lastyear}/p" gsoc.yml | grep "^ [[:alpha:]].*:$" | sed 's/^[ ]*//' | sed "s/$/ ${year}-05-01 00:00:00/g" >> gsoc_times.yml LC_COLLATE=C sort -o gsoc_times.yml gsoc_times.yml # So it sorts as python does, first upper case, then lower
-
Create a PR and ask students to PR to that filling it in. As in: 2018
-
squash merge that pull request into
main. -
Locally, update
dates_post.yamlwith the new date ranges for this season and commit it tomain -
copy the new config files into the
runbranch, for example with:git rebase --onto run <x> <z>
where
<x>is the commit before than<y>which is the one we want to copy (up to included) torun. Then push itrunand all should work. And then push tomain
- remove all the output:
rm -rf .doit.db.* && rm -rf cache && nikola clean && nikola forget && rm -rf __pycache__ && rm -rf output
- run the grab if needed (modifying the gsoc_times) and build.
- To debug the plugin, add
doit.tools.set_trace()instead of breakpoint to get pdb working.