Commit graph

45 commits

Author SHA1 Message Date
Gered 64b8a678a4 set appropriate "content-type" headers for all responses
i'm slowly learning that actix is far more low-level than what i've
become accustomed to over all the other web stuff i've ever done all
these years.
2023-07-11 12:14:10 -04:00
Gered 746f92f52b allow all routes to also respond to HEAD requests
i've noticed that some services out there seem to issue HEAD requests
to web sites as part of some sort of metadata fetching process about
links contained in content that they are processing (e.g. Mastodon).
currently we were just responding with 404's to these because actix
does not respond to HEAD requests for any route unless you explicitly
set up the request to respond that way (with the sole exception being
the default route handler in actix which is invoked for any type of
request)
2023-07-11 12:12:37 -04:00
Gered 2aba6152bd version 0.3.0 2023-07-10 14:24:02 -04:00
Gered 0d75ca6caf update README.md to reflect trailing slash url changes better
they can still be used of course, but i feel like more people would
default to not using them, so i'd prefer the README to reflect this
by default. meh.
2023-07-10 14:20:01 -04:00
Gered 31fd5d444b update example site with trailing-url-less urls 2023-07-10 14:17:18 -04:00
Gered 0b8423a64f switch from requiring trailing slashes to them being optional 2023-07-10 14:15:13 -04:00
Gered 4cce2d4ad7 version 0.2.1 2023-07-10 13:59:58 -04:00
Gered 54b431810e manually log errors in our SiteError ResponseError implementation
actix's `Logger` middleware would do this too for us, but it also
logs all requests in a "web access log" style which i find personally
extremely annoying and unhelpful
2023-07-09 14:05:12 -04:00
Gered 672408c3eb include and display some build metadata at startup 2023-07-09 13:55:04 -04:00
Gered 3427b954ed add simple error response rendering
we don't really need anything pretty here since 99% of the time, the
error's that would be generated during a request will be something to
do with tera template rendering and thus, are probably only going to be
experienced while fiddling with the site. so we just want to display
the error details and move on.

the vast majority (if not all) of other errors will occuring during
startup and content reloading, and thus we only really need to worry
about them being logged to the console (which they are already)
2023-07-09 13:33:38 -04:00
Gered c7665fdc79 disable "smart punctuation" option of pulldown_cmark
the main thing i dislike with this is how it renders double quotes
as the "fancy" double quotes variation. bleh!
2023-07-06 19:23:35 -04:00
Gered cff659b072 version 0.2 2023-07-02 14:02:19 -04:00
Gered 7c1d42f870 do redirects using http 301
actix will instead use http 308, which is technically the more correct,
modern way to do this.

but http 308 isn't understood by some old browsers. today, 99.9% of
people wouldn't care about that. but i do.
2023-07-02 13:58:10 -04:00
Gered d98cef8af9 README.md updates 2023-07-02 13:49:54 -04:00
Gered 39e35c19db release build/profile settings to reduce binary size 2023-07-02 13:49:34 -04:00
Gered 328018834d add trailing slash to the end of post urls
this was intended to have been there from the beginning. oops.
2023-07-02 13:49:01 -04:00
Gered 447fb1d6e4 update README.md 2023-07-01 18:55:27 -04:00
Gered 35863725e3 update gitignore 2023-07-01 18:50:54 -04:00
Gered e12aac3506 add simple little script to generate release artifacts
for linux anyway
2023-07-01 18:50:46 -04:00
Gered 5d732a0880 add license 2023-07-01 18:36:13 -04:00
Gered 8a1fe32bfd add syntax_to_css utility README.md 2023-07-01 18:34:16 -04:00
Gered 8cd7e81a2d add initial README.md 2023-07-01 18:25:39 -04:00
Gered 80b9dd9aec move template_renderer into SiteContent, so it is refreshed as needed
since we want html template modifications to trigger content refreshes,
we need to reload the Tera renderer because it internally is caching
loaded html templates.
2023-07-01 16:30:48 -04:00
Gered 2f8e242a61 update example site html/page titles 2023-07-01 16:24:36 -04:00
Gered 2d9ce75ec0 add separate template for the "latest post" page (the home/main page)
since it's reasonable to assume some may want to customize this a
little differently than the normal post page.
2023-07-01 16:19:22 -04:00
Gered b8200b220d add an example post written in html directly to the example site 2023-07-01 15:36:10 -04:00
Gered 0ac1024c6c add more watched paths 2023-07-01 15:35:48 -04:00
Gered ee30a192c2 allow the log level to be set via environment variable 2023-07-01 14:34:18 -04:00
Gered 276c714ee8 add initial file watching support to trigger content reloading
not all of the paths that we'd probably like are being watched yet
2023-07-01 14:33:57 -04:00
Gered 065f2ededf add a custom syntax highlighting css sheet to the example site 2023-06-30 21:13:50 -04:00
Gered 35b357b1e1 add some css classes to syntax highlighted code block container tags 2023-06-30 21:13:12 -04:00
Gered a3c2175671 add a "companion" project, syntax_to_css
to be used to turn sublime text themes to css files which can then
be included in a pbe site to apply appropriate styling to syntax
highlighted code blocks

