Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timeline content #475

Merged
merged 7 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions config/_default/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,6 @@ home = ["HTML", "RSS", "REDIR"]
[[module.mounts]]
source = "content"
target = "content"
[[module.mounts]]
source = "data"
target = "data"
[[module.mounts]]
source = "i18n"
target = "i18n"
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/en/blog/bootstrap-elements.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ As an example, the following shortcode displays the full text of an abbreviation

<!-- markdownlint-disable MD037 -->
{{< example lang="hugo" >}}
{{</* abbr html */>}}
{{</* abbr "CI/CD" */>}}
{{< /example >}}
<!-- markdownlint-enable MD037 -->

Expand Down
3 changes: 3 additions & 0 deletions data/abbr.yml → exampleSite/data/abbr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@

- id: svg
long: "Scalable Vector Graphics"

- id: ci/cd
long: "Continous Integration/Continuous Deployment"
10 changes: 6 additions & 4 deletions layouts/shortcodes/timeline.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
-->

{{ $error := false }}
{{- $page := .Page -}}

{{- $data := .Get "data" -}}
{{ if not $data -}}
Expand Down Expand Up @@ -59,6 +60,7 @@
<!-- Inline partial to render icon -->
{{- define "partials/timeline-panel.html" -}}
{{- $col := default 6 .col -}}
{{- $page := .page -}}
{{- $content := .content -}}
{{- $color := .color -}}
{{- $title := .title -}}
Expand Down Expand Up @@ -87,7 +89,7 @@
{{ $datestr := (partial "utilities/date.html" (dict "date" $date "format" "long")) -}}
<p class="mb-0"><small class="text-body-secondary text-uppercase">{{ $datestr -}}</small></p>
{{ end }}
<p class="mt-3 mb-0">{{ $content | .Page.RenderString }}</p>
<p class="mt-3 mb-0">{{ $content | $page.RenderString }}</p>
</div>
</div>
</div>
Expand All @@ -98,11 +100,11 @@
{{ range $index, $item := $entries }}
<div class="row timeline timeline-{{ $item.color }} timeline-dot g-0 ">
{{ if eq (mod $index 2) 1 }}
{{ partial "partials/timeline-panel.html" (dict "content" $item.content "color" $item.color "title" $item.title "badge" $item.badge "date" $item.date "url" $item.url "direction" "start") }}
{{ partial "partials/timeline-panel.html" (dict "page" $page "content" $item.content "color" $item.color "title" $item.title "badge" $item.badge "date" $item.date "url" $item.url "direction" "start") }}
{{ partial "partials/timeline-icon.html" (dict "icon" $item.icon "direction" "start") }}
{{ else }}
{{ partial "partials/timeline-icon.html" (dict "icon" $item.icon "direction" "end") }}
{{ partial "partials/timeline-panel.html" (dict "content" $item.content "color" $item.color "title" $item.title "badge" $item.badge "date" $item.date "url" $item.url "direction" "end") }}
{{ partial "partials/timeline-panel.html" (dict "page" $page "content" $item.content "color" $item.color "title" $item.title "badge" $item.badge "date" $item.date "url" $item.url "direction" "end") }}
{{ end }}
</div>
<div class="row timeline g-0 p-3"> </div>
Expand All @@ -114,7 +116,7 @@
{{ range $index, $item := $entries }}
<div class="row timeline-sm timeline-{{ $item.color }} timeline-dot g-0">
{{ partial "partials/timeline-icon.html" (dict "icon" $item.icon "direction" "end" "col" 3) }}
{{ partial "partials/timeline-panel.html" (dict "content" $item.content "color" $item.color "title" $item.title "badge" $item.badge "date" $item.date "url" $item.url "direction" "end" "col" 9) }}
{{ partial "partials/timeline-panel.html" (dict "page" $page "content" $item.content "color" $item.color "title" $item.title "badge" $item.badge "date" $item.date "url" $item.url "direction" "end" "col" 9) }}
</div>
<div class="row timeline-sm g-0 p-3"> </div>
{{ end }}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gethinode/hinode",
"version": "0.19.0-alpha2",
"version": "0.19.0-alpha3",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [
"hugo",
Expand Down