Login  Register

Re: setting imagesdir for asciidoc articles baked with awestruct

Posted by mojavelinux on Dec 03, 2013; 4:47pm
URL: https://discuss.asciidoctor.org/setting-imagesdir-for-asciidoc-articles-baked-with-awestruct-tp528p1174.html

Xavier,

You've got it! That explanation is spot on.

I'll clarify that the awestruct-* attributes are only used to define a limited set of what Awestruct recognizes, and it's not correlated with Asciidoctor rendering behavior. It's more about the layout & handling of the page. You typically only use that syntax to set the following:

* awestruct-layout
* awestruct-tags (for the blog)
* awestruct-javascripts (requires custom logic in main template)

Also, the awestruct- prefix is deprecated in favor of page- for these attributes.

To configure AsciiDoc output globally, you define attributes in _config/site.yml as you have discovered.

I look forward to checking out your new site!

Cheers,

Dan

On Dec 3, 2013 10:25 AM, "xcoulon [via Asciidoctor :: Discussion]" <[hidden email]> wrote:
Hello,

Just to keep you posted, I found the solution to my problem, thanks to the hints I got in previous replies.

It turns out that I just needed to set the following config (in _site/config.yml):
asciidoctor:  
  :safe: safe
  :attributes:
    imagesdir: .
    icons: font

and then use the following syntax in my .adoc files:
image::images/whatever.png

assuming that the images are in a subfolder of the current document.
Even cooler, it works both when building our site with awestruct and when looking at the document rendered in HTML on github \o/

Again, thanks for your help!

Best regards,
Xavier


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/setting-imagesdir-for-asciidoc-articles-baked-with-awestruct-tp528p1173.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML