Coder Social home page Coder Social logo

Comments (7)

bastibe avatar bastibe commented on May 21, 2024

Hi!

Could you run the function wrapped in (debug (your-code-here ...)), and post the full stack trace?

from org-static-blog.

lucasemmoreira avatar lucasemmoreira commented on May 21, 2024

not sure if this is what you meant (I do not have much xp in elisp... still climbing the learning curve =p)

I tried to run (org-static-blog-publish) in the scratch buffer. This is what I got:

Debugger entered--Lisp error: (error "Unknown \"nil\" back-end: Aborting export")
  signal(error ("Unknown \"nil\" back-end: Aborting export"))
  error("Unknown \"%s\" back-end: Aborting export" nil)
  org-export-barf-if-invalid-backend(nil)
  org-export-as(org-static-blog-post-bare nil nil nil nil)
  (setq result (org-export-as 'org-static-blog-post-bare nil nil nil nil))
  (progn (if buffer-exists (insert-buffer-substring buffer-exists) (insert-file-contents post-filename)) (org-mode) (goto-char (point-min)) (org-map-entries (lambda nil (setq org-map-continue-from (point)) (org-cut-subtree)) org-static-blog-no-post-tag) (setq result (org-export-as 'org-static-blog-post-bare nil nil nil nil)) (switch-to-buffer current-buffer) result)
  (unwind-protect (progn (if buffer-exists (insert-buffer-substring buffer-exists) (insert-file-contents post-filename)) (org-mode) (goto-char (point-min)) (org-map-entries (lambda nil (setq org-map-continue-from (point)) (org-cut-subtree)) org-static-blog-no-post-tag) (setq result (org-export-as 'org-static-blog-post-bare nil nil nil nil)) (switch-to-buffer current-buffer) result) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (if buffer-exists (insert-buffer-substring buffer-exists) (insert-file-contents post-filename)) (org-mode) (goto-char (point-min)) (org-map-entries (lambda nil (setq org-map-continue-from (point)) (org-cut-subtree)) org-static-blog-no-post-tag) (setq result (org-export-as 'org-static-blog-post-bare nil nil nil nil)) (switch-to-buffer current-buffer) result) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (with-current-buffer temp-buffer (unwind-protect (progn (if buffer-exists (insert-buffer-substring buffer-exists) (insert-file-contents post-filename)) (org-mode) (goto-char (point-min)) (org-map-entries (lambda nil (setq org-map-continue-from (point)) (org-cut-subtree)) org-static-blog-no-post-tag) (setq result (org-export-as 'org-static-blog-post-bare nil nil nil nil)) (switch-to-buffer current-buffer) result) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (with-current-buffer temp-buffer (unwind-protect (progn (if buffer-exists (insert-buffer-substring buffer-exists) (insert-file-contents post-filename)) (org-mode) (goto-char (point-min)) (org-map-entries (lambda nil (setq org-map-continue-from (point)) (org-cut-subtree)) org-static-blog-no-post-tag) (setq result (org-export-as 'org-static-blog-post-bare nil nil nil nil)) (switch-to-buffer current-buffer) result) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (with-temp-buffer (if buffer-exists (insert-buffer-substring buffer-exists) (insert-file-contents post-filename)) (org-mode) (goto-char (point-min)) (org-map-entries (lambda nil (setq org-map-continue-from (point)) (org-cut-subtree)) org-static-blog-no-post-tag) (setq result (org-export-as 'org-static-blog-post-bare nil nil nil nil)) (switch-to-buffer current-buffer) result)
  (let ((current-buffer (current-buffer)) (buffer-exists (org-static-blog-file-buffer post-filename)) (result nil)) (with-temp-buffer (if buffer-exists (insert-buffer-substring buffer-exists) (insert-file-contents post-filename)) (org-mode) (goto-char (point-min)) (org-map-entries (lambda nil (setq org-map-continue-from (point)) (org-cut-subtree)) org-static-blog-no-post-tag) (setq result (org-export-as 'org-static-blog-post-bare nil nil nil nil)) (switch-to-buffer current-buffer) result))
  (save-excursion (let ((current-buffer (current-buffer)) (buffer-exists (org-static-blog-file-buffer post-filename)) (result nil)) (with-temp-buffer (if buffer-exists (insert-buffer-substring buffer-exists) (insert-file-contents post-filename)) (org-mode) (goto-char (point-min)) (org-map-entries (lambda nil (setq org-map-continue-from (point)) (org-cut-subtree)) org-static-blog-no-post-tag) (setq result (org-export-as 'org-static-blog-post-bare nil nil nil nil)) (switch-to-buffer current-buffer) result)))
  (let ((org-html-doctype "html5") (org-html-html5-fancy t)) (save-excursion (let ((current-buffer (current-buffer)) (buffer-exists (org-static-blog-file-buffer post-filename)) (result nil)) (with-temp-buffer (if buffer-exists (insert-buffer-substring buffer-exists) (insert-file-contents post-filename)) (org-mode) (goto-char (point-min)) (org-map-entries (lambda nil (setq org-map-continue-from (point)) (org-cut-subtree)) org-static-blog-no-post-tag) (setq result (org-export-as 'org-static-blog-post-bare nil nil nil nil)) (switch-to-buffer current-buffer) result))))
  org-static-blog-render-post-content("~/repos/blog/posts/2022-01-13-test.org")
  (concat (org-static-blog-post-preamble post-filename) (org-static-blog-render-post-content post-filename) (org-static-blog-post-postamble post-filename))
  (org-static-blog-template (org-static-blog-get-title post-filename) (concat (org-static-blog-post-preamble post-filename) (org-static-blog-render-post-content post-filename) (org-static-blog-post-postamble post-filename)) (org-static-blog-get-description post-filename))
  (let ((current-buffer (current-buffer)) (buffer-exists (org-static-blog-file-buffer (org-static-blog-matching-publish-filename post-filename))) (result nil) (contents (org-static-blog-template (org-static-blog-get-title post-filename) (concat (org-static-blog-post-preamble post-filename) (org-static-blog-render-post-content post-filename) (org-static-blog-post-postamble post-filename)) (org-static-blog-get-description post-filename)))) (if buffer-exists (switch-to-buffer buffer-exists) (find-file (org-static-blog-matching-publish-filename post-filename))) (erase-buffer) (insert contents) (setq result (progn)) (basic-save-buffer) (unless buffer-exists (kill-buffer)) (switch-to-buffer current-buffer) result)
  (save-excursion (let ((current-buffer (current-buffer)) (buffer-exists (org-static-blog-file-buffer (org-static-blog-matching-publish-filename post-filename))) (result nil) (contents (org-static-blog-template (org-static-blog-get-title post-filename) (concat (org-static-blog-post-preamble post-filename) (org-static-blog-render-post-content post-filename) (org-static-blog-post-postamble post-filename)) (org-static-blog-get-description post-filename)))) (if buffer-exists (switch-to-buffer buffer-exists) (find-file (org-static-blog-matching-publish-filename post-filename))) (erase-buffer) (insert contents) (setq result (progn)) (basic-save-buffer) (unless buffer-exists (kill-buffer)) (switch-to-buffer current-buffer) result))
  (org-static-blog-with-find-file (org-static-blog-matching-publish-filename post-filename) (org-static-blog-template (org-static-blog-get-title post-filename) (concat (org-static-blog-post-preamble post-filename) (org-static-blog-render-post-content post-filename) (org-static-blog-post-postamble post-filename)) (org-static-blog-get-description post-filename)))
  org-static-blog-publish-file("~/repos/blog/posts/2022-01-13-test.org")
  org-static-blog-publish()
  eval((org-static-blog-publish) nil)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

from org-static-blog.

lucasemmoreira avatar lucasemmoreira commented on May 21, 2024

what it looks to me is that (org-export-define-derived-backend 'org-static-blog-post-bare 'html :translate-alist '((template . (lambda (contents info) contents)))) failed to create a working backend on my setup.
Do you have any hint on why that may be?

from org-static-blog.

lucasemmoreira avatar lucasemmoreira commented on May 21, 2024

interesting enough I made it work by putting the (org-export-define-derived-backend 'org-static-blog-post-bare 'html :translate-alist '((template . (lambda (contents info) contents)))) above the call on the function org-static-blog-render-post-content

from org-static-blog.

lucasemmoreira avatar lucasemmoreira commented on May 21, 2024

interesting enough I made it work by putting the (org-export-define-derived-backend 'org-static-blog-post-bare 'html :translate-alist '((template . (lambda (contents info) contents)))) above the call on the function org-static-blog-render-post-content

actually this is wrong. it works when i go to the file and execute the back end with C-x C-e. Not sure why this is happening but must some miss setup on my end

from org-static-blog.

bastibe avatar bastibe commented on May 21, 2024

I suspect that something about the way you import org-static-blog is different from the way it is meant to be done. The line you mentioned is usually automatically executed when org-static-blog is required, triggered by the autoload on the org-static-blog-publish-* functions.

from org-static-blog.

lucasemmoreira avatar lucasemmoreira commented on May 21, 2024

that makes sense! I was using use-package to import the lib. It was fixed when I put the setup under :config instead of :init.
thanks for the help!

from org-static-blog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.