Version 0.0.37
This commit is contained in:
parent
2a61aafbfa
commit
e41fc4e8fe
2
control
2
control
|
@ -1,5 +1,5 @@
|
||||||
Package: egsl
|
Package: egsl
|
||||||
Version: 0.0.36
|
Version: 0.0.37
|
||||||
Section: custom
|
Section: custom
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: all
|
Architecture: all
|
||||||
|
|
|
@ -52,15 +52,11 @@ gsl_log_e='Err'
|
||||||
gsl_log_w='War'
|
gsl_log_w='War'
|
||||||
gsl_log_i='Inf'
|
gsl_log_i='Inf'
|
||||||
|
|
||||||
# Date format
|
|
||||||
gsl_test_date='^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]+$'
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
# Set LOG help Activity for NEEDED HEADERS
|
# Set LOG help Activity for NEEDED HEADERS
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
gsl_log_act_title='POST TITLE'
|
gsl_log_act_title='POST TITLE'
|
||||||
gsl_log_act_author='REGISTRED NAME'
|
gsl_log_act_author='REGISTRED NAME'
|
||||||
gsl_log_act_date='YYYY-MM-DD'
|
|
||||||
gsl_log_act_info='POST is ABOUT...'
|
gsl_log_act_info='POST is ABOUT...'
|
||||||
gsl_log_act_slug='POST-TITLE'
|
gsl_log_act_slug='POST-TITLE'
|
||||||
gsl_log_act_code='NBR : FILENAME : Alt Text'
|
gsl_log_act_code='NBR : FILENAME : Alt Text'
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
# Version: 0.0.35 > 0.0.36
|
# [0.0.37]
|
||||||
|
|
||||||
- New list converter (! Use + for ol, not ø)
|
- Added changelog
|
||||||
- New block titles converter with div
|
- Make stats at each www call
|
||||||
- New option: create
|
- Fix variable name propertie for stats (statoolinfos)
|
||||||
- New option with edit: conf (to edit domain configuration)
|
- Set yourself a class ID for paragraphs: i.e. "( 1a"
|
||||||
- New option: --version (to show changes)
|
- Better Logs harmony
|
||||||
- New generic function if invalid option
|
- date: Set to DD-MM-YYYY if site lang=fr || YYYY-MM-DD
|
||||||
- New min size for post: 150
|
- date: Check for month value > 12
|
||||||
|
- if 'error' log : do not exit 1 anymore
|
||||||
- Fix: No <div</div> if block title empty
|
- link: check only online url from http...
|
||||||
|
- some changed syntax in make process
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Version: 0.0.36
|
# Version: 0.0.37
|
||||||
# file: gsl
|
# file: gsl
|
||||||
# Folder: /usr/local/bin
|
# Folder: /usr/local/bin
|
||||||
# By echolib
|
# By echolib
|
||||||
|
@ -254,7 +254,13 @@ case "$1" in
|
||||||
"$PWD/$3.gsl"
|
"$PWD/$3.gsl"
|
||||||
gsl_checker_war=true
|
gsl_checker_war=true
|
||||||
else
|
else
|
||||||
gsl__create_article "$2" "$(date +%F)" "$gsl_postname" && \
|
[[ `grep -i "fr" <<<"$gsl_site_lang"` ]] \
|
||||||
|
&& gsl_today=`printf '%(%d-%m-%Y)T'` \
|
||||||
|
|| gsl_today=`date +%F`
|
||||||
|
|
||||||
|
gsl__debug "$gsl_site_lang" "$gsl_today"
|
||||||
|
|
||||||
|
gsl__create_article "$2" "$gsl_today" "$gsl_postname" && \
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_i" \
|
"$gsl_log_i" \
|
||||||
"Create" \
|
"Create" \
|
||||||
|
@ -492,6 +498,17 @@ case "$1" in
|
||||||
gsl_srv_www="$gsl_site_server/$gsl_site_ndd/www"
|
gsl_srv_www="$gsl_site_server/$gsl_site_ndd/www"
|
||||||
gsl__loop_posts www "$2"
|
gsl__loop_posts www "$2"
|
||||||
|
|
||||||
|
# Stats
|
||||||
|
gsl__if_file "$gsl_dir_scripts/gsl__stats" source
|
||||||
|
gsl_file_sti="$gsl_site_server/$gsl_find_domain/gsl-sti.properties"
|
||||||
|
gsl__get_stats &>/dev/null && \
|
||||||
|
gsl__logs_print \
|
||||||
|
"$gsl_log_i" \
|
||||||
|
"Stats" \
|
||||||
|
"File" \
|
||||||
|
"Generated" \
|
||||||
|
"$gsl_file_sti"
|
||||||
|
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_i" \
|
"$gsl_log_i" \
|
||||||
"Stopping" \
|
"Stopping" \
|
||||||
|
@ -536,5 +553,5 @@ if [[ "$gsl_checker_err" ]];then
|
||||||
echo
|
echo
|
||||||
gsl_logs_err=true
|
gsl_logs_err=true
|
||||||
gsl__logs_show
|
gsl__logs_show
|
||||||
exit 1
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -68,8 +68,8 @@ if ! [[ "$gsl_post_begin" ]];then
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Content" \
|
||||||
"$gsl_log_c_h1" \
|
"Begins" \
|
||||||
"Missing: #1 TITLE" \
|
"Unused: #1 TITLE" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
fi
|
fi
|
||||||
|
@ -85,9 +85,9 @@ case "$gsl_post_type" in
|
||||||
page|post)
|
page|post)
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_i" \
|
"$gsl_log_i" \
|
||||||
"Content" \
|
"Header" \
|
||||||
"Set as" \
|
"$gsl_marker_type" \
|
||||||
"$gsl_post_type: $gsl_post" \
|
"$gsl_post Set as $gsl_post_type" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -96,9 +96,9 @@ case "$gsl_post_type" in
|
||||||
"$gsl_post" && \
|
"$gsl_post" && \
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_w" \
|
"$gsl_log_w" \
|
||||||
"Content" \
|
"Header" \
|
||||||
"Set as" \
|
"$gsl_marker_type" \
|
||||||
"Default: $gsl_post_type for $gsl_post" \
|
"$gsl_post Set as Default $gsl_post_type" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
gsl__get_sum "$gsl_post"
|
gsl__get_sum "$gsl_post"
|
||||||
;;
|
;;
|
||||||
|
@ -128,8 +128,8 @@ if (( "$gsl_post_p_open" == 0 ));then
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Content" \
|
||||||
"$gsl_loc_c_p" \
|
"Paragraphs" \
|
||||||
"Missing: ( and ) at begining lines" \
|
"Unused: ( and ) at begining lines" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
return
|
return
|
||||||
|
@ -145,7 +145,7 @@ else
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Content" \
|
||||||
"$gsl_log_c_p" \
|
"Paragraphs" \
|
||||||
"Mismatch: (=$gsl_post_p_open ; )=$gsl_post_p_close" \
|
"Mismatch: (=$gsl_post_p_open ; )=$gsl_post_p_close" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
|
@ -177,7 +177,7 @@ else
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Content" \
|
||||||
"$gsl_log_c_cite" \
|
"Citations" \
|
||||||
"Mismatch: --- not paired" \
|
"Mismatch: --- not paired" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
|
@ -190,13 +190,13 @@ fi
|
||||||
gsl__check_link() {
|
gsl__check_link() {
|
||||||
# Get & Check Header CONTENT
|
# Get & Check Header CONTENT
|
||||||
gsl__check_header_fields \
|
gsl__check_header_fields \
|
||||||
"Content" "$gsl_log_h_link" "$gsl_log_act_link" \
|
"Header" "$gsl_marker_link" "$gsl_log_act_link" \
|
||||||
|| return
|
|| return
|
||||||
|
|
||||||
echo -ne "\r\033[2K: Searching for Links... $gsl_post_hf_1"
|
echo -ne "\r\033[2K: Searching for Links... $gsl_post_hf_1"
|
||||||
|
|
||||||
# No ALT TEXT ?
|
# No ALT TEXT ?
|
||||||
gsl__check_header_field3 "Content" "$gsl_log_h_link" "$gsl_marker_link"
|
gsl__check_header_field3 "Header" "$gsl_marker_link"
|
||||||
|
|
||||||
gsl_count_links=`
|
gsl_count_links=`
|
||||||
gsl__get_content_line "_$gsl_post_hf_1" "$gsl_post" | wc -l`
|
gsl__get_content_line "_$gsl_post_hf_1" "$gsl_post" | wc -l`
|
||||||
|
@ -204,25 +204,41 @@ gsl__get_content_line "_$gsl_post_hf_1" "$gsl_post" | wc -l`
|
||||||
if (( "$gsl_count_links" > 0 ));then
|
if (( "$gsl_count_links" > 0 ));then
|
||||||
|
|
||||||
# Check URL
|
# Check URL
|
||||||
gsl_url_status=`
|
case "$gsl_post_hf_2" in
|
||||||
timeout 2 curl -o /dev/null --silent --head --write-out \
|
http*)
|
||||||
'%{http_code}' \
|
gsl_url_status=`
|
||||||
"$gsl_post_hf_2" 2>/dev/null || gsl_url_status=408`
|
timeout 2 curl -o /dev/null --silent --head --write-out \
|
||||||
|
'%{http_code}' \
|
||||||
|
"$gsl_post_hf_2" 2>/dev/null`
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
gsl_url_status=408
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
case "$gsl_url_status" in
|
case "$gsl_url_status" in
|
||||||
1*|2*|3*)
|
1*|2*|3*)
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_i" \
|
"$gsl_log_i" \
|
||||||
"Content" \
|
"Header" \
|
||||||
"$gsl_log_h_link" \
|
"$gsl_marker_link" \
|
||||||
"Online:$gsl_url_status ${gsl_post_hf_2:0:40}..." \
|
"Online:$gsl_url_status ${gsl_post_hf_2:0:40}..." \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
;;
|
;;
|
||||||
|
4*)
|
||||||
|
gsl__logs_print \
|
||||||
|
"$gsl_log_w" \
|
||||||
|
"Header" \
|
||||||
|
"$gsl_marker_link" \
|
||||||
|
"Not checked: ${gsl_post_hf_2:0:40}..." \
|
||||||
|
"${PWD}/$gsl_post"
|
||||||
|
gsl_checker_war=true
|
||||||
|
;;
|
||||||
""|*)
|
""|*)
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_w" \
|
"$gsl_log_w" \
|
||||||
"Content" \
|
"Header" \
|
||||||
"$gsl_log_h_link" \
|
"$gsl_marker_link" \
|
||||||
"Offline:$gsl_url_status ${gsl_post_hf_2:0:40}..." \
|
"Offline:$gsl_url_status ${gsl_post_hf_2:0:40}..." \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
|
|
||||||
|
@ -242,7 +258,7 @@ else
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Content" \
|
||||||
"$gsl_log_c_link" \
|
"Link" \
|
||||||
"Unused: _$gsl_post_hf_1" \
|
"Unused: _$gsl_post_hf_1" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
|
@ -274,8 +290,8 @@ else
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Content" \
|
||||||
"$gsl_log_c_abbr" \
|
"$gsl_marker_abbr" \
|
||||||
"Missing: $gsl_post_header_field_1" \
|
"Unused: $gsl_post_header_field_1" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
|
|
||||||
|
@ -299,8 +315,8 @@ if ! [[ -f "$gsl_dir_domain_files/$gsl_post_hf_2" ]];then
|
||||||
|
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Header" \
|
||||||
"Header $gsl_marker_file" \
|
"$gsl_marker_file" \
|
||||||
"Not found: $gsl_post_hf_2" \
|
"Not found: $gsl_post_hf_2" \
|
||||||
"$gsl_dir_domain_files/$gsl_post_hf_2"
|
"$gsl_dir_domain_files/$gsl_post_hf_2"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
|
@ -332,7 +348,7 @@ else
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Content" \
|
||||||
"$gsl_log_c_file" \
|
"$gsl_log_c_file" \
|
||||||
"Missing: __$gsl_post_hf_1" \
|
"Unused: __$gsl_post_hf_1" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
|
|
||||||
|
@ -344,21 +360,22 @@ fi
|
||||||
#======================================================================
|
#======================================================================
|
||||||
gsl__check_image() {
|
gsl__check_image() {
|
||||||
gsl__check_header_fields \
|
gsl__check_header_fields \
|
||||||
"Content" "$gsl_log_h_image" "$gsl_log_act_image" \
|
"Header" "$gsl_marker_image" "$gsl_log_act_image" \
|
||||||
|
|| return
|
||||||
|
|
||||||
|
gsl__check_header_field3 \
|
||||||
|
"Header" "$gsl_marker_image" "$gsl_marker_image" \
|
||||||
|| return
|
|| return
|
||||||
|
|
||||||
echo -ne "\r\033[2K: Searching for Images... $gsl_post_hf_1"
|
echo -ne "\r\033[2K: Searching for Images... $gsl_post_hf_1"
|
||||||
|
|
||||||
gsl__check_header_field3 "Content" "$gsl_log_h_image" "$gsl_marker_image" \
|
|
||||||
|| return
|
|
||||||
|
|
||||||
# File exists in folder
|
# File exists in folder
|
||||||
if ! [[ -f "$gsl_dir_domain_images/$gsl_post_hf_2" ]];then
|
if ! [[ -f "$gsl_dir_domain_images/$gsl_post_hf_2" ]];then
|
||||||
|
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Header" \
|
||||||
"$gsl_log_h_image" \
|
"$gsl_marker_image" \
|
||||||
"Not found: $gsl_post_hf_2" \
|
"Not found: $gsl_post_hf_2" \
|
||||||
"$gsl_dir_domain_images/$gsl_post_hf_2"
|
"$gsl_dir_domain_images/$gsl_post_hf_2"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
|
@ -389,8 +406,8 @@ else
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Content" \
|
||||||
"$gsl_log_c_image" \
|
"Image" \
|
||||||
"Missing: _image:$gsl_post_hf_1" \
|
"Unused: _image:$gsl_post_hf_1" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
|
|
||||||
|
@ -403,7 +420,7 @@ fi
|
||||||
gsl__check_fcode() {
|
gsl__check_fcode() {
|
||||||
|
|
||||||
gsl__check_header_fields \
|
gsl__check_header_fields \
|
||||||
"Content" "$gsl_log_h_code" "$gsl_log_act_code" \
|
"Header" "$gsl_log_h_code" "$gsl_log_act_code" \
|
||||||
|| return
|
|| return
|
||||||
|
|
||||||
echo -ne "\r\033[2K: Searching for File Codes... $gsl_post_hf_1"
|
echo -ne "\r\033[2K: Searching for File Codes... $gsl_post_hf_1"
|
||||||
|
@ -415,8 +432,8 @@ if ! [[ -f "$gsl_dir_domain_files/$gsl_post_hf_2" ]];then
|
||||||
|
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Header" \
|
||||||
"$gsl_log_h_code" \
|
"$gsl_marker_code" \
|
||||||
"Not found: $gsl_post_hf_2" \
|
"Not found: $gsl_post_hf_2" \
|
||||||
"$gsl_dir_domain_files/$gsl_post_hf_2"
|
"$gsl_dir_domain_files/$gsl_post_hf_2"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
|
@ -447,8 +464,8 @@ else
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Content" \
|
||||||
"$gsl_log_c_code" \
|
"Code" \
|
||||||
"Missing: _code:$gsl_post_hf_1" \
|
"Unused: _code:$gsl_post_hf_1" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
|
|
||||||
|
@ -498,10 +515,18 @@ gsl__check_needed_headers \
|
||||||
|
|
||||||
# Date
|
# Date
|
||||||
echo -ne "\r\033[2K: Searching HEADERS... $gsl_header_date"
|
echo -ne "\r\033[2K: Searching HEADERS... $gsl_header_date"
|
||||||
|
# Date format check in fr or INternational ?
|
||||||
|
if [[ `grep -i "fr" <<<"$gsl_site_lang"` ]];then
|
||||||
|
gsl_log_content="DD-MM-YYYY"
|
||||||
|
gsl_test_date='^[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]+$'
|
||||||
|
else
|
||||||
|
gsl_log_content="YYYY-MM-DD"
|
||||||
|
gsl_test_date='^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]+$'
|
||||||
|
fi
|
||||||
gsl__check_needed_headers \
|
gsl__check_needed_headers \
|
||||||
"$gsl_header_date" \
|
"$gsl_header_date" \
|
||||||
"$gsl_marker_date" \
|
"$gsl_marker_date" \
|
||||||
"YYYY-MM-DD" \
|
"$gsl_log_content" \
|
||||||
&& gsl_date_err=true
|
&& gsl_date_err=true
|
||||||
|
|
||||||
# Description
|
# Description
|
||||||
|
@ -527,8 +552,8 @@ if ! [[ "$gsl_author_err" ]] && \
|
||||||
|
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Header" \
|
||||||
"Header $gsl_marker_author" \
|
"$gsl_marker_author" \
|
||||||
"$gsl_header_author not registred for domain $gsl_find_domain" \
|
"$gsl_header_author not registred for domain $gsl_find_domain" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
|
@ -541,13 +566,25 @@ if ! [[ "$gsl_date_err" ]] && \
|
||||||
|
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Content" \
|
"Header" \
|
||||||
"Header $gsl_marker_date" \
|
"$gsl_marker_date" \
|
||||||
"$gsl_header_date not YYYY-MM-DD" \
|
"$gsl_header_date not $gsl_log_content" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
gsl_checker_err=true
|
gsl_checker_err=true
|
||||||
|
gsl_date_mismatch=true
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
if ! [[ $gsl_date_mismatch ]];then
|
||||||
|
gsl_date_m=`awk -F- '{print $2}' <<<"$gsl_header_date"`
|
||||||
|
[[ "$gsl_date_m" -gt 12 ]] \
|
||||||
|
&& gsl__logs_print \
|
||||||
|
"$gsl_log_e" \
|
||||||
|
"Header" \
|
||||||
|
"$gsl_marker_date" \
|
||||||
|
"$gsl_header_date : Month > 12..." \
|
||||||
|
"${PWD}/$gsl_post" \
|
||||||
|
&& gsl_checker_err=true
|
||||||
|
fi
|
||||||
|
|
||||||
# Slug format title-post
|
# Slug format title-post
|
||||||
if ! [[ "$gsl_slug_err" ]];then
|
if ! [[ "$gsl_slug_err" ]];then
|
||||||
|
@ -561,8 +598,8 @@ if ! [[ "$gsl_slug_err" ]];then
|
||||||
"$gsl_post" && \
|
"$gsl_post" && \
|
||||||
gsl__logs_print \
|
gsl__logs_print \
|
||||||
"$gsl_log_w" \
|
"$gsl_log_w" \
|
||||||
"Content" \
|
"Header" \
|
||||||
"Header $gsl_marker_slug" \
|
"$gsl_marker_slug" \
|
||||||
"Changed: $gsl_header_slug_test" \
|
"Changed: $gsl_header_slug_test" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
|
|
||||||
|
|
|
@ -99,11 +99,11 @@ awk -v s="$1" \
|
||||||
#======================================================================
|
#======================================================================
|
||||||
# Loop till no more list marker
|
# Loop till no more list marker
|
||||||
gsl__make_list() {
|
gsl__make_list() {
|
||||||
if [[ `awk -v mls="$gsl_mark_listo" \
|
if [[ `awk -v mls="\$gsl_mark_listo" \
|
||||||
'$1 ~ mls {print NR,$0;exit}' \
|
'match($1,mls) {print NR,$0;exit}' \
|
||||||
"$gsl_tmp_post"` ]] || \
|
"$gsl_tmp_post"` ]] || \
|
||||||
[[ `awk -v mls="$gsl_mark_list" \
|
[[ `awk -v mls="\$gsl_mark_list" \
|
||||||
'$1 ~ mls {print NR,$0;exit}' \
|
'match($1,mls) {print NR,$0;exit}' \
|
||||||
"$gsl_tmp_post"` ]];then
|
"$gsl_tmp_post"` ]];then
|
||||||
gsl__make_list_read_by_block
|
gsl__make_list_read_by_block
|
||||||
fi
|
fi
|
||||||
|
@ -170,12 +170,12 @@ gsl__make_list
|
||||||
# =====================================================================
|
# =====================================================================
|
||||||
# Create TMP HTML block list file
|
# Create TMP HTML block list file
|
||||||
# =====================================================================
|
# =====================================================================
|
||||||
gsl_file_html_list=`mktemp`
|
|
||||||
gsl__make_list_convert() {
|
gsl__make_list_convert() {
|
||||||
|
gsl_file_html_list=`mktemp`
|
||||||
|
|
||||||
# mln: marker list number | pmln: previous list mark number
|
# mln: marker list number | pmln: previous list mark number
|
||||||
gsl__make_list_count_prev_mark() {
|
gsl__make_list_count_prev_mark() {
|
||||||
pml=`awk -v pln=$(( ln -1 )) 'NR == pln {print $1}' "$gsl_file_block_list"`
|
pml=`gawk -v pln=$(( ln -1 )) 'NR == pln {print $1}' "$gsl_file_block_list"`
|
||||||
pmln=${#pml}
|
pmln=${#pml}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,6 +219,7 @@ do
|
||||||
"" \
|
"" \
|
||||||
"<li class=\"${gsl_site_css}_list-li ${gsl_site_css}_list-$mln\">$content</li>" \
|
"<li class=\"${gsl_site_css}_list-li ${gsl_site_css}_list-$mln\">$content</li>" \
|
||||||
>> "$gsl_file_html_list"
|
>> "$gsl_file_html_list"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
printf "%${mln_indent_close}s%s\n" \
|
printf "%${mln_indent_close}s%s\n" \
|
||||||
|
@ -383,32 +384,32 @@ rm -f "$gsl_file_block_titles"
|
||||||
# Find and convert paragraphs (3 different css styles)
|
# Find and convert paragraphs (3 different css styles)
|
||||||
#=======================================================================
|
#=======================================================================
|
||||||
gsl__make_paragraphs() {
|
gsl__make_paragraphs() {
|
||||||
gsl_html_par_o1="<p class=\"${gsl_site_css}_paragraph\">"
|
|
||||||
gsl_html_par_o2="<p class=\"${gsl_site_css}_paragraph-2\">"
|
|
||||||
gsl_html_par_o3="<p class=\"${gsl_site_css}_paragraph-3\">"
|
|
||||||
gsl_html_par_c="</p>"
|
|
||||||
|
|
||||||
echo -ne "\r\033[2K: Converting Paragraphs..."
|
echo -ne "\r\033[2K: Converting Paragraphs..."
|
||||||
|
|
||||||
while read -r "gsl_content_line_nbr" "gsl_content_line"
|
while read -r "ln" "content"
|
||||||
do
|
do
|
||||||
case "$gsl_content_line" in
|
case "$content" in
|
||||||
")")
|
")")
|
||||||
sed -i "${gsl_content_line_nbr}s,.*,$gsl_html_par_c," \
|
sed -i "${ln}s,.*,</p>," \
|
||||||
"$gsl_tmp_post"
|
"$gsl_tmp_post"
|
||||||
;;
|
;;
|
||||||
"("|"( 1")
|
|
||||||
sed -i "${gsl_content_line_nbr}s,.*,$gsl_html_par_o1," \
|
"("*)
|
||||||
"$gsl_tmp_post"
|
gsl_css_id=`
|
||||||
;;
|
awk -v l="$ln" \
|
||||||
"( 2")
|
'NR == l {print $2}' \
|
||||||
sed -i "${gsl_content_line_nbr}s,.*,$gsl_html_par_o2," \
|
"$gsl_tmp_post"`
|
||||||
"$gsl_tmp_post"
|
|
||||||
;;
|
if [[ "$gsl_css_id" ]] && \
|
||||||
"( 3")
|
[[ `grep '^[-0-9a-zA-Z]*$' <<<"$gsl_css_id"` ]];then
|
||||||
sed -i "${gsl_content_line_nbr}s,.*,$gsl_html_par_o3," \
|
gsl_css_id="-$gsl_css_id"
|
||||||
|
fi
|
||||||
|
gsl_html_par_id="<p class=\"${gsl_site_css}_paragraph$gsl_css_id\">"
|
||||||
|
|
||||||
|
sed -i "${ln}s,.*,$gsl_html_par_id," \
|
||||||
"$gsl_tmp_post"
|
"$gsl_tmp_post"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -226,6 +226,6 @@ awk -v l="$gsl_post_begin" \
|
||||||
gsl__post_begin() {
|
gsl__post_begin() {
|
||||||
gsl_post_begin=`
|
gsl_post_begin=`
|
||||||
awk -v m="#1" \
|
awk -v m="#1" \
|
||||||
'$1 == m {print NR;exit}' \
|
'match($1,m) {print NR;exit}' \
|
||||||
"$gsl_post"`
|
"$gsl_post"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,10 +82,15 @@ done < <(ls -1 "$gsl_dir_db" | grep ".gsl.db")
|
||||||
#gsl.articles.posts=nombre d'articles type page
|
#gsl.articles.posts=nombre d'articles type page
|
||||||
#gsl.authors=nombre d'auteurs
|
#gsl.authors=nombre d'auteurs
|
||||||
|
|
||||||
|
#gsl.articles.words=
|
||||||
|
#gsl.articles.quotes=
|
||||||
|
#gsl.articles.paragraphs=
|
||||||
|
|
||||||
|
|
||||||
printf '%s\n%s\n%s\n%s\n' \
|
printf '%s\n%s\n%s\n%s\n' \
|
||||||
"gsl.articles=$gsl_stats_articles_www" \
|
"gsl.articles=$gsl_stats_articles_www" \
|
||||||
"gsl_articles_pages=$gsl_stats_articles_pages_www" \
|
"gsl.articles.pages=$gsl_stats_articles_pages_www" \
|
||||||
"gsl_articles_posts=$gsl_stats_articles_posts_www" \
|
"gsl.articles.posts=$gsl_stats_articles_posts_www" \
|
||||||
"gsl.authors=$gsl_auth_max" \
|
"gsl.authors=$gsl_auth_max" \
|
||||||
> "$gsl_file_sti" && \
|
> "$gsl_file_sti" && \
|
||||||
echo "> Génération des stats (Statoolinfos): $gsl_file_sti"
|
echo "> Génération des stats (Statoolinfos): $gsl_file_sti"
|
||||||
|
|
|
@ -177,8 +177,8 @@ gsl__check_needed_headers() {
|
||||||
! [[ "$1" ]] \
|
! [[ "$1" ]] \
|
||||||
&& gsl__logs_print \
|
&& gsl__logs_print \
|
||||||
"$gsl_log_e" \
|
"$gsl_log_e" \
|
||||||
"Post" \
|
"Content" \
|
||||||
"Header $2" \
|
"$2" \
|
||||||
"Missing: $3" \
|
"Missing: $3" \
|
||||||
"${PWD}/$gsl_post" \
|
"${PWD}/$gsl_post" \
|
||||||
&& gsl_checker_err=true
|
&& gsl_checker_err=true
|
||||||
|
@ -241,7 +241,7 @@ if ! [[ "$gsl_post_hf_3" ]];then
|
||||||
"$gsl_log_w" \
|
"$gsl_log_w" \
|
||||||
"$1" \
|
"$1" \
|
||||||
"$2" \
|
"$2" \
|
||||||
"Line:$gsl_post_hf_l > No Alt Text ?" \
|
"Line:$gsl_post_hf_l > No Alt Text" \
|
||||||
"${PWD}/$gsl_post"
|
"${PWD}/$gsl_post"
|
||||||
gsl_checker_war=true
|
gsl_checker_war=true
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue