{"html_url": "https://github.com/simonw/datasette/pull/737#issuecomment-619599904", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/737", "id": 619599904, "node_id": "MDEyOklzc3VlQ29tbWVudDYxOTU5OTkwNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-26T18:21:06Z", "updated_at": "2020-04-26T18:21:06Z", "author_association": "OWNER", "body": "Just needs documentation now.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 607067303, "label": "Custom pages mechanism, refs #648"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/737#issuecomment-619593899", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/737", "id": 619593899, "node_id": "MDEyOklzc3VlQ29tbWVudDYxOTU5Mzg5OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-26T17:49:06Z", "updated_at": "2020-04-26T17:49:06Z", "author_association": "OWNER", "body": "I'm going with `custom_header(name, value)`, `custom_status(numeric_code)`, `custom_redirect(\"URL\")`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 607067303, "label": "Custom pages mechanism, refs #648"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/737#issuecomment-619593811", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/737", "id": 619593811, "node_id": "MDEyOklzc3VlQ29tbWVudDYxOTU5MzgxMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-26T17:48:31Z", "updated_at": "2020-04-26T17:48:31Z", "author_association": "OWNER", "body": "Design challenge: the function that can be called in the custom template to return a custom status code and/or headers.\r\n\r\nProposed design:\r\n```\r\n{{ custom_headers({\"x-foo\": \"bar\"}) }}\r\n{{ custom_status_code(404) }}\r\n```\r\nOr should I combine them into one function?\r\n```\r\n{{ custom_headers({\"x-foo\": \"bar\"}, status=404) }}\r\n```\r\nA common use-case here would be a redirect. How should that look?\r\n```\r\n{{ custom_redirect(\"/foo\") }} - defaults to 301\r\n{{ custom_redirect(\"/foo\", status=302) }}\r\n```\r\nMaybe avoid dictionary syntax entirely:\r\n```\r\n{{ custom_header(\"x-foo\", \"bar\") }}\r\n```\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 607067303, "label": "Custom pages mechanism, refs #648"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/737#issuecomment-619591533", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/737", "id": 619591533, "node_id": "MDEyOklzc3VlQ29tbWVudDYxOTU5MTUzMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-04-26T17:33:48Z", "updated_at": "2020-04-26T17:33:48Z", "author_association": "OWNER", "body": "> > Stretch goal: it would be neat if these pages could return custom HTTP headers (eg content-type) and maybe even status codes (eg for redirects) somehow.\r\n> \r\n> I think I could do that with a custom template function - if that function is called during the render then we follow those instructions instead of returning the rendered HTML.\r\nhttps://github.com/simonw/datasette/issues/648#issuecomment-619591380", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 607067303, "label": "Custom pages mechanism, refs #648"}, "performed_via_github_app": null}