New Image marker Options ; Fixes

This commit is contained in:
Cyrille L 2022-06-23 12:24:01 +02:00
parent 6c2552d8dd
commit 37a18a3af4
14 changed files with 304 additions and 373 deletions

View File

@ -99,13 +99,19 @@ gsl help -w
# Comment gérer la sidebar # Comment gérer la sidebar
------------------------------------------------------------------------ ------------------------------------------------------------------------
La gestion de la sidebar est manuelle. Un article doit être convertit La gestion de la sidebar est manuelle. Un article doit être convertit
avec make avant de pouvoir l'ajouter à la position désirée. Le nombre avec make (ou wip add) avant de pouvoir l'ajouter à la position désirée.
d'articles maximum dans la sidebar est configurable dans le fichier de Le nombre d'articles maximum dans la sidebar est configurable dans le
configuration du domaine (DOMAIN.conf) (via le questionnaire) fichier de configuration du domaine (DOMAIN.conf) (via le questionnaire)
``` ```
# Crée la sidebar avec les derniers articles publiés
gsl sidebar latest gsl sidebar latest
# Remplace l'article à la position 2
gsl sidebar replace 2 monarticle.gsl gsl sidebar replace 2 monarticle.gsl
# Place l'article à la position 3, déplace les suivants (enlève le dernier)
gsl sidebar add 3 monarticle.gsl
``` ```
## Astuces ## Astuces

View File

@ -1,5 +1,5 @@
Package: egsl Package: egsl
Version: 0.1.2 Version: 0.1.3
Section: custom Section: custom
Priority: optional Priority: optional
Architecture: all Architecture: all

View File

@ -206,20 +206,30 @@ image: 2 : FILENAME : ALT-TEXT
``` ```
Dans l'article... Dans l'article...
Définir le marqueur ```_image``` et spécifiez les Définir le marqueur ```_image``` et spécifiez 5 valeurs séparées par
valeurs séparées par ```:```. ```+``` indique l'ouverture dans une ```:```. Placez ```+``` pour faire un lien vers l'image ou définir un
nouvelle fenêtre. Seuls le "numéro d'image" est obligatoire lien http/ftp pour faire un lien externe sur l'image.
Seul la prelière valeur est obligatoire. Les suivantes peuvent être soit
la valeur prévue, soit un lien
Les valeurs: Les valeurs:
- Numero d'image 1. Numero d'image
- Alignement: l,r,(g,d également),c pour gauche, droite, centre) 2. Alignement: l,r,(g,d également),c pour gauche, droite, centre)
- - maclasse au lieu de l,r,g,d,c pour utiliser la classe css "maclasse" - - maclasse au lieu de l,r,g,d,c pour utiliser la classe css "maclasse"
- - + (class="center") - - ```+``` : CSS center. Lien vers l'image
- Longueur width: (avec unité) - - ```http/ftp``` : CSS center. Lien externe sur l'image
- - + (taille originale) 3. Longueur width : unité par défaut: px si inconnue
- Largeur height: (avec unité) - - ```0``` : longueur non définie
- - + (longueur définie, largeur originale) - - ```+``` : CSS maclasse. Lien vers l'image
- + (Lien de l'image dans un nouvel onglet) - - ```http/ftp``` : CSS maclasse. Lien externe sur l'image
4. Largeur height : unité par défaut: px si inconnue
- - ```0``` : largeur non définie
- - ```+``` : CSS maclasse. Lien vers l'image
- - ```http/ftp``` : CSS maclasse. Lien externe sur l'image
5. lien : vers l'image interne ou un lien externe
- - ```+``` : CSS maclasse. Lien vers l'image
- - ```http/ftp``` : CSS maclasse. Lien externe sur l'image
Exemple d'images affichées l'une à côté de l'autre Exemple d'images affichées l'une à côté de l'autre
@ -227,7 +237,8 @@ Exemple d'images affichées l'une à côté de l'autre
( (
_image:1 _image:1
_image:2:c:640px:25% _image:2:c:640px:25%
_image:3:maclass:320px:240px:+ _image:3:maclass:320:+
_image:4:maclass:0:400:https://echolib.re
) )
``` ```
@ -240,7 +251,7 @@ center
_image:1:+ _image:1:+
) )
( (
_image:2:c:1920px:25% _image:2:c:1920px:25%:https://echolib.re
) )
``` ```

View File

