Skip to content

Commit 5e3f3b4

Browse files
committed
Sped up typewriter code by putting word lists straight into built pages
1 parent 5d671eb commit 5e3f3b4

File tree

11 files changed

+111
-93
lines changed

11 files changed

+111
-93
lines changed

_includes/head.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@
4141
<link rel="stylesheet" href="css/sidebar.css">
4242

4343
<!-- I know scripts aren't supposed to go in the header, but we need this here in order to pick different suffix lists for the typewriter at the top -->
44-
<script src="./js/suffix-lists.js"></script>
4544
<script lang="javascript">
46-
var suffixOptions = eval("{{ page.title }}".split(" ")[0]).map(function(x) { return x.toUpperCase(); });
45+
var suffixOptions = "{{ page.suffixes }}".split(",").map(function(x) { return x.toUpperCase(); });
4746
</script>
4847

4948
</head>

about.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
2-
title: About
32
layout: default
3+
suffixes:
4+
- Committee,
5+
- Equity,
6+
- History,
7+
- Leadership,
8+
- Publicity,
9+
- Support,
10+
- Us
11+
title: About
412
---
513

614
<h1>{{page.title}}</h1>

activities.html

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
---
2-
title: Activities
32
layout: default
3+
suffixes:
4+
- codecademy,
5+
- CodeCombat,
6+
- CSSDiner,
7+
- CSSTricks,
8+
- FreeCodeCamp,
9+
- git,
10+
- Javascript,
11+
- Udemy,
12+
- #100DaysOfCode,
13+
- AdventOfCode,
14+
- Box-256,
15+
- CodeWars,
16+
- CodinGame,
17+
- Edabit,
18+
- Reddit,
19+
- Jupyter,
20+
- Us
21+
title: Activities
422
---
523

624
<h1>{{page.title}}</h1>

branding.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
2-
title: Branding Guidelines
32
layout: default
3+
suffixes:
4+
- Colours,
5+
- Fonts,
6+
- Icons,
7+
- Logos,
8+
- Us
9+
title: Branding Guidelines
410
---
511

612
<h1>{{page.title}}</h1>

contact.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
---
2-
title: Contact
32
layout: default
3+
suffixes:
4+
- Community,
5+
- Events,
6+
- Forums,
7+
- Friends,
8+
- People,
9+
- Support,
10+
- Workshops,
11+
- Us
12+
title: Contact
413
---
514

615
<link href="https://cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">

events.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
---
2-
title: Events
32
layout: default
3+
suffixes:
4+
- Databases,
5+
- Docker,
6+
- Git,
7+
- SQL,
8+
- Kubernetes,
9+
- Us
10+
title: Events
411
---
512

613
<h1>{{page.title}}</h1>

feedback.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
2-
title: Feedback
32
layout: default
3+
suffixes:
4+
- Change,
5+
- Feedback,
6+
- Improvement,
7+
- Progression,
8+
- Us
9+
title: Feedback
410
---
511

612
<iframe name="feedback" class="feedback-form"

index.html

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,32 @@
11
---
2-
title: Home
32
layout: default
3+
suffixes:
4+
- Ambition,
5+
- Assistance,
6+
- Beginners,
7+
- Confidence,
8+
- Determination,
9+
- Encouragement,
10+
- Experts,
11+
- Friends,
12+
- Guidance,
13+
- Humour,
14+
- Intent,
15+
- Jokes,
16+
- Knowledge,
17+
- Laughter,
18+
- Mastery,
19+
- Novelty,
20+
- Others,
21+
- Purpose,
22+
- Questions,
23+
- Reason,
24+
- Support,
25+
- Trust,
26+
- Understanding,
27+
- Vision,
28+
- Us
29+
title: Home
430
---
531

632
<h1>Welcome to CodeWith!</h1>

js/suffix-lists.js

Lines changed: 2 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,12 @@
11
"use strict"
22

3-
var people = [
4-
"Ben",
5-
"Drew",
6-
"Edward",
7-
"Gareth",
8-
"Harry",
9-
"Jim",
10-
"Liam",
11-
"Liz",
12-
"Keiran",
13-
"Simon",
14-
"Us"
15-
];
16-
17-
var About = people;
18-
var Activities = [
19-
"codecademy",
20-
"CodeCombat",
21-
"CSSDiner",
22-
"CSSTricks",
23-
"FreeCodeCamp",
24-
"git",
25-
"Javascript",
26-
"Udemy",
27-
"#100DaysOfCode",
28-
"AdventOfCode",
29-
"Box-256",
30-
"CodeWars",
31-
"CodinGame",
32-
"Edabit",
33-
"Reddit",
34-
"Jupyter"
35-
];
36-
37-
var Contact = people;
38-
39-
var Events = [
40-
"Databases",
41-
"Docker",
42-
"Git",
43-
"SQL",
44-
"Kubernetes"
45-
];
46-
47-
var Home = people;
48-
49-
var Languages = [
3+
var Error = [
504
"C#",
515
"CSS",
526
"HTML",
537
"Java",
548
"Javascript",
559
"Python",
56-
"SQL"
57-
];
58-
var Error = Languages
59-
60-
61-
var People = [
62-
"Drew",
63-
"Keiran",
10+
"SQL",
6411
"Us"
6512
];
66-
67-
var Resources = [
68-
"AndroidStudio",
69-
"IDLE",
70-
"IntelliJ",
71-
"VisualStudio",
72-
"VSCode",
73-
"Coolors",
74-
"CodePen",
75-
"FontAwesome",
76-
"GoogleFonts",
77-
"Repl"
78-
];
79-
80-
var Branding = [
81-
"Fonts",
82-
"Colours",
83-
"Logos"
84-
]
85-
86-
var Code = [
87-
"Inclusivity",
88-
"Kindness",
89-
"Safety",
90-
"Equality",
91-
"Respect"
92-
]

people.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
---
2-
title: People
32
layout: default
3+
suffixes:
4+
- Drew,
5+
- Keiran,
6+
- Jim,
7+
- Liz,
8+
- Sean,
9+
- Us
10+
title: People
411
---
512

613
<h1>{{page.title}}</h1>

0 commit comments

Comments
 (0)