Skip to content

Commit

Permalink
Homepage (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHinsh authored Sep 17, 2024
2 parents 94d92ba + db41f57 commit f91fa87
Show file tree
Hide file tree
Showing 52 changed files with 987 additions and 266 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/close-pr.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
name: Remove PR Environemnt on Close
name: Azure Static Web App PR Cleanup

on:
pull_request:
types: [closed]

jobs:
build_and_deploy:
pr_cleanup:
runs-on: ubuntu-latest
steps:

- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: Site
path: ./_site

- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.NKDAGILITY_BOT_APP_ID }}
private-key: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }}

- name: Deploy
- name: Clean up pull request environment
uses: Azure/static-web-apps-deploy@v1
with:
repo_token: ${{ steps.app-token.outputs.token }}
action: 'upload'
app_location: ./_site
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
action: 'delete'
app_location: ''
skip_app_build: true
skip_api_build: true
output_location: ''
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
123 changes: 92 additions & 31 deletions .powershell/capabilitiesPostProcessor.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ function Get-FrontMatter {
# Return both the front matter data and the markdown body
return @{
FrontMatter = $frontMatterData;
Body = $markdownBody
Body = $markdownBody
}
} else {
}
else {
Write-Host "No front matter found in $markdownFilePath"
return $null
}
Expand Down Expand Up @@ -56,7 +57,8 @@ function Get-RelativePathFromURL {
# Use regex to remove the domain from the URL
if ($url -match "https?:\/\/[^\/]+(.+)") {
return $matches[1]
} else {
}
else {
return $url
}
}
Expand Down Expand Up @@ -128,14 +130,15 @@ function Ensure-CardNode {
# Add or update the "Card" node in the front matter with empty default structure if no data
if (-not $frontMatterData.ContainsKey('card')) {
$frontMatterData.card = @{
title = $cardTitle;
title = $cardTitle;
content = $cardContent;
button = @{
button = @{
content = $cardButtonContent
}
}
Write-Host "Added empty card structure."
} else {
}
else {
# Ensure all card fields exist
if (-not $frontMatterData.card.ContainsKey('title')) {
$frontMatterData.card.title = $cardTitle
Expand All @@ -145,13 +148,58 @@ function Ensure-CardNode {
}
if (-not $frontMatterData.card.ContainsKey('button')) {
$frontMatterData.card.button = @{ content = $cardButtonContent }
} elseif (-not $frontMatterData.card.button.ContainsKey('content')) {
}
elseif (-not $frontMatterData.card.button.ContainsKey('content')) {
$frontMatterData.card.button.content = $cardButtonContent
}
Write-Host "Ensured card structure exists."
}
}

# Function to update the card front matter
function Update-MarkdownWithCard {
param (
[string]$baseDirectory
)

# Loop through each subdirectory (each capability or course folder)
Get-ChildItem -Path $baseDirectory -Directory | ForEach-Object {
$capabilityFolder = $_.FullName
$yamlFilePath = Join-Path $capabilityFolder "data.yaml"
$markdownFilePath = Join-Path $capabilityFolder "index.md"

# Check if both the YAML and Markdown files exist
if ((Test-Path $yamlFilePath) -and (Test-Path $markdownFilePath)) {
# Read the YAML data from data.yaml
$yamlData = Get-Content -Path $yamlFilePath -Raw | ConvertFrom-Yaml
$postMetaData = $yamlData.post.postmeta

# Get the front matter and body from the Markdown file
$markdownData = Get-FrontMatter -markdownFilePath $markdownFilePath

if ($markdownData) {
$frontMatterData = $markdownData.FrontMatter
$markdownBody = $markdownData.Body

# Extract the necessary data from the YAML file for the Card node
$cardTitle = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-card-title' } | Select-Object -ExpandProperty meta_value
$cardContent = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-card-copy' } | Select-Object -ExpandProperty meta_value
$cardButtonContent = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-card-button-text' } | Select-Object -ExpandProperty meta_value

# Ensure that the card structure exists, even if no data
Ensure-CardNode -frontMatterData $frontMatterData -cardTitle $cardTitle -cardContent $cardContent -cardButtonContent $cardButtonContent

# Save the updated front matter
Set-FrontMatter -markdownFilePath $markdownFilePath -frontMatterData $frontMatterData -markdownBody $markdownBody
Write-Host "Updated card front matter for $markdownFilePath"
}
}
else {
Write-Host "YAML or Markdown file not found in $capabilityFolder"
}
}
}

# Function to update the course metadata in the front matter
function Update-MarkdownWithCourseData {
param (
Expand Down Expand Up @@ -200,29 +248,30 @@ function Update-MarkdownWithCourseData {

# Update the "delivery" node in the front matter
$frontMatterData.delivery = @{
code = $code
type = $courseType
duration = $duration
skilllevel = $skillLevel
lead = $lead
audience = $audience
format = $format
code = $code
type = $courseType
duration = $duration
skilllevel = $skillLevel
lead = $lead
audience = $audience
format = $format
prerequisites = $prerequisites
details = $details
brand = @{
details = $details
brand = @{
colour = $colour
vendor = $vendor
}
topics = $topics
objectives = $objectives
topics = $topics
objectives = $objectives
certification = $certification
}

# Save the updated front matter back to the Markdown file
Set-FrontMatter -markdownFilePath $markdownFilePath -frontMatterData $frontMatterData -markdownBody $markdownBody
Write-Host "Updated front matter for $markdownFilePath with course data."
}
} else {
}
else {
Write-Host "YAML or Markdown file not found in $capabilityFolder"
}
}
Expand Down Expand Up @@ -269,7 +318,8 @@ function Update-OldSlugsAsAliases {
if ($frontMatterData.aliases -notcontains $oldSlug) {
Write-Host "Adding old slug '$oldSlug' to aliases."
$frontMatterData.aliases += $oldSlug
} else {
}
else {
Write-Host "Slug '$oldSlug' already exists in aliases."
}
}
Expand All @@ -283,7 +333,8 @@ function Update-OldSlugsAsAliases {
if ($frontMatterData.aliases -notcontains $relativePath) {
Write-Host "Adding relative path '$relativePath' from post.link to aliases."
$frontMatterData.aliases += $relativePath
} else {
}
else {
Write-Host "Relative path '$relativePath' already exists in aliases."
}
}
Expand All @@ -292,21 +343,31 @@ function Update-OldSlugsAsAliases {
Set-FrontMatter -markdownFilePath $markdownFilePath -frontMatterData $frontMatterData -markdownBody $markdownBody
Write-Host "Updated aliases front matter for $markdownFilePath"
}
} else {
}
else {
Write-Host "YAML or Markdown file not found in $capabilityFolder"
}
}
}

# Example: Run all updates against the courses and capabilities directories
$courseDirectory = "C:\Users\MartinHinshelwoodNKD\source\repos\wordpress-export-to-markdown\output\courses"
$capabilityDirectory = "C:\Users\MartinHinshelwoodNKD\source\repos\wordpress-export-to-markdown\output\capabilities"
$courseDirectory = "content\capabilities\training-courses"
$capabilityDirectory = "content\capabilities"
$peopleDirectory = "content\company\people"
$outcomesDir = "content\outcomes"

Update-MarkdownWithCard -baseDirectory $peopleDirectory
Update-OldSlugsAsAliases -baseDirectory $peopleDirectory

Update-MarkdownWithCard -baseDirectory $outcomesDir
Update-OldSlugsAsAliases -baseDirectory $outcomesDir


# Run each update function sequentially for both directories
Update-MarkdownWithCourseData -baseDirectory $courseDirectory
Update-MarkdownWithCard -baseDirectory $courseDirectory
Update-OldSlugsAsAliases -baseDirectory $courseDirectory
# # Run each update function sequentially for both directories
# Update-MarkdownWithCourseData -baseDirectory $courseDirectory
# Update-MarkdownWithCard -baseDirectory $courseDirectory
# Update-OldSlugsAsAliases -baseDirectory $courseDirectory

#Update-MarkdownWithCourseData -baseDirectory $capabilityDirectory
Update-MarkdownWithCard -baseDirectory $capabilityDirectory
Update-OldSlugsAsAliases -baseDirectory $capabilityDirectory
# #Update-MarkdownWithCourseData -baseDirectory $capabilityDirectory
# Update-MarkdownWithCard -baseDirectory $capabilityDirectory
# Update-OldSlugsAsAliases -baseDirectory $capabilityDirectory
2 changes: 1 addition & 1 deletion content/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Welcome to Our Site"
title: "naked Agility"
url: "/"
---
Welcome to our website. We specialize in helping teams become more productive, agile, and aligned with their business goals. Test
3 changes: 2 additions & 1 deletion content/capabilities/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Capabilities"
title: "What We Do?"
description: "Explore our tailored services and capabilities in Consulting, Coaching, and Mentoring. Specializing in Agile, DevOps, Scrum, and Kanban, we’re here to help you tackle challenges and drive success. Enhance your team’s performance and efficiency with our expert solutions!"
url: "/capabilities/"
layout: "section" # Hugo will use section.html to render the list of pages
---
Expand Down
8 changes: 4 additions & 4 deletions content/capabilities/private-corporate-training/index.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: Private Corporate Training
title: Professional Training
id: "51447"
date: 2024-06-12
author: MrHinsh
draft: true
aliases:
- /capabilities/private-corporate-training/
type: capabilities
slug: private-corporate-training
card:
button:
content: Transform Your Team
content: Elevate your team's performance with our Private Corporate Training! Tailored specifically to your organization's needs, our courses cover everything from Lean Agile practices such as Scrum, Kanban, and DevOps to hands-on tools training in Azure DevOps, GitHub, and Copilot AI.
title: Private Corporate Training

content: Elevate your team's performance with our Private Corporate Training and public offerings! Tailored specifically to your organization's needs, our courses cover everything from Lean Agile practices such as Scrum, Kanban, and DevOps to hands-on tools training in Azure DevOps, GitHub, and Copilot AI.
title: Professional Training
---


Expand Down
9 changes: 9 additions & 0 deletions content/capabilities/training-courses/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
---
title: "Training Courses"
url: "/capabilities/training-courses/"
date: 2024-06-12
weight: 2
type: capabilities
aliases:
- /capabilities/private-corporate-training/
card:
button:
content: Training Courses
content: Elevate your team's performance with our Private Corporate Training! Tailored specifically to your organization's needs, our courses cover everything from Lean Agile practices such as Scrum, Kanban, and DevOps to hands-on tools training in Azure DevOps, GitHub, and Copilot AI.
title: Professional Training
---
Our training courses are designed to equip your team with the skills and knowledge they need to excel in an Agile environment. We offer a variety of courses tailored to different roles, including Scrum Masters, Product Owners, and team members, with both immersive and traditional learning experiences.

7 changes: 7 additions & 0 deletions content/company/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Who are we?"
description: "Naked Agility Limited is a boutique consultancy that offers training, coaching, mentoring, and facilitation to help people and teams evolve, integrate, and continuously improve."
url: "/company/people/"
layout: "section" # Hugo will use section.html to render the list of pages
---
Overview of all People.
6 changes: 6 additions & 0 deletions content/company/people/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "Who are we?"
url: "/company/people/"
layout: "section" # Hugo will use section.html to render the list of pages
---
Overview of all People.
33 changes: 27 additions & 6 deletions content/company/people/ana-pujana-jimenez/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
---
slug: ana-pujana-jimenez
coverImage: Ana.jpg
author: MrHinsh
title: Ana Pujana Jiménez
aliases:
- /company/people/ana-pujana-jimenez/
date: 2021-10-16
id: "46982"
title: "Ana Pujana Jiménez"
date: "2021-10-16"
coverImage: "Ana.jpg"
author: "MrHinsh"
type: "people"
slug: "ana-pujana-jimenez"
type: people
card:
title: Ana Pujana Jiménez
content: |-
<strong>Associate Coach</strong>
Maximising Agile Practices for Software Products ✪ Acclaimed Agile Expert, Trainer, &amp; Speaker with 10+ yrs in IT Industry ✪ Scrum (PSM, PSPO) &amp; Kanban Advocate ✪ Product Management Specialist ✪ Continuous Improvement Enthusiast
button:
content: More info

---












33 changes: 27 additions & 6 deletions content/company/people/dan-brown-kanbandan/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
---
slug: dan-brown-kanbandan
coverImage: kanban-dan.png
author: MrHinsh
title: Dan Brown (KanbanDan)
aliases:
- /company/people/dan-brown-kanbandan/
date: 2023-06-20
id: "49463"
title: "Dan Brown (KanbanDan)"
date: "2023-06-20"
coverImage: "kanban-dan.png"
author: "MrHinsh"
type: "people"
slug: "dan-brown-kanbandan"
type: people
card:
title: Dan Brown (KanbanDan)
content: |-
<strong>Agile Trainer &amp; Coach</strong>
Enhancing Delivery ✪ Agile Trainer &amp; Coach ✪ Expert in Lean Kanban &amp; Agile Transformation ✪ Passionate Coach, Teacher, &amp; Speaker
button:
content: More info

---












Loading

0 comments on commit f91fa87

Please sign in to comment.