Skip to content

Commit

Permalink
TEMP files for objective and task shortcodes (#1190)
Browse files Browse the repository at this point in the history
this is temporary - we probably want to not just use codefencing and use commented out hugo shortcodes so the task lists still work on github. However we also don't want this sort of glob of code and it makes sense to rationalise  all these various ways of getting objectives in order to make the success page cleaner. But that's a task for a clearer head than I currently have, so here, a quick fix so annotation can proceed without breaking the build
  • Loading branch information
SallyMcGrath authored Nov 12, 2024
1 parent af423db commit d71d30f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions common-theme/layouts/shortcodes/objectives.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ $items := slice }}
{{ $objectives := split .Inner "\n" }}
{{ range $objectives }}
{{ $objective := replace . "- [ ] " "" }}
{{ if ne (trim $objective " ") "" }}
{{ $items = $items | append $objective }}
{{ end }}
{{ end }}
{{ with $items }}
{{ partial "objectives/block" . }}
{{ end }}
12 changes: 12 additions & 0 deletions common-theme/layouts/shortcodes/tasks.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ $items := slice }}
{{ $objectives := split .Inner "\n" }}
{{ range $objectives }}
{{ $objective := replace . "- [ ] " "" }}
{{ if ne (trim $objective " ") "" }}
{{ $items = $items | append $objective }}
{{ end }}
{{ end }}
{{ with $items }}
{{ partial "objectives/block" . }}
{{ end }}
<!-- Compare this snippet from common-theme/layouts/shortcodes/objectives.html: -->

0 comments on commit d71d30f

Please sign in to comment.