File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040 git diff --staged --quiet || git commit -m "Bump version to ${{ steps.version.outputs.VERSION }} [skip ci]"
4141 git push
4242
43+ - name : Add version and build date to config
44+ run : |
45+ echo "version: \"${{ steps.version.outputs.VERSION }}\"" >> github-pages/_config.yml
46+ echo "build_date: \"$(date +'%Y-%m-%d')\"" >> github-pages/_config.yml
47+
48+ - name : Generate templates page
49+ run : |
50+ cat > github-pages/templates.md << 'EOF'
51+ ---
52+ layout: default
53+ title: Templates
54+ nav_order: 2
55+ ---
56+
57+ # Templates
58+
59+ Copy these templates to your project and customize them.
60+ EOF
61+ sed -i 's/^ //' github-pages/templates.md
62+
63+ for file in docs/templates/*.md; do
64+ if [ -f "$file" ]; then
65+ filename=$(basename "$file")
66+ name="${filename%.md}"
67+
68+ # Read first line as title (remove # prefix)
69+ title=$(head -1 "$file" | sed 's/^#* *//')
70+
71+ # Read second non-empty line as description
72+ desc=$(sed -n '2,10p' "$file" | grep -v '^$' | grep -v '^#' | head -1)
73+
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
85+ fi
86+ done
87+
4388 - name : Copy README to github-pages with TOC
4489 run : |
4590 # Front matter
Original file line number Diff line number Diff line change 8585 < div class ="footer-container ">
8686 < p > {{ site.title }} © {{ 'now' | date: '%Y' }} < a href ="https://managed-code.com "> ManagedCode</ a > </ p >
8787 < p > Licensed under < a href ="https://creativecommons.org/licenses/by/4.0/ " rel ="noopener "> CC BY 4.0</ a > </ p >
88+ < p class ="footer-version "> v{{ site.version }} · {{ site.build_date }}</ p >
8889 </ div >
8990 </ footer >
9091
92+ < script >
93+ document . querySelectorAll ( '.toc a' ) . forEach ( link => {
94+ link . addEventListener ( 'click' , function ( e ) {
95+ e . preventDefault ( ) ;
96+ const text = this . textContent . trim ( ) . toLowerCase ( ) ;
97+ const headings = document . querySelectorAll ( 'h2' ) ;
98+ for ( const h of headings ) {
99+ if ( h . textContent . toLowerCase ( ) . includes ( text ) ) {
100+ h . scrollIntoView ( { behavior : 'smooth' , block : 'start' } ) ;
101+ break ;
102+ }
103+ }
104+ } ) ;
105+ } ) ;
106+ </ script >
91107</ body >
92108</ html >
Original file line number Diff line number Diff line change @@ -400,6 +400,12 @@ hr {
400400 color : # 785D8F ;
401401}
402402
403+ .footer-version {
404+ font-size : 12px ;
405+ color : # 9992a1 ;
406+ margin-top : 8px ;
407+ }
408+
403409/* Responsive */
404410@media (max-width : 768px ) {
405411 .nav {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments