ucd-library / ucdlib-theme

University branding, additional theme support, theme elements
MIT License
0 stars 0 forks source link

Switch domain to host in ucdlib-author-profile #73

Open jrmerz opened 2 years ago

jrmerz commented 2 years ago

Instead of a domain property referencing the subdomain name of the hosting wordpress server, have a host property which includes the protocol (ex https://) plus the domain. Default the host property to window.location.origin if none is set.

So under this setup, a third party site wanting to use the author component would write something like:

<ucdlib-author-profile host="https://library.ucdavis.edu" email="jrmerz@ucdavis.ed"></ucdlib-author-profile>

Additionally have a new apiPath property which defaults to /wp-json/ucdlib-directory/person/

So this code would now look like:

let url = (this.host || window.location.origin) + this.apiPath + email;