Skip to content

Commit

Permalink
Load metadata.json, closes #6
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Apr 7, 2020
1 parent ca7be13 commit b3dc14e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion datasette_publish_now/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@

INDEX_PY = """
from datasette.app import Datasette
import json
metadata = dict()
try:
metadata = json.load(open("metadata.json"))
except Exception:
pass
app = Datasette([], {database_files}{extras}).app()
app = Datasette([], {database_files}, metadata=metadata{extras}).app()
""".strip()

project_name_re = re.compile(r"^[a-z0-9][a-z0-9-]{1,51}$")
Expand Down

0 comments on commit b3dc14e

Please sign in to comment.