diff --git a/Makefile b/Makefile index 50ab9ed..3d428ba 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ MARKDOWN := $(wildcard *.md doc/*.md doc/mod/*.md) HTML := $(MARKDOWN:.md=.html) DATE ?= $(shell date --rfc-email) -VERSION ?= $(shell git symbolic-ref --short HEAD 2>/dev/null)/$(shell git rev-list --count HEAD 2>/dev/null)/$(shell git rev-parse --short HEAD 2>/dev/null) +VERSION ?= $(shell git symbolic-ref --short HEAD 2>/dev/null)/$(shell git rev-list --count HEAD 2>/dev/null)/$(shell git rev-parse --short=8 HEAD 2>/dev/null) export DATE VERSION .PHONY: all checksums docs rsc clean diff --git a/contrib/html.sh b/contrib/html.sh index 24cc9b0..dfdaf4a 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -3,6 +3,7 @@ set -e RELTO="$(dirname "${1}")" + sed \ -e "s|__TITLE__|$(head -n1 "${1}")|" \ -e "s|__STYLE__|$(realpath --relative-to="${RELTO}" general/style.css)|" \ @@ -10,11 +11,13 @@ sed \ -e "s|__EWORM__|$(realpath --relative-to="${RELTO}" general/eworm-meadow.avif)|" \ -e "s|__QR_CODE__|$(realpath --relative-to="${RELTO}" general/qr-code.png)|" \ < "${0}.d/head.html" + markdown -f toc,idanchor "${1}" | sed \ -e 's/href="\([-_\./[:alnum:]]*\)\.md\(#[-[:alnum:]]*\)\?"/href="\1.html\2"/g' \ -e '/| id="\L\1">|' \ -e '/

Then right-click, click "Take Screenshot" and finally select the logo and download it.

-

Screenshot Browser 01

-

Screenshot Browser 02

-

Screenshot Browser 03

+

Screenshot Browser 01

+

Screenshot Browser 02

+

Screenshot Browser 03

(This example is with Firefox. The workflow diff --git a/contrib/template-capsman.sh b/contrib/template-capsman.sh index 3303472..5771b53 100755 --- a/contrib/template-capsman.sh +++ b/contrib/template-capsman.sh @@ -2,7 +2,10 @@ set -e -sed -e '/\/interface\/wifi\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.capsman|' \ +sed \ + -e '/\/interface\/wifi\//d' \ + -e '/\/interface\/wireless\//d' \ + -e 's|%TEMPL%|.capsman|' \ -e '/^# NOT \/caps-man\/ #$/,/^# NOT \/caps-man\/ #$/d' \ -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ < "${1}" diff --git a/contrib/template-local.sh b/contrib/template-local.sh index 8212028..bc5b327 100755 --- a/contrib/template-local.sh +++ b/contrib/template-local.sh @@ -2,7 +2,10 @@ set -e -sed -e '/\/caps-man\//d' -e '/\/interface\/wifi\//d' -e 's|%TEMPL%|.local|' \ +sed \ + -e '/\/caps-man\//d' \ + -e '/\/interface\/wifi\//d' \ + -e 's|%TEMPL%|.local|' \ -e '/^# NOT \/interface\/wireless\/ #$/,/^# NOT \/interface\/wireless\/ #$/d' \ -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ < "${1}" diff --git a/contrib/template-wifi.sh b/contrib/template-wifi.sh index 8d48ada..5e297d9 100755 --- a/contrib/template-wifi.sh +++ b/contrib/template-wifi.sh @@ -2,7 +2,10 @@ set -e -sed -e '/\/caps-man\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.wifi|' \ +sed \ + -e '/\/caps-man\//d' \ + -e '/\/interface\/wireless\//d' \ + -e 's|%TEMPL%|.wifi|' \ -e '/^# NOT \/interface\/wifi\/ #$/,/^# NOT \/interface\/wifi\/ #$/d' \ -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ < "${1}" diff --git a/global-functions.rsc b/global-functions.rsc index 48aaf7f..dccb8b6 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -539,10 +539,16 @@ :set FetchUserAgentStr do={ :local Caller [ :tostr $1 ]; + :global CommitId; + :global CommitInfo; + + :global IfThenElse; + :local Resource [ /system/resource/get ]; - :return ("User-Agent: Mikrotik/" . $Resource->"version" . " " . \ - $Resource->"architecture-name" . " " . $Caller . "/Fetch (https://rsc.eworm.de/)"); + :return ("User-Agent: Mikrotik/" . $Resource->"version" . " " . $Resource->"architecture-name" . \ + " " . $Caller . "/Fetch (https://rsc.eworm.de/" . [ $IfThenElse ($CommitId != "unknown") \ + ("; " . $CommitInfo . "/" . [ :pick $CommitId 0 8 ]) ] . ")"); } # check for existence of file, optionally with type