teesloane / firn

Org Mode Static Site Generator
Eclipse Public License 1.0
324 stars 24 forks source link

Property drawer at top of file hides title and other keywords #104

Closed MichielCottaar closed 2 years ago

MichielCottaar commented 3 years ago

In org-roam v2 all files will usually have an ID, which will be typically stored in a drawer at the top of the file. This property drawer seems to break firn. For example, firn works fine on a file (called index.org) like:

#+TITLE: My Index Page
* Test heading

On the other hand once I add a property drawer to this file, firn raises an error complaining about a lack of front-matter: Warning: File << index >> does not have 'front-matter' and will not be processed. The tested file was:

:PROPERTIES:
:ID:       fea6fa0a-8566-41c4-9ed9-bbbc413d26b9
:END:
#+TITLE: My Index Page
* Test heading

When entered into orgize, it appears both files are parsed correctly, so I suspect the problem is that firn ignores any keywords which are not at the top of the file. Could this be adjusted to ignore any property drawer?

teesloane commented 3 years ago

I will try and fix this, thanks for reporting it. As an aside - Firn has no plans to support org-roam v2.

yosevu commented 3 years ago

I ran into this too and wrote a script to remove the properties drawer before running firn build as a work around. Is this still something in the scope of Firn to fix, can I look into it?

teesloane commented 3 years ago

@yosevu and I have already chatted briefly but I thought I would share my response here:

For sure. I haven't tried org-roam-v2 yet, but from what I understand interlinking between documents happens using property links (I believe it no longer uses file:... links. File links are necessary for firn to construct web links in the built site.) I don't really have any intention to chase org-roam's implementation and would rather just follow what org does out of the box. Please correct me if I'm wrong! All in all, I'm always open to pull requests - but I can't promise they will merge - so definitely good to discuss here. Further, with regard to contributions; if any more work is going to happen on firn it will probably be moving it toward being built in rust, so everything will have to get overhauled (although I am still thinking about this).

teesloane commented 2 years ago

Looks like this is fixed by the rust re-write as well.