4747
4848 - name : Generate templates page
4949 run : |
50- cat > github-pages/templates.md << 'EOF '
50+ cat > github-pages/templates.md << 'HEADER '
5151 ---
5252 layout: default
5353 title: Templates
@@ -57,31 +57,25 @@ jobs:
5757 # Templates
5858
5959 Copy these templates to your project and customize them.
60- EOF
60+ HEADER
6161 sed -i 's/^ //' github-pages/templates.md
6262
6363 for file in docs/templates/*.md; do
6464 if [ -f "$file" ]; then
6565 filename=$(basename "$file")
6666 name="${filename%.md}"
67-
68- # Read first line as title (remove # prefix)
6967 title=$(head -1 "$file" | sed 's/^#* *//')
70-
71- # Read second non-empty line as description
7268 desc=$(sed -n '2,10p' "$file" | grep -v '^$' | grep -v '^#' | head -1)
7369
74- cat >> github-pages/templates.md << TEMPLATE
75-
76- ---
77-
78- # # ${title:-$name}
79-
80- ${desc:-Template file for your project.}
81-
82- [View on GitHub](https://github.com/managedcode/MCAF/blob/main/docs/templates/${filename}){ : .btn .btn-primary }
83- [Download](https://raw.githubusercontent.com/managedcode/MCAF/main/docs/templates/${filename}){ : .btn }
84- TEMPLATE
70+ echo "" >> github-pages/templates.md
71+ echo "---" >> github-pages/templates.md
72+ echo "" >> github-pages/templates.md
73+ echo "## ${title:-$name}" >> github-pages/templates.md
74+ echo "" >> github-pages/templates.md
75+ echo "${desc:-Template file for your project.}" >> github-pages/templates.md
76+ echo "" >> github-pages/templates.md
77+ echo "[View on GitHub](https://github.com/managedcode/MCAF/blob/main/docs/templates/${filename}){: .btn .btn-primary }" >> github-pages/templates.md
78+ echo "[Download](https://raw.githubusercontent.com/managedcode/MCAF/main/docs/templates/${filename}){: .btn }" >> github-pages/templates.md
8579 fi
8680 done
8781
0 commit comments