Skip to content

Commit

Permalink
Update tests where posts have sub-heading tags
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Jan 11, 2022
1 parent 552386e commit 5b3f856
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 30 deletions.
15 changes: 5 additions & 10 deletions test/site/content-org/all-posts.org
Expand Up @@ -547,16 +547,6 @@ SCHEDULED: <2022-01-20 Mon> DEADLINE: <2022-01-30 Mon>
Export tags of sub-headings
#+end_description
{{{oxhugoissue(513)}}}

#+begin_export html
<style>
.tag span {
background: lightgrey;
font-size: small;
padding: 0.1rem 0.2rem;
}
</style>
#+end_export
*** Sub heading :abc:def:@abc__def__ghi:ghi_jkl:
* Title in Front Matter :title:
** Awesome title with "quoted text"
Expand Down Expand Up @@ -3323,7 +3313,12 @@ This gets both categories =catA= and =catB=.
** Do not leak post's immediate sub-heading tag into the front-matter :expected_tag:post_heading_followed_soon_with_subheading:
:PROPERTIES:
:EXPORT_FILE_NAME: dont-leak-subheading-tags
:EXPORT_OPTIONS: tags:nil
:END:
#+begin_description
Disable exporting of sub-heading tags by setting export option
~tags:nil~.
#+end_description
*** Sub-heading 1 :unexpected_tag:
This is a *special* case where:
- A post has a sub-heading as the first line in its body, and
Expand Down
2 changes: 1 addition & 1 deletion test/site/content-org/dir-locals/dir-locals-test.org
Expand Up @@ -29,7 +29,7 @@ Test setting of few Org Hugo variables via =.dir-locals.el=.
=This is verbatim= but ~this~ is wrapped in the =kbd= tag. As
=org-hugo-preserve-filling= is set to =nil=, the column filling in the
Org source is not preserved in the exported Markdown.
* Local Variables :ARCHIVE:
* Local Variables :ARCHIVE:noexport:
# Local Variables:
# eval: (toggle-truncate-lines 1)
# End:
2 changes: 1 addition & 1 deletion test/site/content-org/single-posts/post-toml.org
Expand Up @@ -38,7 +38,7 @@ the Markdown file name to the actual link/slug.
[[file:post-with-slug.org]]
** Link to the CUSTOM_ID of a different file
[[./post-yaml.org::#first-heading]]
* Local Variables :ARCHIVE:
* Local Variables :ARCHIVE:noexport:
# Local Variables:
# org-link-file-path-type: relative
# End:
4 changes: 0 additions & 4 deletions test/site/content/dir-locals-test/dir-locals-test.md
Expand Up @@ -19,7 +19,6 @@ creator: "Dummy creator string"

- <span class="section-num">1</span> [Variables set in <kbd>.dir-locals.el</kbd>](#variables-set-in-dot-dir-locals-dot-el)
- <span class="section-num">2</span> [Test text](#test-text)
- <span class="section-num">3</span> [Local Variables](#local-variables):ARCHIVE:

</div>
<!--endtoc-->
Expand Down Expand Up @@ -52,7 +51,4 @@ creator: "Dummy creator string"

`This is verbatim` but <kbd>this</kbd> is wrapped in the `kbd` tag. As `org-hugo-preserve-filling` is set to `nil`, the column filling in the Org source is not preserved in the exported Markdown.


## <span class="section-num">3</span> Local Variables {#local-variables}

This text is auto inserted at the end of the exported Markdown.
4 changes: 4 additions & 0 deletions test/site/content/posts/dont-leak-subheading-tags.md
@@ -1,5 +1,9 @@
+++
title = "Do not leak post's immediate sub-heading tag into the front-matter"
description = """
Disable exporting of sub-heading tags by setting export option
`tags:nil`.
"""
tags = ["expected-tag", "post-heading-followed-soon-with-subheading"]
draft = false
+++
Expand Down
6 changes: 3 additions & 3 deletions test/site/content/posts/links-outside-the-same-post.md
Expand Up @@ -7,7 +7,7 @@ draft = false
`ox-hugo` Issue #[30](https://github.com/kaushalmodi/ox-hugo/issues/30)


## External links with search options {#external-links-with-search-options}
## External links with search options <span class="tag"><span class="external_links">external-links</span></span> {#external-links-with-search-options}

Links between documents can contain some search options. Only links
to a heading with a **:CUSTOM_ID** property will be resolved to the
Expand All @@ -19,7 +19,7 @@ links to targets will be resolved to the containing file.
- [Link to a target]({{< relref "link-destination" >}})


## Internal links {#internal-links}
## Internal links <span class="tag"><span class="internal_links">internal-links</span></span> {#internal-links}

Internal links point to targets in the current subtree that will be
exported to the same Hugo post as the link source. To handle links to
Expand All @@ -33,7 +33,7 @@ init file.
- [Link to target within the same post](#org-target--internal-target)


## Cross-post links {#cross-post-links}
## Cross-post links <span class="tag"><span class="crosspost_links">crosspost-links</span></span> {#cross-post-links}

Cross-post links are internal links pointing to targets in a different
subtree that will be exported to another Hugo post than the link
Expand Down
8 changes: 0 additions & 8 deletions test/site/content/posts/sub-headings-with-tags.md
Expand Up @@ -7,13 +7,5 @@ draft = false

`ox-hugo` Issue #[513](https://github.com/kaushalmodi/ox-hugo/issues/513)

<style>
.tag span {
background: lightgrey;
font-size: small;
padding: 0.1rem 0.2rem;
}
</style>


## Sub heading <span class="tag"><span class="abc">abc</span>&#xa0;<span class="def">def</span>&#xa0;<span class="_abc_def_ghi">@abc def ghi</span>&#xa0;<span class="ghi_jkl">ghi-jkl</span></span> {#sub-heading}
3 changes: 0 additions & 3 deletions test/site/content/singles/post-toml.md
Expand Up @@ -63,6 +63,3 @@ the Markdown file name to the actual link/slug.
### Link to the CUSTOM_ID of a different file {#link-to-the-custom-id-of-a-different-file}

[{{< relref "post-yaml#first-heading" >}}]({{< relref "post-yaml#first-heading" >}})


## Local Variables {#local-variables}

0 comments on commit 5b3f856

Please sign in to comment.