X-Git-Url: https://git.shemshak.org/~bandali/bndl.org/blobdiff_plain/d29d6cb99e1596a4ebe45f70b157e9ea0b7c3461..c468ea86fe03b0000d6377079118da7e78e6ca4f:/txt2pre?ds=sidebyside diff --git a/txt2pre b/txt2pre index 49bd164..f25cbcf 100644 --- a/txt2pre +++ b/txt2pre @@ -2,7 +2,7 @@ # txt2pre --- convert my site's txt files to `pre'-based atom/rss/html # Copyright (C) 2014-2021 all contributors -# Copyright (c) 2021 Amin Bandali +# Copyright (c) 2021 bandali # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -21,6 +21,9 @@ # wonderful public-inbox project, under AGPLv3+, with additions of # my own. +# Update (2021-11-01): this script isn't currently used for generating +# my site's pages anymore; but kept for future reference. + use strict; use warnings 'all'; @@ -200,6 +203,7 @@ $title .= " — $author" if $title !~ /$author/; my ($upd, $pub, $url) = $txt =~ /(.*)\r?\n(.*)\r?\n(.*)\r?\n?\z/; ($upd) = $upd =~ /(?:updated|ویرایش): (.*)/ if $upd; ($pub) = $pub =~ /(?:published|انتشار): (.*)/ if $pub; +$upd = $pub if (!$upd); ($url) = $url =~ /(?:plain text|متن ساده): (.*)/ if $url; $url = 'https://bndl.org/bandali-cv.txt' if (!$url and $title =~ /curriculum vitae/); @@ -272,7 +276,7 @@ qq( $url_html $note_id $pub_rfc5322\n) -. ($updated ? $updated : '') . +. (($updated and $pub ne $upd) ? $updated : '') . qq() : ''; }