summaryrefslogtreecommitdiffstats
path: root/markup/org
AgeCommit message (Collapse)Author
2023-05-16Create a struct with all of Hugo's config optionsBjørn Erik Pedersen
Primary motivation is documentation, but it will also hopefully simplify the code. Also, * Lower case the default output format names; this is in line with the custom ones (map keys) and how it's treated all the places. This avoids doing `stringds.EqualFold` everywhere. Closes #10896 Closes #10620
2023-03-12deps: Update go-org to v1.6.6Niklas Fasching
among other things, fixes a race condition in html writer and bug preventing explicit line breaks immediately following emphasis
2023-02-24Split parse and render for GoldmarkBjørn Erik Pedersen
This also speeds up situations where you only need the fragments/toc and not the rendered content, e.g. Related with fragments type indexing: ```bash name old time/op new time/op delta RelatedSite-10 12.3ms ± 2% 10.7ms ± 1% -12.95% (p=0.029 n=4+4) name old alloc/op new alloc/op delta RelatedSite-10 38.6MB ± 0% 38.2MB ± 0% -1.08% (p=0.029 n=4+4) name old allocs/op new allocs/op delta RelatedSite-10 117k ± 0% 115k ± 0% -1.36% (p=0.029 n=4+4) ``` Fixes #10750
2022-02-24Add Markdown diagrams and render hooks for code blocksBjørn Erik Pedersen
You can now create custom hook templates for code blocks, either one for all (`render-codeblock.html`) or for a given code language (e.g. `render-codeblock-go.html`). We also used this new hook to add support for diagrams in Hugo: * Goat (Go ASCII Tool) is built-in and enabled by default; just create a fenced code block with the language `goat` and start draw your Ascii diagrams. * Another popular alternative for diagrams in Markdown, Mermaid (supported by GitHub), can also be implemented with a simple template. See the Hugo documentation for more information. Updates #7765 Closes #9538 Fixes #9553 Fixes #8520 Fixes #6702 Fixes #9558
2021-06-14Misc config loading fixesBjørn Erik Pedersen
The main motivation behind this is simplicity and correctnes, but the new small config library is also faster: ``` BenchmarkDefaultConfigProvider/Viper-16 252418 4546 ns/op 2720 B/op 30 allocs/op BenchmarkDefaultConfigProvider/Custom-16 450756 2651 ns/op 1008 B/op 6 allocs/op ``` Fixes #8633 Fixes #8618 Fixes #8630 Updates #8591 Closes #6680 Closes #5192
2021-04-12org: Disable broken pretty relative links featureNiklas Fasching
go-org PrettyRelativeLinks rewrites relative org links by - adding `../` in front - removing any `.org` suffix This was meant to play well with hugo pretty urls (which pretty much renders posts in a subdirectory without the file suffix) and allow use of normal org file links to reference other posts. There's a lot of edge cases I didn't consider and multiple bug reports in go-org [1] later I don't think the complexity of handling those edge cases is worth it - so let's disable it. [1] - https://github.com/niklasfasching/go-org/issues/53 - https://github.com/niklasfasching/go-org/commit/5dadf8c4c2924cbb3b93be45f96e1147596ca6f2 (comment) - https://github.com/niklasfasching/go-org/issues/51
2021-01-02deps: Update go-org to v1.4.0Niklas Fasching
- Add support for pretty urls [1]. Rewrite file links: 1. replace the `.org` extension with `/` (`/foo.org` -> `/foo/`) 2. prefix unrooted links with `../` as relative links start in the fake subdirectory `/foo/` rather than `/` - Fix case-sensitivity of org drawer `:end:` [1] https://gohugo.io/content-management/urls/#pretty-urls
2020-10-22Allow getJSON errors to be ignoredBjørn Erik Pedersen
This change is mostly motivated to get a more stable CI build (we're building the Hugo site there, with Instagram and Twitter shortcodes sometimes failing). Fixes #7866
2020-06-27deps: Update go-org to v1.2.0Niklas Fasching
- Add support for #+MACRO - fix a bug with #+LINK (edge case, should never happen anyways :TM:) - Make title export optional (add export option) - Remove cosmetic whitespace added by go-org (for easier visual diffing) inside p tags (<p>\nfoo\n</p> => <p>foo</p>) (should make `white-space: pre` on p look more in line with expectations) - implement table separators via multiple tbodies (the html spec is ok with that)
2020-04-17deps: Update go-org to v1.1.0Niklas Fasching
- inline source blocks and exports - result blocks and source block :exports parameter - fix: html escaping in example blocks - #+LINK based links
2019-12-18Add render template hooks for links and imagesBjørn Erik Pedersen
This commit also * revises the change detection for templates used by content files in server mode. * Adds a Page.RenderString method Fixes #6545 Fixes #4663 Closes #6043
2019-11-23Add Goldmark as the new default markdown handlerBjørn Erik Pedersen
This commit adds the fast and CommonMark compliant Goldmark as the new default markdown handler in Hugo. If you want to continue using BlackFriday as the default for md/markdown extensions, you can use this configuration: ```toml [markup] defaultMarkdownHandler="blackfriday" ``` Fixes #5963 Fixes #1778 Fixes #6355
2019-11-06Prepare for GoldmarkBjørn Erik Pedersen
This commmit prepares for the addition of Goldmark as the new Markdown renderer in Hugo. This introduces a new `markup` package with some common interfaces and each implementation in its own package. See #5963