Skip to content
Open
39 changes: 38 additions & 1 deletion .github/workflows/data-processing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,32 @@ jobs:
exit 1
fi

#========================================
# Update FReD citation (Weekly or Manual)
#========================================
- name: Update FReD Citation
continue-on-error: true # Continue even if this step fails
run: |
echo "=== Updating FReD citation ==="

# Check if it's a Sunday (day 0) OR manually triggered
CURRENT_DAY_OF_WEEK=$(date +%u)
if [ "$CURRENT_DAY_OF_WEEK" != "7" ] && [ "${{ github.event_name }}" != "workflow_dispatch" ]; then
echo "ℹ️ Skipping FReD citation update (not Sunday and not manual trigger)"
exit 0
fi

echo "🔄 Running FReD citation update..."
python3 scripts/update_fred_citation.py

if [ -f "static/data/fred_citation.txt" ]; then
echo "✅ FReD citation updated successfully"
echo "Citation length: $(wc -c < static/data/fred_citation.txt) bytes"
else
echo "❌ FReD citation file was not created"
exit 1
fi

#=======================================================
# Create a pull request for GA data updates on monthly runs
#=======================================================
Expand Down Expand Up @@ -320,6 +346,7 @@ jobs:
content/curated_resources/
content/glossary/
data/
static/data/
content/contributor-analysis/
content/publications/citation_chart.webp
retention-days: 7
Expand All @@ -342,6 +369,12 @@ jobs:
cp content/contributors/tenzing.md /tmp/generated-resources/ || true
cp data/ga_data.json /tmp/generated-resources/ga_data.json || true

# Copy FReD citation if it exists
if [ -f static/data/fred_citation.txt ]; then
mkdir -p /tmp/generated-resources/static/data
cp static/data/fred_citation.txt /tmp/generated-resources/static/data/fred_citation.txt
fi

