diff options
author | Joar Wandborg <git@wandborg.com> | 2011-12-20 22:06:36 +0100 |
---|---|---|
committer | Joar Wandborg <git@wandborg.com> | 2011-12-20 22:06:36 +0100 |
commit | c8cb0ee88f8eb667af77c5741cfb04f95afe66b0 (patch) | |
tree | 4dd729b887f4ed7932e35036ab2206222c623f3f /mediagoblin/templates | |
parent | 9df07e87a8452e47eb594763bb700daf6fb69dbe (diff) | |
download | mediagoblin-c8cb0ee88f8eb667af77c5741cfb04f95afe66b0.tar.lz mediagoblin-c8cb0ee88f8eb667af77c5741cfb04f95afe66b0.tar.xz mediagoblin-c8cb0ee88f8eb667af77c5741cfb04f95afe66b0.zip |
Polishing the webfinger implementation
- Changed quotes in the templates from " to '
- Changed all link generation to use request.urlgen
- Moved xrd links data generation from template to view
- Added parsing of the account URI using urlparse
Diffstat (limited to 'mediagoblin/templates')
-rw-r--r-- | mediagoblin/templates/mediagoblin/webfinger/host-meta.xml | 12 | ||||
-rw-r--r-- | mediagoblin/templates/mediagoblin/webfinger/xrd.xml | 20 |
2 files changed, 15 insertions, 17 deletions
diff --git a/mediagoblin/templates/mediagoblin/webfinger/host-meta.xml b/mediagoblin/templates/mediagoblin/webfinger/host-meta.xml index dff2c9aa..95a1a176 100644 --- a/mediagoblin/templates/mediagoblin/webfinger/host-meta.xml +++ b/mediagoblin/templates/mediagoblin/webfinger/host-meta.xml @@ -14,14 +14,14 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -#} -<?xml version='1.0' encoding='UTF-8'?> -<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0' - xmlns:hm='http://host-meta.net/xrd/1.0'> +<?xml version="1.0" encoding="UTF-8"?> +<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0" + xmlns:hm="http://host-meta.net/xrd/1.0"> <hm:Host>{{ request.host }}</hm:Host> - <Link rel='lrdd' - template='{{ lrdd_template }}'> - <Title>{{ llrd_title }}</Title> + <Link rel="lrdd" + template="{{ lrdd_template|replace(placeholder, '{uri}') }}"> + <Title>{{ lrdd_title }}</Title> </Link> </XRD> diff --git a/mediagoblin/templates/mediagoblin/webfinger/xrd.xml b/mediagoblin/templates/mediagoblin/webfinger/xrd.xml index 9a793637..1fe34577 100644 --- a/mediagoblin/templates/mediagoblin/webfinger/xrd.xml +++ b/mediagoblin/templates/mediagoblin/webfinger/xrd.xml @@ -14,16 +14,14 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -#} -<?xml version='1.0' encoding='UTF-8'?> -<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'> +<?xml version="1.0" encoding="UTF-8"?> +<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"> - <Subject>{{ request.GET.get('uri') }}</Subject> - <Alias>http://{{ request.host }}/u/{{ username }}</Alias> - - <Link rel='http://microformats.org/profile/hcard' - href='http://{{ request.host }}/u/{{ username }}' /> - - <Link rel="http://schemas.google.com/g/2010#updates-from" - type="application/atom+xml" - href="http://{{ request.host }}/u/{{ username }}/atom/" /> + <Subject>{{ subject }}</Subject> + <Alias>{{ alias }}</Alias> + {% for link in links %} + <Link + {%- for attr, value in link.attrs.items() %} {{ attr }}="{{ value}}" + {%- endfor %} /> + {%- endfor %} </XRD> |