init
This commit is contained in:
		@@ -1,9 +1,32 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Helper functions
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					declare -i term_width=120
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					h1() {
 | 
				
			||||||
 | 
					    declare border padding text
 | 
				
			||||||
 | 
					    border='\e[1;34m'"$(printf '=%.0s' $(seq 1 "$term_width"))"'\e[0m'
 | 
				
			||||||
 | 
					    padding="$(printf ' %.0s' $(seq 1 $(((term_width - $(wc -m <<<"$*")) / 2))))"
 | 
				
			||||||
 | 
					    text="\\e[1m$*\\e[0m"
 | 
				
			||||||
 | 
					    echo -e "$border"
 | 
				
			||||||
 | 
					    echo -e "${padding}${text}${padding}"
 | 
				
			||||||
 | 
					    echo -e "$border"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					h2() {
 | 
				
			||||||
 | 
					    printf '\e[1;33m==>\e[37;1m %s\e[0m\n' "$*"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					h1 "Inicjalizacja struktury hugo"
 | 
				
			||||||
hugo new site --force ./
 | 
					hugo new site --force ./
 | 
				
			||||||
 | 
					h1 "Inicjalizacja repozytorium git"
 | 
				
			||||||
git init
 | 
					git init
 | 
				
			||||||
 | 
					h2 "Inicjalizacja submodułu z docsy"
 | 
				
			||||||
git submodule add https://github.com/google/docsy.git themes/docsy
 | 
					git submodule add https://github.com/google/docsy.git themes/docsy
 | 
				
			||||||
echo 'theme = "docsy"' >> config.toml
 | 
					echo 'theme = "docsy"' >> config.toml
 | 
				
			||||||
git submodule update --init --recursive
 | 
					git submodule update --init --recursive
 | 
				
			||||||
 | 
					h1 "Czyszczenie repozytorium"
 | 
				
			||||||
rm init_docsy.sh
 | 
					rm init_docsy.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user