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
HUGO_BASE_DIR check does not happen when running C-c C-e H t #333
Comments
Hello, Just checking in to say that I have read your issue. Thanks for opening it. It's just that life's a bit too busy at the moment. But I will definitely get to this. Btw I see that you have image links in Org headings?! I have never tried that and may be that's why this never got tested. |
Thank you for taking the time. I have a huge org document which spans from "me first learning to use Emacs" up to the present day - so it has a lot of things early on that appear to be legal but aren't really idiomatic org. The issue isn't really that I have to change things for ox-hugo to handle them (I've been doing this with regexes and such) - it's just that it's difficult for me to find the actual thing that needs changing when a single problematic line can crash the whole conversion without it telling me where. However, it doesn't appear to be specific to headings. The following both trigger the same error:
and
As a side note, possibly related and possibly not, internal links like |
That's intriguing.. because I definitely use images on my blog and also have many image tests: https://ox-hugo.scripter.co/test/tags/image You can see this big single ox-hugo test Org file that has source to the above exported image test pages. So, now I am curious what's special in your setup.
Yes, please. I'd like to track that separately. Thanks. |
@Hodapp87 Also, please ensure that you are using the latest ox-hugo version from Melpa (and not Melpa-stable). |
I'm not sure how to check exact version, but I'm on melpa, not melpa-stable, and am seeing To be clear, regardless of what is in that large org file you linked to - you are not able to reproduce this error with any of the smaller examples I linked? Or are you? |
I haven't tried that.. I'll get to it soon. I just wanted to check if you were using the latest ox-hugo version.. Just surprised seeing your report that none of the image links work.. because I have used and seen them being used in wild. |
I had an example in my original post that did work. If the link properly contains a description like |
I checked that I already have this test in the ox-hugo test suite:
That exports fine to: {{< figure src="https://ox-hugo.scripter.co/test/images/org-mode-unicorn-logo.png" >}} See https://ox-hugo.scripter.co/test/posts/figure-shortcode-and-attr-html/#multiple-attr-html. (locally I tested that to export fine without the html attr's as well). So I'll need to spend some time later to figure out how to reproduce this issue. |
I see the same behaviour only on org files with links like those mentioned above as well as an entry with the COMMENT keyword. That I get when I use |
@Hodapp87 @Ddscully I am sorry but I cannot reproduce the issue. Here's a simple test (I have used description-less https image links and also one nested inside a COMMENT subtree):
Here's the outcome of that test: Please ensure that you are using |
I'm still reproducing it in every case I try. Here is a gist containing a minimal Dockerfile (Ubuntu 18.04 and Emacs), an
Here is a screen capture of me running through the test: https://www.youtube.com/watch?v=v1nuo93ewR0&feature=youtu.be
If you start from this Dockerfile, and you are still not reproducing the problem, specifically with C-c C-e H t and not with a test suite, then please, tell me exactly what you are running that is different from the above. |
I do not have docker installed. But given that you can consistently create that error, can you post the backtrace here? Do Thanks. |
@Hodapp87 Also, what are the emacs and org mode versions in your container? The minimal versions are Emacs 24.4 and Org 9.2. |
Backtrace is here: https://gist.github.com/Hodapp87/c6c30893a05e99a9331e8f5746a85394 Emacs is 25.2.2. As is visible in several parts of the video, org is 9.3.6. |
I think you are missing the
From above, see that you have I have documented the requirement of the I now need to see why that |
OK, finally I can reproduce the issue by removing Note that |
Actually HUGO_BASE_DIR related stuff should be ignored when running |
May be I will deprecate |
@Hodapp87 Please try out the latest master. Now you should see a user-error with the |
Hello, I am safely assuming that this particular issue is now fixed for you. If the Feel free to comment here if this is still not fixed for your use case. |
Actual Behavior
Export fails with an error like:
org-hugo--attachment-rewrite-maybe: Wrong type argument: stringp, nil
Expected Behavior
Export succeeds or else gives a more relevant error on why it cannot.
How to Reproduce the Issue
Run "C-c C-e H t" on the below org file. In my own tests, I could reproduce this anytime I had a link like
http://.../foo.jpg
or[[http://.../foo.jpg]]
(i.e. the way Emacs produces a link when description is left blank). Links like[[http://.../foo.jpg][foo]]
don't show this problem, links with something like .jpg or .txt don't either.Example Org File
This also seems to cause it:
This does not:
Neither does this:
Generated Markdown File or Error
Ox-Hugo Debug Information
Debug Info
Debug information for
ox-hugo
Emacs Version
Org Version
Hugo Version
Org
load-path
shadowsWarning: Possible mixed installation of Org
Study the output of
M-x list-load-path-shadows
.ox-hugo
defcustomsThe text was updated successfully, but these errors were encountered: