Skip to content

Commit

Permalink
keep path md
Browse files Browse the repository at this point in the history
  • Loading branch information
brown9804 authored Jan 13, 2025
1 parent 8c84792 commit d51d408
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/md-html-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ jobs:
- name: Install pandoc
run: sudo apt-get install -y pandoc

# Step 5: Convert all Markdown files to HTML
# Step 5: Convert all Markdown files to HTML while preserving directory structure
- name: Convert Markdown to HTML
run: |
mkdir -p _site # Create the _site directory if it doesn't exist
# Find all Markdown files and convert them to HTML
# Find all Markdown files and convert them to HTML, preserving directory structure
find . -name "*.md" -type f | while read file; do
pandoc "$file" --standalone --toc -o "_site/$(basename "${file%.md}.html")"
# Create the corresponding directory in _site
mkdir -p "_site/$(dirname "$file")"
# Convert the Markdown file to HTML and save it in the corresponding directory
pandoc "$file" --standalone --toc -o "_site/${file%.md}.html"
done
# Step 6: Deploy the generated HTML files to GitHub Pages
Expand Down

0 comments on commit d51d408

Please sign in to comment.