emacs-love / weblorg

Static Site Generator for Emacs
https://emacs.love/weblorg
GNU General Public License v3.0
280 stars 21 forks source link

Cannot open load file: No such file or directory, weblorg #42

Closed dagomar closed 3 years ago

dagomar commented 3 years ago

Hi I'm having trouble getting weblorg to work and the only message I'm receiving is the title, so it's little information to go on. I followed the getting started guide on https://emacs.love/weblorg/doc/index.html. Not sure what debugging information to add here, I'll include my directory structure and publish.el

❯ tree . ├── output │   └── blog ├── pages │   └── test2.org ├── posts │   └── test.org └── publish.el

`(require 'weblorg)

;; route for rendering each post (weblorg-route :name "posts" :input-pattern "posts/*.org" :template "post.html" :output "output/blog/{{ slug }}.html" :url "/blog/{{ slug }}.html")

;; route for rendering the index page of the blog (weblorg-route :name "blog" :input-pattern "posts/*.org" :input-aggregate #'weblorg-input-aggregate-all-desc :template "blog.html" :output "output/index.html" :url "/")

;; route for rendering each page ;; (weblorg-route ;; :name "pages" ;; :input-pattern "pages/*.org" ;; :template "page.html" ;; :output "output/{{ slug }}.html" ;; :url "/{{ slug }}.html")

;; route for static assets that also copies files to output directory ;; (weblorg-copy-static ;; :output "static/{{ file }}" ;; :url "/static/{{ file }}")

;; fire the engine and export all the files declared in the routes above (weblorg-export) ` As you can see I commented some stuff out to see if I could make it work that way. I started with the copy pasted version on the quickstart. Does anyone have a clue what is going on?

[edit] sorry for the formatting. Yet another thing that doesn't work the way I want today

dagomar commented 3 years ago

I realize I should have mentioned that I am using Doom and installed weblorg using the packages.el route. I understand now the problem is probably not to do with Weblorg itself. I am guessing that running emacs --script doesn't load all packages that are included in my doom configuration, I have yet to figure out if that is indeed the case and what I can do to remedy it...

dagomar commented 3 years ago

Yup, must have been something like this, I got it working now. I had to go the manual installation route and point to the weblorg and templatel locations in my publish.el. Now it's working!

Don't you love it when an issue resolves itself ;)

clarete commented 3 years ago

oh hi @dagomar, thank you for taking the time to bring this up and to document the outcome! Really appreciate it 🙇🏾

Question for you, how did you end up writing the installation lines? did you use use-package or pure package-install? Would you mind sharing your settings?

dagomar commented 3 years ago

Hi @clarete,

So I am using doom emacs first of all. Installing an extension is done by adding a line to packages.el, eg (package! weblorg) and then doom sync

The rest is a bit fuzzy for me as my understanding is growing, but it seems when running emacs --script my doom config is not used. So I ended up using 'add-to-list' in publish.el, pointing to the installation directories of weblorg and templatel:

#!emacs --script
(add-to-list 'load-path "~/.emacs.d/.local/straight/repos/weblorg")
(add-to-list 'load-path "~/.emacs.d/.local/straight/repos/templatel")
(require 'weblorg)

Notice the shebang on the first line, I've made publish.el executable, so now I can just do ./publish.el and it will run the script for me. This was found on https://www.emacswiki.org/emacs/EmacsScripts.