From 27d11eff0d7892e4864405d14775949cc2ad49c6 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 19 Apr 2020 00:53:11 -0400 Subject: [PATCH] Add patch to build with go-org 1.1.0. --- 7180.patch | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ hugo.spec | 9 ++++++++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 7180.patch diff --git a/7180.patch b/7180.patch new file mode 100644 index 0000000..459cad1 --- /dev/null +++ b/7180.patch @@ -0,0 +1,56 @@ +From aa47e4c455089a2b8782cdab0d720479e9f50de1 Mon Sep 17 00:00:00 2001 +From: Niklas Fasching +Date: Fri, 17 Apr 2020 16:09:17 +0200 +Subject: [PATCH] deps: Update go-org to v1.1.0 + +- inline source blocks and exports +- result blocks and source block :exports parameter +- fix: html escaping in example blocks +- #+LINK based links +--- + go.mod | 2 +- + go.sum | 4 ++-- + markup/org/convert.go | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/go.mod b/go.mod +index 904a642caf..601b37f0e8 100644 +--- a/go.mod ++++ b/go.mod +@@ -34,7 +34,7 @@ require ( + github.com/muesli/smartcrop v0.3.0 + github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect + github.com/nicksnyder/go-i18n v1.10.0 +- github.com/niklasfasching/go-org v1.0.0 ++ github.com/niklasfasching/go-org v1.1.0 + github.com/olekukonko/tablewriter v0.0.4 + github.com/pelletier/go-toml v1.6.0 // indirect + github.com/pkg/errors v0.8.1 +diff --git a/go.sum b/go.sum +index d1de6696bd..313ca3c31d 100644 +--- a/go.sum ++++ b/go.sum +@@ -253,8 +253,8 @@ github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6 + github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= + github.com/nicksnyder/go-i18n v1.10.0 h1:5AzlPKvXBH4qBzmZ09Ua9Gipyruv6uApMcrNZdo96+Q= + github.com/nicksnyder/go-i18n v1.10.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2xBGjv0j365Q= +-github.com/niklasfasching/go-org v1.0.0 h1:lDh8zKtmbaQupKQhLyVp1clG+JojkVoVBH9bT7c9O70= +-github.com/niklasfasching/go-org v1.0.0/go.mod h1:AsLD6X7djzRIz4/RFZu8vwRL0VGjUvGZCCH1Nz0VdrU= ++github.com/niklasfasching/go-org v1.1.0 h1:4EQbzTGLhNoHU/G65ZYHwCYmrfL+W7laAuU+8WNhmIE= ++github.com/niklasfasching/go-org v1.1.0/go.mod h1:AsLD6X7djzRIz4/RFZu8vwRL0VGjUvGZCCH1Nz0VdrU= + github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= + github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= + github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8= +diff --git a/markup/org/convert.go b/markup/org/convert.go +index 2b1fbb73c3..7a3ad70764 100644 +--- a/markup/org/convert.go ++++ b/markup/org/convert.go +@@ -52,7 +52,7 @@ func (c *orgConverter) Convert(ctx converter.RenderContext) (converter.Result, e + return afero.ReadFile(c.cfg.ContentFs, filename) + } + writer := org.NewHTMLWriter() +- writer.HighlightCodeBlock = func(source, lang string) string { ++ writer.HighlightCodeBlock = func(source, lang string, inline bool) string { + highlightedSource, err := c.cfg.Highlight(source, lang, "") + if err != nil { + logger.ERROR.Printf("Could not highlight source as lang %s. Using raw source.", lang) diff --git a/hugo.spec b/hugo.spec index 2de1335..16a4ecc 100644 --- a/hugo.spec +++ b/hugo.spec @@ -17,7 +17,7 @@ and templates and renders them into a full HTML website.} %global godocs docs examples README.md CONTRIBUTING.md Name: hugo -Release: 2%{?dist} +Release: 3%{?dist} Summary: The world’s fastest framework for building websites # Upstream license specification: Apache-2.0 and MIT @@ -30,6 +30,9 @@ Patch0002: https://sources.debian.org/data/main/h/hugo/0.69.0-1/debian/patc # Fix error message that changed in gocloud. Patch0003: 0001-Update-error-message.patch +# Fix build against go-org 1.1.0. +Patch0004: https://github.com/gohugoio/hugo/pull/7180.patch + BuildRequires: golang(github.com/alecthomas/chroma) >= 0.7.1 BuildRequires: golang(github.com/alecthomas/chroma/formatters/html) BuildRequires: golang(github.com/alecthomas/chroma/lexers) @@ -136,6 +139,7 @@ BuildRequires: rubygem-asciidoctor %patch0001 -p1 %patch0002 -p1 %patch0003 -p1 +%patch0004 -p1 # Replace blackfriday import path to avoid conflict with v2 # Depend on unversioned tdewolff/minify until Go modules are supported in Fedora @@ -189,6 +193,9 @@ install -Dp man/* -t %{buildroot}%{_mandir}/man1 %changelog +* Sun Apr 19 2020 Elliott Sales de Andrade - 0.69.0-3 +- Add patch for latest go-org + * Sat Apr 18 2020 Athos Ribeiro - 0.69.0-2 - Update golang-github-kyokomi-emoji required version