# Copy additional generated files
mkdir -p /tmp/generated-resources/contributor-analysis
cp -r content/contributor-analysis/* /tmp/generated-resources/contributor-analysis/ || true
Expand Down Expand Up @@ -373,7 +406,7 @@ jobs:
pushd "$WORKTREE_DIR"

# Ensure target directories exist
mkdir -p content/curated_resources content/contributors data content/contributor-analysis content/publications
mkdir -p content/curated_resources content/contributors data content/contributor-analysis content/publications static/data

# Remove old generated resource files (but keep _index.md)
find content/curated_resources -type f ! -name '_index.md' -delete 2>/dev/null || true
Expand All @@ -389,6 +422,9 @@ jobs:
if [ -f /tmp/generated-resources/ga_data.json ]; then
cp /tmp/generated-resources/ga_data.json data/ga_data.json
fi
if [ -f /tmp/generated-resources/static/data/fred_citation.txt ]; then
cp /tmp/generated-resources/static/data/fred_citation.txt static/data/fred_citation.txt
fi
if [ -f /tmp/generated-resources/summaries.json ]; then
cp /tmp/generated-resources/summaries.json data/summaries.json
fi
Expand Down Expand Up @@ -417,6 +453,7 @@ jobs:
git add content/curated_resources/ 2>/dev/null || true
git add content/contributors/tenzing.md 2>/dev/null || true
git add data/ga_data.json 2>/dev/null || true
git add static/data/fred_citation.txt 2>/dev/null || true
git add data/summaries.json 2>/dev/null || true
git add content/contributor-analysis/ 2>/dev/null || true
git add content/publications/citation_chart.webp 2>/dev/null || true
Expand Down
35 changes: 22 additions & 13 deletions layouts/shortcodes/cite-us.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
<link rel="stylesheet" href="{{ " css/cite_us.css" | relURL }}">
{{ end }}

{{/* Load FReD citation from text file or use fallback */}}
{{ $fredCitation := "" }}
{{ $citationFile := "static/data/fred_citation.txt" }}
{{ if fileExists $citationFile }}
{{ $fredCitation = readFile $citationFile }}
{{/* Remove leading/trailing whitespace manually */}}
{{ $fredCitation = trim $fredCitation " \n\r\t" }}
{{ else }}
{{ $fredCitation = print "Wallrich, L.*, & Röseler, L.*, Hartmann, H., Ashcroft-Jones, S., Doetsch, C., Kaiser, L., Schüller, S. M., Aldoh, A., Behbood, H., Elsherif, M. M., Klett, N., Krapp, J., Liu, M., Pavlović, Z., Pennington, C. R., Schütz, A., Seida, C., Siziva, K., Skvortsova, A., Aczel, B., Adelina, N., Agostini, V., Al-Hoorie, A. H., Alarie, S., Albayrak-Aydemir, N., Alzahawi, S., Anvari, F., Arriaga, P., Baker, B. J., Barth, C. L., Bauer, D. J., Becker, R., Beitner, J., Belaus, A., Bhatt, H., Bhogal, J., Boyce, V., Breemer, L., Brick, C., Brohmer, H., Brummernhenrich, B., Budd, E., Butler, A., Casula, A., Chandrashekar, S. P., Chen, S., Chung, K. L., Cockcroft, J. P., Crowe, P., Cummins, J., Daniel, A., Deane, O., Deressa, T. K., Dienlin, T., Diveica, V., Draguns, A., Dumbalska, T., Efendic, E., El Halabi, M., Enright, S., Evans, T. R., Exner, A., Farrar, B. G., Feldman, G., Fillon, A., Floyd, J., Fontana Vieira, F., Frese, J., Förster, N., Gattie, M. C., Gemmecke, C., Genschow, O., Giannouli, V., Gjoneska, B., Gnambs, T., Gourdon-Kanhukamwe, A., Graham, C. J., Greshake Tzovaras, B., Guay, S., Hausenloy, J., Haviva, C., Henderson, E. L., Herderich, A., Hilbert, L., Holgado, D., Hussey, I., Höfer, L., Ilchovska, Z. G., Imada, H., Imwene, P., Izydorczak, K., Jaubert, S., Jeftić, A., Kalandadze, T., Kamermans, K., Karhulahti, V., Kasseckert, L., Kastrinogiannis, A., Klingelhöfer-Jens, M., Kocalar, H. E., Koppel, L., Koppold, A., Korbmacher, M., Kujawa, Z., Kulke, L., Kumar, P., Kuper, N., LaPlume, A. A., Lach, R., Lecuona, O., Lee, J., Leech, G., Leksina, E., Lin, C., Liu, Y., Lohkamp, F., Lou, N. M., Lynott, D., Mackinnon, S., Maier, M., Maiya, S., Makel, M. C., Manrique-Castano, D., Manríquez-Robles, D., Mathes, L., McSharry, D., Meidenbauer, K. L., Meier, M., Micheli, L., Miller, T., Montefinese, M., Moreau, D., Moser, N., Mrkva, K., Murphy, J., Muthu, J., Narkar, N., Nemcova, M., Nádvorník, J., O'Mahoney, R., O'Mahony, A., Oberholzer, Y., Oomen, D., Osano, M., Otstavnov, N., Packheiser, J., Pandey, S., Panton, H., Papenmeier, F., Parsons, S., Paruzel-Czachura, M., Pavlov, Y. G., Pittelkow, M., Plomp, W., Plonski, P. E., Pravednikov, A., Pronizius, E., Pua, A., Pypno-Blajda, K., Rausch, M., Raza, H., Reason, R., Rebholz, T. R., Resulbegoviq, H., Richert, E., Ross, R. M., Russo, S., Röer, J. P., Sandkühler, J. F., Schmidt, K., Sempere, N., Sobolak, R., Sperl, M. F., Stevens, J. R., Stogianni, M., Szekely, R., Tan, A. W., Thürmer, J. L., Tiulpakova, M., Tomczak, J., Tołopiło, A., Tunca, B., Vanpaemel, W., Vaughn, L. A., Verheyen, S., Vineyard, G. H., Weber, L., Weinberg, A., Wingen, S., Wolska, J., Yeung, S. K., Younssi, M., Zaneva, M., Zimmermann, D., Azevedo, F. (2026). FORRT Library of Replication Attempts (FLoRA) [Data set]. OSF. <a href=\"doi.org/10.17605/OSF.IO/9R62X\">doi.org/10.17605/OSF.IO/9R62X </a> <br> * These authors contributed equally to this work." }}
{{ end }}

