-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
359 lines (264 loc) ยท 7.41 KB
/
index.html
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
<!doctype html><head><meta charset="utf-8"/><script src="../eveal.js/eveal.js"></script><title>Blogs & Websites from Markdown & JS - Tracey Jaquith</title></head><body>
# Blogtini
## Blogs & static Websites
## Markdown + 1 line of Javascript
### Decentralize & Archive your content forever
### [Tracey Jaquith](https://twitter.com/tracey_pooh)
#### [DwebCamp 2023](https://dwebcamp.org)
[tracey.archive.org](https://tracey.archive.org)
---
# The Idea
[blogtini.com](https://blogtini.com)
---
# A Site
<a href="https://blogtini.com"><img src="i/website.jpg"</a>
---
# A Post
<a href="https://blogtini.com/2022-07-blogtini-update/"><img src="i/post.jpg"</a>
---
# View Source
<a href="view-source:https://blogtini.com/2022-07-blogtini-update/"><img src="i/view-source.jpg"</a>
---
# Huh?
The page reads & parses itself
```js
const [frontmatter, markdown] = markdown_parse(
document.getElementsByTagName('body')[0].innerHTML
)
```
[JS](https://blogtini.com/js/blogtini.js)
---
# [Files Layout](https://github.com/traceypooh/ipfstini)
---
<!-- .slide: data-background="i/layout.jpg" data-background-size="contain" -->
---
## Publish full blog & web pages
- content 100% markdown
- theme & markdown-to-markup using JavaScript
---
## Publish full blog & web pages
- uses a `sitemap.xml` or RSS feed
<p class="fragment fade-up">
It's like "pointers" to your posts/pages
</p>
<p class="fragment fade-up">
Posts can be hosted anywhere
</p>
<div class="fragment fade-up">
โข free github.com, gitlab.com
</div>
<div class="fragment fade-up">
โข including DWeb
</div>
<div class="fragment fade-up">
โข self-hosted
</div>
---
## How ๐ท๏ธ
<pre class="fragment fade-up">
JS "crawls" your site
</pre>
<pre class="fragment fade-up">
parses markdown "front matter"
- date
- title
- tags
- categories
</pre>
<pre class="fragment fade-up">
`showdown` to convert to HTML
</pre>
<pre class="fragment fade-up">
re-paints page
</pre>
<pre class="fragment fade-up">
browser caches the analyzed site, auto-updates daily (can force re-cache)
</pre>
<pre class="fragment fade-up">
`lunr` for browser searching your posts/pages
</pre>
---
## Why ๐ค
- each post or page is a markdown file
<p class="fragment fade-up">
โข markdown is primary, archive-friendly, format/theme agnostic
</p>
<p class="fragment fade-up">
โข site formatting is _secondary_
</p>
---
## Why ๐ค
<p class="fragment fade-up">
โข no build step, no backend needed<br>
- just a static file server
</p>
<p class="fragment fade-up">
โข theme can be changed anytime (1 line change)
</p>
<p class="fragment fade-up">
โข [_good_ google SEO](https://www.google.com/search?q=site%3Ablogtini.com+and)
</p>
<p class="fragment fade-up">
โข google & more crawlers doing JS rendering
</p>
---
## Why ๐ค
- "View Source" is your _original_ content -- no formatting, no clutter
<p class="fragment fade-up">
โข You control your content
</p>
<p class="fragment fade-up">
โข posting to facebook, twitter, strava sucks
</p>
<p class="fragment fade-up">
โข where is your content?
</p>
<p class="fragment fade-up">
โข _what_ do you do with your GDPR?
</p>
<p class="fragment fade-up">
โข your data should last forever
</p>
<p class="fragment fade-up">
โข "roach proof" content-only format
</p>
---
## Life is better client-side ๐
---
### Life is better client-side ๐
```js
// parse frontmatter & (optional) `config.yml`
import yml from 'https://esm.archive.org/js-yaml'
// markdown-to-html
import showdown from 'https://esm.archive.org/showdown'
// code highlighting
import hljs from 'https://esm.archive.org/highlightjs'
// client-side search - like `solr`
import lunr from 'https://esm.archive.org/lunr'
// date/time hacking
import dayjs from 'https://esm.archive.org/dayjs'
// comments
import './staticman.js'
// sort hashmap by key
import { krsort } from 'https://av.prod.archive.org/js/util/strings.js'
```
---
## Static Sites
- _comments_ possible using `staticman`, etc.
- `staticman` -- comments go into your site repository
- _website search_ using `lunr` JS
- can use `git` "hooks" to run small script:
- keeps `sitemap.xml` and RSS feed up-to-date
- minor comments management
---
## Try it! ๐ค
Simple as:
- create new file
- index.html
- contents:
<pre style="white-space: pre-wrap">
---
title: my neat post
date: 2022-08-27
tags: [blogging, markdown]
comment: &#60;script src="https://blogtini.com/js/blogtini.js" type="module" charset="utf-8"&#62;&#60;/script&#62;
โโโ
Having fun *blogging* and hoping to write _more_ this year.
</pre>
---
# Preview ๐
- use any basic http file server, eg:
```sh
python3 -m http.server
```
- OR open `index.html` in browser
- [mac]: double click from `finder` folder; `open index.html` in `terminal`
- copy url to `safari` (if not already)
- dev tools, disable CORS restrictions & reload
---
<!-- .slide: data-background="i/cors.jpg" data-background-size="contain" -->
---
# Examples
https://blogtini.com/
Site with all posts in same github repository
---
# Examples
https://traceypooh.github.io/dwebtini/
Site with posts served from multiple storage sites
- github
- IPFS
- web3
- archive.org
_(click post links and notice browser url chnages)_
---
# Examples
https://ipfs.io/ipfs/QmWhoVkYm2SNoPEAK5ZmKFNtqVAietNsdzZrZYWK9KaXw9/
Site with all posts on IPFS
---
# Full Example
Tracey's website using HuGo :
- https://poohbot.com
Tracey's website using https://blogtini.com :
- https://traceypooh.github.io/poohtini/
---
# Publish โ๐ฝ
- make https://github.com account
- create and `git clone` a new repository
- add your `index.html` file
- add `.nojekyll` (empty) file
- `git push`
- [turn on GitHub Pages](https://docs.github.com/en/pages/quickstart)
- https://[YOUR-GITHUB-USERNAME].github.io/[REPOSITORY-NAME]/
---
# Extending out
- millions of sites linked together
- save a list of friends & families for a merged activity "feed"
- only needs to determine latest few posts from each site per sitemap/RSS
- JS "crawl" them, parse their markdown, merge into decentralized feed
---
# Future ๐ฎ
- Aggregate all _your data/posts_ (twitter, facebook, etc.) to markdown posts on _your own_ site
- Friends & Family aggregate sitemap/feed
- Friends & Family client-side aggregate lunr search
- comments go to correct specific site/place/person/entity
---
# Future ๐ฎ
Archive a site of many sites
<p class="fragment fade-up">
Just one combo `sitemap.xml` away <span class="fragment">!</span>
</p>
---
# Future ๐ฎ
- https://www.w3.org/TR/activitypub
- SocialWG _(Christine is here...)_
- publish new activity
- notify followers in their chosen way
---
# GDPR ๐ช๐บ
- General Data Protection Regulation (EU)
<p class="fragment fade-up">
โข primary aim is to enhance individuals' control & rights over their personal data
</p>
<p class="fragment fade-up">
"must be able to transfer personal data from one electronic processing system to and into another, without being prevented from doing so"
</p>
---
# Longevity ๐ง
<p class="fragment fade-up">
โข If `WordPress` goes away, billions of people _disappear forever_
</p>
<p class="fragment fade-up">
โข Average web page is gone in *three months*
</p>
<p class="fragment fade-up">
โข Make your (digital) life a _Vampire_
</p>
<p class="fragment fade-up">
โข Make it _Live Forever_
</p>
---
<!-- .slide: data-background="i/redwoods.jpg" data-background-size="contain" -->
## ๐๐ฝ Thank You! ๐๐ฝ
[tracey.archive.org](https://tracey.archive.org)
---
# The Future