-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert homepage Recent Posts and Projects sections to shortcodes wit…
…h the ability to customize the number of results. Those can now be included or excluded from within _index.md. Also add a see more projects link next to projects heading in shortcode.
- Loading branch information
Showing
5 changed files
with
68 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<section class="section"> | ||
<div class="home-title-dropdown"> | ||
<h2 class="home-section-title"> | ||
{{- with $.Page.Params.projects_section_heading -}} | ||
{{- . -}} | ||
{{- else -}} | ||
My Projects | ||
{{- end -}} | ||
</h2> | ||
<a class="see-more-projects" href="{{ "projects/" | relURL }}">View all »</a> | ||
</div> | ||
{{ $num := .Get 0 }} | ||
{{ if not $num }} | ||
{{ $num = 6 }} | ||
{{ end }} | ||
{{ $projects := where site.RegularPages "Section" "projects" | first $num }} | ||
{{ with $projects }} | ||
<div class="project-list"> | ||
{{- range . }} | ||
{{ partial "projects/project-entry.html" . }} | ||
{{ end }} | ||
</div> | ||
{{ else }} | ||
{{ partial "general/fallback-text.html" . }} | ||
{{ end }} | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<section class="section"> | ||
<div class="home-title-dropdown"> | ||
<h2 class="home-section-posts-title"> | ||
{{- with $.Page.Params.posts_section_heading -}} | ||
{{- . -}} | ||
{{- else -}} | ||
Recent Posts | ||
{{- end -}} | ||
</h2> | ||
<select name="choice" id="select-posts"> | ||
{{ range (where site.Sections "Section" "posts") }} | ||
<option value="all-{{ .Name | lower }}" selected>All {{ .Name | lower }}</option> | ||
{{ range .Sections }} | ||
{{ if .CurrentSection.Pages }} | ||
<option value="{{ replace .CurrentSection.RelPermalink "/" "" | lower }}">{{ .CurrentSection.Name }}</option> | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
</select> | ||
</div> | ||
{{ $num := .Get 0 }} | ||
{{ if not $num }} | ||
{{ $num = 10 }} | ||
{{ end }} | ||
{{ range (where site.RegularPages "Section" "posts" | first $num) }} | ||
<div class="post-entry-filter entry--{{ replace .CurrentSection.RelPermalink "/" "" | lower }}"> | ||
{{ partial "posts/post-entry.html" . }} | ||
<div class="post-entry-divider"></div> | ||
</div> | ||
{{ else }} | ||
{{ partial "general/fallback-text.html" . }} | ||
{{ end }} | ||
<a class="btn-secondary see-more" href="{{ "posts/" | relURL }}">More Posts</a> | ||
</section> |