payload: {"action":"created","issue":{"url":"https://api.github.com/repos/swentel/indieweb/issues/408","repository_url":"https://api.github.com/repos/swentel/indieweb","labels_url":"https://api.github.com/repos/swentel/indieweb/issues/408/labels{/name}","comments_url":"https://api.github.com/repos/swentel/indieweb/issues/408/comments","events_url":"https://api.github.com/repos/swentel/indieweb/issues/408/events","html_url":"https://github.com/swentel/indieweb/issues/408","id":434682724,"node_id":"MDU6SXNzdWU0MzQ2ODI3MjQ=","number":408,"title":"Decoupled Drupal, static site generators, and Indieweb","user":{"login":"sonniesedge","id":41983,"node_id":"MDQ6VXNlcjQxOTgz","avatar_url":"https://avatars2.githubusercontent.com/u/41983?v=4","gravatar_id":"","url":"https://api.github.com/users/sonniesedge","html_url":"https://github.com/sonniesedge","followers_url":"https://api.github.com/users/sonniesedge/followers","following_url":"https://api.github.com/users/sonniesedge/following{/other_user}","gists_url":"https://api.github.com/users/sonniesedge/gists{/gist_id}","starred_url":"https://api.github.com/users/sonniesedge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonniesedge/subscriptions","organizations_url":"https://api.github.com/users/sonniesedge/orgs","repos_url":"https://api.github.com/users/sonniesedge/repos","events_url":"https://api.github.com/users/sonniesedge/events{/privacy}","received_events_url":"https://api.github.com/users/sonniesedge/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-04-18T09:46:34Z","updated_at":"2019-04-19T19:50:59Z","closed_at":null,"author_association":"NONE","body":"A bit of a long issue here, sorry! But I hope it's helpful to future development and other contributors.\r\n\r\nThe [Decoupled Drupal](https://dri.es/how-to-decouple-drupal-in-2019) approach is becoming more popular, allowing the use of Drupal as a headless CMS, exposing the Drupal data structure via a [JSON API](https://www.drupal.org/project/jsonapi) and generating the frontend via [another](https://www.gatsbyjs.org) [technology](https://www.11ty.io) altogether. \r\n\r\nGiven an approach of generating a site via a static site generator and a service such as [Netlify](https://www.netlify.com), how can the Indieweb module integrate with that?\r\n\r\nAt the moment this is not entirely possible. \r\n\r\nCurrent scenario:\r\n\r\n- A node is created in a headless Drupal installation running Indieweb. \r\n- In the node create interface the node author chooses to send a webmention to Brid.gy, (or any other webmention-friendly destination).\r\n- The node is created, with a public URL\r\n- A webmention is queued and eventually sent.\r\n- The destination site receives the webmention and (potentially immediately) scans our public URL for microformats and handles it as it desires. \r\n\r\nIf the site were decoupled into a headless CMS and a static site generator the scenario would not work.\r\n\r\n- The Drupal installation would likely be on a different subdomain to the actual public site (e.g. cms.mydomain.org vs www.mydomain.org). The sent webmention would therefore have a different domain to the actual published site.\r\n- The public URL would not be immediately created. A static site generator adds several minutes of lag to this, as a web hook must be sent from Drupal to the static site building service, which must bootstrap a new site, read data from the public API, download all data (including images), build the new site, and publish it. \r\n- In this time the queued webmention would likely have been sent. Even if it were somehow to magically have the correct domain then the public path might still not be available, as it would be in the process of being built. The receiving site would therefore find no URL and no microformat data to read.\r\n\r\nThis is just one scenario - others would likely be effected as well (e.g. receiving webmentions, indieauth, etc). \r\n\r\n## Solution\r\n\r\nAt least for webmentions, could this be solved by the following?:\r\n\r\n- Be able to specify a public domain in Indieweb\r\n  - all webmentions would be sent with this, rather than the Decoupled Drupal domain.\r\n  - all received webmentions would use be compared against this public domain.\r\n- When sending webmentions the Indieweb module would check that the public URL exists before trying to send it to another site. If it does not return a 200 then it stays in the queue until the next sending run.\r\n\r\nThere are plenty of other areas that this could effect, but I do not have as much knowledge of them.\r\n\r\nWould the above solution be feasible?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/swentel/indieweb/issues/comments/484998100","html_url":"https://github.com/swentel/indieweb/issues/408#issuecomment-484998100","issue_url":"https://api.github.com/repos/swentel/indieweb/issues/408","id":484998100,"node_id":"MDEyOklzc3VlQ29tbWVudDQ4NDk5ODEwMA==","user":{"login":"swentel","id":168466,"node_id":"MDQ6VXNlcjE2ODQ2Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/168466?v=4","gravatar_id":"","url":"https://api.github.com/users/swentel","html_url":"https://github.com/swentel","followers_url":"https://api.github.com/users/swentel/followers","following_url":"https://api.github.com/users/swentel/following{/other_user}","gists_url":"https://api.github.com/users/swentel/gists{/gist_id}","starred_url":"https://api.github.com/users/swentel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swentel/subscriptions","organizations_url":"https://api.github.com/users/swentel/orgs","repos_url":"https://api.github.com/users/swentel/repos","events_url":"https://api.github.com/users/swentel/events{/privacy}","received_events_url":"https://api.github.com/users/swentel/received_events","type":"User","site_admin":false},"created_at":"2019-04-19T19:50:59Z","updated_at":"2019-04-19T19:50:59Z","author_association":"OWNER","body":"> Would the above solution be feasible?\r\n\r\nAbsolutely. Just make sure you don't mix up domains in .drushrc ;)\r\n\r\nJoke aside, I will probably struggle longer on writing a good test for this than the actual implementation, but with some luck, I can get this in over the weekend!\r\n\r\nI'm slowly refactoring some callbacks too on my site - Vue.js where some callbacks use jsonapi already, but not all, specifically webmentions is still a custom response. I know they are exposed by JSONAPI, but If you have feedback or suggestions there, feel free to open an issue on that because it's on my radar already."}}
other: {"actor":{"display_login":"swentel"}}