diff --git a/thinks/views.py b/thinks/views.py index 263c186..e0eb83d 100644 --- a/thinks/views.py +++ b/thinks/views.py @@ -82,6 +82,12 @@ class RemixThinkView(ThinkMixin, generic.UpdateView): class ThinkView(ThinkMixin, generic.DetailView): template_name = "thinks/think.html" + default_paths = [ + 'src/App.elm', + 'script.js', + 'index.html', + ] + def get_context_data(self, *args, **kwargs): context = super().get_context_data(*args, **kwargs) @@ -93,6 +99,12 @@ class ThinkView(ThinkMixin, generic.DetailView): path = think.file_path(strpath) + if path is None: + for f in self.default_paths: + if (root / f).exists(): + path = root / f + break + relpath = path.relative_to(root) if path is not None else None if path is None: