summaryrefslogtreecommitdiffstats
path: root/2022/captions/emacsconf-2022-indieweb--putting-org-mode-on-the-indieweb--michael-herstine--main.vtt
blob: f41a39818af06677b4f104a8281e16f9e61fb060 (plain) (blame)
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
WEBVTT captioned by bhavin192

00:00:00.000 --> 00:00:02.280
Hey everyone, I'm Michael,

00:00:02.280 --> 00:00:03.640
and I'm going to be talking about

00:00:03.640 --> 00:00:06.000
Org mode and the IndieWeb.

00:00:06.000 --> 00:00:08.840
I am located in the San Francisco Bay Area,

00:00:08.840 --> 00:00:10.321
where I'm a developer as well as

00:00:10.321 --> 00:00:14.080
a longtime Emacs user.

00:00:14.080 --> 00:00:17.560
So, I maintain a personal website using Org mode.

00:00:17.560 --> 00:00:19.080
If you're watching this talk,

00:00:19.080 --> 00:00:21.560
I'm going to guess that you probably are too.

00:00:21.560 --> 00:00:24.880
For anybody who isn't,

00:00:24.880 --> 00:00:28.680
let me explain exactly what I mean by that.

00:00:28.680 --> 00:00:32.280
I have a static website. I author the pages

00:00:32.280 --> 00:00:34.000
in Org mode's markup language,

00:00:34.000 --> 00:00:36.280
otherwise known as Orgdown.

00:00:36.280 --> 00:00:38.440
I use the Org export facility

00:00:38.440 --> 00:00:43.760
to transcode that markup to HTML.

00:00:43.760 --> 00:00:47.000
And then I just use rsync to push

00:00:47.000 --> 00:00:51.760
the resulting HTML pages up to a VPS.

00:00:51.760 --> 00:00:52.854
I like the workflow.

00:00:52.854 --> 00:00:57.840
It's familiar to me as a coder.

00:00:57.840 --> 00:01:03.960
I get to use familiar tools like Git and Make.

00:01:03.960 --> 00:01:06.120
Publishing and then pushing the site

00:01:06.120 --> 00:01:09.800
to a local test server is just `make`.

00:01:09.800 --> 00:01:13.880
Pushing it to the live site is just `make prod`.

00:01:13.880 --> 00:01:18.680
That said, certain problems made themselves apparent

00:01:18.680 --> 00:01:22.080
with this arrangement pretty quickly.

00:01:22.080 --> 00:01:25.840
Commenting was one. It's very difficult

00:01:25.840 --> 00:01:28.200
to support commenting on a static website.

00:01:28.200 --> 00:01:29.501
I've got no database.

00:01:29.501 --> 00:01:34.120
I have no real server, and so on.

00:01:34.120 --> 00:01:35.960
Yes, of course, there is Disqus

00:01:35.960 --> 00:01:37.868
and other third party services

00:01:37.868 --> 00:01:38.800
that will do this for you,

00:01:38.800 --> 00:01:43.880
but I was uncomfortable outsourcing that job.

00:01:43.880 --> 00:01:45.320
And it was more than just comments.

00:01:45.320 --> 00:01:48.360
There was a general sense of isolation.

00:01:48.360 --> 00:01:50.680
There's no connection to places

00:01:50.680 --> 00:01:53.360
like Reddit, or Mastodon, or Twitter,

00:01:53.360 --> 00:01:56.560
you know, where all the people are.

00:01:56.560 --> 00:01:59.520
I guess you can post, then Tweet a link to it.

00:01:59.520 --> 00:02:01.960
But suppose somebody responds to your Tweet.

00:02:01.960 --> 00:02:05.520
Now you've got a conversation going on on Twitter

00:02:05.520 --> 00:02:07.640
that you're a visitor, and

00:02:07.640 --> 00:02:09.960
that a non-Twitter-using visitor to your site

00:02:09.960 --> 00:02:15.400
would be completely disconnected from.

00:02:15.400 --> 00:02:19.000
I am seeing people using Reddit effectively

00:02:19.000 --> 00:02:22.640
as the comment section for their sites.

00:02:22.640 --> 00:02:24.760
But unless you've got an audience, you know,

00:02:24.760 --> 00:02:27.720
the size of Derek's or Amos's,

00:02:27.720 --> 00:02:32.040
I don't think that's really feasible either.

00:02:32.040 --> 00:02:34.200
Now, after casting about for some time,

00:02:34.200 --> 00:02:37.680
I stumbled upon something called the IndieWeb.

00:02:37.680 --> 00:02:39.280
In their own words, the IndieWeb is

00:02:39.280 --> 00:02:41.960
a community of independent and personal websites

00:02:41.960 --> 00:02:44.401
connected by simple standards based on

00:02:44.401 --> 00:02:46.720
the principles of owning your domain

00:02:46.720 --> 00:02:48.480
and using it as your primary identity,

00:02:48.480 --> 00:02:50.360
publishing on your own site,

00:02:50.360 --> 00:02:52.418
and optionally syndicating elsewhere,

00:02:52.418 --> 00:02:54.320
and owning your data.

00:02:54.320 --> 00:02:57.680
I would describe it as a collection of individuals

00:02:57.680 --> 00:03:01.360
who've chosen to own their own platforms,

00:03:01.360 --> 00:03:05.520
alongside a loosely specked set of standards

00:03:05.520 --> 00:03:07.480
that tie those sites together.

00:03:07.480 --> 00:03:09.218
And it's really those standards

00:03:09.218 --> 00:03:10.640
that make the IndieWeb

00:03:10.640 --> 00:03:13.120
more than just a call for everybody

00:03:13.120 --> 00:03:14.735
to go back to the arts

00:03:14.735 --> 00:03:17.800
and blog on on their own sites.

00:03:17.800 --> 00:03:19.640
Now, this presentation isn't going to

00:03:19.640 --> 00:03:21.480
focus on the IndieWeb as such.

00:03:21.480 --> 00:03:23.360
It's more about using Org mode

00:03:23.360 --> 00:03:24.640
to put your site on the IndieWeb.

00:03:24.640 --> 00:03:28.040
I'm a little limited by time here,

00:03:28.040 --> 00:03:30.351
so I'm going to focus on

00:03:30.351 --> 00:03:32.080
just one of those protocols,

00:03:32.080 --> 00:03:33.400
and that's Webmentions.

00:03:33.400 --> 00:03:35.720
So, what's a Webmention?

00:03:35.720 --> 00:03:38.520
Let's begin with the inveterate Alice,

00:03:38.520 --> 00:03:39.468
who has a website

00:03:39.468 --> 00:03:42.680
and has posted content to that site.

00:03:42.680 --> 00:03:46.080
Her old friend Bob comes along,

00:03:46.080 --> 00:03:47.440
notices that content

00:03:47.440 --> 00:03:49.360
and wishes to say something about it.

00:03:49.360 --> 00:03:51.468
He posts to his site

00:03:51.468 --> 00:03:54.920
and his publication software will,

00:03:54.920 --> 00:03:57.080
if it supports Webmentions,

00:03:57.080 --> 00:04:00.160
will notice that he's mentioned Alice's post.

00:04:00.160 --> 00:04:04.320
At that point, his publication software

00:04:04.320 --> 00:04:07.240
reaches out to Alice's site,

00:04:07.240 --> 00:04:11.040
asks for the mentioned document,

00:04:11.040 --> 00:04:12.560
and will examine it to see

00:04:12.560 --> 00:04:15.600
if Alice advertises an endpoint at her site

00:04:15.600 --> 00:04:18.160
capable of receiving Webmentions.

00:04:18.160 --> 00:04:19.600
In this case, it does.

00:04:19.600 --> 00:04:23.480
So, Bob's publishing software does it.

00:04:23.480 --> 00:04:24.468
At the end of the day,

00:04:24.468 --> 00:04:26.000
a Webmention is really just

00:04:26.000 --> 00:04:30.360
an HTTP post request with two parameters,

00:04:30.360 --> 00:04:33.000
a source and a target.

00:04:33.000 --> 00:04:36.818
On receipt, Alice's server will

00:04:36.818 --> 00:04:39.400
reach out to Bob's site,

00:04:39.400 --> 00:04:43.280
request the document that contains the mention,

00:04:43.280 --> 00:04:45.920
and validate it, decide whether or not

00:04:45.920 --> 00:04:48.120
she wants to accept the Webmention.

00:04:48.120 --> 00:04:50.960
In this case, it's legit, it's accepted,

00:04:50.960 --> 00:04:54.000
and Alice chooses to make a note,

00:04:54.000 --> 00:04:56.760
to update her content,

00:04:56.760 --> 00:04:58.720
to make a note of the fact

00:04:58.720 --> 00:05:00.600
that it was mentioned by Bob.

00:05:00.600 --> 00:05:01.960
Now a couple of things to note here.

00:05:01.960 --> 00:05:03.480
The first is that this is effectively

00:05:03.480 --> 00:05:04.960
decentralized commenting.

00:05:04.960 --> 00:05:07.440
Both parties own their content,

00:05:07.440 --> 00:05:09.080
and there's no third party involved,

00:05:09.080 --> 00:05:13.640
trusted or otherwise.

00:05:13.640 --> 00:05:16.080
Now at this point, you might object that, well,

00:05:16.080 --> 00:05:18.720
as the owner of a statically generated site,

00:05:18.720 --> 00:05:21.600
I have essentially none of the infrastructure

00:05:21.600 --> 00:05:22.920
I need to implement this.

00:05:22.920 --> 00:05:27.120
I have no server above and beyond Apache.

00:05:27.120 --> 00:05:30.600
I can't really…, I have no database.

00:05:30.600 --> 00:05:33.680
I guess you could send Webmentions with curl,

00:05:33.680 --> 00:05:37.040
but now to do Webmention endpoint discovery,

00:05:37.040 --> 00:05:39.640
you're going to be parsing arbitrary HTML.

00:05:39.640 --> 00:05:41.120
It's a lot of work.

00:05:41.120 --> 00:05:45.080
That's okay. There are sites out there

00:05:45.080 --> 00:05:48.840
that offer Webmentions as a service.

00:05:48.840 --> 00:05:51.000
So, let's take a look at how that goes.

00:05:51.000 --> 00:05:54.920
We return to our original example.

00:05:54.920 --> 00:05:57.840
Alice continues to advertise an endpoint

00:05:57.840 --> 00:06:00.320
capable of receiving Webmentions,

00:06:00.320 --> 00:06:01.840
but it's no longer on her site.

00:06:01.840 --> 00:06:03.840
It's at webmention.io.

00:06:03.840 --> 00:06:08.000
Bob is essentially in the same position,

00:06:08.000 --> 00:06:09.920
but he now has in his world

00:06:09.920 --> 00:06:13.920
a third party site called Telegraph.

00:06:13.920 --> 00:06:16.040
When Bob wants to publish,

00:06:16.040 --> 00:06:19.760
he no longer needs to go through all the work

00:06:19.760 --> 00:06:21.760
of sending Webmention,

00:06:21.760 --> 00:06:25.280
and of carrying out Webmention endpoint discovery.

00:06:25.280 --> 00:06:27.880
He sends one API request to Telegraph,

00:06:27.880 --> 00:06:31.120
effectively saying, please send a Webmention for me.

00:06:31.120 --> 00:06:36.640
Asynchronously, telegraph.io is going to

00:06:36.640 --> 00:06:38.718
retrieve Alice's post,

00:06:38.718 --> 00:06:41.320
do Webmention endpoint discovery,

