Skip to content

Commit

Permalink
Merge pull request #45 from progval/build-crosswalks
Browse files Browse the repository at this point in the history
Use native Hugo templating to generate crosswalks
  • Loading branch information
moranegg authored Sep 8, 2023
2 parents 1e65e0e + 54a7093 commit cbf3c9d
Show file tree
Hide file tree
Showing 51 changed files with 222 additions and 2,655 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
# Runs on pushes targeting any branch and on pull requests
push:
pull_request:
schedule:
# rebuild every day at 2:13 UTC, to apply any change to the crosswalk
# table made in https://github.com/codemeta/codemeta
- cron: "13 2 * * *"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -21,6 +25,9 @@ jobs:
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y hugo
- name: Checkout
uses: actions/checkout@v3
- name: Prepare data files
run: |
make
- name: Build with Hugo
run: |
hugo
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Prepare data files
run: |
make
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
all: data/crosswalk.json

# Download the latest crosswalk
data/crosswalk.csv:
wget https://github.com/codemeta/codemeta/raw/master/crosswalk.csv -O data/crosswalk.csv

# Convert crosswalk.csv to crosswalk.json so Hugo can parse it
data/crosswalk.json: data/crosswalk.csv
python3 scripts/crosswalk_to_json.py
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CodeMeta Website

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

To build and preview the site from RStudio, just use `blogdown::serve_site()`. `blogdown::install_hugo()` will get you set up the first time.
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.

Then, at your option:

* To build the site to `../website`, run `hugo`. You may then open that folder in your browser, or
* To previous the site directly without RStudio, run `hugo serve`, which will make the site available at http://localhost:1313/
19 changes: 0 additions & 19 deletions content/crosswalk/R.Rmd

This file was deleted.

159 changes: 0 additions & 159 deletions content/crosswalk/R.html

This file was deleted.

9 changes: 9 additions & 0 deletions content/crosswalk/R.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: "Crosswalk for R Packages"
image: "/img/R.png"
date: "2017-06-01"
---

The following table displays the crosswalk mapping of terms from the R package DESCRIPTION file to codemeta properties.

{{< crosswalk name="R Package Description" >}}
21 changes: 0 additions & 21 deletions content/crosswalk/datacite.Rmd

This file was deleted.

Loading

0 comments on commit cbf3c9d

Please sign in to comment.