From 22c54f54ca0ca9ac8a6ad4b3d9d1e2253f621adf Mon Sep 17 00:00:00 2001 From: Leon Bowie Date: Fri, 29 Mar 2024 15:53:30 +1300 Subject: [PATCH 01/18] chore: cleanup style --- astro.config.mjs | 99 ++++++++----- src/components/Button.astro | 62 ++++++++ src/components/Landing/Card.astro | 53 +++++++ src/components/Landing/ListCard.astro | 51 +++++++ src/components/Landing/SplitCard.astro | 50 +++++++ src/components/ScriptWorkaround.astro | 1 + src/components/about-tuhura.astro | 39 ----- src/components/starlight/Hero.astro | 137 ++++++++++++++++++ src/content/docs/404.md | 13 ++ .../docs/guides/cybersecurity/competitions.md | 5 +- .../docs/guides/cybersecurity/index.md | 6 + .../guides/cybersecurity/sql-injection.md | 2 + .../guides/game-design/{about.md => index.md} | 1 - .../docs/guides/{about.md => index.md} | 0 .../javascript/{setting-up.mdx => index.mdx} | 3 +- src/content/docs/index.mdx | 74 ++++++---- src/content/docs/ncea/{about.md => index.md} | 0 src/javascript/utils.js | 64 ++++++++ src/styles/custom.css | 36 +++++ src/tailwind.css | 4 - tailwind.config.cjs | 16 -- 21 files changed, 582 insertions(+), 134 deletions(-) create mode 100644 src/components/Button.astro create mode 100644 src/components/Landing/Card.astro create mode 100644 src/components/Landing/ListCard.astro create mode 100644 src/components/Landing/SplitCard.astro create mode 100644 src/components/ScriptWorkaround.astro delete mode 100644 src/components/about-tuhura.astro create mode 100644 src/components/starlight/Hero.astro create mode 100644 src/content/docs/404.md create mode 100644 src/content/docs/guides/cybersecurity/index.md rename src/content/docs/guides/game-design/{about.md => index.md} (95%) rename src/content/docs/guides/{about.md => index.md} (100%) rename src/content/docs/guides/javascript/{setting-up.mdx => index.mdx} (99%) rename src/content/docs/ncea/{about.md => index.md} (100%) create mode 100644 src/javascript/utils.js create mode 100644 src/styles/custom.css delete mode 100644 src/tailwind.css delete mode 100644 tailwind.config.cjs diff --git a/astro.config.mjs b/astro.config.mjs index 9b268755..16b7b202 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,39 +1,30 @@ import starlight from '@astrojs/starlight'; -import tailwind from '@astrojs/tailwind'; import { defineConfig } from 'astro/config'; import starlightLinksValidator from 'starlight-links-validator' -export const locales = { - root: { - label: 'English', - lang: 'en' // lang is required for root locales - }, - mi: { - label: 'Māori', - lang: 'mi' - } -}; -const site = 'https://wiki.tuhuratech.org.nz/'; - - -// https://astro.build/config export default defineConfig({ - site, + site: 'https://wiki.tuhuratech.org.nz/', integrations: [starlight({ title: 'Wiki', + description: 'A collection of guides and resources for learning technology targeted towards rangatahi and kura in Aotearoa', logo: { light: './src/assets/logo-light.png', dark: './src/assets/logo-dark.png', replacesTitle: true }, + lastUpdated: true, + editLink: { + baseUrl: 'https://github.com/Tuhura-Tech/Wiki/blob/main/' + }, social: { mastodon: 'https://mastodon.nzoss.nz/@tuhuratech', github: 'https://github.com/Tuhura-Tech/Wiki', discord: 'https://discord.gg/PNxh7cwKfQ' }, - editLink: { - baseUrl: 'https://github.com/Tuhura-Tech/Wiki/blob/main/' - }, + customCss: [ + // Relative path to your custom CSS file + './src/styles/custom.css', + ], sidebar: [{ label: 'Guides', items: [{ @@ -41,34 +32,43 @@ export default defineConfig({ link: 'guides/about' }, { label: "Javascript", - collapsed: true, items: [{ label: "Setting Up", link: 'guides/javascript/setting-up' }, { label: "Creative Coding", - collapsed: true, autogenerate: { directory: 'guides/javascript/creative-coding' } }] }, - { label: "Python", collapsed: true, autogenerate: { directory: 'guides/python' } }, + { + label: "Python", items: [{ + label: "Setting Up", + link: 'guides/python' + }, { + label: "Setting Up", + link: 'guides/python/setting-up' + }, { + label: "Flask", + autogenerate: { + directory: 'guides/python/flask' + } + }] + }, { label: "Git", - collapsed: true, autogenerate: { directory: 'guides/git' } }, { label: "Cybersecurity", - collapsed: true, + autogenerate: { directory: 'guides/cybersecurity' } }, { label: "Game Design", - collapsed: true, items: [{ label: "About", link: 'guides/game-design/about' @@ -81,7 +81,6 @@ export default defineConfig({ }, { label: "SQL", - collapsed: true, autogenerate: { directory: 'guides/sql' } @@ -93,16 +92,27 @@ export default defineConfig({ link: 'ncea/about' }, { label: "NCEA Level 2", - collapsed: true, - autogenerate: { - directory: 'ncea/level-2' - } + items: [{ + label: "About", + link: 'ncea/level-2' + }, { + label: "Flask", + autogenerate: { + directory: 'ncea/level-2/flask' + } + }] }, { label: "NCEA Level 3", - collapsed: true, - autogenerate: { - directory: 'ncea/level-3' - } + items: [{ + label: "About", + link: 'ncea/level-3' + }, { + label: "Flask", + + autogenerate: { + directory: 'ncea/level-3/flask' + } + }] }] }, { label: "Tuhura Tech Resources", @@ -110,7 +120,17 @@ export default defineConfig({ directory: 'tuhura-tech' } }], - locales, + locales: { + root: { + label: 'English', + lang: 'en' // lang is required for root locales + }, + + mi: { + label: 'Māori', + lang: 'mi' + } + }, favicon: '/images/favicon.svg', head: [ // Add ICO favicon fallback for Safari. @@ -123,14 +143,13 @@ export default defineConfig({ } }], plugins: [starlightLinksValidator()], - }), tailwind({ - // Disable the default base styles: - applyBaseStyles: false - }),], + components: { + Hero: './src/components/starlight/Hero.astro', + }, + })], image: { service: { entrypoint: 'astro/assets/services/sharp' } } - }); diff --git a/src/components/Button.astro b/src/components/Button.astro new file mode 100644 index 00000000..1d41f995 --- /dev/null +++ b/src/components/Button.astro @@ -0,0 +1,62 @@ +--- +import { Icon } from '@astrojs/starlight/components'; +import { z } from 'astro/zod'; +type IconName = Parameters[0]['name']; + +interface Props { + variant: 'primary' | 'secondary' | 'minimal'; + link: string; + icon?: undefined | { type: 'icon'; name: IconName } | { type: 'raw'; html: string }; +} + +const propsSchema = z.object({ + variant: z.enum(['primary', 'secondary', 'minimal']).default('primary'), + link: z.string(), + icon: z + .union([ + z.object({ type: z.literal('icon'), name: z.custom(z.string().parse) }), + z.object({ type: z.literal('raw'), html: z.string() }), + ]) + .optional(), +}); + +const { link, variant, icon } = propsSchema.parse(Astro.props); +--- + + + + {icon?.type === 'icon' && } + {icon?.type === 'raw' && } + + + \ No newline at end of file diff --git a/src/components/Landing/Card.astro b/src/components/Landing/Card.astro new file mode 100644 index 00000000..5ad95501 --- /dev/null +++ b/src/components/Landing/Card.astro @@ -0,0 +1,53 @@ +--- +import { Card as StarlightCard } from "@astrojs/starlight/components"; +export type Props = Parameters[0]; +--- + +
+ +
+ + diff --git a/src/components/Landing/ListCard.astro b/src/components/Landing/ListCard.astro new file mode 100644 index 00000000..8536137e --- /dev/null +++ b/src/components/Landing/ListCard.astro @@ -0,0 +1,51 @@ +--- +import Card from './Card.astro'; +export type Props = Parameters[0]; +--- + + + + + + \ No newline at end of file diff --git a/src/components/Landing/SplitCard.astro b/src/components/Landing/SplitCard.astro new file mode 100644 index 00000000..30e6a04b --- /dev/null +++ b/src/components/Landing/SplitCard.astro @@ -0,0 +1,50 @@ +--- +import { Card } from "@astrojs/starlight/components"; + +export type Props = Parameters[0]; +--- + +
+ +
+ +
+
+
+ + diff --git a/src/components/ScriptWorkaround.astro b/src/components/ScriptWorkaround.astro new file mode 100644 index 00000000..761053b3 --- /dev/null +++ b/src/components/ScriptWorkaround.astro @@ -0,0 +1 @@ + diff --git a/src/components/about-tuhura.astro b/src/components/about-tuhura.astro deleted file mode 100644 index 34afdddc..00000000 --- a/src/components/about-tuhura.astro +++ /dev/null @@ -1,39 +0,0 @@ ---- -import { Image } from "astro:assets"; -import logoIcon from "./../assets/logo.svg"; - -interface Props { - title: string; -} - -const { title } = Astro.props; ---- - -
- - {title} - Tūhura Tech - - -
- - diff --git a/src/components/starlight/Hero.astro b/src/components/starlight/Hero.astro new file mode 100644 index 00000000..0bef613c --- /dev/null +++ b/src/components/starlight/Hero.astro @@ -0,0 +1,137 @@ +--- +import type { Props } from "@astrojs/starlight/props"; +import Button from "../Button.astro"; + +const { hero } = Astro.props.entry.data; +const { title, tagline, actions } = hero!; +--- + +
+
+
+
+

+

+

+
+ { + actions.map(({ link, icon, text, variant }) => ( +
+
+
+ + diff --git a/src/content/docs/404.md b/src/content/docs/404.md new file mode 100644 index 00000000..17ab03cc --- /dev/null +++ b/src/content/docs/404.md @@ -0,0 +1,13 @@ +--- +title: Not found +template: splash +editUrl: false +hero: + title: '404' + tagline: Houston, we have a problem. We couldn’t find that page.
Check the URL or try using the search bar. + actions: + - text: Go home + icon: right-arrow + link: / + variant: primary +--- \ No newline at end of file diff --git a/src/content/docs/guides/cybersecurity/competitions.md b/src/content/docs/guides/cybersecurity/competitions.md index 77a2cf28..ed486495 100644 --- a/src/content/docs/guides/cybersecurity/competitions.md +++ b/src/content/docs/guides/cybersecurity/competitions.md @@ -1,6 +1,8 @@ --- title: Competition Resources description: Gives a good source of resources for CTFs and the various NZ CTFs out there +sidebar: + order: 2 --- Cybersecurity competitions are a great way to learn and practice your skills in a safe and legal environment. These competitions are normally organized by universities, companies, and CTF teams and have a range of challenges suiting different skill levels and interests. Named CTFs (Capture the Flag), each of the challenges in the competition has a mock realistic scenario and a flag that you need to find. The flag is usually a string of characters that you need to submit to the competition's website to get points. The team with the most points at the end of the competition wins. @@ -18,9 +20,8 @@ The most common category of CTFs is Jeopardy, as these have the most variety of ### Good CTFs -- [Aotearoa CTF](https://aotearoactf.com/) - Aotearoa CTF is a New Zealand based CTF competition with a focus on secondary and tertiary students. It is organized by us, ([Tūhura Tech](https://tuhuratech.org.nz)) and is designed to be beginner-friendly. +- [DUCTF](https://downunderctf.com) - DownUnderCTF is a world-wide Capture The Flag (CTF) competition targeted at Australian and Aotearoa secondary and tertiary students. - [NZCSC](https://cybersecuritychallenge.org.nz) - The New Zealand Cyber Security Challenge is organized by the University of Waikato and is designed to be beginner-friendly. It has an online Round 0 qualification round and two in person rounds along with some talks at the University of Waikato. -- [DUCTF](https://downunderctf.com) - DownUnderCTF is a world-wide Capture The Flag (CTF) competition targeted at Australian secondary and tertiary students. - [PicoCTF](https://picoctf.com/) - This is an international CTF competition for high school students. It is a great way to get started in CTFs and learn the basics of cybersecurity. The challenges are very beginner-friendly, and they have a range of resources on their website. ## CTFs (Attack/Defense) diff --git a/src/content/docs/guides/cybersecurity/index.md b/src/content/docs/guides/cybersecurity/index.md new file mode 100644 index 00000000..950bd0a3 --- /dev/null +++ b/src/content/docs/guides/cybersecurity/index.md @@ -0,0 +1,6 @@ +--- +title: Javascript +description: A simple website built using flask +sidebar: + order: 1 +--- \ No newline at end of file diff --git a/src/content/docs/guides/cybersecurity/sql-injection.md b/src/content/docs/guides/cybersecurity/sql-injection.md index 875da1a3..412e047e 100644 --- a/src/content/docs/guides/cybersecurity/sql-injection.md +++ b/src/content/docs/guides/cybersecurity/sql-injection.md @@ -1,6 +1,8 @@ --- title: SQL Injection description: Simple introduction to injecting SQL into a website +sidebar: + order: 3 --- SQL injection is one of the most common web vulnerabilities. diff --git a/src/content/docs/guides/game-design/about.md b/src/content/docs/guides/game-design/index.md similarity index 95% rename from src/content/docs/guides/game-design/about.md rename to src/content/docs/guides/game-design/index.md index 20efc038..9f99de62 100644 --- a/src/content/docs/guides/game-design/about.md +++ b/src/content/docs/guides/game-design/index.md @@ -3,7 +3,6 @@ title: Intro description: Brief overview of game design sidebar: - # Make this always the first order: 1 --- diff --git a/src/content/docs/guides/about.md b/src/content/docs/guides/index.md similarity index 100% rename from src/content/docs/guides/about.md rename to src/content/docs/guides/index.md diff --git a/src/content/docs/guides/javascript/setting-up.mdx b/src/content/docs/guides/javascript/index.mdx similarity index 99% rename from src/content/docs/guides/javascript/setting-up.mdx rename to src/content/docs/guides/javascript/index.mdx index 7b7372d2..bb1adfa2 100644 --- a/src/content/docs/guides/javascript/setting-up.mdx +++ b/src/content/docs/guides/javascript/index.mdx @@ -1,7 +1,8 @@ --- title: Setting Up description: This is how to set up a JavaScript environment. -order: -1 +sidebar: + order: 1 --- diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx index 7a605a83..db5917ae 100644 --- a/src/content/docs/index.mdx +++ b/src/content/docs/index.mdx @@ -1,45 +1,57 @@ --- title: Tūhura Tech Wiki description: Free and public resources from Tūhura Tech for NZ Students. -template: splash +editUrl: false +tableOfContents: false +lastUpdated: false +next: false hero: - tagline: Supporting the next generation of students! - image: - file: ../../assets/logo.svg + title: Tūhura Tech Wiki + tagline: | +
+ Supporting the next generation of + RANGATAHI. +
actions: - - text: Our guides - link: ./guides/about - icon: right-arrow - variant: primary - - text: Our Website + - text: About Us link: https://tuhuratech.org.nz icon: external --- -import { Card, CardGrid } from "@astrojs/starlight/components"; -import AboutTuhura from "../../components/about-tuhura.astro"; +import { CardGrid } from "@astrojs/starlight/components"; +import Card from '/src/components/Landing/Card.astro' +import ListCard from '/src/components/Landing/ListCard.astro' +import SplitCard from '/src/components/Landing/SplitCard.astro' +import ScriptWorkaround from "/src/components/ScriptWorkaround.astro"; -## Resorces - - - - A collection of curated and supported resources by the Tūhura Tech and our - partner schools to support NCEA DigiTech. - - - Guides on getting started in python, cybersecurity, 3D Printing and more. - - - Cool projects and guides created by staff and students. + + {/* + Explore [Astro starter themes](https://astro.build/themes/) for blogs, portfolios, docs, landing pages, SaaS, marketing, ecommerce sites, and more! - - Resources for how we run our sessions. - - - -Tūhura Tech is a Aotearoa based charity focused on technology education. + + Complete our introductory [Build a Blog Tutorial](/en/tutorial/0-introduction/) to learn the basics and create your first Astro site. + */} -[About Tūhura Tech](https://tuhuratech.org.nz/) + + - [Python](/guides/python) + - [Javascript](/guides/javascript) + - [Game Development](/guides/game-design) + - [CyberSecurity](/guides/cybersecurity) + + + + - [NCEA Level 2 Flask](/ncea/lvl-2/flask) + - [NCEA Level 3 Flask](/ncea/lvl-3/flask) + + + + All of our resources are free and open source. We aim to provide the best resources for students in Aotearoa. They are licenced under a [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) ensuring they are free for all and never behind a paywall. + + + + Anyone can contribute to the resources whether you are a student, teacher or industry professional. We are always looking for new resources to add to the wiki. If you would like to contribute please visit our [Contributing Guide](/tuhura-tech/contributing). + + - + \ No newline at end of file diff --git a/src/content/docs/ncea/about.md b/src/content/docs/ncea/index.md similarity index 100% rename from src/content/docs/ncea/about.md rename to src/content/docs/ncea/index.md diff --git a/src/javascript/utils.js b/src/javascript/utils.js new file mode 100644 index 00000000..111f81cf --- /dev/null +++ b/src/javascript/utils.js @@ -0,0 +1,64 @@ +document.addEventListener('DOMContentLoaded', (event) => { + const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + const word = document.querySelector("#changing_text"); + const texts = ["Kura.", "Teachers.", "Students.", "Rangatahi.", "Schools.", "ākonga."]; + let textIndex = 0; + + let isAnimating = false; + let rafID; + let then = Date.now(); + const interval = 30; + + const animate = () => { + isAnimating = true; + let iterations = 0; + const originalText = texts[textIndex].toUpperCase(); + + const changeLetter = () => { + let now = Date.now(); + let elapsed = now - then; + + if (elapsed > interval) { + word.innerText = originalText + .split("") + .map((letter, index) => { + if (index < iterations) { + return originalText[index]; + } + if (letter == " ") { + return " "; + } + return letters[Math.floor(Math.random() * 22)]; + }) + .join(""); + + iterations += 1 / 3; + then = now - (elapsed % interval); + } + + if (iterations < word.innerText.length && isAnimating) { + rafID = requestAnimationFrame(changeLetter); + } + } + + rafID = requestAnimationFrame(changeLetter); + } + + animate(); + + setInterval(() => { + textIndex = (textIndex + 1) % texts.length; + if (!document.hidden) { + animate(); + } + }, 4000); + + document.addEventListener('visibilitychange', function () { + if (document.hidden) { + isAnimating = false; + cancelAnimationFrame(rafID); + } else { + animate(); + } + }); +}); \ No newline at end of file diff --git a/src/styles/custom.css b/src/styles/custom.css new file mode 100644 index 00000000..2b40fd21 --- /dev/null +++ b/src/styles/custom.css @@ -0,0 +1,36 @@ +/* Dark mode colours. */ +:root { + --sl-color-accent-low: #131e4f; + --sl-color-accent: #3447ff; + --sl-color-accent-high: #b3c7ff; + --sl-color-white: #ffffff; + --sl-color-gray-1: #eceef2; + --sl-color-gray-2: #c0c2c7; + --sl-color-gray-3: #888b96; + --sl-color-gray-4: #545861; + --sl-color-gray-5: #353841; + --sl-color-gray-6: #24272f; + --sl-color-black: #2c2c2c; +} + +/* Light mode colours. */ +:root[data-theme="light"] { + --sl-color-accent-low: #c7d6ff; + --sl-color-accent: #364bff; + --sl-color-accent-high: #182775; + --sl-color-white: #2c2c2c; + --sl-color-gray-1: #24272f; + --sl-color-gray-2: #353841; + --sl-color-gray-3: #545861; + --sl-color-gray-4: #888b96; + --sl-color-gray-5: #c0c2c7; + --sl-color-gray-6: #eceef2; + --sl-color-gray-7: #f5f6f8; + --sl-color-black: #ffffff; +} + +/* Changing text on the landing page */ +#changing_text { + color: #6aa469; + font-weight: bold; +} diff --git a/src/tailwind.css b/src/tailwind.css deleted file mode 100644 index 4ea6118d..00000000 --- a/src/tailwind.css +++ /dev/null @@ -1,4 +0,0 @@ -/* src/tailwind.css */ -@tailwind base; -@tailwind components; -@tailwind utilities; diff --git a/tailwind.config.cjs b/tailwind.config.cjs deleted file mode 100644 index 5b561a22..00000000 --- a/tailwind.config.cjs +++ /dev/null @@ -1,16 +0,0 @@ -const starlightPlugin = require('@astrojs/starlight-tailwind'); - -// Generated color palettes -const accent = { 200: '#bbcfba', 600: '#427b42', 900: '#213921', 950: '#192819' }; -const gray = { 100: '#f4f7f3', 200: '#eaf0e8', 300: '#bdc4bb', 400: '#82907f', 500: '#4f5c4d', 700: '#303c2d', 800: '#1f2a1c', 900: '#151a13' }; - -/** @type {import('tailwindcss').Config} */ -module.exports = { - content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'], - theme: { - extend: { - colors: { accent, gray }, - }, - }, - plugins: [starlightPlugin()], -}; \ No newline at end of file From 331dd27718474fa2a06bb02f4cd29b4764b5a3ff Mon Sep 17 00:00:00 2001 From: Leon Bowie Date: Fri, 29 Mar 2024 15:56:10 +1300 Subject: [PATCH 02/18] fix: remove currently invalid links --- src/content/docs/index.mdx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx index db5917ae..2dd77279 100644 --- a/src/content/docs/index.mdx +++ b/src/content/docs/index.mdx @@ -25,14 +25,6 @@ import SplitCard from '/src/components/Landing/SplitCard.astro' import ScriptWorkaround from "/src/components/ScriptWorkaround.astro"; - {/* - Explore [Astro starter themes](https://astro.build/themes/) for blogs, portfolios, docs, landing pages, SaaS, marketing, ecommerce sites, and more! - - - - Complete our introductory [Build a Blog Tutorial](/en/tutorial/0-introduction/) to learn the basics and create your first Astro site. - */} - - [Python](/guides/python) - [Javascript](/guides/javascript) @@ -41,8 +33,8 @@ import ScriptWorkaround from "/src/components/ScriptWorkaround.astro"; - - [NCEA Level 2 Flask](/ncea/lvl-2/flask) - - [NCEA Level 3 Flask](/ncea/lvl-3/flask) + {/* - [NCEA Level 2 Flask](/ncea/lvl-2/flask) + - [NCEA Level 3 Flask](/ncea/lvl-3/flask) */} From 40f1da5e8e04731db21745a38e0fac77f2e8ffd9 Mon Sep 17 00:00:00 2001 From: Leon Bowie Date: Fri, 29 Mar 2024 16:07:16 +1300 Subject: [PATCH 03/18] fix: remove green gradient on left --- src/components/starlight/Hero.astro | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/starlight/Hero.astro b/src/components/starlight/Hero.astro index 0bef613c..0f93b40a 100644 --- a/src/components/starlight/Hero.astro +++ b/src/components/starlight/Hero.astro @@ -104,12 +104,14 @@ const { title, tagline, actions } = hero!; :global([data-has-hero] .main-pane) { --cell-size: 3.5rem; background: - radial-gradient(var(--sl-color-green-low), transparent 40%) no-repeat -170vw -55vh / - 250vw 250vh, - radial-gradient(closest-side, var(--sl-color-green-low), transparent) - no-repeat calc(100% + var(--cell-size) * 6) - calc(var(--cell-size) * -7) / calc(var(--cell-size) * 12) - calc(var(--cell-size) * 19); + /* radial-gradient(var(--sl-color-green-low), transparent 40%) no-repeat -170vw -55vh / + 250vw 250vh, */ radial-gradient( + closest-side, + var(--sl-color-green-low), + transparent + ) + no-repeat calc(100% + var(--cell-size) * 6) calc(var(--cell-size) * -7) / + calc(var(--cell-size) * 12) calc(var(--cell-size) * 19); } .hero { From de16f1eaba677e85824b88d6b38ea957a3d8d58e Mon Sep 17 00:00:00 2001 From: Leon Bowie Date: Fri, 29 Mar 2024 16:07:34 +1300 Subject: [PATCH 04/18] fix: remove sidebar on landing page --- src/content/docs/index.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx index 2dd77279..88dc4967 100644 --- a/src/content/docs/index.mdx +++ b/src/content/docs/index.mdx @@ -5,6 +5,7 @@ editUrl: false tableOfContents: false lastUpdated: false next: false +template: splash hero: title: Tūhura Tech Wiki tagline: | @@ -33,8 +34,8 @@ import ScriptWorkaround from "/src/components/ScriptWorkaround.astro"; - {/* - [NCEA Level 2 Flask](/ncea/lvl-2/flask) - - [NCEA Level 3 Flask](/ncea/lvl-3/flask) */} + - [NCEA Level 2 Flask](/ncea/lvl-2/flask) + - [NCEA Level 3 Flask](/ncea/lvl-3/flask) From ae2111dcbf22c330390304e58c82214585383b8c Mon Sep 17 00:00:00 2001 From: Leon Bowie Date: Fri, 29 Mar 2024 16:20:36 +1300 Subject: [PATCH 05/18] fix: make glow slightly smaller --- src/components/starlight/Hero.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/starlight/Hero.astro b/src/components/starlight/Hero.astro index 0f93b40a..69d4250b 100644 --- a/src/components/starlight/Hero.astro +++ b/src/components/starlight/Hero.astro @@ -102,7 +102,7 @@ const { title, tagline, actions } = hero!; @media (min-width: 78rem) { :global([data-has-hero] .main-pane) { - --cell-size: 3.5rem; + --cell-size: 3rem; background: /* radial-gradient(var(--sl-color-green-low), transparent 40%) no-repeat -170vw -55vh / 250vw 250vh, */ radial-gradient( From 8d788354058740470ef2b7b8938d6f7bbf1b33da Mon Sep 17 00:00:00 2001 From: Leon Bowie Date: Fri, 29 Mar 2024 16:32:36 +1300 Subject: [PATCH 06/18] feat: add about us info to landing page --- src/content/docs/index.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx index 88dc4967..4d09bd84 100644 --- a/src/content/docs/index.mdx +++ b/src/content/docs/index.mdx @@ -47,4 +47,12 @@ import ScriptWorkaround from "/src/components/ScriptWorkaround.astro"; +## What is this Wiki for? + +This Wiki is a collection of resources and guides for ākonga (students) and kura (schools) in Aotearoa. We aim to provide free and open source resources for students to learn about technology. Our resources are designed to be used by students in their own time or by teachers in the classroom. It covers introductory guides, NCEA resources and is kept up to date by our staff and all the volunteer contributors. + +## About Us + +At [Tūhura Tech](https://tuhuratech.org.nz), our mission is to provide free technology education to rangatahi in the Wellington region. We believe that every rangatahi should have the opportunity to learn about and engage with technology, regardless of their background or financial situation. As part of that we maintain a collection of public resources. + \ No newline at end of file From 3accebb7d4b094fb3fbf13807bf15a9b4b9981fe Mon Sep 17 00:00:00 2001 From: Leon Bowie Date: Fri, 29 Mar 2024 16:38:34 +1300 Subject: [PATCH 07/18] chore: hide broken links --- src/content/docs/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx index 4d09bd84..9dceed7d 100644 --- a/src/content/docs/index.mdx +++ b/src/content/docs/index.mdx @@ -34,8 +34,8 @@ import ScriptWorkaround from "/src/components/ScriptWorkaround.astro"; - - [NCEA Level 2 Flask](/ncea/lvl-2/flask) - - [NCEA Level 3 Flask](/ncea/lvl-3/flask) + {/* - [NCEA Level 2 Flask](/ncea/lvl-2/flask) + - [NCEA Level 3 Flask](/ncea/lvl-3/flask) */} From 14eb3b98dd14275b28ba90be8af5657f224a1247 Mon Sep 17 00:00:00 2001 From: Leon Bowie Date: Sat, 30 Mar 2024 00:52:25 +1300 Subject: [PATCH 08/18] feat: add hover text for social media links --- src/styles/custom.css | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/styles/custom.css b/src/styles/custom.css index 2b40fd21..af45596b 100644 --- a/src/styles/custom.css +++ b/src/styles/custom.css @@ -29,6 +29,26 @@ --sl-color-black: #ffffff; } +/* Display name of social links */ +.social-icons a { + position: relative; +} +.social-icons a:hover .sr-only, +.social-icons a:focus .sr-only { + all: unset; + position: absolute; + inset-inline-start: 50%; + bottom: 0; + transform: translateX(-50%) translateY(100%); + background: var(--sl-color-black); + color: var(--sl-color-white); + padding: 0.25rem; + line-height: 1; + border-radius: 0.25rem; + box-shadow: var(--sl-shadow-md); + font-size: var(--sl-text-xs); +} + /* Changing text on the landing page */ #changing_text { color: #6aa469; From ab7f40db975e9c57fc67f411fb75f30f3185b9ea Mon Sep 17 00:00:00 2001 From: Leon Bowie Date: Sat, 30 Mar 2024 22:22:31 +1300 Subject: [PATCH 09/18] fix: colour on card in dark mode --- src/components/Landing/Card.astro | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/Landing/Card.astro b/src/components/Landing/Card.astro index 5ad95501..2e9c41cf 100644 --- a/src/components/Landing/Card.astro +++ b/src/components/Landing/Card.astro @@ -9,7 +9,6 @@ export type Props = Parameters[0]; + + diff --git a/src/content/docs/tuhura-tech/contributing.mdx b/src/content/docs/tuhura-tech/contribute.mdx similarity index 100% rename from src/content/docs/tuhura-tech/contributing.mdx rename to src/content/docs/tuhura-tech/contribute.mdx From d4b2d1f3da298b153cba45b11a20e33d2bc2f2e6 Mon Sep 17 00:00:00 2001 From: Leon Bowie Date: Mon, 1 Apr 2024 17:11:41 +1300 Subject: [PATCH 17/18] fix: contributing link --- src/content/docs/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx index 9f628eb0..1965a518 100644 --- a/src/content/docs/index.mdx +++ b/src/content/docs/index.mdx @@ -33,7 +33,7 @@ import ScriptWorkaround from "/src/components/ScriptWorkaround.astro"; - Anyone can contribute to the resources whether you are a student, teacher or industry professional. We are always looking for new resources to add to the wiki. If you would like to contribute please visit our [Contributing Guide](/tuhura-tech/contributing). + Anyone can contribute to the resources whether you are a student, teacher or industry professional. We are always looking for new resources to add to the wiki. If you would like to contribute please visit our [Contributing Guide](/tuhura-tech/contribute). From 639067ea492c4cb8e10e7901807bb9d0a1a8e176 Mon Sep 17 00:00:00 2001 From: Leon Bowie Date: Mon, 8 Apr 2024 21:10:02 +1200 Subject: [PATCH 18/18] fix: remove custom toc and glow on hero --- astro.config.mjs | 1 - src/components/starlight/Hero.astro | 29 ---------- .../starlight/TableOfContents.astro | 53 ------------------- 3 files changed, 83 deletions(-) delete mode 100644 src/components/starlight/TableOfContents.astro diff --git a/astro.config.mjs b/astro.config.mjs index 257f12dc..2c581864 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -112,7 +112,6 @@ export default defineConfig({ plugins: [starlightLinksValidator()], components: { Hero: './src/components/starlight/Hero.astro', - TableOfContents: './src/components/starlight/TableOfContents.astro', }, })], markdown: { diff --git a/src/components/starlight/Hero.astro b/src/components/starlight/Hero.astro index 43288ba5..97f78be4 100644 --- a/src/components/starlight/Hero.astro +++ b/src/components/starlight/Hero.astro @@ -29,28 +29,6 @@ const { title, tagline, actions } = hero!; margin: -1.5rem calc(-1 * var(--sl-content-pad-x)); } - .grid-bg { - z-index: -1; - position: absolute; - content: ""; - inset: 0; - background-image: linear-gradient( - to right, - var(--sl-color-white) 1px, - transparent 1px - ), - linear-gradient(to bottom, var(--sl-color-white) 1px, transparent 1px); - background-position: right -1px; - background-size: 23px 23px; - -webkit-mask-image: radial-gradient( - circle at 100% 0%, - white, - transparent 65% - ); - mask-image: radial-gradient(circle at 100% 0%, white, transparent 65%); - opacity: 0.05; - } - .stack { display: flex; flex-direction: column; @@ -101,13 +79,6 @@ const { title, tagline, actions } = hero!; } @media (min-width: 78rem) { - :global([data-has-hero] .main-pane) { - --cell-size: 3rem; - background: radial-gradient(closest-side, #6aa469, transparent) no-repeat - calc(100% + var(--cell-size) * 6) calc(var(--cell-size) * -7) / - calc(var(--cell-size) * 12) calc(var(--cell-size) * 19); - } - .hero { display: grid; } diff --git a/src/components/starlight/TableOfContents.astro b/src/components/starlight/TableOfContents.astro deleted file mode 100644 index 13db916d..00000000 --- a/src/components/starlight/TableOfContents.astro +++ /dev/null @@ -1,53 +0,0 @@ ---- -import TableOfContentsList from "../../../node_modules/@astrojs/starlight/components/TableOfContents/TableOfContentsList.astro"; -import type { Props } from "@astrojs/starlight/props"; -import { Icon } from "@astrojs/starlight/components"; - -const { toc, editUrl} = Astro.props; ---- - -{ - toc && ( - - - - ) -} - - - -