00:06:41.320 --> 00:06:45.400
and send the Webmention on Bob's behalf.

00:06:45.400 --> 00:06:48.280
Except this time he's sending it to webmention.io.

00:06:48.280 --> 00:06:53.080
Now, at some arbitrary point in the future,

00:06:53.080 --> 00:06:55.800
Alice can ask webmention.io,

00:06:55.800 --> 00:06:57.720
"Hey, do I have any new Webmentions?"

00:06:57.720 --> 00:07:00.480
And if she does, she may choose

00:07:00.480 --> 00:07:04.160
to update her content and publish.

00:07:04.160 --> 00:07:07.240
Okay, so let's code this up.

00:07:07.240 --> 00:07:09.120
Now, I'm recording this talk

00:07:09.120 --> 00:07:10.960
about a month ahead of time

00:07:10.960 --> 00:07:12.520
and I haven't been able to put together

00:07:12.520 --> 00:07:13.920
a little demo project.

00:07:13.920 --> 00:07:16.600
Hopefully, I can hack something together

00:07:16.600 --> 00:07:18.920
before this video streams.

00:07:18.920 --> 00:07:20.920
But in the meantime,

00:07:20.920 --> 00:07:22.960
I'd like to imagine a little test site.

00:07:22.960 --> 00:07:25.218
It has a single page,

00:07:25.218 --> 00:07:28.880
maybe we'll call it index.org,

00:07:28.880 --> 00:07:30.520
and we're going to publish it.

00:07:30.520 --> 00:07:32.600
We're going to export it to

00:07:32.600 --> 00:07:35.840
a subdirectory of our project directory,

00:07:35.840 --> 00:07:39.080
simply called www.

00:07:39.080 --> 00:07:44.800
So, the entry point to the Org export system

00:07:44.800 --> 00:07:46.640
is the function org-publish,

00:07:46.640 --> 00:07:49.960
whose docstring helpfully says,

00:07:49.960 --> 00:07:52.240
it publishes all projects.

00:07:52.240 --> 00:07:56.760
The set of all projects is defined by

00:07:56.760 --> 00:07:59.520
the variable `org-publish-project-alist`,

00:07:59.520 --> 00:08:02.320
which is a very flexible association list

00:08:02.320 --> 00:08:03.868
that lets you define

00:08:03.868 --> 00:08:05.520
what files are in your project,

00:08:05.520 --> 00:08:07.000
how you wish to export them,

00:08:07.000 --> 00:08:10.320
where they're going to go, etc, etc, etc.

00:08:10.320 --> 00:08:13.840
So great. This is actually pretty straightforward.

00:08:13.840 --> 00:08:15.880
We just give ourselves a little Elisp file

00:08:15.880 --> 00:08:17.040
and a single function.

00:08:17.040 --> 00:08:18.640
I'll call it publish,

00:08:18.640 --> 00:08:22.360
and all it will do is define

00:08:22.360 --> 00:08:25.000
`org-publish-project-alist`

00:08:25.000 --> 00:08:26.840
and invoke `org-publish-all`.

00:08:26.840 --> 00:08:31.880
At that point, exporting is a one-liner.

00:08:31.880 --> 00:08:35.560
We just invoke Emacs, load up our site.el file,

00:08:35.560 --> 00:08:37.280
and invoke the publish function.

00:08:37.280 --> 00:08:43.668
And if we want to publish to the live server,

00:08:43.668 --> 00:08:45.520
that's just another one-liner of ours.

00:08:45.520 --> 00:08:48.080
So, that's the publication framework.

00:08:48.080 --> 00:08:51.280
Now, let's take a look at sending Webmentions.

00:08:51.280 --> 00:08:54.400
The idea is that we're going to

00:08:54.400 --> 00:08:57.240
get our fingers into the publication process.

00:08:57.240 --> 00:09:01.000
Note when we see a Webmention in

00:09:01.000 --> 00:09:04.000
the process of exporting our Orgdown,

