Closed lccambiaghi closed 3 years ago
hi @lccambiaghi! Sorry about that, I believe there are two little bugs on that feature right now:
weblorg-copy-static
functionweblorg-copy-static
for that to work. we've been tracking that shortcoming on the issue #20 and we're making steady progress to get better support for theming :)Thank you for taking the time to open the issue!
Hi! It's me again! 😄 now with better news! I just pushed a big change to this static asset copying mechanism in the commit https://github.com/emacs-love/weblorg/commit/e2ae9b14f9ad736f52a7b4275076bc24a45926f8. Alongside with this change, there's a new documentation article that explains a bit more in depths how paths work: https://emacs.love/weblorg/doc/file-paths.html
So now, if you have static files within your website's <root>/theme/static
directory or if you're inheriting from a theme, weblog-copy-static
will work as expected!!
I'm going to close this ticket but please feel free to re-open it or to open a new one if you stumble upon anything else.
Thank you again for bringing this up! 🙇🏾
Amazing, thank you very much for your help, I can confirm the resolution on my side!! Thanks for your brilliant work
Hi, first things first: Thanks for the amazing effort of writing this website generator.
I am not really sure whether I get the purpose of the weblorg-copy-static
function right. I have a very basic setup and assume that the default theme css should be copied over to my website directory, right? However, this is not happening for me with
(require 'weblorg)
(require 'templatel)
(setq weblorg-default-url "SOME-DIR/website/")
;; route for rendering each post
(weblorg-route
:name "posts"
:input-pattern "posts/*.org"
:template "post.html"
:output "output/posts/{{ slug }}.html"
:url "output/posts/{{ 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 "output/")
(weblorg-copy-static
:output "output/static/{{ file }}"
:url "output/static/{{ file }}")
Am I missing something?
hey @JensAc
this is what I have:
(weblorg-copy-static
:output ".build/assets/{{ file }}"
:url "/assets/{{ file }}")
and it works if I have the assets in theme/static/
directory. I think it is mentioned somewhere that the files can live in static/
directory but it worked for me only in theme/static/
.
Thank you very much for the response @semente!
If I understand you correctly, you have a theme/static
directory in your website's root directory. However, I do not want to use any other theme than the default one and expect it to work out of the box, without copying any assets around. Am I right in that regard?
Hi @JensAc , just wanted to provide an example for you: https://github.com/lccambiaghi/lccambiaghi.github.io . Looking at publish.el
and the project structure should help you, I hope!
@JensAc hi hi, thanks for asking the question. This isn't very well documented right now and changed sorta recently, which may have helped make it even more confusing. But right now there this is how it's working:
weblorg-copy-static
because the default theme includes static assetssite/theme/templates
and site/theme/assets
. Files within these directories take precedence over the files in the theme;site/theme/templates
and site/theme/assets
) and disable the default theme completely by adding this before all your routes: (weblorg-site :theme nil)
.I tried to capture some of this information in this article here, and any feedback on it would be appreciated: https://emacs.love/weblorg/doc/theming.html
Hi @JensAc , just wanted to provide an example for you: https://github.com/lccambiaghi/lccambiaghi.github.io . Looking at
publish.el
and the project structure should help you, I hope!
This is so cool! Thank you for sharing how you've been using the project @lccambiaghi! I'm so glad that it's been useful for you! @guilhermecomum suggested making a list of setups and put somewhere on the website, and yours look pretty sleek!! would that be OK? 😄
@JensAc hi hi, thanks for asking the question. This isn't very well documented right now and changed sorta recently, which may have helped make it even more confusing. But right now there this is how it's working:
1. if you're using the default theme and nothing else: you will need `weblorg-copy-static` because the default theme includes static assets 2. if you are using the default theme but want to override either a static asset or a template: add stuff to your `site/theme/templates` and `site/theme/assets`. Files within these directories take precedence over the files in the theme; 3. if you are using your own theme, has static assets and don't want to override the default: create your templates and assets within your theme (`site/theme/templates` and `site/theme/assets`) and disable the default theme completely by adding this before all your routes: `(weblorg-site :theme nil)`.
I tried to capture some of this information in this article here, and any feedback on it would be appreciated: https://emacs.love/weblorg/doc/theming.html
Alright, I see. That was actually also what I understood. However, for some reason I get no theming, when firing (weblorg-export)
. Maybe there is a configuration issue on my side. However, what I actually wanted to do is the following:
I am not very familiar with html and css. Therefore, I wanted to use the default theme as starting point. Thank you very much for providing the example, @lccambiaghi. I think I will be able to proceed somehow...
I moved my blog to weblorg
, just finished setting up the domain. I also wrote a blog post talking about weblorg, here it is: https://luca.cambiaghi.me/posts/weblorg.html . Thanks again for your great work!
Alright, I see. That was actually also what I understood. However, for some reason I get no theming, when firing
(weblorg-export)
. Maybe there is a configuration issue on my side.
Hi @JensAc!
Thank you for sharing more data, it took me a bit to see it but I think it might be related to this line:
(setq weblorg-default-url "SOME-DIR/website/")
That defaults to http://localhost:8000
and the static asset links are generated with absolute URLs, so if you switch to a URL that you can access, it might work.
If your intention with that setting was to configure the final output directory, it unfortunately takes configuring the :output
parameter of every route. I didn't really add any global settings for that because it's too specific of a configuration to each route.
I moved my blog to
weblorg
, just finished setting up the domain. I also wrote a blog post talking about weblorg, here it is: https://luca.cambiaghi.me/posts/weblorg.html . Thanks again for your great work!
@lccambiaghi Thank you so much for the kind words there. weblorg is still quite young, I'm so happy that you were still able to take advantage of it to build some thing so cool! thank you for helping shaping weblorg so it continues to be useful 😄 🙇🏾
Hi, I can't manage to reproduce a minimum example following the getting started guide. In particular, I cannot get to copy the static css files to the output folder.
I tried both by having the 'static' folder in the root of the site as well as having that as a subfolder of the 'theme' folder. Where am I supposed to put the 'static' folder?
Thank you!