Skip to content

OpenAstronomy/Universe_OA

Repository files navigation

This folder contains the source used to generate a static site using Nikola.

Installation and documentation at https://getnikola.com/

Configuration file for the site is conf.py.

To build the site::

nikola build

To see it::

nikola serve -b

To check all available commands::

nikola help

Structure of this repository

There are three branches: main, run and gh-pages.

  • main includes only commits made by people and not automatically.
  • run runs on Travis and updates the posts and everything
  • gh-pages is 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.

Updates for a new season:

  1. Update gsoc_times.yml from run into main

    git restore --source run gsoc_times.yml
    

    This brings the latest updates to gsoc_times.yml.

  2. Add properties on gsoc.yml and on gsoc_times.yml for new students. For names we are using their github handles.

    gsocYYYY:
      gh_student_a:
        rss_feed: "
        rss_fed: "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.yml

    year=$(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
  3. Create a PR and ask students to PR to that filling it in. As in: 2018

  4. squash merge that pull request into main.

  5. Locally, update dates_post.yaml with the new date ranges for this season and commit it to main

  6. copy the new config files into the run branch, 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) to run. Then push it run and all should work. And then push to main

Debug it locally

  • 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.