<div class="cite-us-section">
<h4 class="section-title">If you want to cite FORRT, in general, cite:</h4>

Expand Down Expand Up @@ -46,17 +57,18 @@ <h4 class="section-title">If you want to cite FORRT, in general, cite:</h4>
</div>
</div>


<div class="cite-us-section">
<h4 class="section-title">If you want to cite FReD, cite:</h4>
<h4 class="section-title">Citational Justice Toolkit:</h4>

<div class="cite-us-item">
<div class="cite-us-text">
Röseler, L., Kaiser, L., Doetsch, C., Klett, N., Seida, C., Schütz, A., Aczel, B., Adelina, N., Agostini,
V., Alarie, S., ... , Zaneva, M., & Zhang, Y. (2024). The Replication Database: Documenting the
Replicability of Psychological Science. Journal of Open Psychology Data, 12: 8, pp. 1–23.
<a href="https://doi.org/10.5334/jopd.101" class="doi-link">DOI: https://doi.org/10.5334/jopd.101</a>
Sauvé, S. A., Middleton, S. L., Gellersen, H., & Azevedo, F. (2025, July 31). In Pursuit of Citational
Justice: A Toolkit for Equitable Scholarship. https://doi.org/10.31222/osf.io/qjecy_v2
<a href="https://doi.org/10.31222/osf.io/qjecy_v2" class="doi-link">DOI:
https://doi.org/10.31222/osf.io/qjecy_v2</a>
</div>
<button class="copy-button" onclick="copyText(this, 'fred')">
<button class="copy-button" onclick="copyText(this, 'citational_justice_toolkit')">
<svg class="copy-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">
Expand All @@ -68,16 +80,13 @@ <h4 class="section-title">If you want to cite FReD, cite:</h4>
</div>

<div class="cite-us-section">
<h4 class="section-title">Citational Justice Toolkit:</h4>
<h4 class="section-title">If you want to cite FReD, cite:</h4>

<div class="cite-us-item">
<div class="cite-us-text">
Sauvé, S. A., Middleton, S. L., Gellersen, H., & Azevedo, F. (2025, July 31). In Pursuit of Citational
Justice: A Toolkit for Equitable Scholarship. https://doi.org/10.31222/osf.io/qjecy_v2
<a href="https://doi.org/10.31222/osf.io/qjecy_v2" class="doi-link">DOI:
https://doi.org/10.31222/osf.io/qjecy_v2</a>
{{ $fredCitation | safeHTML }}
</div>
<button class="copy-button" onclick="copyText(this, 'citational_justice_toolkit')">
<button class="copy-button" onclick="copyText(this, 'fred')">
<svg class="copy-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z">
Expand All @@ -92,7 +101,7 @@ <h4 class="section-title">Citational Justice Toolkit:</h4>
const citations = {
forrt1: "Azevedo, F., Parsons, S., Micheli, L., Strand, J., Rinke, E., … & FORRT (2019, December 13). Introducing a Framework for Open and Reproducible Research Training (FORRT). https://doi.org/10.31219/osf.io/bnh7p",
forrt2: "Azevedo, F., Liu, M., Pennington, C. R., Pownall, M., Evans, T. R., Parsons, S., Elsherif, M. M., Micheli, L., Westwood, S., & FORRT. (2021). Towards a culture of open scholarship: The role of pedagogical communities. BMC Research Notes, 15(1), 1-5. https://doi.org/10.1186/s13104-022-05944-1",
fred: "Röseler, L., Kaiser, L., Doetsch, C., Klett, N., Seida, C., Schütz, A., Aczel, B., Adelina, N., Agostini, V., Alarie, S., ... , Zaneva, M., & Zhang, Y. (2024). The Replication Database: Documenting the Replicability of Psychological Science. Journal of Open Psychology Data, 12: 8, pp. 1–23. DOI: https://doi.org/10.5334/jopd.101",
fred: {{ $fredCitation | jsonify }},
citational_justice_toolkit: "Sauvé, S. A., Middleton, S. L., Gellersen, H., & Azevedo, F. (2025, July 31). In Pursuit of Citational Justice: A Toolkit for Equitable Scholarship. https://doi.org/10.31222/osf.io/qjecy_v2"
};

