Skip to content

Commit 290a263

Browse files
feat(3.1.0): add landing page title (#475)
2 parents 1633eb1 + 958785d commit 290a263

12 files changed

Lines changed: 937 additions & 726 deletions

File tree

.freeCodeCamp/client/templates/landing.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
.description {
2+
max-width: 750px;
3+
margin-left: auto;
4+
margin-right: auto;
5+
}
6+
17
.blocks {
28
list-style-type: none;
39
display: flex;
@@ -33,7 +39,7 @@
3339
cursor: pointer;
3440
background-color: var(--dark-3);
3541
}
36-
.tags-row{
42+
.tags-row {
3743
display: flex;
3844
}
3945

@@ -49,4 +55,4 @@
4955
width: -webkit-fit-content;
5056
width: -moz-fit-content;
5157
width: fit-content;
52-
}
58+
}

.freeCodeCamp/client/templates/landing.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ export const Landing = ({
1515
freeCodeCampConfig,
1616
locale
1717
}: LandingProps) => {
18+
const title = freeCodeCampConfig.client?.landing?.[locale]?.title;
1819
return (
1920
<>
21+
{title && <h1>{title}</h1>}
2022
<p className='description'>
2123
{freeCodeCampConfig.client?.landing?.[locale]?.description}
2224
</p>

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "create-freecodecamp-os-app"
3-
version = "3.0.0"
3+
version = "3.0.1"
44
edition = "2021"
55
description = "CLI to create the boilerplate for a new freeCodeCamp-OS app"
66
license = "BSD-3-Clause"

cli/src/conf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub struct Assets {
3838

3939
#[derive(Serialize, Deserialize, Debug)]
4040
pub struct Landing {
41+
pub title: String,
4142
pub description: String,
4243
#[serde(rename = "faq-link")]
4344
pub faq_link: Option<String>,

cli/src/fs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl Course {
104104
"author": "",
105105
"license": "MIT",
106106
"dependencies": {
107-
"@freecodecamp/freecodecamp-os": "^3.0.0"
107+
"@freecodecamp/freecodecamp-os": "^3.1.0"
108108
},
109109
"type": "module"
110110
});
@@ -173,6 +173,7 @@ impl Course {
173173
assets: None,
174174
landing: Some(json!({
175175
"english": Landing {
176+
title: "Course title".to_string(),
176177
description: "Course description".to_string(),
177178
faq_link: None,
178179
faq_text: None,

docs/src/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## [3.1.0] - 2024-02-05
4+
5+
### Add
6+
7+
- `client.landing.locale.title` field for landing page `h1`
8+
9+
### Fix
10+
11+
- Give `.description` element a `max-width` of `750px`
12+
- Add `ws` as dependency
13+
314
## [3.0.0] - 2024-02-01
415

516
### Change

docs/src/configuration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ By default, the server and client communicate over port `8080`. To change this,
5454

5555
- `assets.header`: path relative to the root of the course - `string`
5656
- `assets.favicon`: path relative to the root of the course - `string`
57-
- `landing.description`: description of the course shown on the landing page - `string`
57+
- `landing.<locale>.description`: description of the course shown on the landing page - `string`
58+
- `landing.<locale>.title`: title of the course shown on the landing page - `string`
5859
- `landing.<locale>.faq-link`: link to the FAQ page - `string`
5960
- `landing.<locale>.faq-text`: text to display for the FAQ link - `string`
6061
- `static`: static resources to serve - `string | string[] | Record<string, string> | Record<string, string>[]`

0 commit comments

Comments
 (0)