@ -16,13 +16,24 @@ image: 1 : dir/dir1/pic.png
``` ```
## Images: set style and target ## Images: set style and target
Examples HTML Ouput according to marker "_image:" marker in content
``` ```
# Open in new tab pic, keep origin sizes image: 5 : avatar-echolib.png : echolib
_image:1:+
# Open pic in new tab, using your css class and with width in pixel _image:5:l:234:567:https://echolib.re
# (height is kept) <a class="a-lec_image-link" href="https://echolib.re"><img class="a-lec_image a-lec_image-left" src="./images/avatar-echolib.png" alt="echolib" title="echolib" style="width:234px;height:567px;" /></a>
_image:1:c:640px:+
_image:5:http://echolib.re
<a class="a-lec_image-link" href="http//echolib.re"><img class="a-lec_image a-lec_image-center" src="./images/avatar-echolib.png" alt="echolib" title="echolib" /></a>
_image:5:CSS-B:128:http://echolib.re
<a class="a-lec_image-link CSS-B" href="http//echolib.re"><img class="a-lec_image CSS-B" src="./images/avatar-echolib.png" alt="echolib" title="echolib" style="width:128px;" /></a>
_image:5:CSS-A:http://echolib.re
<a class="a-lec_image-link CSS-A" href="http//echolib.re"><img class="a-lec_image CSS-A" src="./images/avatar-echolib.png" alt="echolib" title="echolib" /></a>
_image:5:+
<a class="a-lec_image-link" href="./images/avatar-echolib.png"><img class="a-lec_image a-lec_image-center" src="./images/avatar-echolib.png" alt="echolib" title="echolib" /></a>
``` ```
## Make (changes in your template) ## Make (changes in your template)
@ -44,3 +55,7 @@ If your remove a www or wip page, and you have put it in the sidebar,
do not forget to replace it with another article. You can also have an do not forget to replace it with another article. You can also have an
automatic sidebar with automatic sidebar with
- gsl sidebar latest - gsl sidebar latest
## Stats
For local URL (i.e. /index.html (or /)), online stats will be couted only
after article is in www on new check (command)

View File

