summary refs log tree commit diff stats
path: root/fwendplanet_html.awk
diff options
context:
space:
mode:
Diffstat (limited to 'fwendplanet_html.awk')
-rwxr-xr-xfwendplanet_html.awk61
1 files changed, 49 insertions, 12 deletions
diff --git a/fwendplanet_html.awk b/fwendplanet_html.awk index c4ebe0e..84f29a6 100755 --- a/fwendplanet_html.awk +++ b/fwendplanet_html.awk
@@ -4,6 +4,8 @@
4BEGIN { 4BEGIN {
5 TITLE = "fwend planet" 5 TITLE = "fwend planet"
6 FS = "\t" 6 FS = "\t"
7 NEXT = ENVIRON["NEXT"]
8 PREV = ENVIRON["PREV"]
7} 9}
8 10
9BEGIN { 11BEGIN {
@@ -18,7 +20,22 @@ BEGIN {
18 print "<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">" 20 print "<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">"
19 print "</head>" 21 print "</head>"
20 print "<body>" 22 print "<body>"
21 print "<h1>fwend planet</h1>" 23 print "<div id=\"main\">"
24 print "<h1>fwend planet"
25 if (PREV) {
26 p = (PREV ~ /index/ ? 1 : PREV)
27 gsub(/[^0-9]/, "", p)
28 print "p. " (int(p) + 1)
29 }
30 print "</h1>"
31 print "<div class=\"nav\">"
32 if (PREV) {
33 print "<a href=\"" PREV "\">prev</a>"
34 }
35 if (NEXT) {
36 print "<a href=\"" NEXT "\">next</a>"
37 }
38 print "</div>"
22} 39}
23 40
24{ 41{
@@ -32,30 +49,50 @@ BEGIN {
32 author = $7 49 author = $7
33 enclosure = $8 50 enclosure = $8
34 category = $9 51 category = $9
52 datecmd = "date -d@" timestamp " +%F"
53 datecmd | getline date
54 close(datecmd)
35 print "<details>" 55 print "<details>"
36 print "<summary>" title "</summary>" 56 print "<summary>" (title ? title : "<untitled>") " : <time class=\"time\">" date "</time></summary>"
37 print "<div class=\"links\">" 57 print "<div class=\"links\">"
38 print "<a href=\"" link "\">read original</a>" 58 if (link && title !~ /linkbudz/ && link != enclosure) {
59 print "<a href=\"" link "\">read original</a>"
60 }
39 if (enclosure) { 61 if (enclosure) {
40 print "<a href=\"" enclosure "\">enclosure</a>" 62 print "<a href=\"" enclosure "\">enclosure</a>"
41 } 63 }
42 print "</div>" 64 print "</div>"
43 print "<div class=\"content\">" content "</div>" 65 print "<div class=\"content\">" content "</div>"
44 print "<details class=\"info\"><summary>item information</summary>" 66 print "<details class=\"info\"><summary>item information</summary>"
45 print "timestamp: " timestamp 67 print "<dl>"
46 print "title: " title 68 print "<dt>timestamp</dt><dd>" timestamp "</dd>"
47 print "link: " link 69 print "<dt>title</dt><dd>" title "</dd>"
48 print "content_type: " content_type 70 print "<dt>link</dt><dd>" link "</dd>"
49 print "id: " id 71 print "<dt>content_type</dt><dd>" content_type "</dd>"
50 print "author: " author 72 print "<dt>id</dt><dd>" id "</dd>"
51 print "enclosure: " enclosure 73 print "<dt>author</dt><dd>" author "</dd>"
52 print "category: " category 74 print "<dt>enclosure</dt><dd>" enclosure "</dd>"
75 print "<dt>category</dt><dd>" category "</dd>"
76 print "</dl>"
53 print "</details>" 77 print "</details>"
54 print "</details>" 78 print "</details>"
55} 79}
56 80
57END { 81END {
58 print "<a href=\"mailto:fwends@me.acdw.net\">email acdw</a> if you have issues." 82 print "<div class=\"nav\">"
83 if (PREV) {
84 print "<a href=\"" PREV "\">prev</a>"
85 }
86 if (NEXT) {
87 print "<a href=\"" NEXT "\">next</a>"
88 }
89 print "</div>"
90 print "<div id=\"footer\">"
91 print "sourced from <a href=\"https://tildegit.org/casa/pages/src/branch/main/opml/mug.of.opml\">"
92 print "a mug of opml</a>."
93 print "<a href=\"mailto:fwends@me.acdw.net\">problems? suggestions?</a>"
94 print "</div>"
95 print "</div>"
59 print "</body>" 96 print "</body>"
60 print "</html>" 97 print "</html>"
61} 98}