rust-lang / prev.rust-lang.org

The previous Rust website. The current website's code is at https://github.com/rust-lang/www.rust-lang.org.
https://prev.rust-lang.org
Apache License 2.0
151 stars 340 forks source link

Rewriting moderation team links as reference-style links #1023

Closed davidalber closed 6 years ago

davidalber commented 6 years ago

This PR pulls instances of /team.html#Moderation-team into reference-style links (i.e., /team.html#Moderation-team appears once in a file and is referenced by a variable). The motivation here is to make the www code of conduct and the Rust repository code of conduct more similar.

Going further, the motivation for that similarity is to make it easier to write automation that identifies when the www code of conduct becomes out of sync with the code of conduct in any code repository. I've nearly finished setting that up in rust-conduct-conformulator. If this is merged, I expect the tests there to begin passing.

This change should not alter the markup generated by Jekyll. I've verified that by running the following.

for l in de-DE en-US es-ES fr-FR id-ID it-IT ja-JP ko-KR pt-BR sv-SE vi-VN zh-CN; do
    o=`curl -s https://www.rust-lang.org/$l/conduct.html | sed -e 's/<!-- Page last generated .*-->//'`
    m=`curl -s http://127.0.0.1:4001/$l/conduct.html | sed -e 's/<!-- Page last generated .*-->//'`
    printf "Diffing %s/conduct.html..." $l
    if diff <(echo $o) <(echo $m) > /dev/null; then
        printf "OK\n"
    else
        printf "FAIL\n"
    fi
done

That script diffs the markdown for each translation's code of conduct page in prod with the page generated by the local server. It first alters the pages by removing the "last generated" comment from the markup.

Here's what I get when running that script on this change:

Diffing de-DE/conduct.html...OK
Diffing en-US/conduct.html...OK
Diffing es-ES/conduct.html...OK
Diffing fr-FR/conduct.html...OK
Diffing id-ID/conduct.html...OK
Diffing it-IT/conduct.html...OK
Diffing ja-JP/conduct.html...OK
Diffing ko-KR/conduct.html...OK
Diffing pt-BR/conduct.html...OK
Diffing sv-SE/conduct.html...OK
Diffing vi-VN/conduct.html...OK
Diffing zh-CN/conduct.html...OK
davidalber commented 6 years ago

r? @steveklabnik