Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more Content Stubs #13

Merged
merged 48 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
4a672bf
Added method stubs
MrHinsh Sep 17, 2024
b471507
Created index stubs
MrHinsh Sep 17, 2024
5b26345
Merge branch 'main' into topic/create-more-content
MrHinsh Sep 17, 2024
80631b7
Bring over guides
MrHinsh Sep 17, 2024
8e70294
Folder full of old stuff for brining in
MrHinsh Sep 17, 2024
b519a16
Move out of main site
MrHinsh Sep 17, 2024
bf4a382
Fixed issues
MrHinsh Sep 17, 2024
614b026
Update folders for blogs
MrHinsh Sep 18, 2024
12240f7
Update and add videos from youtube
MrHinsh Sep 20, 2024
322f998
Update
MrHinsh Sep 20, 2024
96cc52d
Remvoe etag
MrHinsh Sep 20, 2024
a005c13
Update
MrHinsh Sep 20, 2024
d8c1eee
Move to subfolder
MrHinsh Sep 20, 2024
ff6378c
Update to remove percent and diots
MrHinsh Sep 20, 2024
edf3d55
Update
MrHinsh Sep 20, 2024
db28e5b
Update
MrHinsh Sep 27, 2024
023c81b
Update
MrHinsh Sep 30, 2024
73029ea
Update
MrHinsh Sep 30, 2024
b956f86
Update
MrHinsh Sep 30, 2024
79bffec
Update all dates on videos
MrHinsh Sep 30, 2024
230cc2e
✨ (site): add online booking page and connect section
MrHinsh Sep 30, 2024
bddc199
Update for azure-devops-migration-tools-consulting
MrHinsh Sep 30, 2024
11f90d6
Update
MrHinsh Sep 30, 2024
e437cc9
📝 (index.html): correct typos and improve readability of the content
MrHinsh Oct 1, 2024
acd5d5a
📝 (content): update value proposition and NKD Insights sections for c…
MrHinsh Oct 1, 2024
6a44080
Update with icons
MrHinsh Oct 1, 2024
6cefdc9
Update as markdown
MrHinsh Oct 1, 2024
b8b53b4
Update with new image location
MrHinsh Oct 1, 2024
99d9cda
Update with licence
MrHinsh Oct 1, 2024
20bfe13
📝 (footer.html, head.html): update copyright year format and add favicon
MrHinsh Oct 1, 2024
2ad023f
📝 (blog): update image styling and add headline section
MrHinsh Oct 1, 2024
f5fa657
Update all video pages to include the video
MrHinsh Oct 1, 2024
b136374
update
MrHinsh Oct 1, 2024
86ef5bb
✨ (syncNKDAgilityTV-Transcripts.ps1): add support for channelId, outp…
MrHinsh Oct 1, 2024
87b2045
✨ (ensureAllImagesHaveClass.ps1): add script to ensure all images in …
MrHinsh Oct 1, 2024
6b1c3b3
Updated images and redering of links
MrHinsh Oct 1, 2024
759d4b8
📝 (blog): add tags to the blog post for better categorization
MrHinsh Oct 1, 2024
9425447
Update type: post to type: blog
MrHinsh Oct 1, 2024
91a0fee
Update type: post to type: blog
MrHinsh Oct 1, 2024
022718c
Update with pretier with new config
MrHinsh Oct 2, 2024
43130a2
Update newsletters
MrHinsh Oct 2, 2024
366c732
Updated podcasts
MrHinsh Oct 2, 2024
3ece588
Update
MrHinsh Oct 2, 2024
01fe845
Update
MrHinsh Oct 2, 2024
14e23a3
Update many files
MrHinsh Oct 2, 2024
5ad0da3
Update
MrHinsh Oct 2, 2024
0c8af62
Update all
MrHinsh Oct 2, 2024
97ae149
♻️ (baseof.html, headline.html, breadcrumbs.html): refactor HTML stru…
MrHinsh Oct 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ignore directories
/public/
/site/public/
**/.obsidian/
116 changes: 84 additions & 32 deletions .powershell/capabilitiesPostProcessor.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Load the required module to handle YAML
Import-Module powershell-yaml
Import-Module MarkdownPrince

# Function to get front matter from a Markdown file
function Get-FrontMatter {
Expand Down Expand Up @@ -156,6 +157,37 @@ function Ensure-CardNode {
}
}