@ -1,145 +1,15 @@
## [0.1.0] ## [0.1.3]
### Fix:
## Please, see help (and documentations in help folder) - invalid argument
- site_css variable called in sidebar
### Add - make : even if page created, article must be check if changed
- New code about everywhere, more comments, cleaner
- nano dependence
- Check installed configuration at launch
- Dedicated functions for ARGUMENTS in specific files category
- - check: gsl__post_checkers
- - make,sidebar: gsl__post_makers
- - sync,www,wip gsl__srv_manager
- - log: gsl__log_manager
- - db: gsl__db_manager
- - 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:
- - gsl__srv_manager: for all about server
- - gsl__version: for -v, -vv, --version options
- - gsl__domain_manager: for OPT author, new, setdir
- - gsl__edit_file: functions to edit some configuration files
- - gsl__do_commons: Common functions to filter article lines
- - gsl__HTML_template: functions to create HTML pages
- New empty folder in installation:
- - /var/lib/gsl/db: for all DBs (.gitkepp)
- - /var/lib/gsl/domains: for all domains (.gitkeep)
- - /var/log/gsl: for logs files (.gitkeep)
- New help folder in
- - /var/lib/gsl/help (removed "helps" one)
- - - Renamed documentation files (not all translated ; some in french)
### Logs
- Better logs harmony
- New fields in log for article filename and domain name
- Specific number of characters spaces in some log fields
- More verbose
- "automatic" level log set from called functions
- Colored levels: war (yellow), err (red)
### Databases
- Dedicated per article
- Folder: /var/lib/gsl/db/
- New file format: domains.db
- More datas with new stats. Quicker sourced datas
- Dedicated articles in sub-directory "DOMAIN"
- Check if corrupted DB
- Database and wip files won't be removed if errors in article
- If corrupted Database, try restoring www & wip statuses at new check
### Changes ### Changes
- Changes in mapping process: - images marker in content: use external http/ftp link
- - Processes get needed headers FIRST, then split article in 2 sections - - No more needed unity: defaut "px" if not known in content marker
- DOMAIN Profile is only in /var/lib/gsl/domains/DOMAIN/ - - See examples output HTML in help folder (how-to_Tips_And_Advises.md)
- Variables in DOMAIN.conf file has no more "gsl_" - - See main usage in help folder (comment_ecrire_article.md)
- Some translated words in HTML page from lang set DOMAIN (fr || en) - Ask to confirm both wip & www sync with gsl sync
- Between markers (code): put "everything" you want
- New CSS classes: see gsl help css or documentation
- Mark image (i.e. "_image:1:mycss:50%:25%:+)"
- - define your own css class 'mycss'
- - define unity ("%","px"... with height and witdth)
- New lists. Mix "+" (ol) and "=" (ul) and write an item on several lines
- Between hX titles: new div css (none if empty content)
- Changing article Type will remove old wip file (not www file !)
- sync: Logs not shown but added
- stats properties file is now in /www (online)
### Process check [argument] ### Add
- slug: log err if already exists (log war if not well formated) - Stats : local link from slug (/...) counted after new check if added to www
### new ARGUMENTS
- new (page|post) (name): Create article, show its content + check it
- new domain: New domain configuration creator
- new author: Same as author edit
- edit domains: Set/Edit registred domains database
- edit author: Same as author edit
- author edit: Opens nano to Add/Remove authors (one per line) by DOMAIN
- setdir: Set current folder for your DOMAIN (show if one)
- check -N: Only check newer articles not in DB
- clean all: Remove all backups (only) files
- sidebar: add|replace|latest|oldest (See gsl help)
- www sync: Same as sync www (see gsl help)
- wip ...: Same as www but for wip (see gsl help)
### Markers
- css: MYCLASS Customize each article with your CSS (optional)
- brut: Insert brut code from file
- - In article header: "NBR : FILENAME"``
- - In article content: "_brut: NBR"
- "_image:VALUE:MYCSS:WIDTH:HEIGHT:TARGET" (no target=no HTML link)
- Strong mark: '•...•' (alt+gr + ;) on french azerty keyboard)
- Bold mark: '·...·' (alt+gr + :) on french azerty keyboard)
- Emphasis mark: '”...”' (alt+gr + n) on french azerty keyboard)
- Strike mark: '×...×' (alt+gr + shift + ;) on french azerty keyboard
- ```<<``` and ```>>``` as "start" and "close" marker for lists
### Template
- included basic header, metas and footer
- All about template is in /var/lib/gsl/scripts/gsl__HTML_template
- - No more header.html in templates folder
- - - Edit your own in create__HTML_header() function
- In /var/lib/gsl/domains/DOMAIN/templates/
- - Auto created metas.html and footer.html if not exist
- - Edit your own footer.html
- - Edit your own metas per DOMAIN for HTML ```<head>``` in metas.html
- - - included basic pre-registred meta from datas article
- - No CSS styles included: create your own (see classes and IDs used in doc)
- For all changes here, after gsl make, use gsl sync...
### Sidebar
- No more /var/lib/gsl/domains/DOMAIN/templates/last-posts-list.html
- - Remove it with files xxx.X in /var/lib/gsl/domains/DOMAIN/X-tra/
- New HTML file: /var/lib/gsl/domains/DOMAIN/templates/sidebar.html
- - Created with files /var/lib/gsl/domains/DOMAIN/X-tra/sidebar/(POS).html
- articles are sorted from epoch date (in DB) with false time at check
### Statoolinfos (added properties for www status)
- Genereated at each www (add/remove)
- gsl.articles
- gsl.articles.pages
- gsl.articles.posts
- gsl.authors
- gsl.articles.tags
- gsl.articles.words
- gsl.articles.quotes
- gsl.articles.paragraphs
- gsl.articles.links
- gsl.articles.links.online
- gsl.articles.lists
- gsl.articles.lists.items
- gsl_articles.images
### CRITIK
- Remove all files in /var/lib/gsl/db/
- Use: ```gsl new domain```, give your registred DOMAIN name
- - Answer Y to autofix old configurations files and folders
- - Do it for each DOMAIN you registred
- - will add site_max_list=5 (default) in domain configuration file
- Use ```gsl check``` in your articles folder

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Version: 0.1.2 # Version: 0.1.3
# file: gsl # file: gsl
# Folder: /usr/local/bin # Folder: /usr/local/bin
# By echolib (XMPP: im@echolib.re) # By echolib (XMPP: im@echolib.re)
@ -61,7 +61,7 @@ done
#====================================================================== #======================================================================
# Helper # Helper
# $2: arguments list # $1: arguments list from help
#====================================================================== #======================================================================
help__OPTIONS() { help__OPTIONS() {
clear clear
@ -141,12 +141,14 @@ esac
if__gsl_post # from gsl__post_manager: check if .gsl if__gsl_post # from gsl__post_manager: check if .gsl
case "$1" in case "$1" in
db|sync|-s|edit|-E) true ;;
check|-C) check__OPTIONS "$@" ;; check|-C) check__OPTIONS "$@" ;;
make|-M) make__OPTIONS "$@" ;; make|-M) make__OPTIONS "$@" ;;
sidebar|-S) sidebar__OPTIONS "$2" "$3" "$4" ;; sidebar|-S) sidebar__OPTIONS "$2" "$3" "$4" ;;
www) srv__OPTIONS "$1" "$2" "$3" ;; www) srv__OPTIONS "$1" "$2" "$3" ;;
wip) srv__OPTIONS "$1" "$2" "$3" ;; wip) srv__OPTIONS "$1" "$2" "$3" ;;
stats) stats__datas;exit ;; stats) stats__datas;exit ;;
*) gsl__invalid_option "$1" "See help argument";exit ;;
esac esac
#====================================================================== #======================================================================
@ -172,3 +174,4 @@ if [[ "$gsl_checker_err" ]];then
gsl_logs_err=true gsl_logs_err=true
gsl__logs_show gsl__logs_show
fi fi
exit

