New RSS file + fixes

This commit is contained in:
Cyrille L 2022-06-18 12:16:52 +02:00
parent 1ecacef016
commit 2e9ae902fd
9 changed files with 111 additions and 19 deletions

View File

@ -4,6 +4,18 @@ GSL changes from releases. You can send an issue :
- repo: https://git.a-lec.org/echolib/gsl/-/issues - repo: https://git.a-lec.org/echolib/gsl/-/issues
- Contact xmpp: im@echolib.re - 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] ## [0.0.92]
### Fix ### Fix
- make: must not use -F if article has changed - make: must not use -F if article has changed

View File

@ -1,4 +1,4 @@
## [0.0.92] ## [0.0.93]
## Please, see help (and documentations in help folder) ## Please, see help (and documentations in help folder)
@ -15,6 +15,10 @@
- - author,new,setdir: gsl__domain_manager - - author,new,setdir: gsl__domain_manager
- - edit: gsl__edit_file - - edit: gsl__edit_file
- - stats: gsl__stats - - 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 ### Installation
- new files: - new files:

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Version: 0.0.92 # Version: 0.0.93
# file: gsl # file: gsl
# Folder: /usr/local/bin # Folder: /usr/local/bin
# By echolib (XMPP: im@echolib.re) # By echolib (XMPP: im@echolib.re)

View File

@ -4,6 +4,18 @@ GSL changes from releases. You can send an issue :
- repo: https://git.a-lec.org/echolib/gsl/-/issues - repo: https://git.a-lec.org/echolib/gsl/-/issues
- Contact xmpp: im@echolib.re - 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] ## [0.0.92]
### Fix ### Fix
- make: must not use -F if article has changed - make: must not use -F if article has changed

View File

@ -1,4 +1,4 @@
## [0.0.92] ## [0.0.93]
## Please, see help (and documentations in help folder) ## Please, see help (and documentations in help folder)
@ -15,6 +15,10 @@
- - author,new,setdir: gsl__domain_manager - - author,new,setdir: gsl__domain_manager
- - edit: gsl__edit_file - - edit: gsl__edit_file
- - stats: gsl__stats - - 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 ### Installation
- new files: - new files:

View File