00:09:04.000 --> 00:09:07.840
and write it out to disk for sending later on.

00:09:07.840 --> 00:09:11.520
Now, I didn't want to send a Webmention

00:09:11.520 --> 00:09:13.040
for every single link in the post.

00:09:13.040 --> 00:09:14.960
I wanted this to be an intentional choice.

00:09:14.960 --> 00:09:16.960
And it turns out there are

00:09:16.960 --> 00:09:19.120
different sorts of Webmentions

00:09:19.120 --> 00:09:20.160
you can make on a page.

00:09:20.160 --> 00:09:22.520
For instance, if you add

00:09:22.520 --> 00:09:26.800
the CSS class u-in-reply-to to your link,

00:09:26.800 --> 00:09:28.635
the recipient will

00:09:28.635 --> 00:09:30.920
interpret this Webmention as a reply.

00:09:30.920 --> 00:09:33.440
There are similar CSS classes

00:09:33.440 --> 00:09:37.240
for likes, reposts, and generalized mentions.

00:09:37.240 --> 00:09:42.800
When the recipient gets your Webmention,

00:09:42.800 --> 00:09:45.640
if they want to know who's talking to them,

00:09:45.640 --> 00:09:47.960
they need to parse your page

00:09:47.960 --> 00:09:51.800
and look for DOM elements with certain CSS classes

00:09:51.800 --> 00:09:54.000
defined by the protocol as well.

00:09:54.000 --> 00:09:57.520
I'm a visual thinker,

00:09:57.520 --> 00:10:00.680
so I kind of drew out the process of publication,

00:10:00.680 --> 00:10:03.320
and exactly where we're going to

00:10:03.320 --> 00:10:05.160
get our fingers into this.

00:10:05.160 --> 00:10:07.320
So, this is me invoking make,

00:10:07.320 --> 00:10:09.800
which of course fires up Emacs.

00:10:09.800 --> 00:10:14.440
Just as before, my publish function will define

00:10:14.440 --> 00:10:17.920
`org-publish-project-alist` with one difference.

00:10:17.920 --> 00:10:21.040
There is an attribute,

00:10:21.040 --> 00:10:23.520
a property in the list called `publishing-function`.

00:10:23.520 --> 00:10:26.280
We're going to need to customize that.

00:10:26.280 --> 00:10:28.960
As usual, we then call…,

00:10:28.960 --> 00:10:31.960
we kick off the process by calling `org-publish-all`.

00:10:31.960 --> 00:10:36.468
org-publish-all will invoke

00:10:36.468 --> 00:10:37.320
your publishing function

00:10:37.320 --> 00:10:40.560
for each page, and it will hand to

00:10:40.560 --> 00:10:42.520
your publishing function for each page.

00:10:42.520 --> 00:10:45.080
The name of the file you're publishing,

00:10:45.080 --> 00:10:50.680
where it's going, and a parameter entitled plist.

00:10:50.680 --> 00:10:53.200
This is not super well documented.

00:10:53.200 --> 00:10:55.280
There are points in the docs

00:10:55.280 --> 00:10:57.440
that refer to this as a communication channel.

00:10:57.440 --> 00:11:01.800
What I discovered by simply reading the code was that

00:11:01.800 --> 00:11:04.560
it's a property list that is initialized

00:11:04.560 --> 00:11:09.680
for each invocation of your publication function.

00:11:09.680 --> 00:11:13.560
The initial properties are

00:11:13.560 --> 00:11:16.200
inherited from your project,

00:11:16.200 --> 00:11:20.801
but you are free to add properties as you go

00:11:20.801 --> 00:11:23.880
to communicate between different portions

00:11:23.880 --> 00:11:25.520
of the publication process.

00:11:25.520 --> 00:11:30.400
My publication function really does one thing,

00:11:30.400 --> 00:11:34.080
and that's simply swap out the HTML template

00:11:34.080 --> 00:11:36.840
that's passed to `org-publish-to`.

