Skip to content

Commit

Permalink
Update page titles (#15)
Browse files Browse the repository at this point in the history
* Created tabTitle to replace "Welcome to Astro."

* Replaced single Question webpages "Welcome to Astro." with exam name followed by question number

* changed tab title for auto generated quesitons tabs

* Replaced solution tab's title with "Solution"
  • Loading branch information
JohnLu2004 authored Jul 29, 2024
1 parent 0ee4c90 commit cb9aa33
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/pages/practice/tag/[tag].astro
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,14 @@ function formatString(input: string) {
}
const title = formatString(randomQuestion.data.path);
const tabTitle = tag
.slice(9)
.replace(/-/g, " ")
.replace(/\b\w/g, (c) => c.toUpperCase());
---

<Layout title="Welcome to Astro.">
<Layout title={tabTitle}>
<div class="Question__bar">
<div>
<Back href={`/questions/${randomQuestion.data.path}`} label="Back" />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/questions/[...path].astro
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const question = await loadQuestion();
const title = formatString(path);
---

<Layout title="Welcome to Astro.">
<Layout title={title + " Question"}>
<div class="Question__bar">
<div><Back href={`/evaluations`} label="Evaluations" /></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/questions/generator/[...path].astro
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const { path } = Astro.params;
const { page } = Astro.props;
---

<Layout title="Welcome to Astro.">
<Layout title="Auto Generated Question">
<div class="Question__bar">
<div><Back href={`/questions/${path}`} label="Back" /></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/questions/solution/[...path].astro
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const loadQuestion = async () => {
const question = await loadQuestion();
---

<Layout title="Welcome to Astro.">
<Layout title="Solution">
<div class="Question__bar">
<div><Back href={`/questions/${path}`} label="Back" /></div>
</div>
Expand Down

0 comments on commit cb9aa33

Please sign in to comment.