This repository has been archived by the owner on Jul 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Event page #166
Merged
Merged
Event page #166
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,16 @@ | ||
{{ define "main" }} | ||
|
||
{{/* site data query copypasta */}} | ||
{{ $path := split $.Source.File.Path .Site.Params.pathseperator }} | ||
{{ $event_slug := index $path 1 }} | ||
{{ $e := (index $.Site.Data.events $event_slug) }} | ||
{{/* end site data query */}} | ||
|
||
<div> | ||
{{ .Content }} | ||
</div> | ||
|
||
{{ partial "future.html" . }} | ||
{{ partial "past.html" . }} | ||
|
||
{{ end }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!-- The following blocks of comments explains how this list is generated with Hugo. | ||
If you read this post generation, it will make no sense. see pre generated sources --> | ||
|
||
<!-- Scan through a range of years and look in data/events for events during these years. | ||
If found, store year in "active_years" scratch in order to get back to that year later. | ||
Also save the event name under scratch with the ID of the scratch equal to the year number. | ||
|
||
Chomping .year has the nice effect of turning an int into string. --> | ||
{{ range seq 2009 2020 }} | ||
{{ $r_year := . }} | ||
{{ range $.Site.Data.events }} | ||
{{ if .startdate }} | ||
{{ $my_year := string ((dateFormat "2006" .startdate ))}} | ||
{{ if and (eq $my_year (string $r_year)) ( lt (dateFormat "2006-01-02" .startdate) (dateFormat "2006-01-02" ($.Now.Format "2006-01-02"))) }} | ||
{{ $.Scratch.SetInMap "active_years" (print (chomp $my_year)) (print (chomp $my_year)) }} | ||
{{ $.Scratch.SetInMap (print (chomp $my_year)) .startdate (.name) }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
<div class = "row"> | ||
<div class = "col-md-12"> | ||
<h2>Past</h2> | ||
</div> | ||
</div> | ||
<div class = "row"> | ||
<!-- Now scan through all the years that were marked as active in order to print the headline --> | ||
{{ range ($.Scratch.GetSortedMapValues "active_years") }} | ||
<div class = "col-md-4"> | ||
<strong>{{ . }}</strong> | ||
<br/> | ||
<!-- Finally, scan throug the scratch with the ID of that year and print all the events sorted by startdate | ||
Chomping here in order to convert int to string --> | ||
{{ range ($.Scratch.GetSortedMapValues (print (chomp .))) }} | ||
{{ $.Scratch.Set "citydisplay" (index $.Site.Data.events . "city") }} | ||
{{ $friendly := (index $.Site.Data.events . "name") }} | ||
<a href="/events/{{ $friendly }}/">{{ $.Scratch.Get "citydisplay" }}</a> | ||
<br/> | ||
{{ end }} | ||
</div> | ||
{{ end }} | ||
</div> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd sorta rather do this with CSS; we can do some padding on the element itself rather than a `
tag, but it's not the end of the world.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair. I was following the usage already present in this partial, but I don't think it's perfect. It's just less annoying than it was.