emacsorphanage / org-page

[INACTIVE] A static site generator based on Emacs and org mode.
673 stars 99 forks source link

Decouple default parameter tables from render functions #227

Closed jinnovation closed 4 years ago

jinnovation commented 6 years ago

This provides an easy path for users who would like to use additional templating parameters in new themes to easily extend/modify the parameter set passed to each templating function through the use of, say, advice. For example, to add Google Analytics parameters to the header, one can do the following:

(advice-add
 'op/header-param-table :filter-return
 (lambda (param-table)
   (list (ht-merge
          param-table
          (ht ("google-analytics" (and (boundp 'op/personal-google-analytics-id)
                                       op/personal-google-analytics-id))
              ("google-analytics-id" op/personal-google-analytics-id))))))