diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..189cbed --- /dev/null +++ b/.drone.yml @@ -0,0 +1,46 @@ +kind: pipeline +name: default + +steps: +- name: deploy + image: node:latest + volumes: + - name: host-tutorato-dist + path: /drone/src/dist + environment: + BASE_URL: + from_secret: base_url + commands: + - pwd + - npm install + - npm run build + +volumes: +- name: host-tutorato-dist + host: + path: /var/www/tutorato + +trigger: + branch: + - main + event: + - push + +--- +kind: pipeline +type: exec +name: caddy-permissions + +depends_on: +- default + +steps: +- name: chown + commands: + - chown -R caddy:caddy /var/www/tutorato + +trigger: + branch: + - main + event: + - push diff --git a/bun.lockb b/bun.lockb index aa601a1..ccf5736 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index b6156b3..02a9a90 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.15.1" + "astro": "4.15.10" } } \ No newline at end of file diff --git a/src/components/Header.astro b/src/components/Header.astro index 70c1c2d..4920a5b 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -1,53 +1,55 @@ --- -const years = await Astro.glob('../pages/archivio/*/index.md') -const yearLabels = years.map(module => module.file.split('/').at(-2)).toSorted() -const currentYear = yearLabels.at(-1) +const years = await Astro.glob("../pages/archivio/*/index.md"); +const yearLabels = years.map((module) => module.file.split("/").at(-2)).toSorted(); +const currentYear = yearLabels.at(-1); -const { selectedCourseLabel, courses } = Astro.props -const title = courses.find(module => module.file.includes('index.md')).frontmatter.title +const { selectedCourseLabel, courses } = Astro.props; const selectedYear = courses - .find(module => module.file.includes('index.md')) - .file.split('/') - .at(-2) -const isCurrentYear = currentYear == selectedYear -const coursesWithoutIndex = courses.filter(m => !m.file.includes('index.md')) + .find((module) => module.file.includes("index.md")) + .file.split("/") + .at(-2); +const isCurrentYear = currentYear == selectedYear; +const coursesWithoutIndex = courses.filter((m) => !m.file.includes("index.md")); ---

- { - isCurrentYear ? ( - {title} - ) : ( - {title} - ) - } -

- - + + +