-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
add org content support with org keyword headers as frontmatter #3001
Conversation
This looks good, I'm not familiar with org mode, but I understand that many will find this very useful. As to tests; I will have a closer look at this in a couple of days -- when I get the current PR I'm working on into master. It will not touch your code, but it will make some changes in how tests are written, so it would be good for you to wait with those until then. |
Cool. Thanks @bep. |
One first comment would be to add a compatible license to goorgeous so we can acutally use that library. |
Added MIT license. chaseadamsio/_goorgeous@590ae02 |
I haven't used org-mode myself but read good things about it. Having another markup language to choose from is great, especially with a Go-native implementation 👍
Regarding the documentation I would suggest to mention the org-mode support where the other markup formats are also listed/mentioned. Just search in the repo for asciidoc. |
@bep any update on the test PR you referenced previously? |
No. Or, it is getting closer to finish. |
It is this PR: #2932 I just finished it -- gonna let all the tests go to green. |
The main test I think we need would be to add https://github.com/spf13/hugo/blob/master/hugolib/page_test.go#L595 You would have to do more work than that, I guess. It this doesn't make sense to put in here, or it gets too ugly, you would have to make a separate table driven test that does approximately the same. But I guess it would be possible to make the frontmatter variants into funcs that checks what markdown to use etc. |
Thinking about it, maybe it would be better if you could just create a separate But the pattern of the tests are shown:
But the main point is: I trust that you test your own library, so focus on the few Hugo specifics:
|
@chaseadamsio Can you also please add support for tags and publishdate?
|
@kaushalmodi |
@chaseadamsio Sorry, didn't mean to imply that it did not work. I just went through this thread and missed seeing I don't code in go. But I will give a try building |
@kaushalmodi yep, that's all you'll need to do. Please let me know if you find any issues in the goorgeous issues as everything I've run into so far has been a minor bug with the dependency and not with hugo. |
I tried .. but didn't work. What am I missing?
|
@kaushalmodi looks like there's probably some stuff we'd have to walk through to get your |
@chaseadamsio I believe I somehow got past that. Looks like go install is working fine as there are no errors. But still it doesn't seem to work.
|
@chaseadamsio Sorry about the noise. Turns out I had to build it from the So this works:
Org tables are awesome! I will be writing posts directly in org format now-onwards, and will report issues here, if any, Thank you for working on this! |
@chaseadamsio I just rebuilt after your yesterday's update to I have this in my
and my theme processes the categories. So this works:
|
@chaseadamsio I realized that Here is what I see:
Above, the site is built when I run If it matters, I have the post is draft state and I am running
So may be you need to re-base your branch? |
@chaseadamsio Thanks, live update works now after the rebase. |
@chaseadamsio if you feel like this is in a "mostly OK" state, we should consider to pull it into master, then ask people on the forum to take it for a spin. Then create new PR(s) for any updates/fixes. |
@bep +1 @chaseadamsio It will be great if this can be merged to the master. I have only 2 points but those don't seem to be gating factors to this merge:
Somewhere it was discussed to add a switch to |
@kaushalmodi you can set |
@kaushalmodi open the heck out of some issues in https://github.com/chaseadamsio/goorgeous/issues and I'll tackle them as quickly as I can. As far as I've found so far, we're at least matching all the functionality you'd get out of blackfriday, so it's just going to be chipping away at what's left and making sure things like hugo shortcodes are supported. @bep I think it's ready to go, I started on your list of things from above last night, so maybe we could start a separate issue for any extra things that hugo does that's beyond the blackfriday rendering (that was the main goal for me was to at least have support for org that was in blackfriday for markdown, as well as org headers support so people didn't have to have separate frontmatter that's not a part of the org spec). If you're comfortable with it and @kaushalmodi feels good about where it is so far (I'm using it on blog posts right now and I'm personally happy with it, but there may be things I don't use that need to be supported), then I give it a 👍 for merging. |
@chaseadamsio could you:
|
@chaseadamsio also, I seem to have committed a slight conflicting change, so this also needs a rebase. It would be good if you could have a look at this in the not so distant future. I would love to get this into Hugo 0.19 (in about a week, I guess), and I would like for this one to linger in master a little bit before the release. |
@bep, yep, I'll try and get that worked out tonight. Sorry, I've had family in town & haven't had a chance to do my normal hack time. |
@bep updated with squashed commit and resolved your changes. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This PR adds support for Org content, as requested in #936 and #1483.
It doesn't look like much, but it adds a new dependency https://github.com/chaseadamsio/goorgeous, a go org to html package.
Files with the following format with
.org
extensions are supported for 98% of the use cases and 100% of what would be converted from Hugo markdown currently.It supports
.org
headers at the top of the file as well for frontmatter:so there's no need to "manipulate" org files to work with Hugo by including toml, yaml or JSON for frontmatter.
It'd be great to have some folks test it out (I've been generating posts for the past two weeks with this support successfully).
Any guidance on what tests should be written to verify and what documentation should be updated would be appreciated!
@bep @spf13
cc @anthonyfok @eggcaker