Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$site's "static" directory does not shadow the $theme's "static" directory when running weblorg-copy-static #72

Open
akatov opened this issue Oct 17, 2023 · 0 comments

Comments

@akatov
Copy link

akatov commented Oct 17, 2023

I have the following directory structure:

├── posts
│   ├── post1.org
│   └── post2.org
├── publish.el
├── static
│   ├── favicon.ico
│   └── style.css
└── templates
    └── post.html

and the contents of publish.el is:

(require 'weblorg)

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

(weblorg-copy-static
 :output "output/static/{{ file }}"
 :url "/static/{{ file }}")

(weblorg-export)

When running emacs --script publish.el, the (custom) template templates/post.html gets used properly, however, the static/style.css file and in fact any other files inside static/ get ignored in favour of the contents of the static directory of weblorg's default template:

INFO writing: ./output/posts/post-1.html
INFO writing: ./output/posts/post-2.html
INFO copying: ~/.config/emacs/elpa/weblorg-20230828.150/themes/default/static/style.css -> ./output/static/style.css

My understanding of https://emacs.love/weblorg/doc/file-paths.html is that the local ./static directory should get precedence over any static directories in any themes (external or internal).


In any case, there is a workaround - I can move static into a my-theme directory, and adjust publish.el to say this:

(weblorg-copy-static
 :site (weblorg-site
	:theme (lambda () "my-theme"))
 :output "output/static/{{ file }}"
 :url "/static/{{ file }}")

which picks up the custom static files properly:

INFO copying: ./my-theme/static/favicon.ico -> ./output/static/favicon.ico
INFO copying: ./my-theme/static/style.css -> ./output/static/style.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant