Closed Dou-Meishi closed 9 months ago
Thank you for the bug report. It seems that the timestamp regex is a bit broken anyway.
How about this version:
(search-forward-regexp "^\\#\\+date:[ ]*[[<]?\\([^]>]+\\)[]>]?$" nil t)
This should skip any <[
at the beginning of the timestamp, and any >]
at the end, and work without any delimiters as well. Does that work on your end?
I'd prefer to not use the org-
functionality, as it is very slow.
Great! I tested on the previous simple document and it worked as expected, including 2024-01-01
, [2024-01-01]
, <2024-01-01>
and nil.
Wonderful! Since you started this issue, would you like to contribute the change as a pull request?
Wonderful! Since you started this issue, would you like to contribute the change as a pull request?
I am glad to do it!
Thank you very much for your contribution!
Hello, this is a great package! I always want to build my blog site but have no courage to learn thhose heavy SSG tools, especially their template language. Several days ago when I was searching the usage of
org-publish
I found this package and I knew this is exactly what I want.These days I have been exploring this package by following your demo and others configuration and trying to generate my site in my computer. Everything works fine except that the post date was always set to the current time, instead of the value specified by
#+DATE
. Thanks to your clear code organization, it did not take me much time to locate the bug. The current implementation oforg-static-blog-get-date
is based on the following REGEXPIt works fine for active timestamp like
<2024-01-24>
but does not match inactive timestamp like[2024-01-24]
or the bare string2024-01-24
. Sadly, none of my org notes uses active timestamps.I am not very familiar with REGEXP in elisp but I think the function
org-collect-keywords
can extract the value of#+DATE
easily. It is also case-insensitive and can match#+date
. I create a small org file and test on different values of date (absent,2024-01-01
,<2024-01-01>
,[2024-01-01]
) and find out it works well.Interestingly,
org-collect-keywords
seems to be able to ignore#+date
appears in source blocks or example blocks.