summaryrefslogtreecommitdiff
path: root/app/notes/urls.py
blob: 0f9fad7232a2978159773248b4d80c5481133dc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from django.conf.urls import url
from django.views.generic.base import RedirectView

from . import views

app_name = "notes"

urlpatterns = [
    url(
        r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+).txt$',
        views.NoteDetailViewTXT.as_view(),
        name="detail-txt"
    ),
    url(
        r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+).amp$',
        views.NoteDetailViewAMP.as_view(),
        name="detail-amp"
    ),
    url(
        r'(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+)$',
        views.NoteDetailView.as_view(),
        name="detail"
    ),
    url(
        r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$',
        views.NoteMonthArchiveView.as_view(month_format='%m'),
        name="list_month"
    ),
    url(
        r'(?P<year>\d{4})/$',
        views.NoteYearArchiveView.as_view(),
        name="list_year"
    ),


    url(
        r'(?P<year>\d{4})/(?P<month>\d{2})/$',
        views.date_list,
        name="notes_by_month"
    ),
    url(
        r'(?P<year>\d{4})/$',
        views.date_list,
        name="notes_by_year"
    ),
    url(
        r'(?P<page>\d+)/$',
        views.NoteList.as_view(),
        name="list"
    ),
    # redirect / to /1/ for live server
    url(
        r'',
        RedirectView.as_view(url="/field-notes/1/", permanent=False),
        name="live_redirect"
    ),
    url(
        r'^$',
        views.entry_list,
        name="notes_archive"
    ),
]