From 00d3a3cd0143744dcf2cdf6ba915198fe3c32d7c Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Thu, 7 Apr 2022 14:58:26 +0200 Subject: [PATCH] fix: convert link files +media link > 0.0.7 --- control | 2 +- etc/gsl/gsl.conf | 1 + usr/local/bin/gsl | 2 +- var/lib/gsl/scripts/gsl__page_creator | 2 +- var/lib/gsl/scripts/gsl__post_makers | 47 +++++++++++++++++---------- 5 files changed, 34 insertions(+), 20 deletions(-) diff --git a/control b/control index 590a141..eeac4bd 100644 --- a/control +++ b/control @@ -1,5 +1,5 @@ Package: egsl -Version: 0.0.5 +Version: 0.0.6 Section: custom Priority: optional Architecture: all diff --git a/etc/gsl/gsl.conf b/etc/gsl/gsl.conf index 28daeb0..12fb39e 100644 --- a/etc/gsl/gsl.conf +++ b/etc/gsl/gsl.conf @@ -92,6 +92,7 @@ gsl_log_c_file="Content File" #----------------------------------------------------------------------- gsl_mo_p='(' gsl_mc_p=')' +gsl_mark_file='__' gsl_mark_image='_image' gsl_mark_fcode='_code' gsl_mark_title='#' diff --git a/usr/local/bin/gsl b/usr/local/bin/gsl index 2435d00..d57999c 100755 --- a/usr/local/bin/gsl +++ b/usr/local/bin/gsl @@ -1,5 +1,5 @@ #!/bin/bash -# Version: 0.0.5 +# Version: 0.0.6 # file: gsl # Folder: /usr/local/bin # By echolib diff --git a/var/lib/gsl/scripts/gsl__page_creator b/var/lib/gsl/scripts/gsl__page_creator index a0dfabb..5973a10 100644 --- a/var/lib/gsl/scripts/gsl__page_creator +++ b/var/lib/gsl/scripts/gsl__page_creator @@ -293,7 +293,7 @@ cat << EOMETAS >> "$gsl_html_meta" $gsl_header_title - $gsl_site_title - + diff --git a/var/lib/gsl/scripts/gsl__post_makers b/var/lib/gsl/scripts/gsl__post_makers index c0feb9f..d7c59a2 100644 --- a/var/lib/gsl/scripts/gsl__post_makers +++ b/var/lib/gsl/scripts/gsl__post_makers @@ -25,6 +25,10 @@ gsl__page_listing_create Add gsl__do_italics "make" "$gsl_tmp_post" # First gsl__do_header "make" "$gsl_marker_link" "$gsl_post" gsl__do_header "make" "$gsl_marker_abbr" "$gsl_post" + +gsl__make_files +echo "M> $gsl_mark_file" + gsl__do_strongs_bolds "make" "$gsl_tmp_post" gsl__make_list gsl__do_icode "make" "$gsl_tmp_post" @@ -606,50 +610,59 @@ done < <(grep -n "$gsl_this_mark" "$gsl_tmp_post") # Convert HTML: Files #----------------------------------------------------------------------- gsl__make_files() { -! [[ "$gsl_header_files" ]] \ - && return - +echo while read -r "gsl_this_file" do + gsl_this_file=${gsl_this_file/file: /} + echo "Line> $gsl_this_file" + + gsl_filetxt=` + awk -F" : " \ + '{print $1}' \ + <<< "$gsl_this_file"` + + echo "1> $gsl_filetxt" + gsl_filename=` awk -F" : " \ - -v s="$gsl_marker_file$gsl_this_file" \ - 'match($0,s) {print $2}' \ - "$gsl_post"` + '{print $2}' \ + <<< "$gsl_this_file"` + + echo "2> $gsl_filename" gsl_filealt=` awk -F" : " \ - -v s="$gsl_marker_file$gsl_this_file" \ - 'match($0,s) {print $3}' \ - "$gsl_post"` + '{print $3}' \ + <<< "$gsl_this_file"` + + echo "3> $gsl_filealt" [[ "$gsl_filealt" ]] \ && gsl_HTML_file_title=" title=\"$gsl_filealt\"" + sleep 2 + # Set HTML Link case "$gsl_post_type" in - post) gsl_HTML_file_url="./files/$gsl_filename" ;; - page) gsl_HTML_file_url="../files/$gsl_filename" ;; + post) gsl_HTML_file_url="../files/$gsl_filename" ;; + page) gsl_HTML_file_url="files/$gsl_filename" ;; esac # Convert file to link - gsl_mark_file="$gsl_mo_file$gsl_this_file$gsl_mc_file" + gsl_mark_file="$gsl_mark_file$gsl_filetxt" gsl_HTML_file_link=` printf '%s%s%s%s%s%s' \ "" \ - "$gsl_this_file" \ + "$gsl_filetxt" \ ""` sed -i "s|$gsl_mark_file|$gsl_HTML_file_link|g" \ "$gsl_tmp_post" -done < <(gsl__get_content_finder \ - -o "$gsl_mo_file" \ - -c "$gsl_mc_file" \ - -f "$gsl_tmp_post") +done < <(grep "$gsl_marker_file" "$gsl_post") } #-----------------------------------------------------------------------