From cbf62b3abb21e9d87b92ecd7b811abc9c15a52d2 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Sun, 4 Dec 2022 15:25:58 -0500 Subject: Automated commit --- ...-indieweb--michael-herstine--main--chapters.vtt | 43 + ...ode-on-the-indieweb--michael-herstine--main.vtt | 1048 ++++++++++++++++++++ 2 files changed, 1091 insertions(+) create mode 100644 2022/captions/emacsconf-2022-indieweb--putting-org-mode-on-the-indieweb--michael-herstine--main--chapters.vtt create mode 100644 2022/captions/emacsconf-2022-indieweb--putting-org-mode-on-the-indieweb--michael-herstine--main.vtt (limited to '2022/captions') diff --git a/2022/captions/emacsconf-2022-indieweb--putting-org-mode-on-the-indieweb--michael-herstine--main--chapters.vtt b/2022/captions/emacsconf-2022-indieweb--putting-org-mode-on-the-indieweb--michael-herstine--main--chapters.vtt new file mode 100644 index 00000000..7446a15d --- /dev/null +++ b/2022/captions/emacsconf-2022-indieweb--putting-org-mode-on-the-indieweb--michael-herstine--main--chapters.vtt @@ -0,0 +1,43 @@ +WEBVTT + +00:00:00.000 --> 00:00:14.080 +Introduction + +00:00:14.080 --> 00:01:13.880 +Maintaining a personal website using Org mode + +00:01:13.880 --> 00:02:32.040 +Problems with comments and isolation + +00:02:32.040 --> 00:03:17.800 +The Indieweb + +00:03:17.800 --> 00:05:00.600 +Webmentions + +00:05:00.600 --> 00:07:04.160 +Decentralized commenting + +00:07:04.160 --> 00:08:48.080 +The publication framework + +00:08:48.080 --> 00:09:54.000 +Sending Webmentions + +00:09:54.000 --> 00:11:36.840 +The process of publication + +00:11:36.840 --> 00:12:31.920 +Defining new link types + +00:12:31.920 --> 00:14:07.349 +org-publish-to + +00:14:07.349 --> 00:14:46.520 +Sending Webmentions with request.el + +00:14:46.520 --> 00:15:51.400 +Summary + +00:15:51.400 --> 00:16:34.920 +The future diff --git a/2022/captions/emacsconf-2022-indieweb--putting-org-mode-on-the-indieweb--michael-herstine--main.vtt b/2022/captions/emacsconf-2022-indieweb--putting-org-mode-on-the-indieweb--michael-herstine--main.vtt new file mode 100644 index 00000000..f41a3981 --- /dev/null +++ b/2022/captions/emacsconf-2022-indieweb--putting-org-mode-on-the-indieweb--michael-herstine--main.vtt @@ -0,0 +1,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. -- cgit v1.2.3