Skip to content

Commit

Permalink
fixed issue referencing project-docs layout
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronBrooks11 committed Jan 14, 2025
1 parent afcd775 commit 86bf6d1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ platforms :mingw, :x64_mingw, :mswin, :jruby do
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
#gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
Expand Down
7 changes: 2 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ GEM
faraday-net_http (>= 2.0, < 3.2)
faraday-net_http (3.1.0)
net-http
ffi (1.16.3)
ffi (1.16.3-x64-mingw-ucrt)
ffi (1.17.1-x64-mingw-ucrt)
ffi (1.17.1-x86_64-linux-gnu)
forwardable-extended (2.6.0)
gemoji (4.1.0)
github-pages (231)
Expand Down Expand Up @@ -270,10 +270,8 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.9.1)
unf_ext (0.0.9.1-x64-mingw-ucrt)
unicode-display_width (1.8.0)
uri (0.13.0)
wdm (0.1.1)

PLATFORMS
x64-mingw-ucrt
Expand All @@ -287,7 +285,6 @@ DEPENDENCIES
just-the-docs
tzinfo (>= 1, < 3)
tzinfo-data
wdm (~> 0.1.1)

BUNDLED WITH
2.5.10
15 changes: 9 additions & 6 deletions sync_docs.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash

# Set layout type for README.md files (can be easily changed)
# Set layout type for README.md files (project index)
LAYOUT_TYPE="page"

# Set layout type for documentation files in the docs folder
DOCS_LAYOUT_TYPE="page"

# Force submodule update (set to true to force changes)
FORCE_SUBMODULE_UPDATE=true

Expand All @@ -27,25 +30,25 @@ for project in _projects/*; do
if [ -f "$project/README.md" ]; then
readme_file="$project/README.md"
readme_title=$(basename "$project" | sed -e 's/-/ /g' -e 's/\b\(.\)/\u\1/g')

# Check if front matter exists in the README
if ! grep -q "^---" "$readme_file"; then
# Add front matter with the proper permalink, title, and layout type
echo -e "---\nlayout: $LAYOUT_TYPE\ntitle: \"$readme_title\"\npermalink: /projects/$(basename "$project")/\n---\n$(cat "$readme_file")" > "$readme_file"
fi
fi

# Process each markdown file in docs
find "$project/docs" -name "*.md" | while read -r file; do
# Extract relative path from the docs folder and generate a URL-friendly title
relative_path=${file#"$project/docs/"}
filename=$(basename "$relative_path" .md)
title=$(echo "$filename" | sed -e 's/-/ /g' -e 's/\b\(.\)/\u\1/g')

# Check if front matter exists
if ! grep -q "^---" "$file"; then
# Add front matter with a proper permalink and title
echo -e "---\nlayout: project-docs\ntitle: \"$title\"\npermalink: /projects/$(basename "$project")/docs/${relative_path%.md}/\n---\n$(cat "$file")" > "$file"
# Add front matter with a proper permalink, title, and docs layout type
echo -e "---\nlayout: $DOCS_LAYOUT_TYPE\ntitle: \"$title\"\npermalink: /projects/$(basename "$project")/docs/${relative_path%.md}/\n---\n$(cat "$file")" > "$file"
fi
done
fi
Expand Down

0 comments on commit 86bf6d1

Please sign in to comment.