View File

@ -99,13 +99,19 @@ gsl help -w
# Comment gérer la sidebar # Comment gérer la sidebar
------------------------------------------------------------------------ ------------------------------------------------------------------------
La gestion de la sidebar est manuelle. Un article doit être convertit La gestion de la sidebar est manuelle. Un article doit être convertit
avec make avant de pouvoir l'ajouter à la position désirée. Le nombre avec make (ou wip add) avant de pouvoir l'ajouter à la position désirée.
d'articles maximum dans la sidebar est configurable dans le fichier de Le nombre d'articles maximum dans la sidebar est configurable dans le
configuration du domaine (DOMAIN.conf) (via le questionnaire) fichier de configuration du domaine (DOMAIN.conf) (via le questionnaire)
``` ```
# Crée la sidebar avec les derniers articles publiés
gsl sidebar latest gsl sidebar latest
# Remplace l'article à la position 2
gsl sidebar replace 2 monarticle.gsl gsl sidebar replace 2 monarticle.gsl
# Place l'article à la position 3, déplace les suivants (enlève le dernier)
gsl sidebar add 3 monarticle.gsl
``` ```
## Astuces ## Astuces

View File

@ -206,20 +206,30 @@ image: 2 : FILENAME : ALT-TEXT
``` ```
Dans l'article... Dans l'article...
Définir le marqueur ```_image``` et spécifiez les Définir le marqueur ```_image``` et spécifiez 5 valeurs séparées par
valeurs séparées par ```:```. ```+``` indique l'ouverture dans une ```:```. Placez ```+``` pour faire un lien vers l'image ou définir un
nouvelle fenêtre. Seuls le "numéro d'image" est obligatoire lien http/ftp pour faire un lien externe sur l'image.
Seul la prelière valeur est obligatoire. Les suivantes peuvent être soit
la valeur prévue, soit un lien
Les valeurs: Les valeurs:
- Numero d'image 1. Numero d'image
- Alignement: l,r,(g,d également),c pour gauche, droite, centre) 2. Alignement: l,r,(g,d également),c pour gauche, droite, centre)
- - maclasse au lieu de l,r,g,d,c pour utiliser la classe css "maclasse" - - maclasse au lieu de l,r,g,d,c pour utiliser la classe css "maclasse"
- - + (class="center") - - ```+``` : CSS center. Lien vers l'image
- Longueur width: (avec unité) - - ```http/ftp``` : CSS center. Lien externe sur l'image
- - + (taille originale) 3. Longueur width : unité par défaut: px si inconnue
- Largeur height: (avec unité) - - ```0``` : longueur non définie
- - + (longueur définie, largeur originale) - - ```+``` : CSS maclasse. Lien vers l'image
- + (Lien de l'image dans un nouvel onglet) - - ```http/ftp``` : CSS maclasse. Lien externe sur l'image
4. Largeur height : unité par défaut: px si inconnue
- - ```0``` : largeur non définie
- - ```+``` : CSS maclasse. Lien vers l'image
- - ```http/ftp``` : CSS maclasse. Lien externe sur l'image
5. lien : vers l'image interne ou un lien externe
- - ```+``` : CSS maclasse. Lien vers l'image
- - ```http/ftp``` : CSS maclasse. Lien externe sur l'image
Exemple d'images affichées l'une à côté de l'autre Exemple d'images affichées l'une à côté de l'autre
@ -227,7 +237,8 @@ Exemple d'images affichées l'une à côté de l'autre
( (
_image:1 _image:1
_image:2:c:640px:25% _image:2:c:640px:25%
_image:3:maclass:320px:240px:+ _image:3:maclass:320:+
_image:4:maclass:0:400:https://echolib.re
) )
``` ```
@ -240,7 +251,7 @@ center
_image:1:+ _image:1:+
) )
( (
_image:2:c:1920px:25% _image:2:c:1920px:25%:https://echolib.re
) )
``` ```

View File

