1
+
1
2
# Flask Community Workgroup
2
3
3
4
## Setup Instructions
4
5
5
- 1 . ** Fork the repository **
6
- [ Fork the repo] ( https://github.com/flaskcwg/flaskcwg.github.io/fork )
6
+ ### 1. ** Fork the Repository **
7
+ - [ Fork the repo] ( https://github.com/flaskcwg/flaskcwg.github.io/fork ) to your GitHub account.
7
8
8
- 2 . ** Clone your fork**
9
+ ### 2. ** Clone Your Fork**
10
+ - Clone your fork to your local machine:
9
11
``` bash
10
12
git clone https://github.com/{username}/flaskcwg.github.io.git
11
13
cd flaskcwg.github.io
12
14
```
13
15
14
- 3. ** Set up upstream remote**
16
+ # ## 3. **Set Up Upstream Remote**
17
+ - Add the original repository as an upstream remote:
15
18
` ` ` bash
16
19
git remote add upstream https://github.com/flaskcwg/flaskcwg.github.io.git
17
20
` ` `
18
21
19
- 4. ** Create and activate a virtual environment **
22
+ # ## 4. **Create and Activate a Virtual Environment **
20
23
21
- - ** Linux/Mac** :
22
- ` ` ` bash
23
- python -m venv env
24
- source env/bin/activate
25
- ` ` `
24
+ - ** Linux/Mac** :
25
+ ` ` ` bash
26
+ python -m venv env
27
+ source env/bin/activate
28
+ ` ` `
26
29
27
- - ** Windows** :
28
- ` ` ` bash
29
- py -m venv env
30
- env\S cripts\a ctivate.bat # Command Prompt
31
- # Or for Bash:
32
- source env/Scripts/activate
33
- ` ` `
30
+ - ** Windows** :
31
+ ` ` ` bash
32
+ py -m venv env
33
+ env\S cripts\a ctivate.bat # For Command Prompt
34
+ # Or for Bash:
35
+ source env/Scripts/activate
36
+ ` ` `
34
37
35
- 5. ** Install dependencies**
38
+ # ## 5. **Install Dependencies**
39
+ - Install the required dependencies:
36
40
` ` ` bash
37
41
python -m pip install -r requirements.txt
38
42
` ` `
39
43
40
- 6. ** Build the HTML content**
44
+ # ## 6. **Build the HTML Content**
45
+ - Run the ` static.py` script to generate the HTML content:
41
46
` ` ` bash
42
47
python static.py
43
48
` ` `
44
49
45
- 7. ** Serve the site**
50
+ # ## 7. **Serve the Site**
51
+ - Serve the site locally:
46
52
` ` ` bash
47
53
cd docs
48
54
python serve.py
49
55
` ` `
50
- Access the site at the displayed IP address.
56
+ - Access the site at the IP address displayed in the terminal .
51
57
52
- 8. ** View template changes**
53
- To reflect updates in [` /templates` ](/templates), re-run ` python static.py` in a separate terminal, then refresh the browser.
58
+ # ## 8. **View Template Changes**
59
+ - To apply changes made in the ` /templates` directory:
60
+ - Re-run ` python static.py` in a separate terminal.
61
+ - Refresh the browser to see the updates.
62
+
63
+ ---
54
64
55
65
# # Production Workflow
56
66
57
- Pull requests are merged into the source branch, which is automatically deployed to the ` gh-pages` branch.
67
+ Pull requests are merged into the ` source` branch, which is automatically deployed to the ` gh-pages` branch.
68
+
69
+ ---
58
70
59
- # # How to add a new page?
71
+ # # How to Add a New Page
60
72
61
- In ` static.py` , under ` generate` , add another ` generate` function :
73
+ In the ` static.py` file , under the ` generate` function , add another ` generate` call, for example :
62
74
63
75
` ` ` python
64
76
def main(args):
65
77
def gen ():
66
78
generate(' index.html' , join(settings.OUTPUT_FOLDER, ' index.html' ), ** context)
79
+ generate(' source_file.html' , join(settings.OUTPUT_FOLDER, ' output_file.html' ), ** context)
67
80
` ` `
68
81
69
82
Like this:
@@ -127,15 +140,15 @@ For translation, you have lang and coordinator, the latter being optional.
127
140
" Some more lines" ],
128
141
` ` `
129
142
130
- ** retired:** If someomne is active or not.
143
+ ** retired:** If someone is active or not.
131
144
132
145
Links are generated as links with text as the key and link as the value.
133
146
134
147
# ## Blog post
135
148
136
149
A blog post occurs in the format:
137
150
138
- ` ` ` ` md
151
+ ` ` ` ` markdown
139
152
title: Demo blog post
140
153
summary: A demo post
141
154
authors: jugmac00
@@ -154,9 +167,9 @@ def x():
154
167
And hence [link demo](https://flaskcwg.github.io)
155
168
````
156
169
157
- All meta keys are mandatory but summary can be kept empty
170
+ All meta keys are mandatory but summary can be kept empty.
158
171
159
- Inside of ` data/blog` create a folder with the category you want. In ` settings.py` add it
172
+ Inside of ` data/blog` create a folder with the category you want. In ` settings.py` add it:
160
173
161
174
` ` ` python
162
175
BLOG_CATEGORIES = [
@@ -181,10 +194,9 @@ For authors, the author must occur in profiles.
181
194
182
195
In ` data/faq` , create a ` .md` file with whatever name you want ` .md`
183
196
184
- The content should look like this
185
-
197
+ The content should look like this:
186
198
187
- ` ` ` ` md
199
+ ` ` ` ` markdown
188
200
title: Demo faq question
189
201
tags: demo
190
202
flask
0 commit comments