emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: ox-hugo, 2 questions
Date: Sat, 9 Jun 2018 23:24:41 -0400	[thread overview]
Message-ID: <CAFyQvY2yJJLOW9Po6qyf8fyjL6XOUomn8K0Q5b_whB8y0CjFRA@mail.gmail.com> (raw)
In-Reply-To: <87sh5v4sw6.fsf@tsdye.com>

[-- Attachment #1: Type: text/plain, Size: 3355 bytes --]

Hello Tom.

On Sat, Jun 9, 2018 at 4:43 PM Thomas S. Dye <tsd@tsdye.com> wrote:

> Aloha all,
>
> 1) Is this the correct way to get an image in the homepage branch
> bundle?
>
> I have this in the org file:
>
> * Homepage
>   :PROPERTIES:
>   :EXPORT_HUGO_SECTION:
>   :EXPORT_FILE_NAME: index
>   :END:
>
> [[/bldg-1-5-sequence-distance-1332+-small.png]]
>

I see a couple of things that are wrong there:

1. The branch bundles have _index.md file. index.md makes it a page bundle.
You can see Table 1 here: https://scripter.co/hugo-leaf-and-branch-bundles/.
2. You mentioned homepage branch bundle, but I don't see the use of
EXPORT_HUGO_BUNDLE.

Using index.md instead of _index.md is a very common mistake. Reading the
above link might help understand the difference more. Feel free to ask more
questions about that on the ox-hugo Github issue manager itself as this
gets out of the Org mode scope for this mailing list.

This is the markdown export:
>
> +++
> title = "Homepage"
> author = ["Thomas S. Dye"]
> lastmod = 2018-06-09T09:32:43-10:00
> draft = false
> +++
>
> {{< figure src="/bldg-1-5-sequence-distance-1332+-small.png" >}}
>
> I don't see an image on the home page.  Perhaps this is an issue
> with the theme I'm using (material-docs)?
>

It's difficult to tell. Can you share a git repo with a minimal site (just
the config.toml and the Org content files would do). I will try reproducing
the issue locally using ox-hugo plus the ox-hugo test site theme:
https://github.com/kaushalmodi/hugo-bare-min-theme.

I have a "sandbox" site where you can see an example of _index. See for
"_index" here:
https://gitlab.com/kaushalmodi/hugo-sandbox/raw/master/content-org/sandbox.org.
That example also happens to have an image on the home page, though I am
inserting that image in the layout file itself using the .Resources Hugo
method.

Here is the outcome: https://hugo-sandbox.netlify.com/.



> 2) Can I have links in figure captions?
>
> I have this in the org file:
>
>  #+name: fig-12-sequence
>  #+caption: Stratigraphic DAG for the information on Figure
>  [[fig-12-section]].
>  [[file:/fig-12-sequence.png][file:/fig-12-sequence-small.png]]
>
> This is the markdown export:
>
> {{< figure src="/fig-12-sequence-small.png" caption="Figure 2:
> Stratigraphic DAG for the information on Figure [1](#org1658d1e)."
> link="/fig-12-sequence.png" >}}
>

This is a known issue in Hugo. The default figure shortcode does not
convert Markdown in figure captions to HTML:
https://github.com/gohugoio/hugo/issues/4406,
https://github.com/kaushalmodi/ox-hugo/issues/136.

So I use my custom figure shortcode to fix this (and an other unrelated
issue) for my own site:
https://gitlab.com/kaushalmodi/hugo-theme-refined/blob/master/layouts/shortcodes/figure.html
.

Just putting this custom figure.html in your site's layouts/shortcodes/
directory (which will override the inbuilt figure shortcode) will fix this
second issue.

Hope this helps. For future, you can ask ox-hugo questions directly at
https://github.com/kaushalmodi/ox-hugo/issues.

I don't mind Hugo-related questions there too. But just so that you know
the Hugo Discourse forum is pretty active too: https://discourse.gohugo.io/.

Kaushal

PS: My reply ended up containing a lot of links.. hope that doesn't
overwhelm you, but instead helps resolve the issues.

-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 5201 bytes --]

  reply	other threads:[~2018-06-10  3:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-09 20:16 ox-hugo, 2 questions Thomas S. Dye
2018-06-10  3:24 ` Kaushal Modi [this message]
2018-06-10  5:14   ` Thomas S. Dye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFyQvY2yJJLOW9Po6qyf8fyjL6XOUomn8K0Q5b_whB8y0CjFRA@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tsd@tsdye.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).