Skip to content

Commit 6273417

Browse files
committed
fix 2017 social media links--thank you @xolotl for reporting these issues
1 parent 5760a70 commit 6273417

11 files changed

+44
-27
lines changed

bin/create_static_site.sh

+24-7
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ function _change_to_repo_dir {
2121
}
2222

2323

24-
function _recreate_docs_dir {
24+
function _wipe_and_recreate_docs_dir {
25+
printf "\e[1m\e[7m %-80s\e[0m\n" 'Wipe and recreate docs/ directory'
2526
rm -rf docs/*
2627
cp -a temp_download/* docs/
2728
touch docs/.nojekyll
2829
printf 'dev-stateof.creativecommons.org' > docs/CNAME
30+
echo
2931
}
3032

3133

@@ -92,6 +94,19 @@ function _update_licensebuttons_domain {
9294
}
9395

9496

97+
function _fix_social_media_links {
98+
printf "\e[1m\e[7m %-80s\e[0m\n" 'Fix 2017 Social Media links'
99+
for _file in $(find docs -maxdepth 1 -type f -name '*.html')
100+
do
101+
${SED} --regexp-extended \
102+
-e's#^(<a.*elementor-social-icon-facebook" href=")[^"]+(" target="_blank">)#\1https://www.facebook.com/creativecommons\2#g' \
103+
-e's#^(<a.*elementor-social-icon-twitter" href=")[^"]+(" target="_blank">)#\1https://twitter.com/creativecommons\2#g' \
104+
--in-place "${_file}"
105+
done
106+
echo
107+
}
108+
109+
95110
function _replace_full_urls_with_absolute_paths {
96111
printf "\e[1m\e[7m %-80s\e[0m\n" 'Replace full URLs with absolute paths'
97112
# Non-escaped URLs with protocol
@@ -102,22 +117,23 @@ function _replace_full_urls_with_absolute_paths {
102117
for _file in $(grep --files-with-matches --max-count=1 \
103118
--recursive "${_pattern}" docs)
104119
do
105-
${SED} --in-place -e"s#${_pattern}#/#g" "${_file}"
120+
${SED} -e"s#${_pattern}#/#g" --in-place "${_file}"
106121
done
107122
done
108123
# Non-escaped URLs without protocol
109124
_pattern='//stateof\.creativecommons\.org/'
110125
for _file in $(grep --files-with-matches --max-count=1 \
111126
--recursive "${_pattern}" docs)
112127
do
113-
${SED} --in-place -e"s#${_pattern}#/#g" "${_file}"
128+
${SED} -e"s#${_pattern}#/#g" --in-place "${_file}"
114129
done
115130
# Escaped URL
116131
for _file in $(grep --fixed-strings --files-with-matches --max-count=1 \
117132
--recursive 'https:\/\/stateof.creativecommons.org\/' docs)
118133
do
119-
${SED} --in-place \
120-
-e's#https:\\/\\/stateof\.creativecommons\.org\\/#\\/#g' "${_file}"
134+
${SED} \
135+
-e's#https:\\/\\/stateof\.creativecommons\.org\\/#\\/#g' \
136+
--in-place "${_file}"
121137
done
122138
echo
123139
}
@@ -155,7 +171,7 @@ function _cleanup_plaintext_whitespace {
155171
for _file in $(find docs -type f \
156172
\( -name '*.css' -o -name '*.html' -o -name '*.js' \))
157173
do
158-
${SED} --in-place -e's#[ \t]\+$##' "${_file}"
174+
${SED} -e's#[ \t]\+$##' --in-place "${_file}"
159175
done
160176
echo
161177
}
@@ -168,10 +184,11 @@ function _cleanup_orig_file_backups {
168184

169185

170186
_change_to_repo_dir # must be called first
171-
_recreate_docs_dir
187+
_wipe_and_recreate_docs_dir
172188
_remove_lines_from_html_files
173189
_restore_query_strings_in_html_files
174190
_update_licensebuttons_domain
191+
_fix_social_media_links
175192
_replace_full_urls_with_absolute_paths
176193
_revert_non_html_conversions
177194
_cleanup_plaintext_whitespace

docs/data-notes-and-sources-2017.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@
181181
<div data-id="7dc884fa" class="elementor-element elementor-element-7dc884fa elementor-shape-circle elementor-widget elementor-widget-social-icons" data-element_type="social-icons.default">
182182
<div class="elementor-widget-container">
183183
<div class="elementor-social-icons-wrapper">
184-
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="data-notes-and-sources-2017.html" target="_blank">
184+
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="https://www.facebook.com/creativecommons" target="_blank">
185185
<span class="elementor-screen-only">Facebook</span>
186186
<i class="fa fa-facebook"></i>
187187
</a>
188-
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="data-notes-and-sources-2017.html" target="_blank">
188+
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="https://twitter.com/creativecommons" target="_blank">
189189
<span class="elementor-screen-only">Twitter</span>
190190
<i class="fa fa-twitter"></i>
191191
</a>

docs/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -981,11 +981,11 @@
981981
<div data-id="3d03c90" class="elementor-element elementor-element-3d03c90 elementor-shape-circle elementor-widget elementor-widget-social-icons" data-element_type="social-icons.default">
982982
<div class="elementor-widget-container">
983983
<div class="elementor-social-icons-wrapper">
984-
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="index.html" target="_blank">
984+
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="https://www.facebook.com/creativecommons" target="_blank">
985985
<span class="elementor-screen-only">Facebook</span>
986986
<i class="fa fa-facebook"></i>
987987
</a>
988-
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="index.html" target="_blank">
988+
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="https://twitter.com/creativecommons" target="_blank">
989989
<span class="elementor-screen-only">Twitter</span>
990990
<i class="fa fa-twitter"></i>
991991
</a>

docs/index.html?lang=ca.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -972,11 +972,11 @@
972972
<div data-id="3d03c90" class="elementor-element elementor-element-3d03c90 elementor-shape-circle elementor-widget elementor-widget-social-icons" data-element_type="social-icons.default">
973973
<div class="elementor-widget-container">
974974
<div class="elementor-social-icons-wrapper">
975-
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="index.html%3Flang=ca.html" target="_blank">
975+
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="https://www.facebook.com/creativecommons" target="_blank">
976976
<span class="elementor-screen-only">Facebook</span>
977977
<i class="fa fa-facebook"></i>
978978
</a>
979-
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="index.html%3Flang=ca.html" target="_blank">
979+
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="https://twitter.com/creativecommons" target="_blank">
980980
<span class="elementor-screen-only">Twitter</span>
981981
<i class="fa fa-twitter"></i>
982982
</a>

docs/index.html?lang=da.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -972,11 +972,11 @@
972972
<div data-id="3d03c90" class="elementor-element elementor-element-3d03c90 elementor-shape-circle elementor-widget elementor-widget-social-icons" data-element_type="social-icons.default">
973973
<div class="elementor-widget-container">
974974
<div class="elementor-social-icons-wrapper">
975-
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="index.html%3Flang=da.html" target="_blank">
975+
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="https://www.facebook.com/creativecommons" target="_blank">
976976
<span class="elementor-screen-only">Facebook</span>
977977
<i class="fa fa-facebook"></i>
978978
</a>
979-
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="index.html%3Flang=da.html" target="_blank">
979+
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="https://twitter.com/creativecommons" target="_blank">
980980
<span class="elementor-screen-only">Twitter</span>
981981
<i class="fa fa-twitter"></i>
982982
</a>

docs/index.html?lang=es.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -972,11 +972,11 @@
972972
<div data-id="3d03c90" class="elementor-element elementor-element-3d03c90 elementor-shape-circle elementor-widget elementor-widget-social-icons" data-element_type="social-icons.default">
973973
<div class="elementor-widget-container">
974974
<div class="elementor-social-icons-wrapper">
975-
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="index.html%3Flang=es.html" target="_blank">
975+
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="https://www.facebook.com/creativecommons" target="_blank">
976976
<span class="elementor-screen-only">Facebook</span>
977977
<i class="fa fa-facebook"></i>
978978
</a>
979-
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="index.html%3Flang=es.html" target="_blank">
979+
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="https://twitter.com/creativecommons" target="_blank">
980980
<span class="elementor-screen-only">Twitter</span>
981981
<i class="fa fa-twitter"></i>
982982
</a>

docs/index.html?lang=eu.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -972,11 +972,11 @@
972972
<div data-id="3d03c90" class="elementor-element elementor-element-3d03c90 elementor-shape-circle elementor-widget elementor-widget-social-icons" data-element_type="social-icons.default">
973973
<div class="elementor-widget-container">
974974
<div class="elementor-social-icons-wrapper">
975-
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="index.html%3Flang=eu.html" target="_blank">
975+
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="https://www.facebook.com/creativecommons" target="_blank">
976976
<span class="elementor-screen-only">Facebook</span>
977977
<i class="fa fa-facebook"></i>
978978
</a>
979-
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="index.html%3Flang=eu.html" target="_blank">
979+
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="https://twitter.com/creativecommons" target="_blank">
980980
<span class="elementor-screen-only">Twitter</span>
981981
<i class="fa fa-twitter"></i>
982982
</a>

docs/index.html?lang=id.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -972,11 +972,11 @@
972972
<div data-id="3d03c90" class="elementor-element elementor-element-3d03c90 elementor-shape-circle elementor-widget elementor-widget-social-icons" data-element_type="social-icons.default">
973973
<div class="elementor-widget-container">
974974
<div class="elementor-social-icons-wrapper">
975-
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="index.html%3Flang=id.html" target="_blank">
975+
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="https://www.facebook.com/creativecommons" target="_blank">
976976
<span class="elementor-screen-only">Facebook</span>
977977
<i class="fa fa-facebook"></i>
978978
</a>
979-
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="index.html%3Flang=id.html" target="_blank">
979+
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="https://twitter.com/creativecommons" target="_blank">
980980
<span class="elementor-screen-only">Twitter</span>
981981
<i class="fa fa-twitter"></i>
982982
</a>

docs/index.html?lang=ja.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -975,11 +975,11 @@
975975
<div data-id="3d03c90" class="elementor-element elementor-element-3d03c90 elementor-shape-circle elementor-widget elementor-widget-social-icons" data-element_type="social-icons.default">
976976
<div class="elementor-widget-container">
977977
<div class="elementor-social-icons-wrapper">
978-
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="index.html%3Flang=ja.html" target="_blank">
978+
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="https://www.facebook.com/creativecommons" target="_blank">
979979
<span class="elementor-screen-only">Facebook</span>
980980
<i class="fa fa-facebook"></i>
981981
</a>
982-
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="index.html%3Flang=ja.html" target="_blank">
982+
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="https://twitter.com/creativecommons" target="_blank">
983983
<span class="elementor-screen-only">Twitter</span>
984984
<i class="fa fa-twitter"></i>
985985
</a>

docs/index.html?lang=ko.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -975,11 +975,11 @@
975975
<div data-id="3d03c90" class="elementor-element elementor-element-3d03c90 elementor-shape-circle elementor-widget elementor-widget-social-icons" data-element_type="social-icons.default">
976976
<div class="elementor-widget-container">
977977
<div class="elementor-social-icons-wrapper">
978-
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="index.html%3Flang=ko.html" target="_blank">
978+
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="https://www.facebook.com/creativecommons" target="_blank">
979979
<span class="elementor-screen-only">Facebook</span>
980980
<i class="fa fa-facebook"></i>
981981
</a>
982-
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="index.html%3Flang=ko.html" target="_blank">
982+
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="https://twitter.com/creativecommons" target="_blank">
983983
<span class="elementor-screen-only">Twitter</span>
984984
<i class="fa fa-twitter"></i>
985985
</a>

docs/index.html?lang=sv.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -972,11 +972,11 @@
972972
<div data-id="3d03c90" class="elementor-element elementor-element-3d03c90 elementor-shape-circle elementor-widget elementor-widget-social-icons" data-element_type="social-icons.default">
973973
<div class="elementor-widget-container">
974974
<div class="elementor-social-icons-wrapper">
975-
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="index.html%3Flang=sv.html" target="_blank">
975+
<a class="elementor-icon elementor-social-icon elementor-social-icon-facebook" href="https://www.facebook.com/creativecommons" target="_blank">
976976
<span class="elementor-screen-only">Facebook</span>
977977
<i class="fa fa-facebook"></i>
978978
</a>
979-
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="index.html%3Flang=sv.html" target="_blank">
979+
<a class="elementor-icon elementor-social-icon elementor-social-icon-twitter" href="https://twitter.com/creativecommons" target="_blank">
980980
<span class="elementor-screen-only">Twitter</span>
981981
<i class="fa fa-twitter"></i>
982982
</a>

0 commit comments

Comments
 (0)