LifeDesign Learning Zone

Xtof/micropub-to-github

De wikiducamp
Sauter à la navigation Sauter à la recherche

contenu importé de xtof/micropub


Repo de travail pour installer un point de terminaison micropub : https://github.com/voxpelli/webpage-micropub-to-github

Pourquoi "micropub-to-github"

La solution initialement conçue pour accepter un post provenant de n'importe quel client micropub sait convertir le post en un commit compatible-jekyll incluant le front matter en YAML et le contenu. Quelques collègues indieweb parviennent à le faire fonctionner pour Hugo.

Statut : rech. alternatives

> en fouillant rapidement, le soucis viendrait d'ici : https://github.com/voxpelli/node-format-microformat/blob/master/index.js#L131-L137 ([Source jygastaud 2018-05-03](https://jamstatic-fr.slack.com/archives/C58SRKC0P/p1525345451000043) - jamstatic-fr - chan. Hugo)


>.

  • Réglé les 6 variables d'environnement requises + 3 variables facultatives (type de posts, chemin + nom de fichier et répertoire img).

Détails ci-dessous :

Micropub-xtof-settings-Heroku.png

Note : Les variables d'output `MICROPUB_FILENAME_STYLE` et `MICROPUB_MEDIA_FILES_STYLE` pour régler les noms de fichier et chemin/ noms de fichier et chemin pour les images doivent être placées entre guillemets.

  • Installé les 3 points de terminaison micropub, authorization et token dans le `header` html :

```

   <link rel="micropub" href="https://micropub-xtof.herokuapp.com/micropub/main" />
   <link rel="authorization_endpoint" href="https://indieauth.com/auth">
   <link rel="token_endpoint" href="https://tokens.indieauth.com/token" />

```

Résultats

Premiers pas publication de notes avec Quill sans image. Je récupère bien un post généré sur mon repo github que je dois rapatrier sur ma machine locale.

Rendu brut : la ligne de tags du FrontMatter provoque une erreur

``` --- layout: posts date: '2018-05-02T05:12:06.556Z' title: tags: microblog micropub slug: '18726' category: social

--- Microbloguer dans Jekyll : Inspiré par quelques réglages de Micropub webpage-micropub-to-github, l'app qui crée un point de terminaison micropub pour les sites Jekyll hébergés sur GitHub pages.

```


Essai quill avec titre + citation + gif > toujour une erreur sur les tags

``` --- layout: posts date: '2018-05-03T07:08:24.887Z' title: 'Show, not tell, what you know' tags: stoicisme mf-mp-slug:

 - show-not-tell

slug: show-not-tell-what-you --- > Those who receive the bare theories immediately want to spew them, as an upset stomach does its food. First digest your theories and you won’t throw them up. Otherwise they will be raw, spoiled, and not nourishing. After you’ve digested them, show us the changes in your reasoned choices, just like the shoulders of gymnasts display their diet and training, and as the craft of artisans show in what they’ve learned.

—EPICTETUS, DISCOURSES, 3.21.1–3 ![](data:image/gif;base64,R0lGODlheADLAPcAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMjIyQkJCUlJSYmJicnJygoKCkpKSoqKisrKywsLC0tLS4uLi8vLzAwMDExMTIyMjMzMzQ0NDU1NTY2Njc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0BAQEFBQUJCQkNDQ0REREVF...2IVsqAU5kINdkAZx2AYv4IZ3uIZo2AYZkQd6gAd3KCfbCwgAADs=)

```

Travaux à faire :

- batterie de test micropub.rocks - orienter vers "notes" et concevoir un layout de notes sans titre

test quill

Quill-settings-2018-05-03.png


``` --- layout: posts date: '2018-05-03T07:08:24.887Z' title: 'Show, not tell, what you know' tags: stoicisme mf-mp-slug:

 - show-not-tell

slug: show-not-tell-what-you --- > Those who receive the bare theories immediately want to spew them, as an upset stomach does its food. First digest your theories and you won’t throw them up. Otherwise they will be raw, spoiled, and not nourishing. After you’ve digested them, show us the changes in your reasoned choices, just like the shoulders of gymnasts display their diet and training, and as the craft of artisans show in what they’ve learned.

—EPICTETUS, DISCOURSES, 3.21.1–3 ![](data:image/...)

```

