diff --git a/common-content/en/blocks/backlog/index.md b/common-content/en/blocks/backlog/index.md
index daa4c4a3c..3d7dbd704 100644
--- a/common-content/en/blocks/backlog/index.md
+++ b/common-content/en/blocks/backlog/index.md
@@ -4,7 +4,7 @@ title="Backlog"
time= 30
vocabulary="Backlog"
hide_from_overview=true
-[objectives]
+[tasks]
1="Find the backlog"
2="Copy your tickets to your own backlog"
3="Manage your tickets on your board"
diff --git a/common-content/en/blocks/coming-soon/index.md b/common-content/en/blocks/coming-soon/index.md
index acd3f31c9..0f9620e9a 100644
--- a/common-content/en/blocks/coming-soon/index.md
+++ b/common-content/en/blocks/coming-soon/index.md
@@ -4,7 +4,7 @@ description = 'This content is coming soon'
time = 20
facilitation = false
emoji= 'π«οΈ'
-[objectives]
+[tasks]
1='Find the plan in Slack instead'
[build]
list = 'never'
diff --git a/common-content/en/blocks/evaluate/index.md b/common-content/en/blocks/evaluate/index.md
index b70f5e264..891b8d2f9 100644
--- a/common-content/en/blocks/evaluate/index.md
+++ b/common-content/en/blocks/evaluate/index.md
@@ -2,7 +2,7 @@
title="Evaluate βοΈ"
time= 60
-[objectives]
+[tasks]
1="Evaluate your current progress against previous modules"
[build]
render = 'never'
diff --git a/common-content/en/blocks/morning-orientation/index.md b/common-content/en/blocks/morning-orientation/index.md
index c415eb005..7799a7fca 100644
--- a/common-content/en/blocks/morning-orientation/index.md
+++ b/common-content/en/blocks/morning-orientation/index.md
@@ -2,7 +2,7 @@
title="π‘ Morning orientation"
time=15
-[objectives]
+[tasks]
1="Introduce and welcome new volunteers"
2="Nominate a timekeeper"
3="Check the morning day plan and group structures"
diff --git a/common-content/en/blocks/study-group/index.md b/common-content/en/blocks/study-group/index.md
index 121b5fdb8..b48d1c7cc 100644
--- a/common-content/en/blocks/study-group/index.md
+++ b/common-content/en/blocks/study-group/index.md
@@ -1,6 +1,6 @@
+++
title="Study Group"
-objectives=["Resolve blockers in your coursework", "Express and resolve problems effectively by writing tickets and asking questions", "Give and receive code review", "Develop your personal portfolio", "Pair programme", "Evaluate your progress with peers and mentors"]
+tasks=["Resolve blockers in your coursework", "Express and resolve problems effectively by writing tickets and asking questions", "Give and receive code review", "Develop your personal portfolio", "Pair programme", "Evaluate your progress with peers and mentors"]
time=60
[build]
render = 'never'
diff --git a/common-content/en/blocks/workshop/index.md b/common-content/en/blocks/workshop/index.md
index 09e367ab1..e685645d9 100644
--- a/common-content/en/blocks/workshop/index.md
+++ b/common-content/en/blocks/workshop/index.md
@@ -3,7 +3,7 @@ title = 'π§° Workshop Activity'
time = 120
emoji= 'π§°'
-[objectives]
+[tasks]
1='Apply concepts from study to a practical example'
2='Work together on exercises and activities to find gaps in understanding'
3='Describe and resolve mental model errors'
diff --git a/common-content/en/energisers/18-and-unders/index.md b/common-content/en/energisers/18-and-unders/index.md
index 8a0e63c36..5c1ab5f45 100644
--- a/common-content/en/energisers/18-and-unders/index.md
+++ b/common-content/en/energisers/18-and-unders/index.md
@@ -2,7 +2,7 @@
title="18 and under"
emoji="π§"
time=10
-[objectives]
+[tasks]
1="Share any interesting fact about you when you were young"
2="Discover hidden skills of your peers"
[build]
diff --git a/common-content/en/energisers/bad-interview-answers/index.md b/common-content/en/energisers/bad-interview-answers/index.md
index 97e6704d0..1d86d0e17 100644
--- a/common-content/en/energisers/bad-interview-answers/index.md
+++ b/common-content/en/energisers/bad-interview-answers/index.md
@@ -3,7 +3,7 @@ title="Bad Interview Answers"
emoji="π€¦ββοΈ"
hide_from_overview=true
time=15
-[objectives]
+[tasks]
1="Wake up"
3="Have a laugh"
[build]
diff --git a/common-content/en/energisers/blockers/index.md b/common-content/en/energisers/blockers/index.md
index def637b5f..36c51d4bc 100644
--- a/common-content/en/energisers/blockers/index.md
+++ b/common-content/en/energisers/blockers/index.md
@@ -2,7 +2,7 @@
title="Blockers!"
emoji="π"
time=25
-[objectives]
+[tasks]
1="Use the driver and navigator pattern"
2="Break down a problem into steps"
3="Negotiate a strategy with your team"
diff --git a/common-content/en/energisers/confident-presenting/index.md b/common-content/en/energisers/confident-presenting/index.md
index 14d790c30..df0795961 100644
--- a/common-content/en/energisers/confident-presenting/index.md
+++ b/common-content/en/energisers/confident-presenting/index.md
@@ -1,7 +1,7 @@
+++
title="Confident Presenting!"
time=15
-[objectives]
+[tasks]
1="Trainee can strike a power pose"
2="Trainee has experience with confidently introducing themselves"
[build]
@@ -15,15 +15,18 @@ time=15
Get everyone standing for this exercise!
1. Start by everyone demonstrating unconfident poses
-2. Get everyone moving with a quick stretch or power pose to break the ice and release tension.
- - Superman pose β feet shoulder-width apart, hands on hips, chest out.
- - The victor - hands up in the air in a V and feet apart
- - Any others?
-3. In a power pose of your choosing go around the room and ask everyone to say their name in the most exaggerated, enthusiastic way possible, like theyβre introducing themselves to a stadium of people.
+2. Get everyone moving with a quick stretch or power pose to break the ice and release tension.
+
+- Superman pose β feet shoulder-width apart, hands on hips, chest out.
+- The victor - hands up in the air in a V and feet apart
+- Any others?
+
+3. In a power pose of your choosing go around the room and ask everyone to say their name in the most exaggerated, enthusiastic way possible, like theyβre introducing themselves to a stadium of people.
> [!WARNING]
> This is not proven science. This is just a fun game to get everyone up and moving around!
# Resources on Confident Presenting
+
- [Make Body Language Your Superpower](https://www.youtube.com/watch?v=cFLjudWTuGQ&ab_channel=StanfordGraduateSchoolofBusiness)
- [Alter Ego: How having an alter ego empowers you](https://www.bbc.com/worklife/article/20200817-the-batman-effect-how-having-an-alter-ego-empowers-you)
diff --git a/common-content/en/energisers/fizz-buzz/index.md b/common-content/en/energisers/fizz-buzz/index.md
index 73586e6ad..810a1d9a0 100644
--- a/common-content/en/energisers/fizz-buzz/index.md
+++ b/common-content/en/energisers/fizz-buzz/index.md
@@ -3,7 +3,7 @@ title="Fizz Buzz"
emoji="π’"
hide_from_overview=true
time=20
-[objectives]
+[tasks]
1="Execute mental arithmetic and divisibility rules"
3="Listen actively and coordinate with others"
[build]
diff --git a/common-content/en/energisers/introduce-yourself/index.md b/common-content/en/energisers/introduce-yourself/index.md
index e1031681f..fb37ed1b2 100644
--- a/common-content/en/energisers/introduce-yourself/index.md
+++ b/common-content/en/energisers/introduce-yourself/index.md
@@ -2,7 +2,7 @@
title=" Introduce Yourself!"
emoji="ποΈ"
time=20
-objectives=["Introduce yourself in 30 seconds", "Learn two key facts about each other"]
+tasks=["Introduce yourself in 30 seconds", "Learn two key facts about each other"]
[build]
render = 'never'
list = 'local'
@@ -13,16 +13,17 @@ objectives=["Introduce yourself in 30 seconds", "Learn two key facts about each
In your professional life, you will often be asked to introduce yourself. It is a good idea to have an [elevator pitch](https://careerdevelopment.princeton.edu/sites/g/files/toruqf1041/files/media/elevator_pitch.pdf) ready, a brief (30 seconds) way of introducing yourself, getting across a key point or two, and making a connection with someone.
-Today we will be going around the room and introducing ourselves! `
+Today we will be going around the room and introducing ourselves! `
Facilitator(s) start by sharing your elevator pitch and then popcorn around the room.
Some tips:
+
- Your response should be around 30 seconds.
- Have a list of items ready but tailor what you say to your audience. For example, at a technical conference focus on your technical interests rather than your love of making cupcakes, but on the first day of a new job introducing yourself to your new team feel free to add 1-2 personal details.
-- Try to structure your response,
- - Who are you? Where are you from? Where have you worked? Have you studied somewhere and what subjects?
- - What do you do? What are your skills, passions, or hobbies? What motivates you?
+- Try to structure your response,
+ - Who are you? Where are you from? Where have you worked? Have you studied somewhere and what subjects?
+ - What do you do? What are your skills, passions, or hobbies? What motivates you?
- Try to be enthusiastic, let your personality and confidence shine
- Allow space for follow-up questions
- It will feel awkward and nerve-wracking the first couple of times, practice-practice-practice to feel confident
diff --git a/common-content/en/energisers/popcorn-screen-share/index.md b/common-content/en/energisers/popcorn-screen-share/index.md
index 62a63278c..f4b3d9452 100644
--- a/common-content/en/energisers/popcorn-screen-share/index.md
+++ b/common-content/en/energisers/popcorn-screen-share/index.md
@@ -2,7 +2,7 @@
title="Screen Safari"
emoji="π₯οΈ"
time=15
-[objectives]
+[tasks]
1="Practice screen sharing functionality"
2="Build comfort with sharing digital workspace"
[build]
diff --git a/common-content/en/energisers/popcorn/index.md b/common-content/en/energisers/popcorn/index.md
index 07c6f7994..95e3410b5 100644
--- a/common-content/en/energisers/popcorn/index.md
+++ b/common-content/en/energisers/popcorn/index.md
@@ -2,7 +2,7 @@
title="Popcorn Show and Tell"
emoji="πΏ"
time=10
-[objectives]
+[tasks]
1="Practice popcorning participation in meetings"
2="Share quick personal insights"
[build]
diff --git a/common-content/en/energisers/telephone/index.md b/common-content/en/energisers/telephone/index.md
index ccf5cc3ed..6a9d0413f 100644
--- a/common-content/en/energisers/telephone/index.md
+++ b/common-content/en/energisers/telephone/index.md
@@ -3,7 +3,7 @@ title="Telephone!"
emoji="π"
hide_from_overview=true
time=15
-[objectives]
+[tasks]
1="Transmit a message accurately through multiple people"
2="Identify points of miscommunication in the final message"
4="Demonstrate active listening by repeating a message verbatim"
diff --git a/common-content/en/energisers/time-traveller/index.md b/common-content/en/energisers/time-traveller/index.md
index 7eb4b3e8a..42a421b4e 100644
--- a/common-content/en/energisers/time-traveller/index.md
+++ b/common-content/en/energisers/time-traveller/index.md
@@ -2,7 +2,7 @@
title="Time traveller"
emoji="β°"
time=30
-[objectives]
+[tasks]
1="Hear the experience of a CYF alumni"
2="Ask questions about their experience"
[build]
diff --git a/common-content/en/energisers/wemoji/index.md b/common-content/en/energisers/wemoji/index.md
index 89c7b4b2f..0af529df1 100644
--- a/common-content/en/energisers/wemoji/index.md
+++ b/common-content/en/energisers/wemoji/index.md
@@ -2,7 +2,7 @@
title="Wemoji"
emoji="ππ’π²"
time=10
-[objectives]
+[tasks]
1="Express emojis using only facial expressions and body language"
2="Identify emojis from facial expressions and body language"
[build]
diff --git a/common-content/en/energisers/zip-zap-boing/index.md b/common-content/en/energisers/zip-zap-boing/index.md
index 876446fe3..ca0ee73a1 100644
--- a/common-content/en/energisers/zip-zap-boing/index.md
+++ b/common-content/en/energisers/zip-zap-boing/index.md
@@ -3,7 +3,7 @@ title="Zip Zap Boing!"
emoji="β‘"
hide_from_overview=true
time=15
-[objectives]
+[tasks]
1="Coordinate group movement and attention"
3="Energise the group and create a fun atmosphere"
[build]
diff --git a/common-docs/content/common-theme/front-matter/blocks/tasks/index.md b/common-docs/content/common-theme/front-matter/blocks/tasks/index.md
new file mode 100644
index 000000000..1324c3945
--- /dev/null
+++ b/common-docs/content/common-theme/front-matter/blocks/tasks/index.md
@@ -0,0 +1,21 @@
++++
+title = 'Tasks'
+time = 2
+emoji= 'β
'
+[tasks]
+ 1='Use the Teach Tech Together guide to construct your objectives'
+ 2='Limit the objectives to 3-5 items'
+ 3='Write objectives you can measure'
+[build]
+ render = 'never'
+ list = 'local'
+ publishResources = false
++++
+
+```toml
+tasks = ["Write objectives you can measure", "Tasks are objectives that aren't passed to success view or overviews"]
+```
+
+This is a list of tasks for a block. They look the same as learning objectives and should be formulated in the same way. However, tasks will not show up in the success view for any sprint this block is added to. They will only show up on the block itself when rendered on to a page.
+
+Structured objectives are important for organising and focusing the learning time of our community. But repetitive or purely operational tasks like "Nominate a timekeeper" or "Take a break" don't need to be collated and tracked by the learner like objectives do. They are just tasks that need to be done to complete the activity.
diff --git a/common-docs/content/common-theme/render-hooks/tasks.md b/common-docs/content/common-theme/render-hooks/tasks.md
new file mode 100644
index 000000000..b8b054dd8
--- /dev/null
+++ b/common-docs/content/common-theme/render-hooks/tasks.md
@@ -0,0 +1,37 @@
++++
+title="Tasks"
+description="Assign learning objectives via render hook"
+emoji="β
"
+menu=["hooks"]
++++
+
+This is a [codefence render hook](https://gohugo.io/render-hooks/code-blocks/) that allows you to assign inert learning objectives to a page. It's for pages or content sources _outside_ Hugo. You can mark up a tasks checklist on a GitHub readme, say, and then render it as a list of objectives on the page.
+
+Tasks are an inert form of learning objectives. They will be rendered on Hugo and GitHub as task lists. They will be shown in the learning objectives section on a block. But they will _not_ be tracked as learning objectives and won't be passed to the success criteria of a sprint.
+
+> [!TIP]
+> You probably want [objectives](./objectives) instead.
+
+### Invoke
+
+{{}}
+
+````
+```tasks
+- [ ] Use the objectives render hook
+- [ ] Three backticks ```
+- [ ] The word objectives
+- [ ] A list of objectives in a checklist
+```
+````
+
+<--->
+
+````tasks
+- [ ] Use the objectives render hook
+- [ ] Three backticks ```
+- [ ] The word objectives
+- [ ] A list of objectives in a checklist
+````
+
+{{}}
diff --git a/common-docs/content/common-theme/shortcodes/objectives.md b/common-docs/content/common-theme/shortcodes/objectives.md
new file mode 100644
index 000000000..898a3c646
--- /dev/null
+++ b/common-docs/content/common-theme/shortcodes/objectives.md
@@ -0,0 +1,36 @@
++++
+title="Objectives"
+description="Passing objectives from GitHub to Hugo"
+emoji="π―"
+menu=["shortcodes"]
++++
+
+```go
+
+- [ ] Objective 1
+- [ ] Objective 2
+- [ ] Objective 3
+
+```
+
+{{< objectives >}}
+
+- [ ] Objective 1
+- [ ] Objective 2
+- [ ] Objective 3
+
+{{< /objectives >}}
+
+If you want to add objectives from a GitHub issue or readme into your success criteria, mark up a task list and wrap it in the `objectives` shortcode. Comment out the shortcode to hide it on GitHub.
+
+This will render the task list on GitHub and will be picked up, rendered, and _tracked_ as learning objectives by Hugo. This means:
+
+1. readmes: any learning objectives on any readme added to a prep or dayplan will be added to the success criteria of that sprint
+1. issues: any learning objectives on the entire backlog page will be added to the success criteria of the sprint
+1. any issues added as single blocks will be added to the success criteria of the sprint, unless they have already been tracked on the backlog page
+1. on any issue or readme block, learning objectives will be removed from the body and shown in the learning objectives details instead
+
+([Tasks](./tasks) will be rendered but not tracked.)
+
+> [!TIP]
+> Fenced objectives will also work like this on Hugo, but on GitHub will be plain text.
diff --git a/common-docs/content/common-theme/shortcodes/tasks.md b/common-docs/content/common-theme/shortcodes/tasks.md
new file mode 100644
index 000000000..9b096fbc8
--- /dev/null
+++ b/common-docs/content/common-theme/shortcodes/tasks.md
@@ -0,0 +1,27 @@
++++
+title="Tasks"
+description="Inert objectives"
+emoji="β
"
+menu=["shortcodes"]
++++
+
+```go
+
+- [ ] Objective 1
+- [ ] Objective 2
+- [ ] Objective 3
+
+```
+
+{{< tasks >}}
+
+- [ ] Objective 1
+- [ ] Objective 2
+- [ ] Objective 3
+
+{{< /tasks >}}
+
+Tasks are learning objectives you want to render but not track. They will be rendered on Hugo and GitHub as task lists. They will be shown in the learning objectives section on a block. But they will NOT be tracked as learning objectives and won't be passed to the success criteria of a sprint.
+
+> [!TIP]
+> You probably want [objectives](./objectives) instead.
diff --git a/common-docs/hugo.toml b/common-docs/hugo.toml
index 0849ab71b..6a6dfbc52 100644
--- a/common-docs/hugo.toml
+++ b/common-docs/hugo.toml
@@ -51,6 +51,7 @@ main_org_name = "Code Your Future"
our_name="The Docs"
org = "https://github.com/CodeYourFuture"
repo = "https://github.com/CodeYourFuture/curriculum/"
+owner = "CodeYourFuture"
root = "curriculum"
orgapi = "https://api.github.com/repos/CodeYourFuture"
[caches.getresource]
diff --git a/common-theme/hugo.toml b/common-theme/hugo.toml
index 3be4f2cb7..e3c68a4b4 100644
--- a/common-theme/hugo.toml
+++ b/common-theme/hugo.toml
@@ -34,6 +34,7 @@ startTime="10:00"
# our_name = "alias for in text replacement"
# org = "https://github.com/YOUR_ORG_HERE"
# repo = "https://github.com/YOUR_ORG_HERE/YOUR_REPO/"
+# owner = "YOUR_ORG_HERE"
# root = "YOUR_REPO_I_THINK"
# orgapi = "https://api.github.com/repos/YOUR_ORG_HERE/"
# pdrepo = "PD-curriculum-repo"
diff --git a/common-theme/layouts/_default/_markup/render-codeblock-objectives.html b/common-theme/layouts/_default/_markup/render-codeblock-objectives.html
index 8da019712..0d3a89b4b 100644
--- a/common-theme/layouts/_default/_markup/render-codeblock-objectives.html
+++ b/common-theme/layouts/_default/_markup/render-codeblock-objectives.html
@@ -1,11 +1 @@
-{{ $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 }}
+{{ partial "objectives/get-list" .Inner }}
diff --git a/common-theme/layouts/_default/_markup/render-codeblock-tasks.html b/common-theme/layouts/_default/_markup/render-codeblock-tasks.html
new file mode 100644
index 000000000..0d3a89b4b
--- /dev/null
+++ b/common-theme/layouts/_default/_markup/render-codeblock-tasks.html
@@ -0,0 +1 @@
+{{ partial "objectives/get-list" .Inner }}
diff --git a/common-theme/layouts/_default/success.html b/common-theme/layouts/_default/success.html
index 5d3ac6356..6360bb2df 100644
--- a/common-theme/layouts/_default/success.html
+++ b/common-theme/layouts/_default/success.html
@@ -28,14 +28,21 @@
{{ $prep := .Site.GetPage (printf "%sprep/index.md"
.CurrentSection.RelPermalink)
}}
+ {{ $backlog := .Site.GetPage (printf "%sbacklog/index.md"
+ .CurrentSection.RelPermalink)
+ }}
{{ $dayplan := .Site.GetPage (printf "%sday-plan/index.md"
.CurrentSection.RelPermalink)
}}
+ {{ $issueBlocks := partial "block/issues-list-as-blocks.html" (dict "backlog" $backlog.Params.backlog "backlog_filter" $backlog.Params.backlog_filter) }}
{{ $blocks := slice }}
{{/* append non-nil blocks */}}
{{ range $prep.Params.blocks }}
{{ if . }}{{ $blocks = $blocks | append . }}{{ end }}
{{ end }}
+ {{ range $issueBlocks }}
+ {{ if . }}{{ $blocks = $blocks | append . }}{{ end }}
+ {{ end }}
{{ range $dayplan.Params.blocks }}
{{ if . }}{{ $blocks = $blocks | append . }}{{ end }}
{{ end }}
@@ -43,6 +50,7 @@
{{ if and (not $blocks) $dayplan $prep }}
{{ errorf "There are no learning objectives on the %s page. Make sure this sprint has learning objectives." $.Page.RelPermalink }}
{{ end }}
+
{{/* Deduplicate blocks */}}
{{ $uniqueSrcs := slice }}
{{ $dedupedBlocks := slice }}
@@ -64,10 +72,10 @@
{{/* Retrieve the blockData from Scratch */}}
{{ $blockData := $.Page.Scratch.Get "blockData" }}
{{/* Depending on the type of block, call the appropriate partial */}}
- {{ if or (eq $blockData.type "readme") }}
- {{ partial "objectives/parsed" (dict "blockData" $blockData "pageContext" $pageContext) }}
+ {{ if or (eq $blockData.type "readme") (eq $blockData.type "issue") }}
+ {{ partial "objectives/remote" (dict "blockData" $blockData "pageContext" $pageContext "showTitle" $blockData.name) }}
{{ else }}
- {{ partial "objectives/lookup.html" (dict "blockData" $blockData "pageContext" $pageContext) }}
+ {{ partial "objectives/local.html" (dict "blockData" $blockData "pageContext" $pageContext "showTitle" true) }}
{{ end }}
{{ end }}
diff --git a/common-theme/layouts/partials/block/data.html b/common-theme/layouts/partials/block/data.html
index 7a927ed82..f1cfa55e0 100644
--- a/common-theme/layouts/partials/block/data.html
+++ b/common-theme/layouts/partials/block/data.html
@@ -64,6 +64,7 @@
{{/* TODO pull time from commented out front matter in Github readmes */}}
{{ end }}
+ {{/* TODO get rid of the old way of bringing in cyf pd and remove hardcoded CYF stuff here */}}
{{ if or ("cyf-pd.netlify.app" | in $src) ("/pd/"| in $src) }}
{{ .Scratch.SetInMap "blockData" "type" "pd" }}
{{ $blockPath := replace $src "https://cyf-pd.netlify.app/blocks/" "pd/blocks/" }}
diff --git a/common-theme/layouts/partials/block/issue.html b/common-theme/layouts/partials/block/issue.html
index a8308a604..adc20a5bf 100644
--- a/common-theme/layouts/partials/block/issue.html
+++ b/common-theme/layouts/partials/block/issue.html
@@ -22,6 +22,19 @@
{{ end }}
{{ end }}
+ {{/* extract objectives */}}
+ {{ $extractedObjectives := partial "strings/extract-github-objectives.html" $response.body }}
+
+ {{ if gt (len $extractedObjectives) 0 }}
+
+
+ Learning Objectives
+
+ {{ range $extractedObjectives }}
+ {{ . | markdownify }}
+ {{ end }}
+
+ {{ end }}
{{ $response.body | markdownify }}
diff --git a/common-theme/layouts/partials/block/issues-list-as-blocks.html b/common-theme/layouts/partials/block/issues-list-as-blocks.html
new file mode 100644
index 000000000..05c9b6fdc
--- /dev/null
+++ b/common-theme/layouts/partials/block/issues-list-as-blocks.html
@@ -0,0 +1,47 @@
+{{/* This uses graphQL instead of REST
+ It returns a map of "blocks" so issues can be passed into the blocks loop instead of needing its own system
+ If we decide we like this better, we should probably systematise this and store
+ the graphql queries in their own dir
+ https://docs.github.com/en/graphql/reference/objects#issue
+ This exact matches on labels unlike the current system which partial matches inside Hugo
+ We did that because PD kept making partially matching labels, but maybe we should be stricter
+ TODO But it means someone has to go round and clean up
+*/}}
+{{ $variables := dict
+ "owner" site.Params.owner
+ "repo" .backlog
+ "labels" .backlog_filter
+}}
+
+{{ $query := `query($owner: String!, $repo: String!, $labels: [String!]) {
+ repository(owner: $owner, name: $repo) {
+ issues(
+ last: 100,
+ filterBy: {
+ states: OPEN,
+ labels: $labels
+ }
+ ) {
+ nodes {
+ title
+ url
+ }
+ }
+ }
+}` }}
+
+{{ $request := dict
+ "method" "POST"
+ "body" (dict "query" $query "variables" $variables | jsonify)
+}}
+{{ $issueBlocks := slice }}
+{{ with resources.GetRemote "https://api.github.com/graphql" (merge $request (partial "github-auth.html" .)) }}
+ {{ with .Content | unmarshal }}
+ {{ with .data.repository.issues }}
+ {{ range .nodes }}
+ {{ $issueBlocks = $issueBlocks | append (dict "name" .title "src" .url) }}
+ {{ end }}
+ {{ end }}
+ {{ end }}
+{{ end }}
+{{ return $issueBlocks }}
diff --git a/common-theme/layouts/partials/block/local.html b/common-theme/layouts/partials/block/local.html
index c15f9985d..9aced22d8 100644
--- a/common-theme/layouts/partials/block/local.html
+++ b/common-theme/layouts/partials/block/local.html
@@ -18,10 +18,15 @@
{{ partial "time.html" . }}
- {{ with $block.Params.Objectives }}
+ {{ if or $block.Params.Objectives $block.Params.Tasks }}
Learning Objectives
- {{ partial "objectives/block.html" . }}
+ {{ with $block.Params.Objectives }}
+ {{ partial "objectives/block.html" . }}
+ {{ end }}
+ {{ with $block.Params.Tasks }}
+ {{ partial "objectives/block.html" . }}
+ {{ end }}
{{ end }}
{{ $block.Content }}
diff --git a/common-theme/layouts/partials/block/readme.html b/common-theme/layouts/partials/block/readme.html
index 16bf09f3d..ef11edca7 100644
--- a/common-theme/layouts/partials/block/readme.html
+++ b/common-theme/layouts/partials/block/readme.html
@@ -14,6 +14,7 @@
{{ end }}
{{ $response := .Content | unmarshal }}
+ {{ $decodedContent := $response.content | base64Decode }}
{{ partial "time.html" $pageContext }}
+ {{ $extractedObjectives := partial "strings/extract-github-objectives.html" $decodedContent }}
+ {{ if gt (len $extractedObjectives) 0 }}
+
+ Learning Objectives
+ {{ range $extractedObjectives }}
+ {{ . | markdownify }}
+ {{ end }}
+
+ {{ end }}
- {{ $decodedContent := $response.content | base64Decode }}
{{ $strippedComments := $decodedContent | replaceRE "" "$1" }}
{{ $externalPath := replace $response.download_url $response.name "" }}
{{/* TODO this replaces the call to the absolute-image-paths partial as it was breaking the markdownifying --
@@ -35,7 +44,9 @@
*/}}
{{/* Replace Markdown image links, targeting anything without a : */}}
{{ $processedContent := $strippedComments | replaceRE `!\[([^\]]+)\]\(([^"http:\/\/|https:\/\/][^)]+)\)` (printf "![$1](%s$2)" $externalPath) }}
- {{ $processedContent | markdownify }}
+ {{ $textWithoutObjectives := partial "strings/remove-github-objectives.html" $processedContent }}
+ {{ $textWithoutObjectives | markdownify }}
+
{{/* You can attach a range of nested blocks as options
diff --git a/common-theme/layouts/partials/issues.html b/common-theme/layouts/partials/issues.html
index 1220dc3d9..e23ccba3a 100644
--- a/common-theme/layouts/partials/issues.html
+++ b/common-theme/layouts/partials/issues.html
@@ -56,7 +56,23 @@
Clone
- {{ .body | markdownify }}
+
+
+ {{/* extract objectives */}}
+ {{ $extractedObjectives := partial "strings/extract-github-objectives.html" .body }}
+
+ {{ if gt (len $extractedObjectives) 0 }}
+
+
+ Learning Objectives
+
+ {{ range $extractedObjectives }}
+ {{ . | markdownify }}
+ {{ end }}
+
+ {{ end }}
+ {{ .body | markdownify }}
+
{{ with .labels }}
diff --git a/common-theme/layouts/partials/objectives/get-list.html b/common-theme/layouts/partials/objectives/get-list.html
new file mode 100644
index 000000000..6d98032fd
--- /dev/null
+++ b/common-theme/layouts/partials/objectives/get-list.html
@@ -0,0 +1,17 @@
+{{ $items := slice }}
+{{ $inner := . }}
+{{/* I called this inner because I'm typically expecting .Inner from a shortcode or partial
+ But it could be a gob of text from GitHub
+*/}}
+{{ if gt (len $inner) 0 }}
+ {{ $objectives := split $inner "\n" }}
+ {{ range $objectives }}
+ {{ $objective := replace . "- [ ] " "" }}
+ {{ if ne (trim $objective " ") "" }}
+ {{ $items = $items | append $objective }}
+ {{ end }}
+ {{ end }}
+ {{ with $items }}
+ {{ partial "objectives/block" . }}
+ {{ end }}
+{{ end }}
diff --git a/common-theme/layouts/partials/objectives/local.html b/common-theme/layouts/partials/objectives/local.html
new file mode 100644
index 000000000..64880055b
--- /dev/null
+++ b/common-theme/layouts/partials/objectives/local.html
@@ -0,0 +1,13 @@
+{{/* This partial goes and gets a local block
+ But instead of rendering the whole thing like blocks/local
+ It just renders the objectives
+*/}}
+{{ $scope := . }}
+{{ $pageContext := .pageContext }}
+{{ $localBlock := $pageContext.GetPage $scope.blockData.api }}
+{{ $showTitle := .showTitle |default false }}
+
+{{ with $localBlock.Page.Params.Objectives }}
+ {{ if $showTitle }}{{ $localBlock.Page.Title }}
{{ end }}
+ {{ partial "objectives/block.html" . }}
+{{ end }}
diff --git a/common-theme/layouts/partials/objectives/lookup.html b/common-theme/layouts/partials/objectives/lookup.html
deleted file mode 100644
index e2acd4c7a..000000000
--- a/common-theme/layouts/partials/objectives/lookup.html
+++ /dev/null
@@ -1,11 +0,0 @@
-{{ $scope := . }}
-{{ $pageContext := .pageContext }}
-{{ $localBlock := $pageContext.GetPage $scope.blockData.api }}
-{{ if (eq $scope.blockData.type "local_module") }}
- {{ $localBlock = $pageContext.GetPage (replace $scope.blockData.api "%!s()" .pageContext.Section) }}
-{{ end }}
-{{ $blockTitle := $localBlock.Page.Title }}
-{{ with $localBlock.Page.Params.Objectives }}
- {{ $blockTitle | default $scope.blockData.name }}
- {{ partial "objectives/block.html" . }}
-{{ end }}
diff --git a/common-theme/layouts/partials/objectives/parsed.html b/common-theme/layouts/partials/objectives/parsed.html
deleted file mode 100644
index 0ffff24d8..000000000
--- a/common-theme/layouts/partials/objectives/parsed.html
+++ /dev/null
@@ -1,37 +0,0 @@
-{{ $sot := .blockData.sot }}
-{{ $name := .blockData.name }}
-
-{{ with resources.GetRemote .blockData.api .blockData.headers }}
- {{ with .Err }}
- {{ errorf "Failed %s on %s. Error: %s" $sot .Page.Title .Err }}
- {{ end }}
- {{ $response := .Content | unmarshal }}
-
- {{ $decodedContent := $response.content | base64Decode }}
- {{/* Find fenced objectives in text */}}
- {{ $regexFence := "```objectives\\s*([^`]*?)\\s*```" }}
- {{ $rawBlocks := findRE $regexFence $decodedContent }}
-
- {{ $blocks := slice }}
- {{ range $rawBlocks }}
- {{ $blockContent := . | replaceRE "^```objectives\\s*|\\s*```$" "" }}
- {{ $objectives := split $blockContent "\n" }}
- {{ range $objectives }}
- {{ $objective := replace . "- [ ] " "" }}
- {{ if ne (trim $objective " ") "" }}
- {{ $blocks = $blocks | append $objective }}
- {{ end }}
- {{ end }}
- {{ end }}
-
- {{/* Output list */}}
- {{ if gt (len $blocks) 0 }}
-
- {{ with $blocks }}
- {{ partial "objectives/block.html" . }}
- {{ end }}
- {{ end }}
-
-{{ end }}
diff --git a/common-theme/layouts/partials/objectives/remote.html b/common-theme/layouts/partials/objectives/remote.html
new file mode 100644
index 000000000..31f767ee7
--- /dev/null
+++ b/common-theme/layouts/partials/objectives/remote.html
@@ -0,0 +1,30 @@
+{{/* This partial goes and gets a remote content block but instead of rendering
+ a whole block like blocks/etc does, it just renders learning objectives
+*/}}
+
+{{ $response := resources.GetRemote .blockData.api .blockData.headers }}
+{{ $blockType := .blockData.type }}
+{{ $showTitle := .showTitle | default false }}
+{{/* 404s lead to GetRemote returning nil rather than an error. */}}
+{{ if eq $response nil }}
+ {{ errorf "Couldn't find anything at %s" .blockData.api }}
+{{ end }}
+
+{{ with $response }}
+ {{ $response := .Content | unmarshal }}
+ {{/* readme and issue responses are a tiny bit different but not enough to warrant different partials */}}
+ {{ if eq $blockType "readme" }}
+ {{ $response = $response.content | base64Decode }}
+ {{ end }}
+ {{ if eq $blockType "issue" }}
+ {{ $response = $response.body }}
+ {{ end }}
+
+ {{ $extractedObjectives := partial "strings/extract-github-objectives.html" $response }}
+ {{ if gt (len $extractedObjectives) 0 }}
+ {{ if $showTitle }}{{ $showTitle }}
{{ end }}
+ {{ range $extractedObjectives }}
+ {{ . | markdownify }}
+ {{ end }}
+ {{ end }}
+{{ end }}
diff --git a/common-theme/layouts/partials/strings/extract-github-objectives.html b/common-theme/layouts/partials/strings/extract-github-objectives.html
new file mode 100644
index 000000000..6d951c184
--- /dev/null
+++ b/common-theme/layouts/partials/strings/extract-github-objectives.html
@@ -0,0 +1,11 @@
+{{ $strippedText := . | replaceRE "" "" | replaceRE "\r\n" "\n" }}
+
+{{/* Find fenced objectives in text */}}
+{{ $regexFence := "```objectives\\s*([^`]*?)\\s*```" }}
+{{ $extractedObjectives := findRE $regexFence $strippedText }}
+
+{{/* Find shortcoded objectives in text */}}
+
+{{ $regexShortcode := "{{}}([^`]*?){{}}" }}
+{{ $extractedObjectives = $extractedObjectives | append (findRE $regexShortcode $strippedText) }}
+{{ return $extractedObjectives }}
diff --git a/common-theme/layouts/partials/strings/remove-github-objectives.html b/common-theme/layouts/partials/strings/remove-github-objectives.html
new file mode 100644
index 000000000..2551fdd6e
--- /dev/null
+++ b/common-theme/layouts/partials/strings/remove-github-objectives.html
@@ -0,0 +1,16 @@
+{{/* This removes objectives - to remove text and only have objectives use extract-github-objectives */}}
+
+{{/* Find fenced objectives in text */}}
+{{ $regexFence := "```objectives\\s*([^`]*?)\\s*```" }}
+{{ $textWithoutObjectives := replaceRE $regexFence "" . }}
+
+{{/* Find shortcoded objectives in text */}}
+
+{{ $regexShortcode := "{{}}([^`]*?){{}}" }}
+{{ $textWithoutObjectives = replaceRE $regexShortcode "" $textWithoutObjectives }}
+{{/* Find and remove headings that contain "earning objective" */}}
+{{ $regexHeading := "(?im)^#{1,6}\\s*[^\\n]*earning\\s*objective[^\\n]*$" }}
+{{ $textWithoutObjectives = $textWithoutObjectives | replaceRE $regexHeading "" }}
+
+
+{{ return $textWithoutObjectives }}
diff --git a/common-theme/layouts/shortcodes/objectives.html b/common-theme/layouts/shortcodes/objectives.html
index 8da019712..0d3a89b4b 100644
--- a/common-theme/layouts/shortcodes/objectives.html
+++ b/common-theme/layouts/shortcodes/objectives.html
@@ -1,11 +1 @@
-{{ $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 }}
+{{ partial "objectives/get-list" .Inner }}
diff --git a/common-theme/layouts/shortcodes/tasks.html b/common-theme/layouts/shortcodes/tasks.html
index 111f4f624..0d3a89b4b 100644
--- a/common-theme/layouts/shortcodes/tasks.html
+++ b/common-theme/layouts/shortcodes/tasks.html
@@ -1,12 +1 @@
-{{ $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 }}
-
+{{ partial "objectives/get-list" .Inner }}
diff --git a/org-cyf-theme/hugo.toml b/org-cyf-theme/hugo.toml
index c359466ba..7e8fdfa2c 100644
--- a/org-cyf-theme/hugo.toml
+++ b/org-cyf-theme/hugo.toml
@@ -44,6 +44,7 @@ description = "A free and open source software development programme."
main_website = "https://codeyourfuture.io/"
main_org_name = "Code Your Future"
our_name="CYF"
+owner = "CodeYourFuture"
org = "https://github.com/CodeYourFuture"
repo = "https://github.com/CodeYourFuture/curriculum/"
pdrepo = "CYF-PD"
diff --git a/org-cyf-tracks/content/sap-fico/sprints/1/backlog/index.md b/org-cyf-tracks/content/sap-fico/sprints/1/backlog/index.md
index 178d4bf51..8b7f918c0 100644
--- a/org-cyf-tracks/content/sap-fico/sprints/1/backlog/index.md
+++ b/org-cyf-tracks/content/sap-fico/sprints/1/backlog/index.md
@@ -5,5 +5,5 @@ emoji= 'π·οΈ'
menu_level = ['sprint']
weight = 2
backlog= 'Track-ERP-SAP-FICO'
-backlog_filter= 'Sprint 1'
+backlog_filter= 'π
Sprint 1'
+++