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

Update sidebar GitHub links and taxonomies #638

Merged
merged 4 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/layouts/partials/page-meta-links.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
{{ end }}
{{ $editURL := printf "%s/edit/%s" $gh_repo $gh_repo_path }}
{{ $createURL := printf "%s/edit/%s" $gh_repo $gh_repo_path }}
{{ $issuesURL := printf "%s/issues/new?title=%s" $gh_repo (safeURL $.Title )}}
{{ $issuesURL := printf "%s/issues/new/choose" $gh_repo }}
{{ $newPageStub := resources.Get "stubs/new-page-template.md" }}
{{ $newPageQS := querify "value" $newPageStub.Content "filename" "change-me.md" | safeURL }}
{{ $newPageURL := printf "%s/new/%s?%s" $gh_repo $gh_repo_path $newPageQS }}

<a href="{{ $editURL }}" target="_blank"><i class="fa fa-edit fa-fw"></i> Edit this page</a>
<a href="{{ $issuesURL }}" target="_blank"><i class="fab fa-github fa-fw"></i> New docs issue</a>
{{ if $gh_project_repo }}
{{ $project_issueURL := printf "%s/issues/new" $gh_project_repo }}
{{ $project_issueURL := printf "%s/issues/new/choose" $gh_project_repo }}
<a href="{{ $project_issueURL }}" target="_blank"><i class="fas fa-tasks fa-fw"></i> New project issue</a>
{{ end }}

Expand Down
18 changes: 18 additions & 0 deletions docs/layouts/partials/taxonomy_terms_cloud.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{ $context := .context }}
{{ $taxo := .taxo }}
{{ $title := .title }}
{{ if and (isset $context.Site.Taxonomies (lower $taxo)) ($context.Page.IsHome) }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main update here is the addition of and (....) ($context.Page.IsHome), where ... is existing logic that was already there before.

Adding the check for IsHome ensures that this only applies to the home page

{{ $taxonomy := index $context.Site.Taxonomies (lower $taxo) }}
{{ if (gt (len $taxonomy) 0)}}
<div class="taxonomy taxonomy-terms-cloud taxo-{{ urlize $taxo }}">
{{ with $title }}
<h5 class="taxonomy-title">{{ . }}</h5>
{{ end }}
<ul class="taxonomy-terms">
{{ range $taxonomy }}
<li><a class="taxonomy-term" href="{{ .Page.Permalink }}" data-taxonomy-term="{{ urlize .Page.Title }}"><span class="taxonomy-label">{{ .Page.Title }}</span><span class="taxonomy-count">{{ .Count }}</span></a></li>
{{ end }}
</ul>
</div>
{{ end }}
{{ end }}