i don't intend to support syntect's alternative inline css html
rendering functionality which would otherwise allow you to skip needing
a separate css file (at the cost of some html output that is a little
bit more bloated and less customizable from a web styling perspective)
2023-06-30 17:25:07 -04:00
Gered 73e400db1a add example custom syntax stuff to the example site 2023-06-30 16:41:24 -04:00
Gered 1d83b95211 add custom syntax loading support 2023-06-30 16:40:53 -04:00
Gered 4dfd946204 switch a bunch of naming from using "commonmark" to "markdown"
while we are actually using a CommonMark renderer instead of Markdown,
i think i just prefer referring to everything related to this as
"markdown" for simplicity's sake. meh.
2023-06-30 14:58:06 -04:00
Gered 913612c6e8 cleanups 2023-06-30 14:53:39 -04:00
Gered 8885a7c9d8 markdown rendering refactor and addition of code syntax highlighting
currently syntax highlighting is limited to the default syntax
definitions that syntect comes pre-loaded with (which is the same
as sublime text's out-of-the-box language support)
2023-06-30 14:53:10 -04:00
Gered 6e3eae7abd switch from json to yaml
yaml is just easier to write by hand, and since we're using it for
files which are all meant to be written/edited by hand, it seems like
a no-brainer.
2023-06-28 17:38:41 -04:00
Gered 1fbdab9c58 rename "old urls" to "alternate urls" 2023-06-28 17:12:36 -04:00
Gered 7ad5beb717 add a bit more content to the example site for testing purposes 2023-06-28 17:07:00 -04:00
Gered 9d2af25c81 improve how posts and pages are referenced internally
since most often, we need to get posts sorted in descending order by
date, we now just store the actual posts in a Vec, pre-sorted by date.
everything else that needs to reference posts now does so by the post's
index in that Vec.

pages are also changed to be stored/referenced in a similar manner, but
it is somewhat less important for pages since we don't do any real
enumeration of pages at all anywhere. but it's nice to be consistent.
2023-06-28 16:59:10 -04:00
Gered b144813654 tweak example site css styling a bit 2023-06-28 15:16:44 -04:00
Gered 83d75d4885 represent post dates as a NaiveDateTime, still allowing for date-only
posts can be specified with a date only, or date and time as desired.
it is up to the site's specific template to render posts with an
appropriate date/time format string based on what the author's
preferences
2023-06-28 15:16:29 -04:00
Gered 3f18b2a58a add example site config and content 2023-06-27 17:18:52 -04:00
Gered 4c3fc25e50 initial commit
basically works, but still missing things. as well as some (much?) code
being kinda janky
2023-06-27 17:15:58 -04:00