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

Updating the Makefile script on the website to work natively with MacOS. #1417

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion website/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ deps:

# Update all imported markdown files to work as standalone hugo pages (except READMEs, see below)
# sed command is configured for the Netlify ubuntu env
# If you're NOT running this on a mac, you'll need to remove the empty string after -i (line 25)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# If you're NOT running this on a mac, you'll need to remove the empty string after -i (line 25)
# If you're running this on a mac, you'll need to add double quotes after -i in the sed command below: `sed -i "" "1s/^/$$text_to_prepend/" "$$file"; \`

find root -type f -name '*.md' | while IFS= read -r file; do \
base_name=$$(basename "$$file" .md); \
if [ "$$file" = "/_index.md" -o "$$base_name" = "README" ]; then \
continue; \
fi; \
title_case=$$(echo "$$base_name" | sed -e 's/-/ /g' -e 's/\b\(.\)/\u\1/g' | sed 's/cncf/CNCF/Ig'); \
text_to_prepend="---\ntitle: \"$$title_case\"\n---\n"; \
sed -i "1s/^/$$text_to_prepend/" "$$file"; \
sed -i "" "1s/^/$$text_to_prepend/" "$$file"; \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sed -i "" "1s/^/$$text_to_prepend/" "$$file"; \
sed -i "1s/^/$$text_to_prepend/" "$$file"; \

done

# Set up Navbar and Sidebar contents
Expand Down
Loading