# Define the function to convert HTML to Markdown using ReverseMarkdown.Net
function Convert-HTMLToMarkdown {
param (
[string]$html # Input HTML string
)

# Load the ReverseMarkdown assembly
$nugetPath = ".powershell\lib\ReverseMarkdown.dll"
if (-Not (Test-Path $nugetPath)) {
throw "ReverseMarkdown.dll not found at path: $nugetPath. Make sure it's installed."
}

# Try loading the ReverseMarkdown assembly safely
try {
Add-Type -Path $nugetPath -ErrorAction Stop
}
catch {
#Write-Error "Failed to load ReverseMarkdown.dll: $_"
#return $null
}

# Create a ReverseMarkdown converter instance
$converter = New-Object ReverseMarkdown.Converter

# Convert HTML to Markdown
$markdown = $converter.Convert($html)

# Return the resulting Markdown
return $markdown
}

# Function to update the card front matter
function Update-MarkdownWithCard {
param (
Expand Down Expand Up @@ -200,6 +232,21 @@ function Update-MarkdownWithCard {
}
}

function Convert-UrlToImagePath {
param (
[string]$url # Input URL
)

# Extract the file name from the URL
$fileName = [System.IO.Path]::GetFileName($url)

# Construct the new image path
$imagePath = "$fileName"

# Return the new path
return $imagePath
}

# Function to update the course metadata in the front matter
function Update-MarkdownWithCourseData {
param (
Expand Down Expand Up @@ -230,16 +277,19 @@ function Update-MarkdownWithCourseData {
$courseType = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-type' } | Select-Object -ExpandProperty meta_value
$duration = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-duration' } | Select-Object -ExpandProperty meta_value
$skillLevel = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-skill-level' } | Select-Object -ExpandProperty meta_value
$lead = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-lead' } | Select-Object -ExpandProperty meta_value
$audience = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-cource-target-audience' } | Select-Object -ExpandProperty meta_value
$format = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-format' } | Select-Object -ExpandProperty meta_value
$prerequisites = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-prerequisites' } | Select-Object -ExpandProperty meta_value
$details = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-more-details' } | Select-Object -ExpandProperty meta_value
$lead = Convert-HTMLToMarkdown($postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-lead' } | Select-Object -ExpandProperty meta_value)
$audience = Convert-HTMLToMarkdown($postMetaData | Where-Object { $_.meta_key -eq 'wpcf-cource-target-audience' } | Select-Object -ExpandProperty meta_value)
$format = Convert-HTMLToMarkdown($postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-format' } | Select-Object -ExpandProperty meta_value)
$prerequisites = Convert-HTMLToMarkdown($postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-prerequisites' } | Select-Object -ExpandProperty meta_value)
$details = Convert-HTMLToMarkdown($postMetaData | Where-Object { $_.meta_key -eq 'wpcf-more-details' } | Select-Object -ExpandProperty meta_value)
$colour = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-colour-primary' } | Select-Object -ExpandProperty meta_value
$vendor = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-vendor' } | Select-Object -ExpandProperty meta_value
$topics = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-topics' } | Select-Object -ExpandProperty meta_value
$objectives = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-objectives' } | Select-Object -ExpandProperty meta_value
$certification = $postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-assessment-and-certification' } | Select-Object -ExpandProperty meta_value
$topics = Convert-HTMLToMarkdown($postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-topics' } | Select-Object -ExpandProperty meta_value)
$objectives = Convert-HTMLToMarkdown($postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-objectives' } | Select-Object -ExpandProperty meta_value)
$certification = Convert-HTMLToMarkdown($postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-assessment-and-certification' } | Select-Object -ExpandProperty meta_value)

$courseIcon = Convert-UrlToImagePath($postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-icon' } | Select-Object -ExpandProperty meta_value)
$courseAssessmentIcon = Convert-UrlToImagePath($postMetaData | Where-Object { $_.meta_key -eq 'wpcf-course-assessment-icon' } | Select-Object -ExpandProperty meta_value)

# Convert values as necessary
$courseType = Convert-CourseType -courseType $courseType
Expand All @@ -248,22 +298,24 @@ 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
prerequisites = $prerequisites
details = $details
brand = @{
code = $code
type = $courseType
duration = $duration
skilllevel = $skillLevel
lead = $lead
audience = $audience
format = $format
prerequisites = $prerequisites
details = $details
brand = @{
colour = $colour
vendor = $vendor
}
topics = $topics
objectives = $objectives
certification = $certification
topics = $topics
objectives = $objectives
certification = $certification
courseIcon = $courseIcon
courseAssessmentIcon = $courseAssessmentIcon
}

# Save the updated front matter back to the Markdown file
Expand Down Expand Up @@ -351,22 +403,22 @@ function Update-OldSlugsAsAliases {
}

# Example: Run all updates against the courses and capabilities directories
$courseDirectory = "content\capabilities\training-courses"
$capabilityDirectory = "content\capabilities"
$peopleDirectory = "content\company\people"
$outcomesDir = "content\outcomes"
$courseDirectory = "site\content\capabilities\training-courses"
$capabilityDirectory = "site\content\capabilities"
$peopleDirectory = "site\content\company\people"
$outcomesDir = "site\content\outcomes"

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

Update-MarkdownWithCard -baseDirectory $outcomesDir
Update-OldSlugsAsAliases -baseDirectory $outcomesDir
##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
Update-MarkdownWithCourseData -baseDirectory $courseDirectory
#Update-MarkdownWithCard -baseDirectory $courseDirectory
#Update-OldSlugsAsAliases -baseDirectory $courseDirectory

# #Update-MarkdownWithCourseData -baseDirectory $capabilityDirectory
# Update-MarkdownWithCard -baseDirectory $capabilityDirectory
Expand Down
87 changes: 87 additions & 0 deletions .powershell/createStubsForSection.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
function Create-StubIndexForSection {
param (
[Parameter(Mandatory = $true)]
[array]$sections, # List of sections with slugs, titles, and content

[Parameter(Mandatory = $true)]
[string]$baseFolder # Base folder location to process
)

# Iterate over each section and create the appropriate .md files if they don't exist
foreach ($section in $sections) {
$folderPath = Join-Path $baseFolder $section["slug"]
$filePath = Join-Path $folderPath "index.md"

# Ensure the folder exists
if (-not (Test-Path $folderPath)) {
New-Item -Path $folderPath -ItemType Directory
}

# Only create the index.md file if it doesn't already exist
if (-not (Test-Path $filePath)) {
# Define the content for the .md file with custom card content
$content = @"
---
slug: $($section["slug"])
author: MrHinsh
title: $($section["title"])
aliases:
- $($section["aliases"])
date: $(Get-Date -Format yyyy-MM-dd)
type: methods
card:
title: $($section["title"])
content: $($section["content"])
button:
content: Start Optimizing Now
---

Coming soon!

"@

# Write the content to the index.md file
Set-Content -Path $filePath -Value $content

Write-Host "Created: $filePath"
}
else {
Write-Host "Skipped: $filePath (already exists)"
}
}
}

# Example usage of Create-StubIndexForSection

# Define the list of sections with their corresponding slugs, titles, aliases, and card content
$methods = @(
@{ "slug" = "scrum-framework"; "title" = "Scrum Framework"; "aliases" = "/methods/scrum-framework/"; "content" = "Master the Scrum Framework with our expert-led training. Empower your team to deliver high-value increments and ensure product success through iterative development and continuous feedback." },
@{ "slug" = "kanban-strategy"; "title" = "Kanban Strategy"; "aliases" = "/methods/kanban-strategy/"; "content" = "Optimize your workflow with Kanban strategies tailored for your team. Visualize work, limit work-in-progress, and enhance overall efficiency." },
@{ "slug" = "evidence-based-management"; "title" = "Evidence-Based Management"; "aliases" = "/methods/ebm/"; "content" = "Make data-driven decisions with Evidence-Based Management (EBM). Use metrics to guide your team toward continuous improvement and increased value delivery." },
@{ "slug" = "beta-codex-cell-structure-design"; "title" = "Beta Codex Cell Structure Design"; "aliases" = "/methods/beta-codex-cell-structure-design/"; "content" = "Implement Beta Codex cell structure design to decentralize and scale your organization. Create a flexible, adaptive team structure that promotes innovation." },
@{ "slug" = "open-space-agile"; "title" = "Open Space Agile"; "aliases" = "/methods/open-space-agile/"; "content" = "Harness the power of Open Space Agile to enable dynamic self-organization. Facilitate meaningful discussions and collaborative decision-making across your team." },
@{ "slug" = "one-engineering-system"; "title" = "One Engineering System"; "aliases" = "/methods/one-engineering-system/"; "content" = "Unify your development pipeline with One Engineering System. Ensure seamless collaboration and integration across all engineering teams and workflows." },
@{ "slug" = "liberating-structures"; "title" = "Liberating Structures"; "aliases" = "/methods/liberating-structures/"; "content" = "Unlock creativity and innovation through Liberating Structures. Engage your team in dynamic, inclusive conversations that drive impactful outcomes." }
)

$principles = @(
@{ "slug" = "competence"; "title" = "Competence"; "aliases" = "/principles/competence/"; "content" = "Foster a culture of competence where skills and expertise are continuously developed to drive excellence in every aspect of the organization." },
@{ "slug" = "first-principles-thinking"; "title" = "First Principles Thinking"; "aliases" = "/principles/first-principles-thinking/"; "content" = "Apply First Principles Thinking to break down complex problems and find innovative solutions by understanding the fundamental truths." },
@{ "slug" = "continuous-improvement"; "title" = "Continuous Improvement"; "aliases" = "/principles/continuous-improvement/"; "content" = "Commit to a mindset of Continuous Improvement, always seeking ways to enhance processes, products, and team performance." },
@{ "slug" = "customer-focus"; "title" = "Customer Focus"; "aliases" = "/principles/customer-focus/"; "content" = "Maintain a strong Customer Focus to ensure that the needs and feedback of the customer are at the heart of everything we do." },
@{ "slug" = "innovation"; "title" = "Innovation"; "aliases" = "/principles/innovation/"; "content" = "Encourage Innovation by creating an environment where new ideas and approaches are explored to solve challenges and create value." }
)

$outcomes = @(
@{ "slug" = "increased-team-productivity"; "title" = "Increased Team Productivity"; "aliases" = "/outcomes/increased-team-productivity/"; "content" = "Boost your team's productivity through effective collaboration, streamlined workflows, and enhanced focus on value delivery." },
@{ "slug" = "improved-collaboration"; "title" = "Improved Collaboration"; "aliases" = "/outcomes/improved-collaboration/"; "content" = "Foster improved collaboration across teams and departments, leading to better communication, transparency, and project success." },
@{ "slug" = "faster-delivery-of-value"; "title" = "Faster Delivery of Value"; "aliases" = "/outcomes/faster-delivery-of-value/"; "content" = "Accelerate the delivery of value by adopting agile practices that reduce time-to-market and improve responsiveness to change." },
@{ "slug" = "enhanced-product-quality"; "title" = "Enhanced Product Quality"; "aliases" = "/outcomes/enhanced-product-quality/"; "content" = "Improve product quality by embedding continuous testing, feedback, and iterative development into your product lifecycle." }
)



# Call the function with the methods list and the base folder location
Create-StubIndexForSection -sections $methods -baseFolder "site\content\methods"
Create-StubIndexForSection -sections $principles -baseFolder "site\content\principles"
Create-StubIndexForSection -sections $outcomes -baseFolder "site\content\outcomes"
40 changes: 40 additions & 0 deletions .powershell/ensureAllImagesHaveClass.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Define the directory containing the blog posts
$blogDir = "site\content\resources\blog"

# Recursively find all Markdown files in the blog directory
$markdownFiles = Get-ChildItem -Path $blogDir -Recurse -Filter *.md

# Loop through each markdown file
foreach ($file in $markdownFiles) {
# Read the contents of the markdown file
$content = Get-Content -Path $file.FullName

# Initialize a list to hold the updated content
$updatedContent = @()

# Loop through each line of the content
for ($i = 0; $i -lt $content.Count; $i++) {
$line = $content[$i]

# Check if the line contains an image (starts with ![] and is not already followed by {.post-img})
if ($line -match "!\[.*\]\(.*\)" -and (($i + 1 -lt $content.Count) -and $content[$i + 1] -notmatch "\{.*\.post-img.*\}")) {
# Add the image line
$updatedContent += $line
# Add the {.post-img} line on a new line immediately after the image
$updatedContent += "{ .post-img }"
}
else {
# Otherwise, add the line as is
$updatedContent += $line
}
}

# Write the updated content back to the file if changes were made
if ($updatedContent -ne $content) {
Set-Content -Path $file.FullName -Value $updatedContent
Write-Host "Updated file: $($file.FullName)"
}
else {
Write-Host "No changes made to: $($file.FullName)"
}
}
Loading
Loading