@ -59,17 +59,13 @@ cat <<EOFOOTER > "$gsl_dir_domain_tpl/footer.html"
<div id="${site_css}_footer-about"> <div id="${site_css}_footer-about">
<p class="${site_css_footer-p}"> <p class="${site_css_footer-p}">
<a href="$site_url"> <ul>
<b>$site_title</b> <li><a href="$site_url"><b>$site_title</b></a>: $site_about</li>
</a>: $site_about <li>Contact: $site_mail</li>
<br /> <li>Copyright: $site_cr</li>
Contact: $site_mail <li>$gsl_gen: <a href="https://git.a-lec.org/echolib/gsl" target="_blank"><b>GSL: Statique Littérateur</b></a></li>
<br /> <li>RSS: <a type="application/rss+xml" href="$site_url/rss.xml">$site_url/rss.xml</a></li>
Copyright: $site_cr </ul>
<br />
$gsl_gen: <a href="https://git.a-lec.org/echolib/gsl" target="_blank">
<b>GSL: Statique Littérateur</b>
</a>
</p> </p>
</div> </div>
</footer> </footer>
@ -89,6 +85,7 @@ if [[ `grep -i "fr" <<<"$site_lang"` ]];then
gsl_the="Le" gsl_the="Le"
gsl_by="par" gsl_by="par"
gsl_read="Lire l'article de" gsl_read="Lire l'article de"
gsl_rss_info="Tous les titres de"
else else
gsl_welcome="Welcome page of" gsl_welcome="Welcome page of"
@ -98,6 +95,7 @@ else
gsl_the="The" gsl_the="The"
gsl_by="by" gsl_by="by"
gsl_read="Read the post of" gsl_read="Read the post of"
gsl_rss_info="All titles from"
fi fi
} }
@ -131,9 +129,11 @@ $(cat "$gsl_dir_domain_tpl/metas.html")
<meta name='keywords' content="$site_keys,$article_Tags"> <meta name='keywords' content="$site_keys,$article_Tags">
<meta name='search_date' content="$article_Date"> <meta name='search_date' content="$article_Date">
<link rel="alternate" type="application/rss+xml" href="$site_url/rss.xml" title="RSS: $gsl_rss_info $site_title" />
<link rel="stylesheet" media="screen" href="${srv_uri}templates/styles.css" /> <link rel="stylesheet" media="screen" href="${srv_uri}templates/styles.css" />
<link rel="shortcut icon" type="image/png" href="${srv_uri}templates/favicon.png" /> <link rel="shortcut icon" type="image/png" href="${srv_uri}templates/favicon.png" />
<link rel='me' type='text/html' href="$site_auth_url"> <link rel='me' type='text/html' href="$site_auth_url">
<title>$article_Title - $site_title</title> <title>$article_Title - $site_title</title>
</head> </head>
@ -170,7 +170,7 @@ $(cat "$gsl_dir_domain_tpl/footer.html")
</html> </html>
EOPAGE EOPAGE
gsl__logs_print -i -S -wip \ gsl__logs_print -i -srv -wip \
"Created HTML $article_Type" \ "Created HTML $article_Type" \
"$gsl_srv_post_wip" "$gsl_srv_post_wip"
} }
@ -253,3 +253,61 @@ gsl__logs_print -i -s "$1" \
"Created" \ "Created" \
"$2" "$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 <<EORSS > "$rss_file"
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>$site_title - $site_ndd - Flux RSS 2.0</title>
<link>$site_url</link>
<description>$gsl_rss_info $site_title</description>
<language>$site_lang</language>
<lastBuildDate>$(date)</lastBuildDate>
<copyright>$site_cr</copyright>
<webMaster>$site_mail</webMaster>
<generator>GSL: Statique Littérateur</generator>
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 <<EOITEM >> "$rss_file"
<item>
<title>$article_Title</title>
<link>$site_url/$end_url</link>
<guid>$site_url/$end_url</guid>
<pubDate>$(date -d @$article_epoch)</pubDate>
<description>$article_Info</description>
<author>$article_Author</author>
</item>
EOITEM
done < <(grep "article_epoch" "$gsl_dir_db_domain/"*.db | sort -t= -k2r)
cat <<EORSS >> "$rss_file"
</channel>
</rss>
EORSS
gsl__logs_print -i -srv -www \
"RSS feed updated" \
"$rss_file"
}

View File

@ -631,8 +631,7 @@ make__file_images() {
this_image=`grep -n "$gsl_mark_image:$header_f1" "$1"` this_image=`grep -n "$gsl_mark_image:$header_f1" "$1"`
[[ "$this_image" ]] || return [[ "$this_image" ]] || return
mark_image=${this_image#*:} mark_image=${this_image#*:} # Get content mark to replace
while IFS=: read -r "ln" \ while IFS=: read -r "ln" \
"marker" \ "marker" \
"f1" \ "f1" \

View File

@ -113,6 +113,7 @@ case "$1" in
DB__set_status "www-del" DB__set_status "www-del"
fi fi
create__RSS_feed
stats__datas # Statoolinfos stats__datas # Statoolinfos
return return
;; ;;
@ -139,7 +140,7 @@ elif (( $article_Status_chk == $article_Status_www )) && \
else else
if (( $article_Status_chk == $article_Status_wip ));then if (( $article_Status_chk == $article_Status_wip ));then
[[ "$article_Slug" =~ "/" ]] \ [[ "$article_Type" == "post" ]] \
&& mkdir -p "$gsl_slug_dir_www" && mkdir -p "$gsl_slug_dir_www"
rsync -a "$gsl_srv_post_wip" "$gsl_srv_post_www" && \ rsync -a "$gsl_srv_post_wip" "$gsl_srv_post_www" && \
@ -147,6 +148,7 @@ else
"Article validated online" \ "Article validated online" \
"$gsl_srv_post_www" && \ "$gsl_srv_post_www" && \
DB__set_status "www" DB__set_status "www"
create__RSS_feed
stats__datas # Statoolinfos stats__datas # Statoolinfos
fi fi
fi fi
@ -299,6 +301,7 @@ case "$1" in
esac esac
} }
#====================================================================== #======================================================================
# Remove WIP page # Remove WIP page
# If error from check and exists # If error from check and exists