@ -16,13 +16,24 @@ image: 1 : dir/dir1/pic.png
``` ```
## Images: set style and target ## Images: set style and target
Examples HTML Ouput according to marker "_image:" marker in content
``` ```
# Open in new tab pic, keep origin sizes image: 5 : avatar-echolib.png : echolib
_image:1:+
# Open pic in new tab, using your css class and with width in pixel _image:5:l:234:567:https://echolib.re
# (height is kept) <a class="a-lec_image-link" href="https://echolib.re"><img class="a-lec_image a-lec_image-left" src="./images/avatar-echolib.png" alt="echolib" title="echolib" style="width:234px;height:567px;" /></a>
_image:1:c:640px:+
_image:5:http://echolib.re
<a class="a-lec_image-link" href="http//echolib.re"><img class="a-lec_image a-lec_image-center" src="./images/avatar-echolib.png" alt="echolib" title="echolib" /></a>
_image:5:CSS-B:128:http://echolib.re
<a class="a-lec_image-link CSS-B" href="http//echolib.re"><img class="a-lec_image CSS-B" src="./images/avatar-echolib.png" alt="echolib" title="echolib" style="width:128px;" /></a>
_image:5:CSS-A:http://echolib.re
<a class="a-lec_image-link CSS-A" href="http//echolib.re"><img class="a-lec_image CSS-A" src="./images/avatar-echolib.png" alt="echolib" title="echolib" /></a>
_image:5:+
<a class="a-lec_image-link" href="./images/avatar-echolib.png"><img class="a-lec_image a-lec_image-center" src="./images/avatar-echolib.png" alt="echolib" title="echolib" /></a>
``` ```
## Make (changes in your template) ## Make (changes in your template)
@ -44,3 +55,7 @@ If your remove a www or wip page, and you have put it in the sidebar,
do not forget to replace it with another article. You can also have an do not forget to replace it with another article. You can also have an
automatic sidebar with automatic sidebar with
- gsl sidebar latest - gsl sidebar latest
## Stats
For local URL (i.e. /index.html (or /)), online stats will be couted only
after article is in www on new check (command)

View File

@ -1,145 +1,15 @@
## [0.1.0] ## [0.1.3]
### Fix:
## Please, see help (and documentations in help folder) - invalid argument
- site_css variable called in sidebar
### Add - make : even if page created, article must be check if changed
- New code about everywhere, more comments, cleaner
- nano dependence
- Check installed configuration at launch
- Dedicated functions for ARGUMENTS in specific files category
- - check: gsl__post_checkers
- - make,sidebar: gsl__post_makers
- - sync,www,wip gsl__srv_manager
- - log: gsl__log_manager
- - db: gsl__db_manager
- - 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:
- - gsl__srv_manager: for all about server
- - gsl__version: for -v, -vv, --version options
- - gsl__domain_manager: for OPT author, new, setdir
- - gsl__edit_file: functions to edit some configuration files
- - gsl__do_commons: Common functions to filter article lines
- - gsl__HTML_template: functions to create HTML pages
- New empty folder in installation:
- - /var/lib/gsl/db: for all DBs (.gitkepp)
- - /var/lib/gsl/domains: for all domains (.gitkeep)
- - /var/log/gsl: for logs files (.gitkeep)
- New help folder in
- - /var/lib/gsl/help (removed "helps" one)
- - - Renamed documentation files (not all translated ; some in french)
### Logs
- Better logs harmony
- New fields in log for article filename and domain name
- Specific number of characters spaces in some log fields
- More verbose
- "automatic" level log set from called functions
- Colored levels: war (yellow), err (red)
### Databases
- Dedicated per article
- Folder: /var/lib/gsl/db/
- New file format: domains.db
- More datas with new stats. Quicker sourced datas
- Dedicated articles in sub-directory "DOMAIN"
- Check if corrupted DB
- Database and wip files won't be removed if errors in article
- If corrupted Database, try restoring www & wip statuses at new check
### Changes ### Changes
- Changes in mapping process: - images marker in content: use external http/ftp link
- - Processes get needed headers FIRST, then split article in 2 sections - - No more needed unity: defaut "px" if not known in content marker
- DOMAIN Profile is only in /var/lib/gsl/domains/DOMAIN/ - - See examples output HTML in help folder (how-to_Tips_And_Advises.md)
- Variables in DOMAIN.conf file has no more "gsl_" - - See main usage in help folder (comment_ecrire_article.md)
- Some translated words in HTML page from lang set DOMAIN (fr || en) - Ask to confirm both wip & www sync with gsl sync
- Between markers (code): put "everything" you want
- New CSS classes: see gsl help css or documentation
- Mark image (i.e. "_image:1:mycss:50%:25%:+)"
- - define your own css class 'mycss'
- - define unity ("%","px"... with height and witdth)
- New lists. Mix "+" (ol) and "=" (ul) and write an item on several lines
- Between hX titles: new div css (none if empty content)
- Changing article Type will remove old wip file (not www file !)
- sync: Logs not shown but added
- stats properties file is now in /www (online)
### Process check [argument] ### Add
- slug: log err if already exists (log war if not well formated) - Stats : local link from slug (/...) counted after new check if added to www
### new ARGUMENTS
- new (page|post) (name): Create article, show its content + check it
- new domain: New domain configuration creator
- new author: Same as author edit
- edit domains: Set/Edit registred domains database
- edit author: Same as author edit
- author edit: Opens nano to Add/Remove authors (one per line) by DOMAIN
- setdir: Set current folder for your DOMAIN (show if one)
- check -N: Only check newer articles not in DB
- clean all: Remove all backups (only) files
- sidebar: add|replace|latest|oldest (See gsl help)
- www sync: Same as sync www (see gsl help)
- wip ...: Same as www but for wip (see gsl help)
### Markers
- css: MYCLASS Customize each article with your CSS (optional)
- brut: Insert brut code from file
- - In article header: "NBR : FILENAME"``
- - In article content: "_brut: NBR"
- "_image:VALUE:MYCSS:WIDTH:HEIGHT:TARGET" (no target=no HTML link)
- Strong mark: '•...•' (alt+gr + ;) on french azerty keyboard)
- Bold mark: '·...·' (alt+gr + :) on french azerty keyboard)
- Emphasis mark: '”...”' (alt+gr + n) on french azerty keyboard)
- Strike mark: '×...×' (alt+gr + shift + ;) on french azerty keyboard
- ```<<``` and ```>>``` as "start" and "close" marker for lists
### Template
- included basic header, metas and footer
- All about template is in /var/lib/gsl/scripts/gsl__HTML_template
- - No more header.html in templates folder
- - - Edit your own in create__HTML_header() function
- In /var/lib/gsl/domains/DOMAIN/templates/
- - Auto created metas.html and footer.html if not exist
- - Edit your own footer.html
- - Edit your own metas per DOMAIN for HTML ```<head>``` in metas.html
- - - included basic pre-registred meta from datas article
- - No CSS styles included: create your own (see classes and IDs used in doc)
- For all changes here, after gsl make, use gsl sync...
### Sidebar
- No more /var/lib/gsl/domains/DOMAIN/templates/last-posts-list.html
- - Remove it with files xxx.X in /var/lib/gsl/domains/DOMAIN/X-tra/
- New HTML file: /var/lib/gsl/domains/DOMAIN/templates/sidebar.html
- - Created with files /var/lib/gsl/domains/DOMAIN/X-tra/sidebar/(POS).html
- articles are sorted from epoch date (in DB) with false time at check
### Statoolinfos (added properties for www status)
- Genereated at each www (add/remove)
- gsl.articles
- gsl.articles.pages
- gsl.articles.posts
- gsl.authors
- gsl.articles.tags
- gsl.articles.words
- gsl.articles.quotes
- gsl.articles.paragraphs
- gsl.articles.links
- gsl.articles.links.online
- gsl.articles.lists
- gsl.articles.lists.items
- gsl_articles.images
### CRITIK
- Remove all files in /var/lib/gsl/db/
- Use: ```gsl new domain```, give your registred DOMAIN name
- - Answer Y to autofix old configurations files and folders
- - Do it for each DOMAIN you registred
- - will add site_max_list=5 (default) in domain configuration file
- Use ```gsl check``` in your articles folder

