~aprates/gempress

85ec03afc1c1974840c915035c8d233135bb65b6 — Antonio Prates 1 year, 1 month ago 10a61f1
Fix config progagation
3 files changed, 20 insertions(+), 11 deletions(-)

M publish
M src/capsule-to-website.sh
M src/gmi-to-html.c
M publish => publish +1 -1
@@ 79,7 79,7 @@ then
    generateAtomFeedHttps
    ./src/append-footer.sh $templateDir/web-footer.gmi $capsule
    linkFeedToHome
    ./src/capsule-to-website.sh $templateDir $capsule $langCode
    ./src/capsule-to-website.sh $configFile $capsule
    echo
    echo "Buidling GEMINI Capsule…"
    takeCleanCopyOfLocalBaseDir

M src/capsule-to-website.sh => src/capsule-to-website.sh +17 -7
@@ 6,9 6,9 @@
# Note: this script assumes you have Sugar C in yor system
# (see provided README.md for more information)

templateDir=$1 # path to template folder
configFile=$1
gmipath=$2 # path to content folder
langCode=$3
. $configFile

# set script globals
website=$PWD/website # if you change here also change on lib.sh


@@ 57,18 57,28 @@ cp -ux $templateDir/styles.css $website

# colect all file paths in contents and run the conversion tool
getFilePaths $website
conversionArgs=""
if [[ -n $extraMarkup ]];
then
    echo "Using extra markup conversion: enabled"
    conversionArgs="$conversionArgs -extraMarkup"
    conversionArgs="extraMarkup"
fi
if [[ -n $langCode ]];
then
    echo "Using language code: $langCode"
    conversionArgs="$conversionArgs -lang:$langCode"
    if [[ -n $conversionArgs ]];
    then
        echo "Using language code: $langCode"
        conversionArgs="$conversionArgs -lang:$langCode"
    else
        echo "Using language code: $langCode"
        conversionArgs="lang:$langCode"
    fi
fi
if [[ -n $conversionArgs ]];
then
    conversionArgs="$conversionArgs $filePaths"
else
    conversionArgs=$filePaths
fi
conversionArgs="$conversionArgs $filePaths"
sugar src/gmi-to-html.c $conversionArgs

# clean up

M src/gmi-to-html.c => src/gmi-to-html.c +2 -3
@@ 149,12 149,11 @@ string lineToHTML(string line) {

// try to get the file from path and generate the corresponding html in place
void convert(string path) {
  path = replaceWord(path, " ", ""); // trim extra spaces from args
  if (startsWith(path, "-lang:")) {
  if (startsWith(path, "lang:")) {
    htmlTag = join3s("<html lang=\"", &path[6], "\">\n"); // set langCode
    return;
  }
  if (startsWith(path, "-extraMarkup")) {
  if (startsWith(path, "extraMarkup")) {
    extraMarkup = true; // set extraMarkup
    return;
  }