33def generate_site (data , output_file = './_site/index.html' ):
44 env = Environment (loader = FileSystemLoader ('templates' ))
55 template = env .get_template ('kaban_board.html' )
6- output = template .render (data )
6+
7+ # Extract unique statuses from the tasks list
8+ unique_statuses = sorted ({task ["status" ] for task in data ["tasks" ]})
9+
10+ # Add statuses to the data dictionary
11+ data_with_statuses = {** data , "statuses" : unique_statuses }
12+
13+ # Render template with updated data
14+ output = template .render (data_with_statuses )
715
816 with open (output_file , 'w' ) as f :
917 f .write (output )
@@ -13,42 +21,93 @@ def generate_site(data, output_file='./_site/index.html'):
1321 'title' : 'Version Two' ,
1422 'github_user' : 'octocat' ,
1523 'team' : 'Platform Engineering' ,
16- 'tasks' : {
17- 'Backlog' : [
18- ],
19- 'New' : [
20- {
21- "assignees" : [
22- "coolAssignee"
23- ],
24- "content" : {
25- "body" : "https://dummy_url/test#L42\n \n Rename from `X` to `Y`" ,
26- "number" : 241 ,
27- "repository" : "pandas/coolrepo" ,
28- "title" : "cool title" ,
29- "type" : "Issue" ,
30- "url" : "https://github.com/pandas/coolrepo/issues/241"
31- },
32- "id" : "PVTI_lADOBgkjhkjhjjh" ,
33- "labels" : [
34- "Bug"
35- ],
36- "linked pull requests" : [
37- "https://github.com/pandas/coolrepo/pull/242"
38- ],
39- "repository" : "https://github.com/pandas/coolrepo" ,
40- "status" : "Done" ,
41- "title" : "Cool Pandas Task"
42- }
43- ],
44- 'In-Progress' : [
45- ],
46- 'Blocked' : [
47- ],
48- 'Done' : [
49- ]
50- }
24+ 'tasks' : [
25+ {
26+ "assignees" : ["coolAssignee" ],
27+ "content" : {
28+ "body" : "https://dummy_url/test#L42\n \n Rename from `X` to `Y`" ,
29+ "number" : 241 ,
30+ "repository" : "pandas/coolrepo" ,
31+ "title" : "cool title" ,
32+ "type" : "Issue" ,
33+ "url" : "https://github.com/pandas/coolrepo/issues/241"
34+ },
35+ "id" : "PVTI_lADOBgkjhkjhjjh" ,
36+ "labels" : ["Bug" ],
37+ "linked pull requests" : ["https://github.com/pandas/coolrepo/pull/242" ],
38+ "repository" : "https://github.com/pandas/coolrepo" ,
39+ "status" : "New" ,
40+ "title" : "Cool Pandas Task 1"
41+ },
42+ {
43+ "assignees" : ["coolAssignee" ],
44+ "content" : {
45+ "body" : "https://dummy_url/test#L42\n \n Rename from `X` to `Y`" ,
46+ "number" : 241 ,
47+ "repository" : "pandas/coolrepo" ,
48+ "title" : "cool title" ,
49+ "type" : "Issue" ,
50+ "url" : "https://github.com/pandas/coolrepo/issues/241"
51+ },
52+ "id" : "PVTI_lADOBgkjhkjhjjh" ,
53+ "labels" : ["Bug" ],
54+ "linked pull requests" : ["https://github.com/pandas/coolrepo/pull/242" ],
55+ "repository" : "https://github.com/pandas/coolrepo" ,
56+ "status" : "Backlog" ,
57+ "title" : "Cool Pandas Task 2"
58+ },
59+ {
60+ "assignees" : ["coolAssignee" ],
61+ "content" : {
62+ "body" : "https://dummy_url/test#L42\n \n Rename from `X` to `Y`" ,
63+ "number" : 241 ,
64+ "repository" : "pandas/coolrepo" ,
65+ "title" : "cool title" ,
66+ "type" : "Issue" ,
67+ "url" : "https://github.com/pandas/coolrepo/issues/241"
68+ },
69+ "id" : "PVTI_lADOBgkjhkjhjjh" ,
70+ "labels" : ["Bug" ],
71+ "linked pull requests" : ["https://github.com/pandas/coolrepo/pull/242" ],
72+ "repository" : "https://github.com/pandas/coolrepo" ,
73+ "status" : "In Progress" ,
74+ "title" : "Cool Pandas Task 3"
75+ },
76+ {
77+ "assignees" : ["coolAssignee" ],
78+ "content" : {
79+ "body" : "https://dummy_url/test#L42\n \n Rename from `X` to `Y`" ,
80+ "number" : 241 ,
81+ "repository" : "pandas/coolrepo" ,
82+ "title" : "cool title" ,
83+ "type" : "Issue" ,
84+ "url" : "https://github.com/pandas/coolrepo/issues/241"
85+ },
86+ "id" : "PVTI_lADOBgkjhkjhjjh" ,
87+ "labels" : ["Bug" ],
88+ "linked pull requests" : ["https://github.com/pandas/coolrepo/pull/242" ],
89+ "repository" : "https://github.com/pandas/coolrepo" ,
90+ "status" : "Blocked" ,
91+ "title" : "Cool Pandas Task 4"
92+ },
93+ {
94+ "assignees" : ["coolAssignee" ],
95+ "content" : {
96+ "body" : "https://dummy_url/test#L42\n \n Rename from `X` to `Y`" ,
97+ "number" : 241 ,
98+ "repository" : "pandas/coolrepo" ,
99+ "title" : "cool title" ,
100+ "type" : "Issue" ,
101+ "url" : "https://github.com/pandas/coolrepo/issues/241"
102+ },
103+ "id" : "PVTI_lADOBgkjhkjhjjh" ,
104+ "labels" : ["Bug" ],
105+ "linked pull requests" : ["https://github.com/pandas/coolrepo/pull/242" ],
106+ "repository" : "https://github.com/pandas/coolrepo" ,
107+ "status" : "Done" ,
108+ "title" : "Cool Pandas Task 5"
109+ }
110+ ]
51111}
52112
53-
54113generate_site (data )
0 commit comments