View File

@ -85,12 +85,19 @@ case "$1" in
&& return && return
[[ $article_is_new ]] && return [[ $article_is_new ]] && return
[[ $article_Errors == "yes" ]] \ if (( $article_Hash != $article_Status_chk ));then
&& gsl__logs_print -e -A -inv \ gsl__logs_print -e -A -inv \
"Found errors ; Cannot continue" \ "Article not checked yet" \
"$PWD/$gsl_post" \ "$PWD/$gsl_post"
&& return return
elif [[ $article_Errors == "yes" ]];then
gsl__logs_print -e -A -inv \
"Found errors ; Cannot continue" \
"$PWD/$gsl_post"
return
fi
gsl_do_make=true gsl_do_make=true
;; ;;
esac esac

View File

@ -104,6 +104,7 @@ if ! [[ "$header_f1" ]];then
fi fi
case "$1" in case "$1" in
# TYPE
"$gsl_marker_type") "$gsl_marker_type")
gsl_post_type="$header_f1" gsl_post_type="$header_f1"
@ -122,7 +123,8 @@ case "$1" in
;; ;;
esac esac
;; ;;
# CSS
"$gsl_marker_css") "$gsl_marker_css")
gsl_post_css=" $header_f1" gsl_post_css=" $header_f1"
gsl__logs_print -i -h \ gsl__logs_print -i -h \
@ -130,11 +132,13 @@ case "$1" in
"Body template: $header_f1" \ "Body template: $header_f1" \
"$PWD/$gsl_post" "$PWD/$gsl_post"
;; ;;
# Title
"$gsl_marker_title") "$gsl_marker_title")
gsl_post_title="$header_f1" gsl_post_title="$header_f1"
;; ;;
# DATE
"$gsl_marker_date") "$gsl_marker_date")
gsl_post_date="$header_f1" gsl_post_date="$header_f1"
if [[ `grep -i "fr" <<<"$site_lang"` ]];then if [[ `grep -i "fr" <<<"$site_lang"` ]];then
@ -172,7 +176,8 @@ case "$1" in
date_epoch="$gsl_date_y-$gsl_date_m-$gsl_date_d $false_time" date_epoch="$gsl_date_y-$gsl_date_m-$gsl_date_d $false_time"
date_epoch=`date +%s -u -d "$date_epoch"` date_epoch=`date +%s -u -d "$date_epoch"`
;; ;;
# SLUG
"$gsl_marker_slug") "$gsl_marker_slug")
gsl_post_slug="$header_f1" gsl_post_slug="$header_f1"
gsl_post_slug_src="$gsl_post_slug" gsl_post_slug_src="$gsl_post_slug"
@ -232,7 +237,8 @@ case "$1" in
done < <(grep -sl "article_Slug=\"$gsl_post_slug\"" \ done < <(grep -sl "article_Slug=\"$gsl_post_slug\"" \
$gsl_dir_db_domain/*.db) $gsl_dir_db_domain/*.db)
;; ;;
# AUTHOR
"$gsl_marker_author") "$gsl_marker_author")
gsl_post_author="$header_f1" gsl_post_author="$header_f1"
if ! [[ `grep "^$gsl_post_author$" "$gsl_file_domain_authors"` ]];then if ! [[ `grep "^$gsl_post_author$" "$gsl_file_domain_authors"` ]];then
@ -243,6 +249,7 @@ case "$1" in
fi fi
;; ;;
# INFO
"$gsl_marker_info") "$gsl_marker_info")
gsl_post_info="$header_f1" gsl_post_info="$header_f1"
if (( ${#gsl_post_info} <= 18 ));then if (( ${#gsl_post_info} <= 18 ));then
@ -253,6 +260,7 @@ case "$1" in
fi fi
;; ;;
# TAGS
"$gsl_marker_tags") "$gsl_marker_tags")
gsl_post_tags="$header_f1" gsl_post_tags="$header_f1"
gsl_stat_tags=`awk -F, '{print NF}' <<<$gsl_post_tags` gsl_stat_tags=`awk -F, '{print NF}' <<<$gsl_post_tags`
@ -391,6 +399,15 @@ if ! [[ `grep "\<_$header_f1\>" "$gsl_tmp_post"` ]];then
return return
fi fi
# For online stats, convert /... url
# article not yet in www ; do not check status and count
case "$header_f2" in
"/"*)
[[ $gsl_srv_www_file ]] \
&& header_f2="$site_url$header_f2"
;;
esac
# Get Online status # Get Online status
case "$header_f2" in case "$header_f2" in
"http"*) "http"*)

View File

@ -230,7 +230,6 @@ fi
! [[ "$gsl_do_make" ]] && return ! [[ "$gsl_do_make" ]] && return
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# Set HTML to replace first marker # Set HTML to replace first marker
# Closed HTML are static > in gsl.conf # Closed HTML are static > in gsl.conf
@ -628,8 +627,20 @@ make__file_bruts "$1"
# $1: file post # $1: file post
#====================================================================== #======================================================================
make__file_images() { make__file_images() {
this_image=`grep -n "$gsl_mark_image:$header_f1" "$1"` unset ${!image_@}
link_class="${site_css}_image-link"
this_image=`grep -n "$gsl_mark_image:$header_f1" "$1" | head -n 1`
[[ "$this_image" ]] || return [[ "$this_image" ]] || return
echo "$this_image"
# local link with "+" or external link if http*
# $1: field
make__file_image_link() {
case "$1" in
"+") image_link="${srv_uri}images/$header_f2" ;;
"http"*|"ftp"*) image_link="$image_field_link" ;;
esac
}
mark_image=${this_image#*:} # Get content mark to replace mark_image=${this_image#*:} # Get content mark to replace
while IFS=: read -r "ln" \ while IFS=: read -r "ln" \
@ -640,51 +651,129 @@ while IFS=: read -r "ln" \
"height" \ "height" \
"target" "target"
do do
case "$class" in # Class
R|r|D|d) image_class="${site_css}_image-right" ;; if [[ "$class" ]];then
G|g|L|l) image_class="${site_css}_image-left" ;; image_field_link="$class$width"
C|c|D|d) image_class="${site_css}_image-center" ;; case "$class" in
"+") image_class="${site_css}_image-center";target=true ;; R|r|D|d) image_class="${site_css}_image-right" ;;
"") image_class="${site_css}_image-center";unset width height ;; G|g|L|l) image_class="${site_css}_image-left" ;;
*) image_class="$class";link_class=" $class" ;; C|c|D|d) image_class="${site_css}_image-center" ;;
esac
case "$width" in
"+") target=true;unset width ;;
esac
case "$height" in # Use this class if not known target
"+") target=true;unset height ;; *)
esac make__file_image_link "$class"
if [[ $image_link ]];then
image_class="${site_css}_image-center"
unset width height
else
image_class="$class"
link_class+=" $class"
fi
;;
esac
else
image_class="${site_css}_image-center"
fi
# Width
if [[ "$width" ]];then
image_field_link="$width$height"
make__file_image_link "$width"
if [[ $image_link ]];then
unset width height target
else
image_width=`
grep -Eo '[[:alpha:]]+|[0-9]+' \
<<<"$width" \
| head -n 1`
if (( $image_width == 0 ));then
unset width
else
image_unitw=${width/$image_width/}
! [[ "$image_unitw" ]] && image_unitw="px"
fi
fi
fi
# Height
if [[ "$height" ]];then
image_field_link="$height$target"
make__file_image_link "$height"
if [[ $image_link ]];then
unset height target
else
image_height=`
grep -Eo '[[:alpha:]]+|[0-9]+' \
<<<"$height" \
| head -n 1`
if (( $image_height == 0 ));then
unset height
else
image_unith=${height/$image_height/}
! [[ "$image_unith" ]] && image_unith="px"
fi
fi
fi
# Target
if [[ "$target" ]];then
image_field_link="$target"
make__file_image_link "$target"
fi
# Create HTML width & height for <img ...
if [[ "$height" && "$width" ]];then
image_style=`
printf ' %s%s%s\n' \
"style=\"" \
"width:$image_width$image_unitw;" \
"height:$image_height$image_unith;\""`
elif [[ "$width" ]];then
image_style=`
printf ' %s%s\n' \
"style=\"" \
"width:$image_width$image_unitw;\""`
elif [[ "$height" ]];then
image_style=`
printf ' %s%s\n' \
"style=\"" \
"height:$image_height$image_unith;\""`
fi
# Create HTML
image_css="class=\"${site_css}_image $image_class\"" image_css="class=\"${site_css}_image $image_class\""
image_src="src=\"${srv_uri}images/$header_f2\"" image_src="src=\"${srv_uri}images/$header_f2\""
image_alt="alt=\"$header_f3\" title=\"$header_f3\"" image_alt="alt=\"$header_f3\" title=\"$header_f3\""
if [[ "$height" && "$width" ]];then
image_style=" style=\"width:$width;height:$height;\""
elif [[ "$width" ]];then
image_style=" style=\"width:${width};\""
elif [[ "$height" ]];then
image_style=" style=\"height:${height};\""
fi
HTML_image=` HTML_image=`
printf '%s%s\n' \ printf '%s%s\n' \
"<img $image_css $image_src $image_alt" \ "<img $image_css $image_src $image_alt" \
"$image_style />"` "$image_style />"`
if [[ "$target" ]];then if [[ "$image_link" ]];then
image_clink="class=\"${site_css}_image-link$link_class\"" link_css="class=\"$link_class\""
HTML_image=` HTML_image=`
printf '%s%s%s\n' \ printf '%s%s%s\n' \
"<a $image_clink href=\"${srv_uri}images/$header_f2\">" \ "<a $link_css href=\"$image_link\">" \
"$HTML_image" \ "$HTML_image" \
"</a>"` "</a>"`
fi fi
echo "$HTML_image"
echo
sed -i "${ln}s^$mark_image^$HTML_image^" "$1"
done <<<"$this_image" done <<<"$this_image"
sed -i "${ln}s^$mark_image^$HTML_image^" "$1"
make__file_images "$1" make__file_images "$1"
} }

View File

@ -300,12 +300,23 @@ case "$1" in
log__process_begin "Sync $srv_proc" log__process_begin "Sync $srv_proc"
case "$1" in case "$1" in
"") "")
sync__srv "$srv_proc" "$gsl_srv_wip" read -rp "! Sync Template for both wip and www (Y|*) ? " sync_ask
sync__srv "$srv_proc" "$gsl_srv_www" case "$sync_ask" in
Y)
sync__srv "$srv_proc" "$gsl_srv_wip"
sync__srv "$srv_proc" "$gsl_srv_www"
;;
*)
echo "Abandon..."
exit
;;
esac
;; ;;
www) www)
sync__srv "$srv_proc" "$gsl_srv_www" sync__srv "$srv_proc" "$gsl_srv_www"
;; ;;
wip) wip)
sync__srv "$srv_proc" "$gsl_srv_wip" sync__srv "$srv_proc" "$gsl_srv_wip"
;; ;;