mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 01:36:13 +00:00
improve translation system
jekyll now automatically generates sitemap alternate hreflang is now correctly handled by sitemaps language bar now gracefully associate with the translated equivalent of the page update README with updated translation guidelines and instructions
This commit is contained in:
parent
cbc0f9485e
commit
d1c90a6232
43 changed files with 173 additions and 236 deletions
|
@ -12,12 +12,9 @@ sed -i "s_href=\"/en/_href=\"/${1}/_g" ${1}/*.html
|
|||
sed -i "s_src=\"/en/_src=\"/${1}/_g" ${1}/*.html
|
||||
sed -i "s_href=\"/en/_href=\"/${1}/_g" _layouts/base-${1}.html
|
||||
sed -i "s_src=\"/en/_src=\"/${1}/_g" _layouts/base-${1}.html
|
||||
sed -i "s_langcode: en_langcode: ${1}_g" _layouts/base-${1}.html
|
||||
sed -i "s_langtext: English_langtext: ${2}_g" _layouts/base-${1}.html
|
||||
sed -i "s_lang: en_lang: ${1}_g" _layouts/base-${1}.html
|
||||
sed -i "s/ALERT_CLASS_en/ALERT_CLASS_${1}/g" _layouts/base-${1}.html
|
||||
sed -i "s/ALERT_en/ALERT_${1}/g" _layouts/base-${1}.html
|
||||
sed -i "/langcode: ${1}/d" _config.yml
|
||||
sed -i "/langtext: ${2}/d" _config.yml
|
||||
sed -i "/langs:/a - langtext: ${2}" _config.yml
|
||||
sed -i "/langs:/a - langcode: ${1}" _config.yml
|
||||
sed -i "s_- langtext: ${2}_ langtext: ${2}_g" _config.yml
|
||||
sed -i "/${1}: ${2}/d" _config.yml
|
||||
sed -i "/langs:/a - ${1}: ${2}" _config.yml
|
||||
sed -i "s_- ${1}: ${2}_ ${1}: ${2}_g" _config.yml
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
#!/bin/bash
|
||||
#Should be called each time a page is updated, added or removed to update sitemaps
|
||||
echo '<?xml version="1.0" encoding="UTF-8"?>' > sitemap.xml
|
||||
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' >> sitemap.xml
|
||||
for l in *; do
|
||||
if [[ ! -d $l || $l == "_site" || $l == "_layouts" ]]; then
|
||||
continue
|
||||
fi
|
||||
files=`find ${l} -name "*.html" -type f`
|
||||
for f in $files; do
|
||||
c=(${f//"."/ })
|
||||
c=${c[@]:0:1}
|
||||
if [[ $c == "${l}/index" ]]; then
|
||||
c=(${c//"/"/ })
|
||||
c="${c[@]:0:1}/"
|
||||
fi
|
||||
t=$(stat -c "%y" ${f})
|
||||
t=(${t//" "/ })
|
||||
t=${t[@]:0:1}
|
||||
echo "<url>" >> sitemap.xml
|
||||
echo " <loc>http://bitcoin.org/${c}</loc>" >> sitemap.xml
|
||||
echo " <lastmod>${t}</lastmod>" >> sitemap.xml
|
||||
echo "</url>" >> sitemap.xml
|
||||
done
|
||||
done
|
||||
echo '</urlset>' >> sitemap.xml
|
Loading…
Add table
Add a link
Reference in a new issue