Skip to content

Commit 037e383

Browse files
committed
Use native Hugo templating to generate crosswalks
Instead of .Rmd files, which require having .html files as input to Hugo, which need to be committed to git. This makes it easier to keep the website up-to-date with the main crosswalk. This also updates `.github/workflows/deploy.yml` to run daily, in order to apply such changes from github.com/codemeta/codemeta without the need for specific commits in this repository (github.com/codemeta/codemeta.github.io/)
1 parent ed5b6be commit 037e383

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+219
-2655
lines changed

.github/workflows/check.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
# Runs on pushes targeting any branch and on pull requests
55
push:
66
pull_request:
7+
schedule:
8+
# rebuild every day at 2:13 UTC, to apply any change to the crosswalk
9+
# table made in https://github.com/codemeta/codemeta
10+
- cron: "13 2 * * *"
711

812
# Allows you to run this workflow manually from the Actions tab
913
workflow_dispatch:

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
- name: Setup Pages
3737
id: pages
3838
uses: actions/configure-pages@v3
39+
- name: Prepare data files
40+
run: |
41+
make
3942
- name: Build with Hugo
4043
env:
4144
# For maximum backward compatibility with Hugo modules

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
all: data/crosswalk.json
2+
3+
# Download the latest crosswalk
4+
data/crosswalk.csv:
5+
wget https://github.com/codemeta/codemeta/raw/master/crosswalk.csv -O data/crosswalk.csv
6+
7+
# Convert crosswalk.csv to crosswalk.json so Hugo can parse it
8+
data/crosswalk.json: data/crosswalk.csv
9+
python3 scripts/crosswalk_to_json.py

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CodeMeta Website
22

3-
This website is written in [Hugo](https://hugodocs.info). Hugo is the static website engine behind the wonderful RStudio package `blogdown`, and is fast, popular, and easy to install and theme. See the [Hugo docs](https://hugodocs.info) for a quick orientation on how the site is organized. `blogdown` makes it easy to run Hugo from the RStudio editor and include R code in `.Rmd` content in Hugo sites.
3+
This website is written in [Hugo](https://hugodocs.info). Hugo is a static website engine, which is fast, popular, and easy to install and theme. See the [Hugo docs](https://hugodocs.info) for a quick orientation on how the site is organized.
44

5-
To build and preview the site from RStudio, just use `blogdown::serve_site()`. `blogdown::install_hugo()` will get you set up the first time.
5+
Before building the site, you should run the `make` command, in order to download the crosswalk locally; which is used by Hugo to generate the content of crosswalk pages.
6+
7+
Then, at your option:
8+
9+
* To build the site to `../website`, run `hugo`. You may then open that folder in your browser, or
10+
* To previous the site directly without RStudio, run `hugo serve`, which will make the site available at http://localhost:1313/

content/crosswalk/R.Rmd

Lines changed: 0 additions & 19 deletions
This file was deleted.

content/crosswalk/R.html

Lines changed: 0 additions & 159 deletions
This file was deleted.

content/crosswalk/R.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: "Crosswalk for R Packages"
3+
image: "/img/R.png"
4+
date: "2017-06-01"
5+
---
6+
7+
The following table displays the crosswalk mapping of terms from the R package DESCRIPTION file to codemeta properties.
8+
9+
{{< crosswalk name="R Package Description" >}}

content/crosswalk/datacite.Rmd

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)