~m15o/midnight-pub

ref: e8a28848e237b39449ffcf75391174ed41870d88 midnight-pub/gemini/gmi.go -rw-r--r-- 7.5 KiB
e8a28848m15o New logo thanks to she12! 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
// Code generated by go generate; DO NOT EDIT.

package gemini

var GmiMap = map[string]string{
	"index": `` + "```" + `
 .----. |:: :::|__.-'.. . .'-. | .: :  | _.-
 |:. '| |.:: .:|  |  || : . :| | : ::: | | '
 |.-----------+++----------------------. |
.'             |           ( >)         '.
-------------------------------------------
___      ___     .'The'.     ___      ___ |
|+|      |+|   MidnightPub   |+|      |+| |
___   (  ___     ` + "`" + `.___.'     ___      ___ |
|+| ) () |+|      !L||       |+|      |+| |
___/====\______--.!L||_|--_.--._--|\\-._.--.
   '    '@    /_/\     !--.:==: \--||--\` + "`" + `:=:
..-....-.@ @          @@ @....-....-....-...
  I    I@|/            ` + "`" + `Y@    I    I_.-.I
        \_/            \_/       o=',,-,,` + "`" + `=-
--------------------------------------------
` + "```" + `

{{ if .logged -}}
Welcome back {{ .name }}
{{ if .hasNotifications }}
=> /notifications >> New replies <<
{{ end }}
=> /account Account
=> {{ web }}/posts/new Write Post
{{ else -}}
It's late. You are seconds away from the main street in a small alley. It's quieter here, but you can still hear the sound of chatter, footsteps, and cars from busy downtown. The city is buzzing, the streets are like arteries. You see an intriguing place in the alley, with a moon on its door. It reads "The Midnight Pub".

The Midnight is a virtual pub that lets you write posts and create pages. To join, send an email to m15o@posteo.net

=> {{ web }}/login Login
=> {{ web }}/register Register
{{ end }}
Latest posts:

{{ range .posts -}}
{{ template "post" . }}
{{ end }}
=> /posts All posts

Patrons:

{{ range .users -}}
=> /~{{ . }} ~{{ . }}
{{ end }}
=> /patrons All patrons

Midnight Pub - Small alley off mainstreet
=> /manual Read Manual
=> /feed.xml Feed
=> https://www.buymeacoffee.com/m15o Order some beers (donate)
=> //smol.pub "Smol Pub" Notebooks
=> //main-street.nightfall.city/small-alley/ Exit the pub`,
	"manual": `=> / Back to the pub

# Midnight Pub's Manual

The following is written on a chalkboard at the entrance of the pub, you can see it's been erased and rewritten multiple times.

> Welcome to the Midnight, kind stranger! This little establishment aims to become your hide-out amidst the sprawling metropolis of bits and data the internet has become. Our furnitures might be a little old-school, but they'll hopefully offer you a dose of coziness which will only get enhanced by the bartender's carefully-crafted cocktails. You are currently standing in the entrance. If you look around, you will find the bar with its stools and jukebox, the lounge with fire crackling in the fireplace and a terrace that's open during the summer with a few tables. - m15o

The Midnight is an internet message-board where you can share your thoughts and connect with others. It's a slow place where reading is as important as writing. It's built to be small and favors quality of interaction over quantity.

The pub is reachable from the Web and Gemini. Gemini is a small-internet protocol. You can think of it as an alternate Web where only markdown-like (gemtext) documents are available, no html, css nor javascript. Because of its simplicity, Gemini offers a perfect medium for the Midnight, and uses it as its default content-type. The Web version converts from gemtext to html to display its content.

## How to register

To create an account, you will need a key. To get one, send an email to m15o@posteo.net. Once you receive your key, head to the following place to create your account:
=> /register Register

## Posts

The main way to interact on the Midnight is by writing posts. To create a post, you need a title and a content. The content allows the gemtext syntax:

` + "```" + `
# Top level title
## Second level title
### Third level title

* List item
* List item

> Quoted text

=> ://example.com This is a link
` + "```" + `

=> https://portal.mozz.us/gemini/gemini.circumlunar.space/docs/gemtext.gmi Read more about gemtext (web)
=> gemini://gemini.circumlunar.space/docs/gemtext.gmi Read more about gemtext (gemini)

## Pages

Midnight lets you host your personal homepage, available at username.midnight.pub. Here's an example:
=> //m15o.midnight.pub

You can create any kind of page. To make one accessible from gemini, make sure to use the .gmi extension. A gemini page is also viewable from the web.

## Theme (web)

If you are visiting from the web, you might be thinking, "hey, this pub looks... basic?". And you'd be right! From the outside, the Midnight is just simple HTML. However, anyone can give it the style they want. Just head over to your account page, and click the "Theme" link. Feel free to inject any CSS you'd like in there.

## Post using your terminal

It's possible to write posts and replies from your terminal using the following bash script:

=> //m15o.midnight.pub/midnight-sh.gmi midnight.sh
=> //m15o.midnight.pub/midnight-sh-man.gmi man midnight.sh

## Nightfall City

The Midnight is located in...

=> //main-street.nightfall.city/small-alley/ A small alley, on Main Street, Nightfall City

## Matrix room

tskaalgard has created a matrix room available on #midnightpub:matrix.org, or directly through:
=> https://matrix.to/#/!lOfHyKHtihXlDsIoYt:matrix.org?via=matrix.org

## Source code

=> https://sr.ht/~m15o/midnight-pub/

## Guidelines

The Midnight Pub has its own virtual pub etiquette so that everyone feels welcome and included.

### Do

* Respect others
* Be friendly
* Have fun
* Drink virtual cocktails responsibly

### Don't

* Pure self-promotion
* Spam & Phishing
* Hate
* Share anyone's private information
* Harmful and illegal activities
* Not Safe for Work (NSFW) content
`,
	"post": `=> / Midnight Pub

# {{ .post.Title }}

=> /~{{ .post.User }} ~{{ .post.User }}
{{- if eq .name .post.User }}
=> /posts/{{ .post.Id }}/edit Edit
=> /posts/{{ .post.Id }}/remove Remove
{{- end }}

{{ .post.Content }}

=> https://midnight.pub/posts/{{ .post.Id }} Write a reply

{{ if .replies -}}
# Replies
{{ range .replies }}
=> /replies/{{ .Id }} ~{{ .Author }} wrote{{ if .Thread }} (thread){{end}}:

{{ .Content }}
{{ end }}
{{- end -}}`,
	"posts": `=> / Back

# Midnight Pub

{{ range .posts -}}
{{ template "post" . }}
{{ end }}

{{- if ne 0 .page}}
=> ?page={{ dec .page }} Newer
{{- end }}{{if .showMore }}
=> ?page={{ inc .page }} Older
{{- end }}`,
	"reply": `=> /posts/{{ .reply.PostId }} < {{ .post.Title }}
{{ if .reply.ParentId -}}
=> /replies/{{ .reply.ParentId }} Parent
{{ end -}}
=> /~{{ .reply.Author }} ~{{ .reply.Author }}

{{ .reply.Content }}

=> https://midnight.pub/replies/{{ .reply.Id }} Write a reply

{{ if .reply.Thread -}}
# Replies
{{ range .reply.Thread }}
=> /replies/{{ .Id }} ~{{ .Author }} wrote{{ if .Thread }} (thread){{end}}:

{{ .Content }}
{{ end -}}
{{ end }}`,
	"user": `# {{ .user.Name }}

{{ range .posts }}
=> //midnight.pub/posts/{{ .Id }} {{ .Date }} {{ .Title }}
{{- end }}

=> //midnight.pub/~{{ .user.Name }} More posts
`,
	"user_pages": `=> / Midnight Pub

# {{ .user.Name }}

## Pages
{{ range .pages -}}
=> {{ url . }} {{ .Filename }} ({{ .User }})
{{ end }}

{{- if ne 0 .page}}
=> ?page={{ dec .page }} Newer
{{- end }}{{if .showMore }}
=> ?page={{ inc .page }} Older
{{- end }}
`,
	"user_posts": `=> / Midnight Pub

# {{ .user.Name }}
{{ if .user.About }}
{{ .user.About }}
{{ end }}
{{- range .posts }}
=> /posts/{{ .Id }} {{ .Date }} {{ .Title }}
{{- end }}
{{ if ne 0 .page }}
=> {{ prev_page .page }} Newer
{{- end }}{{if .showMore }}
=> {{ next_page .page }} Older
{{- end }}
`,
	"users": `=> / Midnight Pub

# All patrons
{{ range .users }}
=> /~{{ . }} ~{{ . }}
{{- end }}`,
}