Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Static Glyphicons #71

Closed
drewc opened this issue Feb 22, 2013 · 1 comment
Closed

Static Glyphicons #71

drewc opened this issue Feb 22, 2013 · 1 comment
Milestone

Comments

@drewc
Copy link

drewc commented Feb 22, 2013

So, I like o-blog quite a bit, and have decided to use it for http://alpha.common-lisp.net/ ... but I did not want to use the .less and the .js, so changed the template(s) to something like :

<lisp>
          (drewc.org:replace-<i>-icons
           (replace-regexp-in-string (rx "<ul>")
            "<ul class=\"nav\">"
            (ob:post-content-html (ob:get-snippet "Navigation"))))
</lisp>

And here is the code. It is not-so-great, but works fine :)

(defun drewc.org:replace-<i>-icons (string)
  (let* ((re-icon (rx
                   "\<i\>"
                   (submatch
                    (and "icon-"
                         (one-or-more (or alphabetic (any "  -")))))
                   "\</i\>"))
         (match (string-match re-icon string))
         (all (drewc.org:match-strings-all string))
         (class (second (and match all )))
         (future (and match (substring string (+ 1 match))))
         (next (when future (string-match re-icon future)))
         (string-to-replace (if next
                                (substring string 0 (+ match (length (first all))))
                              string))

         (next-string (if next
                          (substring string (length string-to-replace))
                        "")))
    (if class
        (concatenate
         'string
         (replace-regexp-in-string
          re-icon
          (concatenate 'string "<i class=\"" class "\"></i>")
          string-to-replace)
         (if next (drewc.org:replace-<i>-icons next-string) "")
         )
      string-to-replace)))

Let me know if that can be included or what has to be done to make it so.

-- drewc

@renard
Copy link
Owner

renard commented Mar 29, 2013

This has ben setup in dd76aa1 which is a new o-blog exporter.

Anyway this could be easily setup for o-blog-v1.

Let me know if you need help for that.

@renard renard closed this as completed Mar 29, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants