There is an existing port patch to Drupal 8 of Contact Info module which generates an hcard for the entire site. I tested it and I believe it's generating the right markup via Twig. Patch here: #2624866: D8 port
I think it would make sense to create a submodule called microformats_hcard_site which would implement this.
Not necessary for an initial commit but in general I think it would be best for modularity if the parent microformats module - or possibly another submodule - could generate hcard objects for best consistency.
For generating these objects could it be like a plugin factory architecture? Extending something like:
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Plugin!Facto...
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Plug...
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 2720199-10-microformats-siteinfo-block.patch | 22.2 KB | hongpong |
Comments
Comment #2
hongpong commentedComment #3
hongpong commentedNew module microformats_hcard_site is almost working here
https://github.com/HongPong/microformats/tree/hcard_sitewide
but the block is not working yet. It does save its config settings. Very close now.
Comment #4
hongpong commentedComment #5
hongpong commentedComment #6
hongpong commentedhcard code is available here #2624866: D8 port , thinking it would make sense to put into this module. especially as there hasn't been movement on that module for 8 yet.
Comment #8
hongpong commentedStarting out by importing the awesome work from karthikeyan-manivasagam via here https://github.com/karthikeyan-manivasagam/contactinfo
Still rough but it's a place to start from
Comment #10
hongpong commentedPatch puts it in much better shape, theme function is close.
Comment #13
mlncn commentedNote that patches and code mentioned have been committed.
Theme function is still empty.
I could take this on; is there any in-progress code to push?
The idea is to automatically create a theme function with all the variables from the configuration options, rather than hard-code it, yes?
Comment #14
hongpong commentedyes but probably everything here got superseded by https://www.drupal.org/project/indieweb which is kind of taking the Swiss army approach to this stuff.
Comment #15
mlncn commentedYeah, i had looked— the microformats hcard stuff is not advertized as being done at all, but i'll take a closer look at the code here. You'd prefer feature requests go there?
Comment #16
mlncn commentedOK per the indieweb README:
So yeah, they don't yet have microformats-like functionality, but seem open to it.
Comment #17
mlncn commentedAnyhow, for now here's a version of the microformats module with a working sitewide contact info block.
Comment #18
mlncn commentedComment #20
hongpong commentedCalling it fixed yay