diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b89bac..eec223e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ GSL changes from releases. You can send an issue : - repo: https://git.a-lec.org/echolib/gsl/-/issues - Contact xmpp: im@echolib.re +## [0.0.93] +### New +- Basic RSS feed created at each www (COMMAND) +- - on root server: /DOMAIN/www/rss.xml +- Basic footer with new list (added RSS feed). +- - Do not forget to add link in your footer, to /rss.xml + +### Fix +- www add: when type is post +- log: field "server" for WIP + + ## [0.0.92] ### Fix - make: must not use -F if article has changed diff --git a/new-version.md b/new-version.md index 4d3aee4..e34ee07 100644 --- a/new-version.md +++ b/new-version.md @@ -1,4 +1,4 @@ -## [0.0.92] +## [0.0.93] ## Please, see help (and documentations in help folder) @@ -15,6 +15,10 @@ - - author,new,setdir: gsl__domain_manager - - edit: gsl__edit_file - - stats: gsl__stats +- Basic RSS feed created at each www (COMMAND) +- - on root server: /DOMAIN/www/rss.xml +- Basic footer with new list (added RSS feed). +- - Do not forget to add link in your footer, to /rss.xml ### Installation - new files: diff --git a/usr/local/bin/gsl b/usr/local/bin/gsl index 503f0d1..e5101cb 100755 --- a/usr/local/bin/gsl +++ b/usr/local/bin/gsl @@ -1,5 +1,5 @@ #!/bin/bash -# Version: 0.0.92 +# Version: 0.0.93 # file: gsl # Folder: /usr/local/bin # By echolib (XMPP: im@echolib.re) diff --git a/var/lib/gsl/CHANGELOG.md b/var/lib/gsl/CHANGELOG.md index 4b89bac..eec223e 100644 --- a/var/lib/gsl/CHANGELOG.md +++ b/var/lib/gsl/CHANGELOG.md @@ -4,6 +4,18 @@ GSL changes from releases. You can send an issue : - repo: https://git.a-lec.org/echolib/gsl/-/issues - Contact xmpp: im@echolib.re +## [0.0.93] +### New +- Basic RSS feed created at each www (COMMAND) +- - on root server: /DOMAIN/www/rss.xml +- Basic footer with new list (added RSS feed). +- - Do not forget to add link in your footer, to /rss.xml + +### Fix +- www add: when type is post +- log: field "server" for WIP + + ## [0.0.92] ### Fix - make: must not use -F if article has changed diff --git a/var/lib/gsl/new-version.md b/var/lib/gsl/new-version.md index 4d3aee4..e34ee07 100644 --- a/var/lib/gsl/new-version.md +++ b/var/lib/gsl/new-version.md @@ -1,4 +1,4 @@ -## [0.0.92] +## [0.0.93] ## Please, see help (and documentations in help folder) @@ -15,6 +15,10 @@ - - author,new,setdir: gsl__domain_manager - - edit: gsl__edit_file - - stats: gsl__stats +- Basic RSS feed created at each www (COMMAND) +- - on root server: /DOMAIN/www/rss.xml +- Basic footer with new list (added RSS feed). +- - Do not forget to add link in your footer, to /rss.xml ### Installation - new files: diff --git a/var/lib/gsl/scripts/gsl__HTML_template b/var/lib/gsl/scripts/gsl__HTML_template index 832ae76..ca7bc27 100644 --- a/var/lib/gsl/scripts/gsl__HTML_template +++ b/var/lib/gsl/scripts/gsl__HTML_template @@ -59,17 +59,13 @@ cat < "$gsl_dir_domain_tpl/footer.html" @@ -89,6 +85,7 @@ if [[ `grep -i "fr" <<<"$site_lang"` ]];then gsl_the="Le" gsl_by="par" gsl_read="Lire l'article de" + gsl_rss_info="Tous les titres de" else gsl_welcome="Welcome page of" @@ -98,6 +95,7 @@ else gsl_the="The" gsl_by="by" gsl_read="Read the post of" + gsl_rss_info="All titles from" fi } @@ -131,9 +129,11 @@ $(cat "$gsl_dir_domain_tpl/metas.html") + + $article_Title - $site_title @@ -170,7 +170,7 @@ $(cat "$gsl_dir_domain_tpl/footer.html") EOPAGE -gsl__logs_print -i -S -wip \ +gsl__logs_print -i -srv -wip \ "Created HTML $article_Type" \ "$gsl_srv_post_wip" } @@ -253,3 +253,61 @@ gsl__logs_print -i -s "$1" \ "Created" \ "$2" } + + +#====================================================================== +# ATOM/RSS Creator +# File is at root www server ; filename=rss.xml +# reverse sort time from DB | newest first +#====================================================================== +create__RSS_feed() { +create__HTML_translation +rss_file="$gsl_srv_www/rss.xml" +cat < "$rss_file" + + + + $site_title - $site_ndd - Flux RSS 2.0 + $site_url + $gsl_rss_info $site_title + $site_lang + $(date) + $site_cr + $site_mail + GSL: Statique Littérateur + +EORSS + +while IFS=: read -r "filename" "status" +do + source "$filename" + ! (( $article_Status_www > 0 )) && continue + + case "$article_Type" in + page) end_url="$article_Slug.html" ;; + post) end_url="$article_Slug/index.html" ;; + esac + +cat <> "$rss_file" + + $article_Title + $site_url/$end_url + $site_url/$end_url + $(date -d @$article_epoch) + $article_Info + $article_Author + + +EOITEM +done < <(grep "article_epoch" "$gsl_dir_db_domain/"*.db | sort -t= -k2r) + +cat <> "$rss_file" + + +EORSS + +gsl__logs_print -i -srv -www \ + "RSS feed updated" \ + "$rss_file" +} + diff --git a/var/lib/gsl/scripts/gsl__post_makers b/var/lib/gsl/scripts/gsl__post_makers index b0ac0d1..fe9cfd9 100644 --- a/var/lib/gsl/scripts/gsl__post_makers +++ b/var/lib/gsl/scripts/gsl__post_makers @@ -631,8 +631,7 @@ make__file_images() { this_image=`grep -n "$gsl_mark_image:$header_f1" "$1"` [[ "$this_image" ]] || return -mark_image=${this_image#*:} - +mark_image=${this_image#*:} # Get content mark to replace while IFS=: read -r "ln" \ "marker" \ "f1" \ diff --git a/var/lib/gsl/scripts/gsl__srv_manager b/var/lib/gsl/scripts/gsl__srv_manager index fb2982a..23ed561 100644 --- a/var/lib/gsl/scripts/gsl__srv_manager +++ b/var/lib/gsl/scripts/gsl__srv_manager @@ -113,6 +113,7 @@ case "$1" in DB__set_status "www-del" fi + create__RSS_feed stats__datas # Statoolinfos return ;; @@ -139,7 +140,7 @@ elif (( $article_Status_chk == $article_Status_www )) && \ else if (( $article_Status_chk == $article_Status_wip ));then - [[ "$article_Slug" =~ "/" ]] \ + [[ "$article_Type" == "post" ]] \ && mkdir -p "$gsl_slug_dir_www" rsync -a "$gsl_srv_post_wip" "$gsl_srv_post_www" && \ @@ -147,6 +148,7 @@ else "Article validated online" \ "$gsl_srv_post_www" && \ DB__set_status "www" + create__RSS_feed stats__datas # Statoolinfos fi fi @@ -299,6 +301,7 @@ case "$1" in esac } + #====================================================================== # Remove WIP page # If error from check and exists diff --git a/var/lib/gsl/scripts/gsl__stats b/var/lib/gsl/scripts/gsl__stats index e78edc8..4ec22cb 100644 --- a/var/lib/gsl/scripts/gsl__stats +++ b/var/lib/gsl/scripts/gsl__stats @@ -54,7 +54,7 @@ stats_articles_max_images_www=0 while IFS=: read -r "filename" "status" do source "$filename" - ! (( $article_Status_www> 0 )) && continue + ! (( $article_Status_www > 0 )) && continue ((stat_articles_www++))