I have overridden the following functions on my BlogPost model to give my posts a /blog/year/month/slug link style:
def route(self, request, path_components):
if path_components:
reqYear = path_components[0]
reqMonth = path_components[1]
if int(reqYear) == self.date.year and int(reqMonth) == self.date.month:
if self.live:
return RouteResult(self)
raise Http404
def url(self):
return self.date.strftime("%Y") + "/" + self.date.strftime("%m") + "/" + self.slug
However, when I click the "Live" link in Wagtail CMS it directs me to /blog/slug/.
Is there a method I need to override to change this link?