Commit Graph

37 Commits

Author SHA1 Message Date
Brian S. Stephan e61c55bed2 handle graphviz parsing errors more cleanly 2021-06-24 11:37:57 -05:00
Brian S. Stephan 1583e3be99 more debugging and catch md misconfigured error 2021-06-24 09:43:00 -05:00
Brian S. Stephan 954f7f4e80 allow markdown files to specify a redirect
closes #13
2021-06-06 22:24:35 -05:00
Brian S. Stephan e8377adcf5 allow pages to specify different templates 2021-04-30 19:41:39 -05:00
Brian S. Stephan f4beb15a3b make directory redirects absolute paths
I think this is always the right choice, since we're rewriting the full
input path
2021-04-17 15:06:39 -05:00
Brian S. Stephan 60715a3a5c make request -> instance conversion support symlink dirs
I think this also clarifies the code, a bit
2021-04-17 10:31:05 -05:00
Brian S. Stephan c90f0a3a42 treat symlinks as redirects
closes #7
2021-04-15 21:44:02 -05:00
Brian S. Stephan 71ead20f3f have file handler return render type rather than bool
for when we have further types to render
2021-04-15 20:36:30 -05:00
Brian S. Stephan be88c3c1bc don't error on breadcrumbs if a dir doesn't have index.md
fixes #8
2021-04-14 21:35:14 -05:00
Brian S. Stephan ced67bec8b allow for serving files directly inside pages/ 2021-04-14 20:45:50 -05:00
Brian S. Stephan d89fd151ca use just the page part of the path in breadcrumbs
rather than showing the full path (e.g. /foo/bar/baz) in breadcrumbs
when the page doesn't have a Title, show just the leaf (baz)

Closes #4
2021-02-27 00:30:32 -06:00
Brian S. Stephan 0bfea79a8f log the OSError before returning 500 2021-02-21 19:37:59 -06:00
Brian S. Stephan e570ee26b5 clean up unused imports 2021-02-21 18:41:09 -06:00
Brian S. Stephan c1801b0086 move render() into shared spot
going to be used by error page handling code, once it exists
2021-02-20 23:36:03 -06:00
Brian S. Stephan f08c1117d8 move site suffix into title always
this tweaks the behavior of the title to always append ' - suffix' to
any title (from the meta tag, or generated via request path), unless the
page explicitly specifies an empty Title meta tag
2021-02-20 23:21:29 -06:00
Brian S. Stephan dd7687884a remove resolve_page_file, been refactored away 2021-02-20 22:50:56 -06:00
Brian S. Stephan 15c88d920b use request path as an alternative to Title metadata 2021-02-20 22:43:42 -06:00
Brian S. Stephan 1cef3b8196 rewrite generate_parent_navs to work on resource paths
the old code was kind of impossible to understand by reading it, so this
is hopefully considerably clearer
2021-02-20 21:47:39 -06:00
Brian S. Stephan 4dcc1c91c2 add method to from resource path to request path 2021-02-20 19:19:36 -06:00
Brian S. Stephan 1c40f45ffd clarify name of request_path_to_instance_resource_path 2021-02-20 17:53:32 -06:00
Brian S. Stephan 2e0e87fe95 begin rewriting path to resource resolver
this code was getting too messy and scattered, and I realized that Flask
wasn't doing as much as I thought it was here, so now we need more
safety and sanity checks
2021-02-20 17:42:58 -06:00
Brian S. Stephan 4f45943775 initialize markdown on a per-page basis
the footnote extra expects to only parse one document over the Markup's
lifetime, and writes the footnotes to the bottom of every page that is
rendered (again assuming only one) with links back to the reference

having one parser for the entire app, naturally, introduced
ever-increasing footnote links and every footnote on the site showing up
on every page. this was not intended

in some light testing, doing this per-request has a nominal effect on
performance
2021-02-11 18:17:26 -06:00
Brian S. Stephan c25fefa9e3 add opengraph metadata to pages, via Markdown meta 2021-01-17 23:02:14 -06:00
Brian S. Stephan d2c1c2e3ce why did I make user styles a config setting???
this moves it into the code, where it's sensible, and leaves the default
to the config
2020-12-08 16:43:20 -06:00
Brian S. Stephan 7cf11986c5 user-selectable light and dark themes
cookies, template rendering with different CSS files via default or
request param or cookie, etc.
2020-10-30 00:19:19 -05:00
Brian S. Stephan 5ca483a904 configurable markdown extensions
meta is always loaded, because the code expects it
2020-10-29 23:51:58 -05:00
Brian S. Stephan 0f7495bf2b add the ability to redirect a file-looking request to a dir
if the client has requested /foo, and foo is actually a directory,
this redirects the client to /foo/
2020-06-19 19:58:12 -05:00
Brian S. Stephan cf8f0325a2 fix /most/ isort problems, but conftest.py is being weird 2020-06-19 19:54:01 -05:00
Brian S. Stephan ce06de78a8 tests misleadingly had a leading /, need to append it ourselves 2020-05-28 16:52:43 -05:00
Brian S. Stephan 05f879ab80 display untitled-page paths as /path rather than path.md 2020-05-28 12:17:27 -05:00
Brian S. Stephan 059108c37b rewrite generate_parent_navs
* works on a path now, not a file location
* as such is sliiiiiightly easier to understand
* now also puts the current page in the nav
* fixed failing test where this caused an error (rather than 404) on
  non-existent paths
2020-05-28 12:09:59 -05:00
Brian S. Stephan da2476bbda enable table support in the markdown parser 2020-04-05 10:25:46 -05:00
Brian S. Stephan 576ffc359c show some navigation on every page
closes #1
2020-03-15 20:33:23 -05:00
Brian S. Stephan 582cc9a2d1 rename: page_file_resolver -> resolve_page_file 2020-03-15 18:52:49 -05:00
Brian S. Stephan 5ce44ba31c move display_page path resolution logging to DEBUG 2020-03-15 18:43:41 -05:00
Brian S. Stephan 04145e92f8 add page modified time to the template 2020-03-07 15:39:12 -06:00
Brian S. Stephan fe0ca7d90b rename journal module to pages
this better represents the general purpose of this module, rather than
just "journal" stuff (though that will likely be a use)
2020-03-07 14:11:12 -06:00