Skip to content

Commit c32359c

Browse files
committed
Fix EXPORT_HUGO_SECTION not getting inherited
Fixes #90 - Also update changelog
1 parent 9df23b7 commit c32359c

File tree

8 files changed

+92
-7
lines changed

8 files changed

+92
-7
lines changed

README.org

+13
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,15 @@ The common =ox-hugo= export bindings are:
155155
Do =M-x customize-group=, and select =org-export-hugo= to see the
156156
available customization options for this package.
157157
* Changelog
158+
** v0.4.1 <2017-10-29 Sun>
159+
*** Features
160+
- Support specifying the =:height= parameter in the =#+ATTR_HTML=
161+
above image links. That eventually gets transformed to the =height=
162+
parameter in the =figure= tag in the HTML generated by Hugo. This
163+
feature requires building Hugo from its master branch with commit
164+
[[https://github.com/gohugoio/hugo/commit/488631fe0abc3667355345c7eb98ba7a2204deb5][488631fe]] (or Hugo v0.31+).
165+
*** Fixes
166+
- Fix =EXPORT_HUGO_SECTION= not getting inherited [[[https://github.com/kaushalmodi/ox-hugo/issues/90][90]]].
158167
** v0.4 <2017-10-28 Sat>
159168
*** Backward-incompatible changes
160169
- Restore the default Org behavior of =#+TAGS=. Now that keyword (and
@@ -177,6 +186,10 @@ available customization options for this package.
177186

178187
See the new section added to documentation:
179188
[[https://ox-hugo.scripter.co/doc/tags-and-categories][*Tags and Categories*]]
189+
*** Features
190+
- Support specifying the =:width= parameter in the =#+ATTR_HTML= above
191+
image links. That eventually gets transformed to the =width=
192+
parameter in the =figure= tag in the HTML generated by Hugo.
180193
** v0.3.2 <2017-10-24 Tue>
181194
*** Fixes
182195
- Fix issue with headline metadata parsing (ALLTAGS, CLOSED, TODO)

doc/content/doc/changelog.md

+24
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ draft = false
66
identifier = "changelog"
77
+++
88

9+
## v0.4.1 <span class="timestamp-wrapper"><span class="timestamp">&lt;2017-10-29 Sun&gt;</span></span> {#v0-dot-4-dot-1}
10+
11+
12+
### Features {#features}
13+
14+
- Support specifying the `:height` parameter in the `#+ATTR_HTML`
15+
above image links. That eventually gets transformed to the `height`
16+
parameter in the `figure` tag in the HTML generated by Hugo. This
17+
feature requires building Hugo from its master branch with commit
18+
[488631fe](https://github.com/gohugoio/hugo/commit/488631fe0abc3667355345c7eb98ba7a2204deb5) (or Hugo v0.31+).
19+
20+
21+
### Fixes {#fixes}
22+
23+
- Fix `EXPORT_HUGO_SECTION` not getting inherited [[90](https://github.com/kaushalmodi/ox-hugo/issues/90)].
24+
25+
926
## v0.4 <span class="timestamp-wrapper"><span class="timestamp">&lt;2017-10-28 Sat&gt;</span></span> {#v0-dot-4}
1027

1128

@@ -33,6 +50,13 @@ See the new section added to documentation:
3350
[**Tags and Categories**](/doc/tags-and-categories)
3451

3552

53+
### Features {#features}
54+
55+
- Support specifying the `:width` parameter in the `#+ATTR_HTML` above
56+
image links. That eventually gets transformed to the `width`
57+
parameter in the `figure` tag in the HTML generated by Hugo.
58+
59+
3660
## v0.3.2 <span class="timestamp-wrapper"><span class="timestamp">&lt;2017-10-24 Tue&gt;</span></span> {#v0-dot-3-dot-2}
3761

3862

doc/ox-hugo-manual.org

+13
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
:PROPERTIES:
1414
:CUSTOM_ID: changelog
1515
:END:
16+
** v0.4.1 <2017-10-29 Sun>
17+
*** Features
18+
- Support specifying the =:height= parameter in the =#+ATTR_HTML=
19+
above image links. That eventually gets transformed to the =height=
20+
parameter in the =figure= tag in the HTML generated by Hugo. This
21+
feature requires building Hugo from its master branch with commit
22+
[[https://github.com/gohugoio/hugo/commit/488631fe0abc3667355345c7eb98ba7a2204deb5][488631fe]] (or Hugo v0.31+).
23+
*** Fixes
24+
- Fix =EXPORT_HUGO_SECTION= not getting inherited {{{issue(90)}}}.
1625
** v0.4 <2017-10-28 Sat>
1726
*** Backward-incompatible changes
1827
- Restore the default Org behavior of =#+TAGS=. Now that keyword (and
@@ -35,6 +44,10 @@
3544

3645
See the new section added to documentation:
3746
{{{doc(tags-and-categories,*Tags and Categories*)}}}
47+
*** Features
48+
- Support specifying the =:width= parameter in the =#+ATTR_HTML= above
49+
image links. That eventually gets transformed to the =width=
50+
parameter in the =figure= tag in the HTML generated by Hugo.
3851
** v0.3.2 <2017-10-24 Tue>
3952
*** Fixes
4053
- Fix issue with headline metadata parsing (ALLTAGS, CLOSED, TODO)

ox-hugo.el

+9-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
;; URL: https://ox-hugo.scripter.co
66
;; Package-Requires: ((emacs "24.5") (org "9.0"))
77
;; Keywords: Org, markdown, docs
8-
;; Version: 0.4
8+
;; Version: 0.4.1
99

1010
;;; Commentary:
1111

@@ -1905,7 +1905,12 @@ contents of hidden elements.
19051905
Return output file's name."
19061906
(interactive)
19071907
(org-hugo--before-export-function)
1908-
(let* ((info (org-combine-plists
1908+
;; Allow certain `ox-hugo' properties to be inherited. It is
1909+
;; important to set the `org-use-property-inheritance' before
1910+
;; setting the `info' var so that properties like
1911+
;; EXPORT_HUGO_SECTION get inherited.
1912+
(let* ((org-use-property-inheritance (org-hugo--selective-property-inheritance))
1913+
(info (org-combine-plists
19091914
(org-export--get-export-attributes
19101915
'hugo subtreep visible-only)
19111916
(org-export--get-buffer-attributes)
@@ -1920,9 +1925,8 @@ Return output file's name."
19201925
(pub-dir (let ((dir (concat base-dir content-dir section-dir)))
19211926
(make-directory dir :parents) ;Create the directory if it does not exist
19221927
dir))
1923-
(outfile (org-export-output-file-name ".md" subtreep pub-dir))
1924-
;; Allow certain `ox-hugo' properties to be inherited.
1925-
(org-use-property-inheritance (org-hugo--selective-property-inheritance)))
1928+
(outfile (org-export-output-file-name ".md" subtreep pub-dir)))
1929+
;; (message "[org-hugo-export-to-md DBG] section-dir = %s" section-dir)
19261930
(unless subtreep ;Reset the variables that are used only for subtree exports
19271931
(setq org-hugo--subtree-count 0)
19281932
(setq org-hugo--subtree-coord nil))

test/site/content-org/all-posts.org

+16
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,22 @@ a_{b} a_{bc} a^{b} a^{bc}
18351835
a_b a_bc a^b a^bc
18361836
*** Following text will export =_{..}= as subscript and =^{..}= as superscript
18371837
a_{b} a_{bc} a^{b} a^{bc}
1838+
* Section Inheritance :section_inheritance:
1839+
** Section A
1840+
:PROPERTIES:
1841+
:EXPORT_HUGO_SECTION: section-a
1842+
:END:
1843+
*** Post A1
1844+
:PROPERTIES:
1845+
:EXPORT_FILE_NAME: post-a1
1846+
:END:
1847+
This post should be created in =content/section-a/=.
1848+
*** Category X :@cat_x:
1849+
**** Post AX
1850+
:PROPERTIES:
1851+
:EXPORT_FILE_NAME: post-ax
1852+
:END:
1853+
This post should also be created in =content/section-a/=.
18381854
* TODO Pre-Draft State
18391855
:PROPERTIES:
18401856
:EXPORT_FILE_NAME: draft-state-todo

test/site/content/posts/figure-shortcode-and-attr-html.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ image is 200px × 200px. But the image will still show up in 1000px ×
7676

7777
**NOTE**: Support for specifying `height` parameter to the Hugo `figure`
7878
shortcut was only added recently in [hugo PR #4018](https://github.com/gohugoio/hugo/pull/4018). So setting this
79-
parameter will need **hugo v0.31** or newer.
79+
parameter will need **hugo v0.31** or later.
8080

8181
---
8282

@@ -100,7 +100,7 @@ this image is 200px × 200px. But the image will still show up in
100100

101101
### Setting both `:width` and `:height` {#setting-both-width-and-height}
102102

103-
The **NOTE** above applies here too.. needs **hugo v0.31** or newer.
103+
The **NOTE** above applies here too.. needs **hugo v0.31** or later.
104104

105105
The figure sizes below are intentionally set _mis-proportionally_ just
106106
for testing.
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
+++
2+
title = "Post A1"
3+
tags = ["section-inheritance"]
4+
draft = false
5+
+++
6+
7+
This post should be created in `content/section-a/`.
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
+++
2+
title = "Post AX"
3+
tags = ["section-inheritance"]
4+
categories = ["cat-x"]
5+
draft = false
6+
+++
7+
8+
This post should also be created in `content/section-a/`.

0 commit comments

Comments
 (0)