00:11:36.840 --> 00:11:43.696
Now, in order to take note of

00:11:43.696 --> 00:11:45.680
each Webmention that I send,

00:11:45.680 --> 00:11:47.585
I took advantage of another

00:11:47.585 --> 00:11:49.880
Org mode extension point

00:11:49.880 --> 00:11:52.720
called defining new link types.

00:11:52.720 --> 00:11:54.851
Here you can see

00:11:54.851 --> 00:11:58.560
I've created a new link type called reply.

00:11:58.560 --> 00:12:01.960
One of the attributes that you can attach to this

00:12:01.960 --> 00:12:06.160
is the function that is used to export your link.

00:12:06.160 --> 00:12:08.562
I've elided the code for

00:12:08.562 --> 00:12:10.720
mentions, likes, and reposts.

00:12:10.720 --> 00:12:13.520
If you look at my export function,

00:12:13.520 --> 00:12:16.280
you can see that it ultimately yields

00:12:16.280 --> 00:12:19.440
the appropriate HTML for this link.

00:12:19.440 --> 00:12:22.320
Before that, it calls a little helper function

00:12:22.320 --> 00:12:24.518
that will pull out the actual

00:12:24.518 --> 00:12:26.160
target URL of the link

00:12:26.160 --> 00:12:28.680
and shove it into this communication channel

00:12:28.680 --> 00:12:31.920
under the property name `sp1ff/mentions`.

00:12:31.920 --> 00:12:37.360
So, `org-publish-to` is really the workhorse

00:12:37.360 --> 00:12:40.240
of the publication process.

00:12:40.240 --> 00:12:42.120
The first thing it's going to do is

00:12:42.120 --> 00:12:47.400
transcode from the parsed Orgdown,

00:12:47.400 --> 00:12:50.320
which is an intermediate representation

00:12:50.320 --> 00:12:53.200
known as Org elements, to HTML.

00:12:53.200 --> 00:12:57.680
In particular, for every one of my new links

00:12:57.680 --> 00:13:00.440
that I'm using to mark Webmentions,

00:13:00.440 --> 00:13:04.040
it's going to invoke my little export function.

00:13:04.040 --> 00:13:06.600
And so as we work our way through the post,

00:13:06.600 --> 00:13:09.040
I'm going to accumulate all the Webmentions

00:13:09.040 --> 00:13:10.920
that I've made in the property list.

00:13:10.920 --> 00:13:14.360
The second step is to actually render

00:13:14.360 --> 00:13:16.560
the final HTML document,

00:13:16.560 --> 00:13:18.800
and that's where my specialized template comes in.

00:13:18.800 --> 00:13:21.480
All I do there is, use it to get

00:13:21.480 --> 00:13:24.920
my authorship information into the page.

00:13:24.920 --> 00:13:29.000
And then the last step is called finalization.

00:13:29.000 --> 00:13:32.320
At this point, we have the rendered HTML document,

00:13:32.320 --> 00:13:35.720
and Org mode gives you an extension point here,

00:13:35.720 --> 00:13:38.080
where you can do arbitrary post-processing

00:13:38.080 --> 00:13:39.200
on that document.

00:13:39.200 --> 00:13:42.160
I arguably abuse it to retrieve

00:13:42.160 --> 00:13:44.440
all the Webmentions I've made

00:13:44.440 --> 00:13:46.280
out of the communication channel

00:13:46.280 --> 00:13:47.920
and write them to disk.

00:13:47.920 --> 00:13:54.840
At this point, when we type make,

00:13:54.840 --> 00:13:59.160
we wind up with the rendered HTML

00:13:59.160 --> 00:14:01.080
for our Orgdown document,

00:14:01.080 --> 00:14:03.880
along with a little text file

00:14:03.880 --> 00:14:06.040
in which we've recorded all the Webmentions

00:14:06.040 --> 00:14:07.349
that need to be sent.

00:14:07.349 --> 00:14:11.800
The next step is to send said Webmentions.

00:14:11.800 --> 00:14:15.560
This is surprisingly easy in Emacs Lisp.

00:14:15.560 --> 00:14:17.360
This is my actual implementation.

00:14:17.360 --> 00:14:22.360
I use the request.el package to talk to Telegraph.

00:14:22.360 --> 00:14:26.920
And at this point, we really don't need to

00:14:26.920 --> 00:14:30.640
add a lot to our little site Elisp file.

00:14:30.640 --> 00:14:34.320
I sketched out a `send-webmentions` implementation

00:14:34.320 --> 00:14:36.160
that just goes through in a loop

00:14:36.160 --> 00:14:39.000
and calls my send-webmention function.

00:14:39.000 --> 00:14:42.640
And now publication becomes a two-step process.

00:14:42.640 --> 00:14:46.520
First, the org-publish, then sending Webmentions.

00:14:46.520 --> 00:14:51.418
Okay, so I realize this has been

00:14:51.418 --> 00:14:52.800
a bit of a whirlwind.

00:14:52.800 --> 00:14:55.240
So, where are we now?

00:14:55.240 --> 00:15:00.600
We have a sample site that we can publish

00:15:00.600 --> 00:15:02.400
and have sent Webmentions.

00:15:02.400 --> 00:15:05.480
And we've done it with just Emacs, Org mode,

00:15:05.480 --> 00:15:07.080
a little Lisp, and a make file.

00:15:07.080 --> 00:15:09.080
If you'd like to see more,

00:15:09.080 --> 00:15:11.680
I've put my library up on GitHub.

00:15:11.680 --> 00:15:13.754
It has logic for both

00:15:13.754 --> 00:15:15.560
sending and receiving Webmentions

00:15:15.560 --> 00:15:16.960
as well as something

00:15:16.960 --> 00:15:19.120
that on the IndieWeb is called POSSE,

00:15:19.120 --> 00:15:22.400
which is an acronym standing for

00:15:22.400 --> 00:15:25.400
Publish (on your) Own Site, Syndicate Elsewhere.

00:15:25.400 --> 00:15:27.818
What that means is that

00:15:27.818 --> 00:15:31.400
you turn the publication step

00:15:31.400 --> 00:15:35.400
from merely publishing new content to your site

00:15:35.400 --> 00:15:36.920
to also replicating it to places

00:15:36.920 --> 00:15:39.160
like Twitter and Facebook and so forth.

00:15:39.160 --> 00:15:44.120
And also when people like, comment,

00:15:44.120 --> 00:15:45.960
and retweet your content,

00:15:45.960 --> 00:15:47.680
that gets fed back to your site,

00:15:47.680 --> 00:15:51.400
where you can display it as comments.

00:15:51.400 --> 00:15:52.600
In terms of the future,

00:15:52.600 --> 00:15:54.520
I feel like I'm at a decision point.

00:15:54.520 --> 00:15:58.000
Org mode is admirably flexible,

00:15:58.000 --> 00:16:00.320
and I'm confident that I can continue to

00:16:00.320 --> 00:16:02.560
add support for IndieWeb protocols.

00:16:02.560 --> 00:16:05.440
On the other hand, it is so flexible

00:16:05.440 --> 00:16:07.880
that the process of figuring out

00:16:07.880 --> 00:16:10.680
which extension points to use in any situation

00:16:10.680 --> 00:16:12.000
is very challenging.

00:16:12.000 --> 00:16:14.800
When I started down this path,

00:16:14.800 --> 00:16:17.840
my mindset was keep it simple

00:16:17.840 --> 00:16:20.400
and let's just see how far I could get with Org mode.

00:16:20.400 --> 00:16:23.160
And I feel like I might be bumping up

00:16:23.160 --> 00:16:25.800
against the limitations of that approach now.

00:16:25.800 --> 00:16:34.920
Thank you very much.