library(metar)
library(magrittr)

Motivation

GitHub Pages lets you serve static websites (HTML5, CSS, JS) right from GitHub. That can be convenient to publish research results or documentation.

You just need to push your assets to a branch named gh-pages or a docs/ folder on master. The website for, say, project foo is then available to the world at https://subugoe.github.io/foo.

To learn more about publishing results of your R project to GitHub Pages, see muggle. You can also use this GitHub Action to publish arbitrary assets to GitHub Pages.

Existing GitHub Pages Usage at SUB

To potentially transition to a custom domain (see #4), we first need to know who would be affected by such a change. (Notice though, that all old URLs would be forwarded automatically, so this is just out of an abundance of caution.) Here are all repos who currently have a GitHub Page (as defined a 200 status return).

repos <- gh::gh(
  endpoint = "GET /users/:username/repos",
  username = "subugoe",
  .limit = Inf
) %>%
  purrr::map_dfr(
    .f = function(x) {
      name <- x$name
      response <- httr::GET(url = paste0("https://subugoe.github.io/", name))
      tibble::tibble(
        name = name,
        status = httr::status_code(x = response),
        has_ghpages = status == 200
      )
    },
    .id = NULL
  )
#> ℹ Running gh query ℹ Running gh query, got 100 records of about 300 ℹ Running gh
#> query, got 300 records of about 450
repos %>%
  dplyr::filter(has_ghpages == TRUE) %>%
  knitr::kable()
name status has_ghpages
2019-11-12-ugoe-carpentries 200 TRUE
2020-02-25-dc-rda-germany 200 TRUE
2020-05-19-lc 200 TRUE
adw-sketches 200 TRUE
archaeo18 200 TRUE
devsettings 200 TRUE
fidmath-mathematikernachlaesse 200 TRUE
gdz-solr-unittests 200 TRUE
gdz-website 200 TRUE
germania-sacra-daten 200 TRUE
hoad 200 TRUE
hybrid_oa_dashboard 200 TRUE
ipoa-html-mockup 200 TRUE
ipoa-html-template 200 TRUE
metar 200 TRUE
metrics-website 200 TRUE
muggle 200 TRUE
nl-website 200 TRUE
oauni_10_18 200 TRUE
on-merrit-website 200 TRUE
openairegraph 200 TRUE
ous-print 200 TRUE
prototyp-sub-website-mobile 200 TRUE
Prototype-SUB-Website 200 TRUE
redi 200 TRUE
ROPEN 200 TRUE
scholcomm_analytics 200 TRUE
shinycaas 200 TRUE
subugoe.github.io 200 TRUE
subugoetheme 200 TRUE
Test-AdW-1 200 TRUE
website-DARIAH-EU 200 TRUE
www-2250 200 TRUE
# can't get collaborators via API b/c that would require push access to all repos
# gh::gh("GET /repos/:owner/:repo/collaborators", owner = "subugoe", repo = "2019-11-12-ugoe-carpentries", .limit = Inf)
# committers are possible, but are a bad source, b/c they include lots of outside contributors
# gh::gh("GET /repos/:owner/:repo/commits", owner = "subugoe", repo = "2019-11-12-ugoe-carpentries", .limit = Inf)