ic-labs / django-icekit

GLAMkit is a next-generation Python CMS by the Interaction Consortium, designed especially for the cultural sector.
http://glamkit.com
MIT License
47 stars 11 forks source link

URL shortener #284

Open cogat opened 7 years ago

cogat commented 7 years ago

Let's put a URL shortener in ICEkit.

We (at ACMI) want to be able to:

a) have many short URLs point to the same long URL, with different UTM codes (or perhaps other GET parameters).

b) specify short URLs, but generate a short one made if none is specified.

c) shared short URLs retain social sharing metadata.

Proposed approach:

1) create a short_urls app in ICEkit, with a model that maps a unique shortcode to an ICEkitURL (which can be a GFK or an arbitrary URL). Create an admin UI for

2) create an inlineadmin for ICEkit content that allows a user to specify one or more shortcodes for content, with potentially varying GET strings. If no shortcode is specified, one is generated. If a duplicate shortcode is specified, a validation error is made.

3) serve requests to shortcodes as redirects to the destination URLs.

4) serve ICEkit pages with a <link rel="shortlink" href="http://www.mywebsite.com/shortcode"> in the header.

5) Implement short URLs in such a way that social sharing metadata is conveyed when the short link is shared.

Questions:

a) does this supersede the existing redirects module? should we migrate away from it? I propose it does and we should. b) should short URLs be tied to one domain or work with any domain? Should the main site domain be one of these? I propose that the solution be domain-agnostic. The short domain to use should be a setting, defaulting to the usual domain. c) should this URL do any tracking/analytics? I propose not for now - the UTM code can be used for GA. d) should short URLs allow slashes? I propose yes, because it is necessary for a) above.

cc @andrewserong

aweakley commented 7 years ago

@cogat That sounds like a great Idea. Please can you fork the repo and make a pull request when you're ready?