Expand Down
112 changes: 112 additions & 0 deletions scripts/update_fred_citation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#!/usr/bin/env python3
"""
Script to fetch and update the FReD citation from the FReD-data repository.

This script downloads the latest citation from:
https://raw.githubusercontent.com/forrtproject/FReD-data/refs/heads/main/output/citation.txt

And saves it to static/data/fred_citation.txt for use in the cite_us page.
"""

import sys
import logging
from pathlib import Path
from urllib import request
from urllib.error import URLError

# Set up logging
logging.basicConfig(
level=logging.INFO,
format='%(levelname)s: %(message)s'
)
logger = logging.getLogger(__name__)

# Constants
CITATION_URL = "https://raw.githubusercontent.com/forrtproject/FReD-data/refs/heads/main/output/citation.txt"
OUTPUT_FILE = "static/data/fred_citation.txt"

def fetch_fred_citation():
"""
Fetch the FReD citation from the GitHub repository.

Returns:
str: The citation text, or None if fetch failed
"""
try:
logger.info(f"Fetching FReD citation from {CITATION_URL}")
with request.urlopen(CITATION_URL, timeout=10) as response:
citation = response.read().decode('utf-8')
logger.info("Successfully fetched FReD citation")
return citation
except URLError as e:
logger.error(f"Failed to fetch citation: {e}")
return None
except Exception as e:
logger.error(f"Unexpected error while fetching citation: {e}")
return None

def save_citation(citation, output_path):
"""
Save the citation to a text file.

Args:
citation: The citation text to save
output_path: Path where to save the citation

Returns:
bool: True if successful, False otherwise
"""
try:
output_file = Path(output_path)
output_file.parent.mkdir(parents=True, exist_ok=True)

# Post-process citation to match required format
# Replace DOI URL with HTML link and append note if not present
import re
# Find DOI URL (assume starts with https://doi.org/)
citation = citation.strip()
# Remove any trailing note
citation_main = citation
note = "* These authors contributed equally to this work."
if "* These authors contributed equally to this work." in citation:
citation_main = citation.split("* These authors contributed equally to this work.")[0].strip()

# Replace DOI URL with HTML link
doi_pattern = r'(https://doi\.org/[\w\./-]+)'
def repl(match):
url = match.group(1)
return f'<a href="{url}">{url}</a>'
citation_main = re.sub(doi_pattern, repl, citation_main)

# Compose final citation
citation_final = citation_main + "\n\n" + note + "\n"

with open(output_file, 'w', encoding='utf-8') as f:
f.write(citation_final)

logger.info(f"Successfully saved citation to {output_path}")
return True
except Exception as e:
logger.error(f"Failed to save citation: {e}")
return False

def main():
"""Main function to fetch and save the FReD citation."""
logger.info("Starting FReD citation update")

# Fetch citation
citation = fetch_fred_citation()
if not citation:
logger.error("Failed to fetch citation, exiting")
return 1

# Save citation
if not save_citation(citation, OUTPUT_FILE):
logger.error("Failed to save citation, exiting")
return 1

logger.info("FReD citation update completed successfully")
return 0

