-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perhaps use org-collect-keywords
to extract date?
#131
Comments
Thank you for the bug report. It seems that the timestamp regex is a bit broken anyway. How about this version:
This should skip any I'd prefer to not use the |
Great! I tested on the previous simple document and it worked as expected, including |
Wonderful! Since you started this issue, would you like to contribute the change as a pull request? |
I am glad to do it! |
Fix #131: update regexp to support inactive date timestamp.
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 Iwant.
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 yourclear code organization, it did not take me much time to locate the bug.
The current implementation of
org-static-blog-get-date
is based on thefollowing REGEXP
It works fine for active timestamp like
<2024-01-24>
but does notmatch 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 isalso case-insensitive and can match
#+date
. I create a small org fileand 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.The text was updated successfully, but these errors were encountered: