This article was originally published on trendschau.net, but you will probably read it on dev.to first. How come?
Some weeks ago a dev-user asked other members how they crosspost their markdown articles to the dev-platform. Since I develop a small flat-file cms called Typemill that works with markdown, I asked myself if it is worth to create a little plugin for such crossposts. I checked the dev-API, wrote about 200 lines of code and voila: The first crosspost is online.
This is a screenshot of the Typemill admin-ui for this article:
The plugin adds a new tab called "dev.to" to each article and in that tab you can manage the crosspost. You can activate the crosspost, you can choose between draft or publish and you can add tags or series. The plugin will synchronise the articles (and rewrite the image-urls) whenever you publish or update the article on Typemill. It will also store and display the response from dev.to and display a little preview.
It is pretty simple to create a plugin like this with Typemill:
- All you need is a YAML-file, a small vue-component and a php-file with some logic.
- With the YAML-file you can define the forms and fields for your tab.
- With the vue-component you can render the tab and also add the vue-logic that you want.
- With the php-file you can listen to the typemill-events (I wrote about the event-dispatcher here) and make the api calls.
Typemill is open source. Don't expect a high level system or a super robust and bug-free software: It is still a side project with a small community and we work hard to improve it with each release. If you have a close look to the GitHub repository: 8 more stars and we have 100 !!!