tests micropub.rocks

série de test à produire sur https://micropub.rocks

test 100 ok

(h-entry basique).

url de destination https://www.christopheducamp.com/2018/05/03/30661/ (front matter non retouché, modifié le contenu)


``` --- layout: posts date: '2018-05-03T08:31:01.440Z' title: slug: '30661' category: social --- Micropub test of creating a basic h-entry ```


test 101 : h-entry avec 2 catégories - échec

Création d'un post h-entry incluant 2 categories. Les paramètres de category sont envoyés en utilisant une syntaxe category[] sous forme de liste encodée dans un formulaire.

``` POST https://micropub-xtof.herokuapp.com/micropub/main HTTP/1.1 Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtZSI6Imh0dHBzOlwvXC9jaHJpc3RvcGhlZHVjYW1wLmNvbVwvIiwiaXNzdWVkX2J5IjoiaHR0cHM6XC9cL3Rva2Vucy5pbmRpZWF1dGguY29tXC90b2tlbiIsImNsaWVudF9pZCI6Imh0dHBzOlwvXC9taWNyb3B1Yi5yb2Nrc1wvIiwiaXNzdWVkX2F0IjoxNTI1MzM2MjU2LCJzY29wZSI6ImNyZWF0ZSB1cGRhdGUgZGVsZXRlIHVuZGVsZXRlIiwibm9uY2UiOjc0MzA5NDc5MH0.MvRB7qJDJLhul-RYonDZwNozDLlFMEgC6KLFyzfEaV4 Content-type: application/x-www-form-urlencoded; charset=utf-8

h=entry& content=Micropub+test+of+creating+an+h-entry+with+categories.+This+post+should+have+two+categories,+test1+and+test2& category[]=test1&category[]=test2 ```

Résultat :

``` --- layout: posts date: '2018-05-03T09:05:43.460Z' title: tags: test1 test2 slug: '32743' category: social --- Micropub test of creating an h-entry with categories. This post should have two categories, test1 and test2

```

Rendu dans le terminal :

> ERROR 2018/05/03 11:06:53 Error while rendering "home" in "": template: index.html:14:50: executing "index.html" at <.Params.tags>: range can't iterate over test1 test2


Test 104

https://micropub.rocks/server-tests/104?endpoint=232

``` POST https://micropub-xtof.herokuapp.com/micropub/main HTTP/1.1 Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtZSI6Imh0dHBzOlwvXC9jaHJpc3RvcGhlZHVjYW1wLmNvbVwvIiwiaXNzdWVkX2J5IjoiaHR0cHM6XC9cL3Rva2Vucy5pbmRpZWF1dGguY29tXC90b2tlbiIsImNsaWVudF9pZCI6Imh0dHBzOlwvXC9taWNyb3B1Yi5yb2Nrc1wvIiwiaXNzdWVkX2F0IjoxNTI1MzM2MjU2LCJzY29wZSI6ImNyZWF0ZSB1cGRhdGUgZGVsZXRlIHVuZGVsZXRlIiwibm9uY2UiOjc0MzA5NDc5MH0.MvRB7qJDJLhul-RYonDZwNozDLlFMEgC6KLFyzfEaV4 Content-type: application/x-www-form-urlencoded; charset=utf-8

h=entry& content=Micropub+test+of+creating+a+photo+referenced+by+URL& photo=https%3A%2F%2Fmicropub.rocks%2Fmedia%2Fsunset.jpg ```


Le post s'affiche mais pas la photo référencée par une URL ``` --- layout: posts date: '2018-05-03T10:49:53.222Z' title: mf-photo:

 - 'https://micropub.rocks/media/sunset.jpg'

slug: '38993' category: social --- Micropub test of creating a photo referenced by URL

