Skip to content

Commit 38065a3

Browse files
Add preview banner
1 parent 8e97753 commit 38065a3

File tree

8 files changed

+30
-12
lines changed

8 files changed

+30
-12
lines changed

articles/introduction/article.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
title: "Introduction"
22
content: "article.md"
33
author: "MTA Team"
4-
date: "2025-01-01 12:00:00"
4+
date: "January 1, 2025"
55
revisions: []
66
assets: []
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
title: "Getting Started"
22
content: "article.md"
33
author: "MTA Team"
4-
date: "2025-01-01 12:00:00"
4+
date: "January 1, 2025"
55
revisions: []
66
assets: []

articles/privacy/article.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
title: "Privacy policy"
22
content: "article.md"
33
author: "MTA Team"
4-
date: "2025-01-01 12:00:00"
4+
date: "January 1, 2025"
55
revisions: []
66
assets: []

web/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ pip install -r requirements.txt
2626

2727
### Usage
2828

29-
Depending on your operating system, you can run the following commands:
29+
Depending on your operating system, you can run the following commands to build and serve the wiki website.
30+
31+
You may keep `server_web` running in the background (in another terminal) and rebuild the website with `build_web` whenever you make changes.
3032

3133
#### Linux
3234

web/resources/article.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
{{ article.html_content }}
12

2-
<div style="float:right; text-align:right;">
3-
<p><strong>{{ article.title }}</strong></p>
4-
<p style="color: #b5b5b5;"><em>{{ article.author }}</em><br>{{ article.date }}</p>
3+
<div style="text-align: left; font-size: 0.8em; color: #b5b5b5; margin-top: 4em;">
4+
<div>Article: <strong>{{ article.title }}</strong></div>
5+
<div style="margin-top: 0.5em;">Written by <em>{{ article.author }}</em> on {{ article.date }}</div>
56
</div>
6-
7-
{{ article.html_content }}

web/resources/assets/style.css

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,22 @@ header {
119119
opacity: 0.8;
120120
}
121121
#logo-wrapper {
122-
max-width: 1080px;
123-
padding: 2em;
122+
height: 64px;
123+
position: relative;
124+
padding: 16px;
124125
margin: 0 auto;
125126
}
127+
.preview-badge {
128+
position: absolute;
129+
top: 10px;
130+
left: 16px;
131+
color: #fff;
132+
padding: 0.25em 0.5em;
133+
font-size: 0.75em;
134+
font-weight: bold;
135+
background-color: rgba(255, 115, 0, 0.8);
136+
border-radius: 0.25em;
137+
}
126138

127139
.function-type-title {
128140
float: right;

web/resources/layout.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@
6464

6565
<header>
6666
<div id="logo-wrapper">
67-
<a href="/"><img id="logo" src="/assets/wikilogo.png" alt="Multi Theft Auto" /></a>
67+
<a href="/"><img id="logo" src="/assets/wikilogo.png" alt="Multi Theft Auto"/></a>
68+
{% if preview_mode %}
69+
<div class="preview-badge">Preview</div>
70+
{% endif %}
71+
6872
</div>
6973
</header>
7074

web/scripts/builder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def parse_function_preview_images(self, function):
181181

182182
def render_page(self, title, content):
183183
return self.layout_template.render(
184+
preview_mode = os.environ.get('CI_PREVIEW', True),
184185
year = date.today().year,
185186
title = title,
186187
navigation = self.navigation,

0 commit comments

Comments
 (0)