Skip to content

Commit 984c542

Browse files
Merge pull request #129 from PovertyAction/feature/use-cc-by-sa
Use CC BY-SA as default license on all pages, make more prominent in sidebar
2 parents a19e444 + 7365a98 commit 984c542

File tree

84 files changed

+459
-1320
lines changed

Some content is hidden

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

84 files changed

+459
-1320
lines changed

.github/workflows/checks.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
- uses: actions/checkout@v5
2020
- uses: errata-ai/vale-action@v2.1.1
2121
with:
22-
reporter: github-pr-check # github-pr-check, github-pr-review, github-check
22+
reporter: github-pr-check # Alternatives: github-pr-check, github-pr-review, github-check
2323
fail_on_error: false
24-
filter_mode: file # added, diff_context, file, nofilter
25-
vale_flags: "--no-exit --minAlertLevel=error --glob=*.qmd"
24+
filter_mode: diff_context # Alternatives: added, diff_context, file, nofilter
25+
vale_flags: "--minAlertLevel=error"
26+
files: '["data-cleaning/", "data-collection/", "data-quality/", "data-security/", "research-design/", "research-ethics/", "software/", "index.qmd"]'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,5 @@ rsconnect/
227227
.claude/
228228

229229
**/*.quarto_ipynb
230+
231+
/.luarc.json

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"[quarto]": {
99
"editor.formatOnSave": true,
10-
"editor.defaultFormatter": "Posit.air-vscode",
10+
"editor.defaultFormatter": "quarto.quarto",
1111
"editor.wordWrap": "on"
1212
},
1313
"[r]": {

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
C:/Users/NKeleher/code/ipa-research-data-science-hub/CLAUDE.md

CLAUDE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ All `.qmd` files need:
4747

4848
- `title`: Page title
4949
- `abstract`: Page description
50-
- `date: last-modified`: Auto-update modification date
5150
- `authors-ipa`: List of main content creators
5251
- `contributors`: List of supporting contributors
5352
- `keywords`: List of research and data science keywords, including the type of documentation within the Diataxis Framework.
54-
- `license`: "CC BY" unless otherwise specified
53+
- `license`: "CC BY-SA" unless otherwise specified
5554

5655
Always move the `:::{.custom-summary-block}...:::` to the abstract and provide readability improvements.
5756

CONTRIBUTING.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Science Hub:
2121
2. **Update existing content**: Improve or expand existing
2222
documentation
2323
3. **Fix typos or errors**: Help maintain high-quality content
24-
4. **Suggest improvements**: Open issues for content or features youd
24+
4. **Suggest improvements**: Open issues for content or features you'd
2525
like to see
2626
5. **Enhance functionality**: Contribute to the technical
2727
infrastructure of the Hub
@@ -52,7 +52,7 @@ small, helps improve the Hub for everyone.
5252

5353
The IPA Global Research and Data Science team reviews any content you
5454
add or modify before publication on the Hub. This ensures that all
55-
content meets quality standards and aligns with the Hubs goals.
55+
content meets quality standards and aligns with the Hub's goals.
5656

5757
- The team uses IPA writing guidelines to ensure that all content is
5858
clear, concise, and accessible.
@@ -67,7 +67,7 @@ automatically published on the Hub.
6767
## Git Development Workflow
6868

6969
If you want to contribute code or content, this project uses Git for
70-
version control and collaboration. Heres a quick overview of the
70+
version control and collaboration. Here's a quick overview of the
7171
workflow:
7272

7373
### Branching Strategy
@@ -94,7 +94,7 @@ just get-started
9494
```
9595

9696
This will install all required software and create a Python virtual
97-
environment. Note that you may need to install `Just` if you dont have
97+
environment. Note that you may need to install `Just` if you don't have
9898
it already.
9999

100100
``` bash
@@ -198,7 +198,6 @@ Example YAML frontmatter:
198198
---
199199
title: "My New Page"
200200
description: "Description of the page content"
201-
date: last-modified
202201
203202
204203
#------------------------------------------------------------------

CONTRIBUTING.qmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ abstract: |
55
to the IPA Research and Data Science Hub. This guide covers the development
66
workflow, writing standards, content creation process, and technical
77
requirements for contributors.
8-
date: last-modified
98
format:
109
html: default
1110
gfm: default
@@ -52,7 +51,7 @@ Before publication, a site administrator conducts a final review to ensure new c
5251

5352
## Git Development Workflow
5453

55-
If you want to contribute code or content, this project uses Git for version control and collaboration. Heres a quick overview of the workflow:
54+
If you want to contribute code or content, this project uses Git for version control and collaboration. Here's a quick overview of the workflow:
5655

5756
### Branching Strategy
5857

@@ -176,7 +175,6 @@ Example YAML frontmatter:
176175
---
177176
title: "My New Page"
178177
description: "Description of the page content"
179-
date: last-modified
180178

181179

182180
#------------------------------------------------------------------
@@ -204,7 +202,9 @@ contributors:
204202
- "Contributor 3"
205203

206204
keywords: ["keyword1", "keyword2", "keyword3"]
207-
license: "CC BY"
205+
license:
206+
text: "CC BY-SA"
207+
url: https://creativecommons.org/licenses/by-sa/4.0/
208208
---
209209
```
210210

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ Section 8 -- Interpretation.
369369
Creative Commons is not a party to its public licenses.
370370
Notwithstanding, Creative Commons may elect to apply one of its public
371371
licenses to material it publishes and in those instances will be
372-
considered the Licensor. The text of the Creative Commons public
372+
considered the "Licensor." The text of the Creative Commons public
373373
licenses is dedicated to the public domain under the CC0 Public Domain
374374
Dedication. Except for the limited purpose of indicating that material
375375
is shared under a Creative Commons public license or as otherwise
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: Git Dates
2+
author: IPA Research and Data Science Hub
3+
version: 1.0.0
4+
quarto-required: ">=1.2.0"
5+
contributes:
6+
filters:
7+
- git-dates.lua
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
--[[
2+
Quarto filter to set date-modified from git commit history.
3+
4+
This filter runs during Quarto rendering and sets the date-modified
5+
metadata field based on the last git commit for each document.
6+
]]--
7+
8+
local function get_git_date(file_path)
9+
-- Get the last commit date for the file
10+
local command = 'git log -1 --format=%cI -- "' .. file_path .. '"'
11+
local handle = io.popen(command)
12+
local result = handle:read("*a")
13+
handle:close()
14+
15+
-- Trim whitespace
16+
result = result:gsub("^%s*(.-)%s*$", "%1")
17+
18+
if result ~= "" then
19+
-- Parse ISO date
20+
local year, month, day = result:match("(%d%d%d%d)%-(%d%d)%-(%d%d)")
21+
if year and month and day then
22+
-- Format as "MMMM D, YYYY" (e.g., "October 14, 2025")
23+
local months = {
24+
"January", "February", "March", "April", "May", "June",
25+
"July", "August", "September", "October", "November", "December"
26+
}
27+
local month_name = months[tonumber(month)]
28+
local day_num = tonumber(day)
29+
30+
return month_name .. " " .. day_num .. ", " .. year
31+
end
32+
end
33+
34+
return nil
35+
end
36+
37+
-- This runs after Quarto processes metadata, so we need to set date-modified
38+
-- regardless of what's already there
39+
function Meta(meta)
40+
-- Get the input file path
41+
local input_file = quarto.doc.input_file
42+
43+
if not input_file then
44+
return meta
45+
end
46+
47+
-- Get git date for this file
48+
local git_date = get_git_date(input_file)
49+
50+
if git_date then
51+
-- Set date-modified to the git commit date
52+
-- Use MetaString so Quarto can format it
53+
meta["date-modified"] = pandoc.MetaString(git_date)
54+
else
55+
-- Fallback: use current date if no git history
56+
meta["date-modified"] = pandoc.MetaString(os.date("%Y-%m-%d"))
57+
end
58+
59+
return meta
60+
end

0 commit comments

Comments
 (0)