1
0
Fork 0
Commit graph

192 commits

Author SHA1 Message Date
f880847f15 Merge remote-tracking branch 'sourcehut/customizations' into customizations 2023-09-06 15:25:54 -07:00
cc4ce6cad4 Merge remote-tracking branch 'origin/master' into customizations 2023-09-06 15:17:33 -07:00
Andy Wingo
21793fb83e Allow \r in pre terminators 2022-12-10 21:41:13 +01:00
Andy Wingo
f290d7c2c7 Allow tt in comments, class in pre 2022-11-29 10:19:11 +01:00
Andy Wingo
17905ace44 Fix online classifier update 2022-11-29 10:16:30 +01:00
Andy Wingo
ba9a560f01 Fix html translation 2022-10-23 21:48:57 +02:00
Andy Wingo
304f8839ec Hopefully fix paragraph parsing 2022-10-23 21:45:43 +02:00
Andy Wingo
105873854c Fix list parsing 2022-10-23 17:30:36 +02:00
Andy Wingo
7652cb17cf Implement heading parsing 2022-10-23 09:45:52 +02:00
Andy Wingo
5f1620e0e7 Handle CR/LF in marxdown; fix trailing ! in paragraphs 2022-10-22 09:55:07 +02:00
Andy Wingo
4a9766c6c1 Fix emph lowering 2022-10-20 23:26:35 +02:00
Andy Wingo
2d102677d1 Fix xml attr parsing 2022-10-20 23:10:46 +02:00
Andy Wingo
eebd1b219a Parse formats to symbol 2022-10-20 23:03:16 +02:00
Andy Wingo
f920fb678b Fix some marxdown bugs 2022-10-20 22:57:13 +02:00
Andy Wingo
9720ba7bcf New posts are marxdown 2022-10-20 22:54:07 +02:00
Andy Wingo
ddb029d674 Fix format for posts (!) 2022-10-20 22:51:27 +02:00
Andy Wingo
9dd5eba908 Fix format for comments 2022-10-20 22:45:35 +02:00
Andy Wingo
f424227fff Fix format for comments 2022-10-20 22:42:57 +02:00
Andy Wingo
4374fbf1dc Switch to marxdown as default post and comment format 2022-10-20 22:37:55 +02:00
Andy Wingo
1236e8a996 Add marxdown
Marxdown a new dialect for writing blog posts.  We'll see!
2022-10-20 21:40:27 +02:00
Andy Wingo
e62d37ae7f Commit pending changes 2022-10-08 07:51:39 +00:00
a502f2ce9c Merge branch 'svg-support' into customizations 2021-07-02 02:32:22 -07:00
3924728bab Add trickery to support embedded SVG images
- Specify the svg and xlink namespaces to the `xml->sxml' procedure so that it
  doesn't include them in full for each tag.
- For the default `pre-post-order' handler strip the `svg:' prefix if found.
- Strip the `svg:' namespace from the SVG element and insert the `xmlns' and
  `xmlns:xlink' namespace definition attributes into the attributes.

This is all very brittle and badly done, but for the moment this fixes my
use-case of wanting to display SVG images embedded in the HTML.
2021-07-02 02:28:27 -07:00
32b9adf4bf Fix tag pages by reverting to the original layout 2021-05-31 20:44:34 -07:00
d34a14b3d6 Merge branch 'initial-startup-fix' into customizations 2021-05-30 19:27:03 -07:00
6da1ed8fd2 Fix some “Numerical overflow” errors
When starting a new blog, or trying to run on some very old data, there is no
data available on any bogus or legitimate comments. When this happens Tekuti
will try to divide by 0 and divide 0 by other things in a few places, assuming
that there is at least _some_ data about bogus and legitimate comments.

I’m not 100% sure what the expectation is of these calculations, so I might have
chosen the wrong solution, but it seems to me that if there is no data
available, all we know is that there is nothing (0).

This fixes an issue with both trying to comment on a fresh new data set, or a
dataset that hasn’t been touched since 2014.
2021-05-30 01:21:47 -07:00
480c050275 Check that a revision has been provided before trying to parse it
When setting up Tekuti for the first time the ‘compute-bogus-comments’ will get
the current commit passed in and try to get the parent. Since there is only the
“initial commit” at this stage it will get ‘#f’ as the parent commit and pass it
in to ‘fold-commits’. Trying to parse revision ‘#f’ will surely fail.

The ‘fold-commits’ function already expects that ‘rev’ might be empty, so this
should work out fine.
2021-05-30 01:16:48 -07:00
Andy Wingo
ae3d83d5f2 Fix comments-open? logic. sadness 2021-03-08 15:49:41 +01:00
Andy Wingo
70a93318b4 Fix comments-closed-timestamp spec parser 2021-03-08 15:42:29 +01:00
Andy Wingo
768578c873 Fix comments-closed-timestamp spec parser 2021-03-08 15:37:34 +01:00
Andy Wingo
d6cee09123 Fix serializing no-comments-closed-date state 2021-03-08 15:16:26 +01:00
Andy Wingo
60bc3db10f Add comment closing window feature
* tekuti/config.scm (*comments-open-window*): New config, indicating
seconds for which to keep comments open.
* tekuti/page-helpers.scm (post-editing-form): Expose comments closed
date feature.
* tekuti/page.scm (page-new-comment): Oops -- we were missing a
server-side comments-open check!
* tekuti/post.scm (*post-spec*): Serialize comments-closed-timestamp.
(post-comments-open?): Return false if we are after the
comments-closed-timestamp.
(post-comments-closed-timestamp): New accessor.
(munge-post): Write comments-closed-timestamp.
(parse-post-data): Parse comments-closed-timestamp from form data.
2021-03-08 15:04:23 +01:00
Andy Wingo
bb11cb984e Fix a nodelist issue in admin edit page 2019-06-26 15:37:37 +02:00
Andy Wingo
83c47a9185 Make raw text closing tag check reflect the spec
* tekuti/page-helpers.scm (shtml->html): The previous code was too
  strict.
2019-05-31 16:11:32 +02:00
Andy Wingo
5cdda50445 Fix another accidental-nodelist area
* tekuti/page.scm (page-admin): Fix accidental nodelist.
2019-05-31 15:56:41 +02:00
Andy Wingo
9d9d39c7f5 Allow numbers in shtml->html
* tekuti/page-helpers.scm (shtml->html): Allow numbers.
2019-05-31 15:51:08 +02:00
Andy Wingo
83fd0a044e Unroll a few locations that were receiving nodelists
* tekuti/page-helpers.scm (post-editing-form):
* tekuti/page.scm (page-index, page-show-post): show-post returns a
  nodelist; deal with it.
2019-05-31 15:42:30 +02:00
Andy Wingo
b16c08a385 Serialize as HTML rather than XHTML
* tekuti/page-helpers.scm (html-doctype): Relax to HTML doctype.
  (define-tag-set, void-element?, template-element?, raw-text-element?)
  (escapable-raw-text-element?, foreign-element?, make-char-quotator)
  (attribute-value-empty?, attribute-value-needs-quotes-chars)
  (attribute-value-needs-quotes?, print-attribute-value/quoted)
  (print-text/quoted, shtml->html): Emit HTML by default.  This will
  allow documents to contain <script> tags which themselves have &, <,
  and so on.
2019-05-31 15:31:04 +02:00
Andy Wingo
ff529670e1 Fix env invocation 2017-03-06 14:18:37 +00:00
Andy Wingo
493fe697ba Update parsed entities 2017-03-06 11:17:39 +01:00
Andy Wingo
5e603daa9e Add bogus comment detector.
* tekuti/classifier.scm: New file.
* Makefile.am: Add new file.
* tekuti/comment.scm:
* tekuti/git.scm:
* tekuti/index.scm:
* tekuti/page.scm: Update to include bogus comment detector.
2017-03-06 09:41:52 +01:00
Andy Wingo
42b77efe6a Neutralize links in comments. 2017-03-03 17:13:36 +01:00
Andy Wingo
01ca951b76 Improve security question. Fix reindexing. 2017-03-02 15:28:55 +00:00
Andy Wingo
e700e4af7a Fix spurious 304 error
* tekuti/cache.scm (make-entry): Only return a cached not-modified
  response if the request was conditional.
2016-08-28 10:58:34 +02:00
Andy Wingo
7643585d12 Fix 304 edge case in atom feed
* tekuti/page.scm (atom-feed-from-posts): Don't bomb if the client sends
  a if-modified-since but we have no posts.
2016-08-28 10:40:36 +02:00
Andy Wingo
cf10aa7056 New posts start in private status
* tekuti/page-helpers.scm (post-editing-form): Fix status of new posts.
2014-12-17 11:19:49 +01:00
Andy Wingo
acc13819e1 Minor aesthetic fixups
* tekuti/page-helpers.scm (post-editing-form): Aesthetic fixups.
2014-12-17 11:17:56 +01:00
Andy Wingo
20e7658295 Add ability to share draft posts
As a side effect of this change, any pending posts in your repository
that are in "draft" status will effectively move into the new "draft"
state, which means they can be reached by their URL.  That's not a big
deal though because those URLs are not trivial to guess.

* tekuti/page-helpers.scm (post-editing-form): Add radio button to
  choose post status.

* tekuti/post.scm (post-public?, post-draft?, post-private?): New
  accessors for post status.
  (post-from-key): Add #:allow-draft? keyword argument.

* tekuti/page.scm (page-show-post): Allow direct access to draft posts.
2014-12-17 11:05:07 +01:00
Andy Wingo
7ecade64bd Fix expanduser on absolute paths.
* tekuti/util.scm (expanduser): Fix when given absolute paths.
2014-10-22 16:14:59 +02:00
Andy Wingo
e45cd521f9 Add example nginx config.
* nginx-config: New file.
2014-10-22 15:50:31 +02:00