# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 11
# self = https://watcher.sour.is/conv/5stzvda
@bender I should put the template that is used by default as a file in the repo. Look at the source for now and you'll see 😅
@bender I should put the template that is used by default as a file in the repo. Look at the source for now and you'll see 😅
@prologic ah! Something like this:


<!DOCTYPE html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>{{ .Title }}</title>
  </head>
	<body class="preload">
	  <main class="container">
		{{ range $_, $twt := $.Twts }}
		  <article id="{{ $twt.Hash }}" class="h-entry">
			<div class="u-author h-card">
			  <div class="dt-publish">
				<a class="u-url" href="#{{ $twt.Hash }}">
				  <time class="dt-published" datetime="{{ $twt.Created | date "2006-01-02T15:04:05Z07:00" }}">
					{{ $twt.Created }}
				  </time>
				</a>
				<span>&nbsp;{{ $twt.Created | time }}</span>
				<a class="u-search" href="https://search.twtxt.net/twt/{{ $twt.Hash }}">(search)</a>
			  </div>
			</div>
			<div class="e-content">
			  {{ formatTwt $twt }}
			</div>
		  </article>
		{{ end }}
	  </main>
	</body>
</html>
@prologic ah! Something like this:


<!DOCTYPE html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>{{ .Title }}</title>
  </head>
\t<body class="preload">
\t  <main class="container">
\t\t{{ range $_, $twt := $.Twts }}
\t\t  <article id="{{ $twt.Hash }}" class="h-entry">
\t\t\t<div class="u-author h-card">
\t\t\t  <div class="dt-publish">
\t\t\t\t<a class="u-url" href="#{{ $twt.Hash }}">
\t\t\t\t  <time class="dt-published" datetime="{{ $twt.Created | date "2006-01-02T15:04:05Z07:00" }}">
\t\t\t\t\t{{ $twt.Created }}
\t\t\t\t  </time>
\t\t\t\t</a>
\t\t\t\t<span>&nbsp;{{ $twt.Created | time }}</span>
\t\t\t\t<a class="u-search" href="https://search.twtxt.net/twt/{{ $twt.Hash }}">(search)</a>
\t\t\t  </div>
\t\t\t</div>
\t\t\t<div class="e-content">
\t\t\t  {{ formatTwt $twt }}
\t\t\t</div>
\t\t  </article>
\t\t{{ end }}
\t  </main>
\t</body>
</html>
How difficult will it be for you to modify this, so that can also spit out individual HTML files named after the twtxt hash, using a similar template?
What's wrong with the timestamps, @prologic? See https://aelaraji.com/log.html, all are +0000 UTC+0000. Same on a local test I am running.

I tried changing {{ $twt.Created | date "2006-01-02T15:04:05Z07:00" }} to {{ $twt.Created | date "2006-01-02T15:04:05" }}, but no dice. I don't really care about the timezone. LOL.
@bender LOL normally things (in the vanilla template) render like <time class="dt-published" datetime="2024-09-17T15:05:19+01:00"> 2024-09-17 14:05:19 +0000 UTC+0000 </time> the datetime=... atribute is in my local time UTC+1 then the text within the tag is in UTC+0

The thing is, I've been poking at the template as well, but nothing changes. I literally whole portionsm added in lorem text just to see if it would do anything, then twtxt2html -T ./layout.html <link to twtxt file> | less shows same thing as before! nothing changes. LOL I'm not sure I'm going at it the right way.
@bender LOL normally things (in the vanilla template) render like <time class="dt-published" datetime="2024-09-17T15:05:19+01:00"> 2024-09-17 14:05:19 +0000 UTC+0000 </time> the datetime=... atribute is in my local time UTC+1 then the text within the tag is in UTC+0

The thing is, I've been poking at the template as well, but nothing changes. I literally whole portionsm added in lorem text just to see if it would do anything, then twtxt2html -T ./layout.html <link to twtxt file> | less shows same thing as before! nothing changes. LOL I'm not sure I'm going at it the right way.
@aelaraji this is my change on main.go (but it can be done on a template now, so no reason to touch the code):


                                 <time class="dt-published" datetime="{{ $twt.Created | date "2006-01-02T15:04:05Z07:00" }}">
                                        {{ $twt.Created | date "2006-01-02 15:04:05 MST" }}
                                  </time>


See https://ferengi.one. I am going to further customise things, but that's a start.
@bender that's not your change, silly robot, it is mine! LOL. I am finding @prologic's tool handy to refer to previous posts (as reference, for example).
@bender that's not your change, silly robot, it is mine! LOL. I am finding @prologic's tool handy to refer to previous posts (as reference, for example).