Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
actions:
patterns: ["*"]
77 changes: 77 additions & 0 deletions .github/workflows/verify-redirects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
name: Verify redirects

on:
pull_request:
paths:
- .netlify.toml
- content/version/3/0/**
- hugo.toml
- static/_redirects
- static/scripts/builder.js
push:
branches:
- release
workflow_dispatch:

permissions:
contents: read

jobs:
verify-redirects:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Hugo
run: |
HUGO_VERSION="0.155.0"
wget -q "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb" -O hugo.deb
sudo dpkg -i hugo.deb
hugo version
- name: Build site
run: hugo --quiet
- name: Verify uppercase file exists
run: |
if [ -f "public/version/3/0/code_of_conduct/CODE_OF_CONDUCT.md" ]; then
echo "::info::✓ CODE_OF_CONDUCT.md exists"
else
echo "::error::✗ CODE_OF_CONDUCT.md does NOT exist"
exit 1
fi
- name: Verify cased filenames
run: |
echo "Files generated by Hugo:"
ls -la public/version/3/0/code_of_conduct/*.md 2>/dev/null || true

if [ -f "public/version/3/0/code_of_conduct/code_of_conduct.md" ]; then
echo "::error::✗ code_of_conduct.md exists (should NOT exist)"
exit 1
else
echo "::info::✓ code_of_conduct.md does NOT exist (correct - redirect will work)"
fi

# Verify uppercase exists
if [ -f "public/version/3/0/code_of_conduct/CODE_OF_CONDUCT.md" ]; then
echo "::info::✓ CODE_OF_CONDUCT.md exists (correct)"
else
echo "::error::✗ CODE_OF_CONDUCT.md NOT found"
exit 1
fi
- name: Verify _redirects file exists
run: |
if [ -f "public/_redirects" ]; then
echo "::info::✓ _redirects file exists"
cat public/_redirects
else
echo "::error::✗ _redirects file does NOT exist"
exit 1
fi
- name: Verify redirect rule exists
run: |
if grep -q "/version/3/0/code_of_conduct/code_of_conduct.md.*CODE_OF_CONDUCT.md" public/_redirects; then
echo "::info::✓ Redirect rule found in _redirects"
else
echo "::error::✗ Redirect rule NOT found in _redirects"
exit 1
fi
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ If you are a native speaker interested in doing a translation, please follow the

1. Fork the repository and make a branch for your translation.
1. If it's a new language, add it to `config.toml`, with a localized name and language code/optional region (e.g. `pt` or `pt-br`).
1. Create a markdown file with your translation in `version/3/0/code_of_conduct.LANGUAGECODE.md`. (Underscores, not hyphens.) Use the English markdown file as an example.
1. Create a markdown file with your translation in `version/3/0/CODE_OF_CONDUCT.LANGUAGECODE.md`. (Underscores, not hyphens.) Use the English markdown file as an example.
1. Update the two fields at the top of your new markdown file: `reportingPlaceholder`, which should contain the exact placeholder text in the "how to report" section, and `enforcementPlaceholder`, which should contain the exact placeholder text in the "Addressing and Repairing Harm" section.
1. Open a pull request.
1. We will put out a call to have one or more other native speakers review the translation.
Expand Down
1 change: 1 addition & 0 deletions content/version/3/0/code_of_conduct.bn.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title = "Contributor Covenant 3"
version = "3.0"
aliases = ["/version/3/0/bn"]
slug = "code_of_conduct"
reportingPlaceholder = "[দ্রষ্টব্য: এখানে আপনার রিপোর্ট করার পদ্ধতি বর্ণনা করুন.]"
enforcementPlaceholder = "[দ্রষ্টব্য: নীচে বর্ণিত প্রতিকার ও মেরামতি প্রক্রিয়াগুলি আচরণবিধি প্রয়োগের উত্তম চর্চার উপর ভিত্তি করে পরামর্শ মাত্র। আপনার দলের নিজস্ব প্রয়োগ প্রক্রিয়া থাকলে, অনুগ্রহ করে এই অংশটি আপনার নীতিমালা অনুযায়ী সম্পাদনা করুন.]"
+++
Expand Down
1 change: 1 addition & 0 deletions content/version/3/0/code_of_conduct.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title = "Contributor Covenant 3"
version = "3.0"
aliases = ["/version/3/0/de"]
slug = "code_of_conduct"
reportingPlaceholder = "[ANMERKUNG: Beschreiben Sie hier Ihr Meldeverfahren.]"
enforcementPlaceholder = "[ANMERKUNG: Die unten aufgeführten Maßnahmen bei Verstößen und zur Wiedergutmachung sind Vorschläge basierend auf bewährten Praktiken der Durchsetzung von Verhaltenskodizes. Wenn Ihre Gemeinschaft eigene Verfahren hat, passen Sie diesen Abschnitt entsprechend an.]"
+++
Expand Down
1 change: 1 addition & 0 deletions content/version/3/0/code_of_conduct.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title = "Contributor Covenant 3"
version = "3.0"
aliases = ["/version/3/0"]
slug = "code_of_conduct"
reportingPlaceholder = "[NOTE: describe your means of reporting here.]"
enforcementPlaceholder = "[NOTE: The remedies and repairs outlined below are suggestions based on best practices in code of conduct enforcement. If your community has its own established enforcement process, be sure to edit this section to describe your own policies.]"
+++
Expand Down
1 change: 1 addition & 0 deletions content/version/3/0/code_of_conduct.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title = "Contributor Covenant 3"
version = "3.0"
aliases = ["/version/3/0/cn"]
slug = "code_of_conduct"
reportingPlaceholder = "[注意:请在此填入举报方式]"
enforcementPlaceholder = "[注意:下文所列的处理办法与补救措施,是基于行为准则执行过程中的最佳做法而提出的建议。如果你们的社区已经有既定的执行流程,请确保修改本段内容,以描述你们自己的政策。]"
+++
Expand Down
1 change: 1 addition & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ baseURL = "https://www.contributor-covenant.org"
languageCode = "en-us"
title = "Contributor Covenant"
disableKinds = ["RSS"]
disablePathToLower = true

DefaultContentLanguage = "en"
hasCJKLanguage = true
Expand Down
5 changes: 5 additions & 0 deletions static/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Redirect lowercase filename to canonical format: code_of_conduct/CODE_OF_CONDUCT.md
/version/3/0/code_of_conduct/code_of_conduct.md /version/3/0/code_of_conduct/CODE_OF_CONDUCT.md
/version/3/0/bn/code_of_conduct/code_of_conduct.md /version/3/0/bn/code_of_conduct/CODE_OF_CONDUCT.md
/version/3/0/de/code_of_conduct/code_of_conduct.md /version/3/0/de/code_of_conduct/CODE_OF_CONDUCT.md
/version/3/0/zh-cn/code_of_conduct/code_of_conduct.md /version/3/0/zh-cn/code_of_conduct/CODE_OF_CONDUCT.md
12 changes: 10 additions & 2 deletions static/scripts/builder.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
const initializeBuilder = async (languageCode, version, reportingPlaceholder, enforcementPlaceholder) => {
const versionPath = version.replace(".", "/")
const sourceUrl = window.location.href.replace("adopt/",`${languageCode.replace("en","")}/version/${versionPath}/code_of_conduct/code_of_conduct.md`)
const versionMajor = parseInt(version.split('.')[0], 10);
const filename = versionMajor >= 3 ? "CODE_OF_CONDUCT.md" : "code_of_conduct.md";
const sourceUrl = window.location.href.replace(
"adopt/",
`${languageCode.replace(
"en",
""
)}/version/${versionPath}/code_of_conduct/${filename}`
);
const content = await readTemplate(sourceUrl)

const template = document.getElementById('template')
Expand Down Expand Up @@ -220,7 +228,7 @@ const downloadBuffer = () => {

const a = document.createElement('a');
a.href = url;
a.download = "CODE_OF_CONDUCT.MD";
a.download = "CODE_OF_CONDUCT.md";
a.style.display = 'none';

document.body.appendChild(a);
Expand Down