diff --git a/.grenrc.js b/.grenrc.js index 9ec5e82e9b..0ffcfe944d 100644 --- a/.grenrc.js +++ b/.grenrc.js @@ -30,7 +30,6 @@ module.exports = { milestoneMatch: "{{tag_name}}", onlyMilestones: true, template: { - changelogTitle: "", group: "\n### {{heading}}\n", release: ({ body, date, release }) => `## ${release} (` + date.replace( /(\d+)\/(\d+)\/(\d+)/, '$3-$2-$1' ) + `)\n${body}`, }, diff --git a/exampleSite/content/basics/CHANGELOG.md b/exampleSite/content/basics/CHANGELOG.md index bca793c8c3..91d487ba30 100644 --- a/exampleSite/content/basics/CHANGELOG.md +++ b/exampleSite/content/basics/CHANGELOG.md @@ -1,3 +1,5 @@ +# Changelog + ## 1.2.0 (2021-07-26) ### Enhancements @@ -15,11 +17,14 @@ ### Bug Fixes -- [**bug**] dependency: upgrade jquery to 3.6.0 [#30](https://github.com/McShelby/hugo-theme-relearn/issues/30) - [**bug**] attachments: support i18n for attachment size [#21](https://github.com/McShelby/hugo-theme-relearn/issues/21) - [**bug**] notice: support i18n for box labels [#16](https://github.com/McShelby/hugo-theme-relearn/issues/16) - [**bug**] notice: support multiple blocks in one box [#15](https://github.com/McShelby/hugo-theme-relearn/issues/15) +### Maintenance + +- [**task**] dependency: upgrade jquery to 3.6.0 [#30](https://github.com/McShelby/hugo-theme-relearn/issues/30) + --- ## 1.1.1 (2021-07-04) diff --git a/exampleSite/content/basics/history/_index.en.md b/exampleSite/content/basics/history/_index.en.md index 9e0c82d122..d238f412b2 100644 --- a/exampleSite/content/basics/history/_index.en.md +++ b/exampleSite/content/basics/history/_index.en.md @@ -2,4 +2,4 @@ title = "History" weight = 30 +++ -{{% include "basics/CHANGELOG.md" %}} +{{% include "basics/CHANGELOG.md" false %}} diff --git a/exampleSite/content/shortcodes/INCLUDE_ME.md b/exampleSite/content/shortcodes/INCLUDE_ME.md index e91e305d0b..65e40df612 100644 --- a/exampleSite/content/shortcodes/INCLUDE_ME.md +++ b/exampleSite/content/shortcodes/INCLUDE_ME.md @@ -4,7 +4,7 @@ You can add: - bullet point lists - _emphasized_, **bold** and even **_bold emphasized_** text - [links](https://example.com) -- other shortcodes besides `expand` +- other shortcodes besides `include` - etc. ```plaintext diff --git a/exampleSite/content/shortcodes/include.en.md b/exampleSite/content/shortcodes/include.en.md index edf34c39ab..472af2e4b2 100644 --- a/exampleSite/content/shortcodes/include.en.md +++ b/exampleSite/content/shortcodes/include.en.md @@ -8,9 +8,13 @@ The include shortcode includes other files from your project inside of the curre ## Usage ````go -{{%/* include "" */%}} +{{%/* include "" { "true" | "false" } */%}} ```` +The first parameter is the path to the file to be included. + +If the file's content will be displayed as HTML, the second optional parameter controls if the first heading of the included file should be displayed ("true")- which is the default - or be hidden. + ## Examples ### Arbitray content diff --git a/layouts/shortcodes/include.html b/layouts/shortcodes/include.html index fb8712b7db..bade73f36e 100644 --- a/layouts/shortcodes/include.html +++ b/layouts/shortcodes/include.html @@ -1,2 +1,6 @@ {{ $file := .Get 0 }} -{{ $file | readFile | safeHTML }} +{{ $showFirstHeading := .Get 1 | default true }} +
+ + {{ $file | readFile | safeHTML }} +
diff --git a/static/css/theme.css b/static/css/theme.css index 1c1702c0f4..203fc00e27 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -1153,4 +1153,31 @@ option { .mermaid { margin-bottom: 1.7rem; margin-top: 1.7rem; -} \ No newline at end of file +} + +.include.hide-first-heading h1:first-of-type, +.include.hide-first-heading h2:first-of-type, +.include.hide-first-heading h3:first-of-type, +.include.hide-first-heading h4:first-of-type, +.include.hide-first-heading h5:first-of-type, +.include.hide-first-heading h6:first-of-type { + display: none; +} + +.include.hide-first-heading h1 + h2:first-of-type, +.include.hide-first-heading h1 + h3:first-of-type, +.include.hide-first-heading h2 + h3:first-of-type, +.include.hide-first-heading h1 + h4:first-of-type, +.include.hide-first-heading h2 + h4:first-of-type, +.include.hide-first-heading h3 + h4:first-of-type, +.include.hide-first-heading h1 + h5:first-of-type, +.include.hide-first-heading h2 + h5:first-of-type, +.include.hide-first-heading h3 + h5:first-of-type, +.include.hide-first-heading h4 + h5:first-of-type, +.include.hide-first-heading h1 + h6:first-of-type, +.include.hide-first-heading h2 + h6:first-of-type, +.include.hide-first-heading h3 + h6:first-of-type, +.include.hide-first-heading h4 + h6:first-of-type, +.include.hide-first-heading h5 + h6:first-of-type { + display: block; +}