if __name__ == "__main__":
sys.exit(main())
3 changes: 3 additions & 0 deletions static/data/fred_citation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Wallrich, L.*, & Röseler, L.*, Hartmann, H., Ashcroft-Jones, S., Doetsch, C., Kaiser, L., Schüller, S. M., Aldoh, A., Behbood, H., Elsherif, M. M., Klett, N., Krapp, J., Liu, M., Pavlović, Z., Pennington, C. R., Schütz, A., Seida, C., Siziva, K., Skvortsova, A., Aczel, B., Adelina, N., Agostini, V., Al-Hoorie, A. H., Alarie, S., Albayrak-Aydemir, N., Alzahawi, S., Anvari, F., Arriaga, P., Baker, B. J., Barth, C. L., Bauer, D. J., Becker, R., Beitner, J., Belaus, A., Bhatt, H., Bhogal, J., Boyce, V., Breemer, L., Brick, C., Brohmer, H., Brummernhenrich, B., Budd, E., Butler, A., Casula, A., Chandrashekar, S. P., Chen, S., Chung, K. L., Cockcroft, J. P., Crowe, P., Cummins, J., Daniel, A., Deane, O., Deressa, T. K., Dienlin, T., Diveica, V., Draguns, A., Dumbalska, T., Efendic, E., El Halabi, M., Enright, S., Evans, T. R., Exner, A., Farrar, B. G., Feldman, G., Fillon, A., Floyd, J., Fontana Vieira, F., Frese, J., Förster, N., Gattie, M. C., Gemmecke, C., Genschow, O., Giannouli, V., Gjoneska, B., Gnambs, T., Gourdon-Kanhukamwe, A., Graham, C. J., Greshake Tzovaras, B., Guay, S., Hausenloy, J., Haviva, C., Henderson, E. L., Herderich, A., Hilbert, L., Holgado, D., Hussey, I., Höfer, L., Ilchovska, Z. G., Imada, H., Imwene, P., Izydorczak, K., Jaubert, S., Jeftić, A., Kalandadze, T., Kamermans, K., Karhulahti, V., Kasseckert, L., Kastrinogiannis, A., Klingelhöfer-Jens, M., Kocalar, H. E., Koppel, L., Koppold, A., Korbmacher, M., Kujawa, Z., Kulke, L., Kumar, P., Kuper, N., LaPlume, A. A., Lach, R., Lecuona, O., Lee, J., Leech, G., Leksina, E., Lin, C., Liu, Y., Lohkamp, F., Lou, N. M., Lynott, D., Mackinnon, S., Maier, M., Maiya, S., Makel, M. C., Manrique-Castano, D., Manríquez-Robles, D., Mathes, L., McSharry, D., Meidenbauer, K. L., Meier, M., Micheli, L., Miller, T., Montefinese, M., Moreau, D., Moser, N., Mrkva, K., Murphy, J., Muthu, J., Narkar, N., Nemcova, M., Nádvorník, J., O'Mahoney, R., O'Mahony, A., Oberholzer, Y., Oomen, D., Osano, M., Otstavnov, N., Packheiser, J., Pandey, S., Panton, H., Papenmeier, F., Parsons, S., Paruzel-Czachura, M., Pavlov, Y. G., Pittelkow, M., Plomp, W., Plonski, P. E., Pravednikov, A., Pronizius, E., Pua, A., Pypno-Blajda, K., Rausch, M., Raza, H., Reason, R., Rebholz, T. R., Resulbegoviq, H., Richert, E., Ross, R. M., Russo, S., Röer, J. P., Sandkühler, J. F., Schmidt, K., Sempere, N., Sobolak, R., Sperl, M. F., Stevens, J. R., Stogianni, M., Szekely, R., Tan, A. W., Thürmer, J. L., Tiulpakova, M., Tomczak, J., Tołopiło, A., Tunca, B., Vanpaemel, W., Vaughn, L. A., Verheyen, S., Vineyard, G. H., Weber, L., Weinberg, A., Wingen, S., Wolska, J., Yeung, S. K., Younssi, M., Zaneva, M., Zimmermann, D., Azevedo, F. (2026). FORRT Library of Replication Attempts (FLoRA) [Data set]. OSF. <a href="https://doi.org/10.17605/OSF.IO/9R62X">https://doi.org/10.17605/OSF.IO/9R62X</a>

* These authors contributed equally to this work.
Loading