forked from CodeYourFuture/curriculum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_module.sh
executable file
·128 lines (109 loc) · 2.46 KB
/
create_module.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/bash
if [ -z "$1" ]
then
echo "No module name supplied. Usage: ./create_module.sh <module_name>"
exit 1
fi
MODULE_NAME=$1
MODULE_DIR="content/$MODULE_NAME"
SPRINT_DIR="$MODULE_DIR/sprints"
BLOCKS_DIR="$MODULE_DIR/blocks"
PRODUCT_DIR="$MODULE_DIR/product"
mkdir -p $MODULE_DIR
mkdir -p $SPRINT_DIR
mkdir -p $BLOCKS_DIR
mkdir -p $PRODUCT_DIR
echo "+++
title = '$MODULE_NAME'
description = 'The plan for $MODULE_NAME'
layout = 'module'
emoji= '📚'
menu = ['syllabus']
+++
" > $MODULE_DIR/_index.md
FILES=("prep" "backlog" "success")
MENU_ORDER=1
for file in "${FILES[@]}"; do
mkdir -p $MODULE_DIR/$file
echo "+++
title = '$file'
description = '$file description'
layout = '$file'
emoji= '📝'
menu_level = ['module']
weight = $MENU_ORDER
backlog= 'Module-$MODULE_NAME'
backlog_filter= '$MODULE_NAME'
+++
" > $MODULE_DIR/$file/index.md
MENU_ORDER=$((MENU_ORDER + 5))
done
for i in {1..4}; do
SPRINT_NAME="$i"
SPRINT_PATH="$SPRINT_DIR/$SPRINT_NAME"
mkdir -p $SPRINT_PATH
echo "+++
title = 'Sprint $i'
description = 'The plan for the week'
layout = 'sprint'
emoji= '⏱️'
menu_level = ['module']
weight = $((i + 1))
+++
" > $SPRINT_PATH/_index.md
SPRINT_FILES=("prep" "backlog" "day-plan" "success")
MENU_ORDER=1
for file in "${SPRINT_FILES[@]}"; do
mkdir -p $SPRINT_PATH/$file
echo "+++
title = '$file'
layout = '$file'
emoji= '📝'
menu_level = ['sprint']
weight = $MENU_ORDER
backlog= 'Module-$MODULE_NAME'
backlog_filter= 'Week $i'
+++
" > $SPRINT_PATH/$file/index.md
MENU_ORDER=$((MENU_ORDER + 1))
done
done
BLOCKS=("block1" "block2" "block3")
for block in "${BLOCKS[@]}"; do
mkdir -p $BLOCKS_DIR/$block
echo "+++
title = '$block'
headless = true
time = 30
facilitation = false
emoji= '🧩'
[objectives]
1='Use the Teach Tech Together guide to construct your objectives'
2='Limit the objectives to 3-5 items'
3='Write objectives you can measure'
+++
" > $BLOCKS_DIR/$block/index.md
done
PRODUCT_FILES=("plan" "build" "test" "ship")
echo "+++
title = 'Product'
description = 'Product description'
layout = 'product'
emoji= '🎁'
menu_level = ['module']
+++
" > $PRODUCT_DIR/_index.md
MENU_ORDER=1
for product_file in "${PRODUCT_FILES[@]}"; do
mkdir -p $PRODUCT_DIR/$product_file
echo "+++
title = '$product_file'
description = '$product_file description'
layout = '$product_file'
menu_level = ['product']
emoji= '🎁'
weight = $MENU_ORDER
+++
" > $PRODUCT_DIR/$product_file/index.md
MENU_ORDER=$((MENU_ORDER + 1))
done