diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2020-12-30 20:57:15 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2020-12-30 20:57:15 +0100 |
| commit | 8c1256185ee44b1c4abbccfd8b0bfc92e119e688 (patch) | |
| tree | 5eed92b74b0e5f6433873cbb745869c378748a27 /build.sh | |
| parent | 2013d68dad67988ae62e21c4921c2910e9bdff40 (diff) | |
| download | quatuorbellefeuille.com-8c1256185ee44b1c4abbccfd8b0bfc92e119e688.tar.xz | |
Refactor "current" class addition
Will make it easier to add them up for individual members.
Diffstat (limited to 'build.sh')
| -rwxr-xr-x | build.sh | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -14,6 +14,22 @@ then fi cp template.html ${output} + +transform-li-current-a () +{ + local old="<li><a href=\"$1.html\">" + local new="<li class=\"current\"><a href=\"$1.html\">" + echo "s/${old}/${new}/" +} + +transform-li-dropdown-current-a () +{ + local old="<li class=\"dropdown\"><a href=\"$1.html\">" + local new="<li class=\"dropdown current\"><a href=\"$1.html\">" + echo "s/${old}/${new}/" +} + +transforms=() . ${parameters} sed -i s/'{TITLE}'/"${title}"/ ${output} @@ -26,9 +42,9 @@ done sed -i /'{STYLESHEETS}'/'c\'"${link_stylesheets}" ${output} -if test "${current_div:-}" -then - sed -i s"${current_div}" ${output} -fi +for transform in "${transforms[@]}" +do + sed -i "${transform}" ${output} +done sed -i -e /'{MAIN}'/"r ${input}" -e /'{MAIN}'/'c\' ${output} |
