Skip to content

Instantly share code, notes, and snippets.

@wobh
Last active November 22, 2022 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wobh/b30dce7a2f33bc8883ed40ef2c3d92b3 to your computer and use it in GitHub Desktop.
Save wobh/b30dce7a2f33bc8883ed40ef2c3d92b3 to your computer and use it in GitHub Desktop.
blorg-jekyll

blorg

1 templates

1.1 export file name

 (let ((post-date (format-time-string "%F" 
				       (org-time-string-to-time (org-entry-get nil
									       "DATE"))))
	(post-stub (replace-regexp-in-string " "
					     "-"
					     (downcase (or (org-entry-get nil "post_stub")
							   (org-entry-get nil "ITEM"))))))
   (org-set-property "EXPORT_FILE_NAME"
		      (file-name-concat (org-entry-get nil "blog_path" t)
					(file-name-with-extension (mapconcat #'identity
									     (list post-date
										   post-stub)
									     "-")
								  "md"))))

1.1.1 example Wat with stub

1.1.2 example Wat sans stub

1.2 front matter

{ 'layout' => 'post',
  'title' => post_title,
  'date' => post_date,
  'tags' => (post_tags.empty? ? nil : post_tags)
}.
  compact.
  to_yaml.
  concat(YAML.dump(nil))

1.2.1 example Wat sans tags

#+RESULTS[c0dce3871839081df9f8dffdc2f5736d641bb0a5]:

1.2.2 example Wat with tags

#+RESULTS[5b304566eca958074cdf584ec8c92365f4a62bdf]:

1.3 new posts

1.3.0.1 post title

Stuff

More stuff

2 drafts

2.0.0.1 First Post

#+RESULTS[0b4d5d1e2dbc3585f236ace10c9183739c7b4943]:

This is a test.

Contents of test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment