renard / o-blog

Standalone orgmode blog exporter. DEPECATED, NOT MAINTAINED
http://renard.github.com/o-blog-v2
260 stars 58 forks source link

Post "CUSTOM_ID" property #11

Closed exaos closed 12 years ago

exaos commented 12 years ago

Default org properties have "CUSTOM_ID" option, which can be used as internal references. Again, I want the post filename can use this property value, e.g. the post filename can be "blog/2012/04/01_computer-OCD-users.html" while its "CUSTOM_ID" is "computer-OCD-users" no matter what its tile is. If posts refer to each other, I can use "CUSTOM_ID" as link to each other. So, post filename may be based on "CUSTOM_ID" > "#+FILENAME_SANITIZER" > "ob-sanitize-string". PROS

renard commented 12 years ago

Hi,

do you think a such patch for o-blog.el would be enough:


@@ -474,7 +474,8 @@ MARKERS is a list of entries given by `org-map-entries'."

       (page (org-entry-get (point) "PAGE"))

-      (filename (ob:sanitize-string title))
+      (filename (or (org-entry-get (point) "CUSTOM_ID")
+            (ob:sanitize-string title)))
       (filepath (format "%s/%.4d/%.2d" category year month))
       (htmlfile (format "%s/%.2d_%s.html" filepath day filename))
renard commented 12 years ago

References between posts is not a simple thing since the date is a part of the URL.

I am wondering how a simple post-links could be done.

If you do have some ideas you're welcome ;-)

exaos commented 12 years ago

Thanks. Simple links are enough. Interlink is a wiki-needed feature. :-)