```

Test 107 échec

Create an h-entry post with one category (form-encoded) https://micropub.rocks/server-tests/107?endpoint=232

``` --- layout: posts date: '2018-05-03T10:56:29.016Z' title: tags: test1 slug: '39389' category: social --- Micropub test of creating an h-entry with one category. This post should have one category, test1 ```

Test 200

Ok Création h-entry avec requête JSON https://www.christopheducamp.com/2018/05/03/39630/

Test 201 échec

> This is a test of creating an h-entry post in JSON format including two categories. The categories are sent in an array.

https://micropub.rocks/server-tests/201?endpoint=232


Test 202

Create an h-entry with HTML content (JSON) ``` > POST https://micropub-xtof.herokuapp.com/micropub/main HTTP/1.1 Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtZSI6Imh0dHBzOlwvXC9jaHJpc3RvcGhlZHVjYW1wLmNvbVwvIiwiaXNzdWVkX2J5IjoiaHR0cHM6XC9cL3Rva2Vucy5pbmRpZWF1dGguY29tXC90b2tlbiIsImNsaWVudF9pZCI6Imh0dHBzOlwvXC9taWNyb3B1Yi5yb2Nrc1wvIiwiaXNzdWVkX2F0IjoxNTI1MzM2MjU2LCJzY29wZSI6ImNyZWF0ZSB1cGRhdGUgZGVsZXRlIHVuZGVsZXRlIiwibm9uY2UiOjc0MzA5NDc5MH0.MvRB7qJDJLhul-RYonDZwNozDLlFMEgC6KLFyzfEaV4 Content-type: application/json

{

 "type": ["h-entry"],
 "properties": {
   "content": [{

"html": "

This post has bold and italic text.

"

   }]
 }

} ```


``` --- layout: posts date: '2018-05-03T11:10:16.588Z' title: slug: '40216' category: social --- This post has **bold** and *italic* text.

```

Test 203 échec pas de photo

``` --- layout: posts date: '2018-05-03T11:23:24.418Z' title: mf-photo:

 - 'https://micropub.rocks/media/sunset.jpg'

slug: '41004' category: social --- Micropub test of creating a photo referenced by URL. This post should include a photo of a sunset.

```


test 204 échec

204: Create an h-entry post with a nested object (JSON)

> This is a test of creating an h-entry post in JSON format including a nested Microformats 2 object. While it is not expected that every endpoint will be able to render the checkin object, it should still store the checkin property and render the rest of the post.


``` --- layout: posts date: '2017-05-31T19:03:36.000Z' title: mf-checkin:

 - type:
     - h-card
   properties:
     name:
       - Los Gorditos
     url:
       - 'https://foursquare.com/v/502c4bbde4b06e61e06d1ebf'
     latitude:
       - 45.524330801154
     longitude:
       - -122.68068808051
     street-address:
       - 922 NW Davis St
     locality:
       - Portland
     region:
       - OR
     country-name:
       - United States
     postal-code:
       - '97209'

slug: '68616' category: social --- Lunch meeting

```

Test OwnYourGram

``` --- layout: posts date: '2018-05-04T09:19:52.000Z' title: mf-location:

 - 'geo:48.8567,2.3508'

mf-syndication:

 - 'https://www.instagram.com/p/BiWaqEAA8gc/'

mf-place_name:

 - 'Paris, France'

slug: '33592' mf-photo:

 - 'https://christopheducamp.com/static/img/2018-05-33592/iga-vsb85.jpg'

category: social persontags:

 - 'https://www.instagram.com/philip.glass'

--- 1 2 3 4 5 6 7 8 🎶 Einstein à la plage. ```

Liens ressources

liens indieweb à compléter, relire et classer

Une recherche dans la jungle de collègues indieweb ayant configuré un point de terminaison micropub iwc:token-endpoint avec micropub-to-github de voxpelli :

1. Amit https://www.amitgawande.com/ (cf son post de recherche https://micro.blog/amit/353415) Post de setup https://www.amitgawande.com/indiewebify-hugo-website/ 1. jnjosh thème "internet weblog" https://jnjosh.com/microposts/19431/ https://micro.blog/jnjosh# repo https://github.com/jnjosh/jnjosh.com (micropub mais sans image)