Compare commits
2 Commits
cb00252364
...
54db411930
Author | SHA1 | Date | |
---|---|---|---|
54db411930 | |||
023c8b7c85 |
55
README.md
55
README.md
@ -1,54 +1,5 @@
|
||||
# Astro Starter Kit: Basics
|
||||
# Homepage / portfolio
|
||||
|
||||
```sh
|
||||
npm create astro@latest -- --template basics
|
||||
```
|
||||
> This repository is mirrored on [Codeberg](https://codeberg.org/martials/martials.no)
|
||||
|
||||
[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
|
||||
[](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
|
||||
[](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)
|
||||
|
||||
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
|
||||
|
||||

|
||||
|
||||
## 🚀 Project Structure
|
||||
|
||||
Inside of your Astro project, you'll see the following folders and files:
|
||||
|
||||
```text
|
||||
/
|
||||
├── public/
|
||||
│ └── favicon.svg
|
||||
├── src/
|
||||
│ ├── components/
|
||||
│ │ └── Card.astro
|
||||
│ ├── layouts/
|
||||
│ │ └── Layout.astro
|
||||
│ └── pages/
|
||||
│ └── index.astro
|
||||
└── package.json
|
||||
```
|
||||
|
||||
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
|
||||
|
||||
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
|
||||
|
||||
Any static assets, like images, can be placed in the `public/` directory.
|
||||
|
||||
## 🧞 Commands
|
||||
|
||||
All commands are run from the root of the project, from a terminal:
|
||||
|
||||
| Command | Action |
|
||||
| :------------------------ | :----------------------------------------------- |
|
||||
| `npm install` | Installs dependencies |
|
||||
| `npm run dev` | Starts local dev server at `localhost:4321` |
|
||||
| `npm run build` | Build your production site to `./dist/` |
|
||||
| `npm run preview` | Preview your build locally, before deploying |
|
||||
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
||||
| `npm run astro -- --help` | Get help using the Astro CLI |
|
||||
|
||||
## 👀 Want to learn more?
|
||||
|
||||
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
|
||||
More to come!
|
||||
|
41
TODO.md
Normal file
41
TODO.md
Normal file
@ -0,0 +1,41 @@
|
||||
# TODO
|
||||
|
||||
## Code
|
||||
- [ ] Temporal API or day.js for dates
|
||||
|
||||
## Layout
|
||||
- [ ] Show current page in navbar
|
||||
- [x] Correct bg colour on entire page
|
||||
|
||||
## Accessibility
|
||||
- [ ] Fix colours on buttons
|
||||
- [ ] Correct contrast
|
||||
- [ ] All interactable elements have labels
|
||||
- [ ] Colour links, also in MDX posts
|
||||
|
||||
## ~/
|
||||
- [ ] About me description
|
||||
- [ ] Non-cat image
|
||||
|
||||
## ~/about
|
||||
- [ ] About me
|
||||
|
||||
## ~/links
|
||||
- [ ] Add Bluesky link
|
||||
- [ ] Add MusicBrainz link
|
||||
|
||||
## ~/slashes
|
||||
- [ ] List of all slashes
|
||||
|
||||
## ~/uses
|
||||
- [ ] Homelab uses
|
||||
- [ ] Raspberry PI uses
|
||||
- [ ] Hardware anchor
|
||||
|
||||
## ~/certifications
|
||||
- [ ] Embed certifications
|
||||
|
||||
## ~/tools
|
||||
|
||||
### /simplify-truths
|
||||
- [ ] Merge simplify truths implementation
|
@ -28,9 +28,8 @@ export default defineConfig({
|
||||
svelte(),
|
||||
icon(),
|
||||
paraglide({
|
||||
// recommended settings
|
||||
project: "./project.inlang",
|
||||
outdir: "./src/paraglide", //where your files should be
|
||||
outdir: "./src/paraglide",
|
||||
}),
|
||||
],
|
||||
adapter: node({
|
||||
|
@ -2,7 +2,7 @@
|
||||
"$schema": "https://inlang.com/schema/inlang-message-format",
|
||||
"hiIm": "Hi, I'm",
|
||||
"position": "Software Engineer",
|
||||
"aboutMe": "Some bullshit about me",
|
||||
"aboutMe": "Dedicated developer currently working at Capgemini Bergen.",
|
||||
"home": "Home",
|
||||
"contactMe": "Contact me",
|
||||
"myLinks": "My links",
|
||||
|
@ -2,7 +2,7 @@
|
||||
"$schema": "https://inlang.com/schema/inlang-message-format",
|
||||
"hiIm": "Hei, jeg er",
|
||||
"position": "Programvareutvikler",
|
||||
"aboutMe": "Bunntekst",
|
||||
"aboutMe": "Engasjert utvikler som for tiden jobber hos Capgemini Bergen",
|
||||
"home": "Hjem",
|
||||
"contactMe": "Kontakt meg",
|
||||
"myLinks": "Mine lenker",
|
||||
|
BIN
public/favicon.jpg
Normal file
BIN
public/favicon.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 55 KiB |
@ -1,9 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 128 128">
|
||||
<path d="M50.4 78.5a75.1 75.1 0 0 0-28.5 6.9l24.2-65.7c.7-2 1.9-3.2 3.4-3.2h29c1.5 0 2.7 1.2 3.4 3.2l24.2 65.7s-11.6-7-28.5-7L67 45.5c-.4-1.7-1.6-2.8-2.9-2.8-1.3 0-2.5 1.1-2.9 2.7L50.4 78.5Zm-1.1 28.2Zm-4.2-20.2c-2 6.6-.6 15.8 4.2 20.2a17.5 17.5 0 0 1 .2-.7 5.5 5.5 0 0 1 5.7-4.5c2.8.1 4.3 1.5 4.7 4.7.2 1.1.2 2.3.2 3.5v.4c0 2.7.7 5.2 2.2 7.4a13 13 0 0 0 5.7 4.9v-.3l-.2-.3c-1.8-5.6-.5-9.5 4.4-12.8l1.5-1a73 73 0 0 0 3.2-2.2 16 16 0 0 0 6.8-11.4c.3-2 .1-4-.6-6l-.8.6-1.6 1a37 37 0 0 1-22.4 2.7c-5-.7-9.7-2-13.2-6.2Z" />
|
||||
<style>
|
||||
path { fill: #000; }
|
||||
@media (prefers-color-scheme: dark) {
|
||||
path { fill: #FFF; }
|
||||
}
|
||||
</style>
|
||||
</svg>
|
Before Width: | Height: | Size: 749 B |
@ -12,12 +12,12 @@ import * as m from "@/paraglide/messages.js"
|
||||
<Input label={m.name()} type="text" name="name" required />
|
||||
<Input label={m.subject()} name="subject" required />
|
||||
<Input label={m.email()} name="_replyto" />
|
||||
<input name="_gotcha" type="text" class={"hidden"} />
|
||||
{/*Honeypot spam filter*/}
|
||||
<input name="_gotcha" type="text" class={"hidden"} />
|
||||
<label class="flex flex-col">
|
||||
{m.message()}
|
||||
<textarea name="message" class="textarea textarea-bordered" required
|
||||
<textarea name="message" class="textarea textarea-bordered w-full" required
|
||||
></textarea>
|
||||
</label>
|
||||
<button type="submit">{m.send()}</button>
|
||||
</form>
|
||||
<button type="submit" class="btn mt-2" title={m.send()}>{m.send()}</button>
|
||||
|
@ -9,12 +9,18 @@ import * as m from "@/paraglide/messages"
|
||||
const giteaLink = `${GIT_URL}/martials/martials.no`
|
||||
---
|
||||
|
||||
<div class="divider"></div>
|
||||
<div class="py-5 flex flex-row gap-1 justify-around w-full items-center">
|
||||
<div class="divider bg-inherit"></div>
|
||||
<div
|
||||
class="py-5 flex flex-row gap-1 justify-around w-full items-center bg-inherit"
|
||||
>
|
||||
<div>
|
||||
<GiteaLink href={giteaLink} />
|
||||
<ExternalLink href={STATUS_URL} class="flex items-center" title="Status">
|
||||
<PajamasIcon name="pajamas:status-health" class="w-6 h-6 mr-2" />
|
||||
<PajamasIcon
|
||||
name="pajamas:status-health"
|
||||
class="w-6 h-6 mr-2"
|
||||
aria-label="Status health icon"
|
||||
/>
|
||||
{m.status()}
|
||||
</ExternalLink>
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@ import "@/styles/global.css"
|
||||
|
||||
<div class="flex items-center justify-around flex-wrap">
|
||||
<div class="m-5">
|
||||
<h1 class="sm:text-7xl font-bold">
|
||||
<h1>
|
||||
{m.hiIm()}
|
||||
<br />
|
||||
Martin Berg Alstad
|
||||
|
@ -19,7 +19,7 @@ const {
|
||||
<label class="flex flex-col">
|
||||
{label}
|
||||
<input
|
||||
class="input input-bordered"
|
||||
class="input input-bordered w-full"
|
||||
type={type}
|
||||
name={name}
|
||||
required={required}
|
||||
|
@ -1,14 +0,0 @@
|
||||
---
|
||||
import LocaleLink from "./links/LocaleLink.astro"
|
||||
import Links from "@/links"
|
||||
---
|
||||
|
||||
<div class="flex justify-end">
|
||||
{
|
||||
Links.map(({ to, label }) => (
|
||||
<LocaleLink to={to} class="m-2 hover:underline">
|
||||
{label()}
|
||||
</LocaleLink>
|
||||
))
|
||||
}
|
||||
</div>
|
31
src/components/UsesPage.astro
Normal file
31
src/components/UsesPage.astro
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
import Select from "./Select.svelte"
|
||||
import * as m from "@/paraglide/messages"
|
||||
import CollapseList from "@/components/collapse/CollapseList.svelte"
|
||||
import type { CollectionEntry } from "astro:content"
|
||||
|
||||
interface Props {
|
||||
uses: ReadonlyArray<CollectionEntry<"uses">>
|
||||
}
|
||||
|
||||
const { uses } = Astro.props
|
||||
// TODO set url anchor to selected hardware
|
||||
---
|
||||
|
||||
<div class="px-2 max-w-[750px] sm:min-w-[750px] w-screen">
|
||||
{
|
||||
uses.map((hardware) => (
|
||||
<div class="my-5">
|
||||
<h3>{hardware.data.title}</h3>
|
||||
<CollapseList items={hardware.data.hardware} title={m.hardware()} />
|
||||
<div class="my-2" />
|
||||
{hardware.data.accessories && (
|
||||
<CollapseList
|
||||
items={hardware.data.accessories}
|
||||
title={m.accessories()}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
))
|
||||
}
|
||||
</div>
|
@ -1,44 +0,0 @@
|
||||
<script lang="ts">
|
||||
import Select from "./Select.svelte"
|
||||
import * as m from "@/paraglide/messages"
|
||||
import CollapseList from "@/components/collapse/CollapseList.svelte"
|
||||
import type { CollectionEntry } from "astro:content"
|
||||
|
||||
interface Props {
|
||||
uses: CollectionEntry<"uses">[]
|
||||
}
|
||||
|
||||
const { uses }: Props = $props()
|
||||
|
||||
const hardwareOptions = uses.map((item) => ({
|
||||
key: item.id,
|
||||
value: item.data.title,
|
||||
}))
|
||||
|
||||
let selectedHardwareKey = $state(uses[0].id)
|
||||
let selectedHardware = $derived(
|
||||
uses.find((item) => item.id === selectedHardwareKey)!,
|
||||
)
|
||||
// TODO set url query param to selected hardware
|
||||
</script>
|
||||
|
||||
<div class="px-2 max-w-[750px] sm:min-w-[750px] w-screen">
|
||||
<h1 class="text-center">{m.uses()}</h1>
|
||||
<div>
|
||||
<Select
|
||||
options={hardwareOptions}
|
||||
bind:selected={selectedHardwareKey}
|
||||
class="mx-auto w-max"
|
||||
/>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<CollapseList items={selectedHardware.data.hardware} title={m.hardware()} />
|
||||
<div class="my-2"></div>
|
||||
{#if selectedHardware.data.accessories}
|
||||
<CollapseList
|
||||
items={selectedHardware.data.accessories}
|
||||
title={m.accessories()}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
@ -5,4 +5,4 @@ interface Props {
|
||||
const { tag } = Astro.props
|
||||
---
|
||||
|
||||
<div class="badge badge-outline">{tag}</div>
|
||||
<div class="badge badge-outline !text-cat-lavender">{tag}</div>
|
||||
|
7
src/components/header/Header.astro
Normal file
7
src/components/header/Header.astro
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
import Navbar from "./Navbar.astro"
|
||||
---
|
||||
|
||||
<div class="m-auto">
|
||||
<Navbar />
|
||||
</div>
|
17
src/components/header/Navbar.astro
Normal file
17
src/components/header/Navbar.astro
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
import LocaleLink from "@/components/links/LocaleLink.astro"
|
||||
import Links from "@/links"
|
||||
---
|
||||
|
||||
<div class="flex justify-end">
|
||||
{
|
||||
Links.map(({ to, label }) => (
|
||||
<LocaleLink
|
||||
to={to}
|
||||
class={"m-2 hover:text-cat-mauve font-bold font-mono"}
|
||||
>
|
||||
~/{label()}
|
||||
</LocaleLink>
|
||||
))
|
||||
}
|
||||
</div>
|
@ -1,10 +0,0 @@
|
||||
---
|
||||
import PajamasIcon from "./PajamasIcon.astro"
|
||||
interface Props {
|
||||
class?: string
|
||||
}
|
||||
|
||||
const { class: clazz } = Astro.props
|
||||
---
|
||||
|
||||
<PajamasIcon name="pajamas:gitea" class={clazz} />
|
@ -1,16 +1,21 @@
|
||||
---
|
||||
import ExternalLink from "./ExternalLink.astro"
|
||||
import * as m from "@/paraglide/messages"
|
||||
import Gitea from "../icons/Gitea.astro"
|
||||
import PajamasIcon from "../icons/PajamasIcon.astro"
|
||||
interface Props {
|
||||
href: string
|
||||
class?: string
|
||||
}
|
||||
const { href } = Astro.props
|
||||
const { href, class: clazz } = Astro.props
|
||||
---
|
||||
|
||||
<div>
|
||||
<ExternalLink href={href} class="flex items-center gap-1">
|
||||
<Gitea class="w-6 h-6" />
|
||||
<ExternalLink
|
||||
href={href}
|
||||
class:list={["flex items-center gap-1", clazz]}
|
||||
title="Gitea"
|
||||
>
|
||||
<PajamasIcon name="pajamas:gitea" class="w-6 h-6" aria-label="Gitea icon" />
|
||||
{m.sourceCode()}
|
||||
</ExternalLink>
|
||||
</div>
|
||||
|
@ -8,12 +8,28 @@ interface Props extends MyLink {
|
||||
}
|
||||
|
||||
const { title, message, url, icon, class: clazz } = Astro.props
|
||||
const iconStyle = "w-6 h-6"
|
||||
console.log(icon)
|
||||
---
|
||||
|
||||
<ExternalLink href={url} noStyle>
|
||||
<div class:list={["card bg-base-300", clazz]}>
|
||||
<div class="card-body p-5 flex flex-row items-center">
|
||||
<PajamasIcon name={icon ?? "pajamas:link"} class="w-6 h-6" />
|
||||
{
|
||||
icon ? (
|
||||
<PajamasIcon
|
||||
name={icon.src}
|
||||
class={iconStyle}
|
||||
aria-label={icon.alt}
|
||||
/>
|
||||
) : (
|
||||
<PajamasIcon
|
||||
name={"pajamas:link"}
|
||||
class={iconStyle}
|
||||
aria-label="Link icon"
|
||||
/>
|
||||
)
|
||||
}
|
||||
<div>
|
||||
<h5 class="card-title">{title}</h5>
|
||||
<p class="prose">{message}</p>
|
||||
|
@ -2,10 +2,8 @@
|
||||
import links from "./myLinks"
|
||||
import LinkCard from "./LinkCard.astro"
|
||||
import "@/styles/global.css"
|
||||
import * as m from "@/paraglide/messages"
|
||||
---
|
||||
|
||||
<h1 class="text-center">{m.myLinks()}</h1>
|
||||
<div class="flex flex-col mx-auto w-fit gap-5">
|
||||
{
|
||||
links.map((link) => (
|
||||
|
@ -6,7 +6,10 @@ export interface MyLink {
|
||||
title: string
|
||||
url: string
|
||||
message?: string
|
||||
icon?: PajamasIcon
|
||||
icon?: {
|
||||
src: PajamasIcon
|
||||
alt: string
|
||||
}
|
||||
}
|
||||
|
||||
export default [
|
||||
@ -14,28 +17,43 @@ export default [
|
||||
title: "Codeberg",
|
||||
url: "https://codeberg.org/martials",
|
||||
message: m.forMirrors(),
|
||||
icon: "pajamas:git",
|
||||
icon: {
|
||||
src: "pajamas:git",
|
||||
alt: "Git icon",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Gitea",
|
||||
url: `${GIT_URL}/martials`,
|
||||
message: m.forPersonalProjects(),
|
||||
icon: "pajamas:gitea",
|
||||
icon: {
|
||||
src: "pajamas:gitea",
|
||||
alt: "Gitea icon",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "GitHub",
|
||||
url: "https://github.com/emberal",
|
||||
icon: "pajamas:github",
|
||||
icon: {
|
||||
src: "pajamas:github",
|
||||
alt: "GitHub icon",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "LinkedIn",
|
||||
url: "https://www.linkedin.com/in/martin-b-2a69391a3/",
|
||||
icon: "pajamas:linkedin",
|
||||
icon: {
|
||||
src: "pajamas:linkedin",
|
||||
alt: "LinkedIn icon",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Mastodon (Snabelen.no)",
|
||||
url: "https://snabelen.no/@Martials",
|
||||
icon: "pajamas:mastodon",
|
||||
icon: {
|
||||
src: "pajamas:mastodon",
|
||||
alt: "Mastodon icon",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Pixelfed",
|
||||
@ -49,4 +67,4 @@ export default [
|
||||
title: "Trakt.tv",
|
||||
url: "https://trakt.tv/users/martials",
|
||||
},
|
||||
] as MyLink[]
|
||||
] satisfies MyLink[]
|
||||
|
@ -13,7 +13,6 @@ const { projects } = Astro.props
|
||||
const baseUrl: NavLink = "/projects"
|
||||
---
|
||||
|
||||
<h1 class="text-4xl font-bold text-center sm:my-10 mt-2">{m.myProjects()}</h1>
|
||||
<div class="flex flex-wrap justify-around">
|
||||
{
|
||||
projects.map(
|
||||
|
@ -19,7 +19,7 @@ const { title, description, tags, image, imageAlt, linkTo } = Astro.props
|
||||
|
||||
<LocaleLink
|
||||
to={linkTo}
|
||||
class="card bg-base-100 max-w-96 shadow-xl hover:scale-105 transition"
|
||||
class="card bg-cat-base max-w-96 shadow-xl hover:scale-105 transition"
|
||||
>
|
||||
<figure>
|
||||
<Image src={image} alt={imageAlt} />
|
||||
|
@ -2,10 +2,10 @@
|
||||
import Layout from "@/layouts/Layout.astro"
|
||||
import { Image } from "astro:assets"
|
||||
import { getEntry, render } from "astro:content"
|
||||
import BadgeList from "../badge/BadgeList.astro"
|
||||
import BadgeList from "@/components/badge/BadgeList.astro"
|
||||
import * as m from "@/paraglide/messages"
|
||||
import { languageTag } from "@/paraglide/runtime"
|
||||
import GiteaLink from "../links/GiteaLink.astro"
|
||||
import GiteaLink from "@/components/links/GiteaLink.astro"
|
||||
import "@/styles/global.css"
|
||||
|
||||
interface Props {
|
||||
@ -28,7 +28,7 @@ const {
|
||||
} = entry!.data
|
||||
---
|
||||
|
||||
<!--TODO day.js for dates?-->
|
||||
<!--TODO day.js / Temporal API for dates?-->
|
||||
<Layout title={title} class="mx-auto max-w-[750px]">
|
||||
<div class="flex justify-between my-2">
|
||||
<div>
|
||||
@ -44,9 +44,9 @@ const {
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Image src={heroImage} alt={heroImageAlt} />
|
||||
<Image src={heroImage} alt={heroImageAlt} class="m-auto" />
|
||||
|
||||
<GiteaLink href={source} />
|
||||
<GiteaLink href={source} class="text-cat-mauve my-2" />
|
||||
|
||||
<p class="my-2">{description}</p>
|
||||
<Content />
|
||||
|
@ -10,9 +10,9 @@ const projectCollection = defineCollection({
|
||||
heroImage: image(),
|
||||
heroImageAlt: z.string(),
|
||||
tags: z.array(z.string()),
|
||||
source: z.string(),
|
||||
createdAt: z.string(),
|
||||
updatedAt: z.string(),
|
||||
source: z.string().url(),
|
||||
createdAt: z.string().date(),
|
||||
updatedAt: z.string().date(),
|
||||
}),
|
||||
})
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 73 KiB |
Binary file not shown.
Before Width: | Height: | Size: 59 KiB |
BIN
src/content/projects/assets/recursive-meme.png
Normal file
BIN
src/content/projects/assets/recursive-meme.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
@ -1,14 +1,17 @@
|
||||
---
|
||||
title: "Hjemmeside"
|
||||
description: "Hjemmesiden"
|
||||
heroImage: "./kevin-james.jpg"
|
||||
heroImageAlt: "The homepage of this site"
|
||||
tags: [Astro, Svelte, TypeScript, I18n]
|
||||
source: "https://example.com"
|
||||
description: "Welcome to my homepage / portfolio"
|
||||
heroImage: "assets/recursive-meme.png"
|
||||
heroImageAlt: "A recursive meme that says: Self-reference, recursive meme is self-referential"
|
||||
tags: [Astro, Svelte, TypeScript, I18n, TailwindCSS, Docker]
|
||||
source: "https://git.martials.no/martials/martials.no"
|
||||
createdAt: "2024-09-22"
|
||||
updatedAt: "2024-09-22"
|
||||
updatedAt: "2025-02-15"
|
||||
---
|
||||
|
||||
This is a short meta post about the homepage of this site.
|
||||
It is a simple landing page with a short introduction to the site and a list of the latest posts.
|
||||
The site is not built with GatsbyJS and Contentful.
|
||||
This is a short meta post about my homepage which you are looking at right now.
|
||||
|
||||
This page is going to be a simple site where I will share my projects, stuff i've accomplished and things about me.
|
||||
It is still a work in progress, so it will be updated for the forseable future.
|
||||
|
||||
In the meantime, you can see what i'm working on at [Gitea](https://git.martials.no/martials?tab=activity).
|
||||
|
@ -1,16 +0,0 @@
|
||||
---
|
||||
title: "API for å forenkle TimeEdit iCalendar filer"
|
||||
description: "Et API som forenkler tittler i ICS filer fra TimeEdit"
|
||||
heroImage: "./Calendar before and after.png"
|
||||
heroImageAlt: "En kalender før og etter APIet har blitt brukt. Venstre side er før, høyre etter."
|
||||
tags: [API, Kotlin, Spring Boot, Tomcat, iCal4j, CI/CD]
|
||||
source: "https://github.com/emberal/hvl_ics_simplifier"
|
||||
createdAt: "2023-08-08"
|
||||
updatedAt: "2024-10-20"
|
||||
---
|
||||
|
||||
Ble lei av hvor vanskelig det var å lese iCalendar filer fra HVL sin kalender i TimeEdit, så jeg lagde et API som gjør det enklere.
|
||||
Data for tittelen blir hentet fra den gamle tittelen.
|
||||
For å finne hvilken type hendselse det er, sjekkes beskrivelsen og lokasjonen.
|
||||
|
||||
APIet er skrevet i Kotlin med Spring boot, og hosted på en selvhostet tomcat server.
|
Binary file not shown.
Before Width: | Height: | Size: 364 KiB |
@ -1,26 +0,0 @@
|
||||
---
|
||||
title: "Forenkle sannhetsverdier og sannhetstabeller"
|
||||
description: "Forenkle sannhetsuttrykk og opprette sannhetstabeller"
|
||||
heroImage: "./Simplify-truths-website.png"
|
||||
heroImageAlt: "Nettsiden med en sannhetstabell"
|
||||
tags: [TypeScript, SolidJS, Tailwind css, Nettside, Java, API, Spring Boot, Raspberry Pi, Apache, Tomcat]
|
||||
source: "https://github.com/h600878/martials.no"
|
||||
createdAt: "2022-11-08"
|
||||
updatedAt: "2024-10-20"
|
||||
---
|
||||
{/* TODO change to Rust */}
|
||||
Noen sannhetsverdier kan bli ganske store, og kompliserte. Derfor har jeg laget dette programmet for å forenkle uttrykk mest mulig.
|
||||
Programmet bruker flere kjente metoder for å skrive om uttrykkene. Hvilke uttrykk som er brukt og hvilke endringer de gjorde,
|
||||
kan vises i menyen under søkefeltet.
|
||||
<br />
|
||||
I tillegg til å bare forenkle uttrykk, kan man også generere en sannhetstabell med alle mulige verdier i uttrykket.
|
||||
Hvis man ikke ønsker å forenkle uttrykket, men bare generere tabellen, kan man enkelt skru av forenkling. I tillegg har
|
||||
man muligheten til å filtrere resultat, enten ved å skjule sanne eller usanne verdier. Eller ved å sortere etter sanne
|
||||
eller usanne først.
|
||||
<br />
|
||||
Nettsiden er laget med TypeScript, SolidJS og Tailwind CSS. API-et er laget med Java og Spring Boot.
|
||||
Begge kjører på min egen raspberry pi 4, nettsiden er hostet på en apache2 tjener, mens API-et ligger på en tomcat tjener.
|
||||
<a href={"https://martials.no/simplify-truths.html"}>Lenke til nettsiden.</a>
|
||||
<br />
|
||||
Spørringer kan gjøres mot API-et kan utføres med GET eller POST. API-et returnerer JSON.
|
||||
[Lenke til API-docs](https://api.martials.no/simplify-truths)
|
@ -1,13 +1,15 @@
|
||||
---
|
||||
import Navbar from "@/components/Navbar.astro"
|
||||
import Footer from "@/components/Footer.astro"
|
||||
import Header from "@/components/header/Header.astro"
|
||||
import { languageTag } from "@/paraglide/runtime"
|
||||
import { resolvePathname } from "@/utils/linking"
|
||||
|
||||
interface Props {
|
||||
title: string
|
||||
class?: string
|
||||
}
|
||||
const { title, class: clazz } = Astro.props
|
||||
const mainClass = "grow max-w-[1000px] m-auto sm:min-w-[500px] mt-5"
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
@ -17,13 +19,14 @@ const { title, class: clazz } = Astro.props
|
||||
<meta name="description" content="Astro description" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<link rel="sitemap" href="/sitemap-index.xml" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="icon" type="image/jpg" href="/favicon.jpg" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>{title}</title>
|
||||
<title>{title} | Martin Berg Alstad</title>
|
||||
</head>
|
||||
<body class="flex flex-col h-screen">
|
||||
<Navbar />
|
||||
<main class:list={["grow", clazz]}>
|
||||
<body class="flex flex-col min-h-screen bg-cat-base text-cat-text">
|
||||
<Header />
|
||||
<main class:list={[mainClass, clazz]}>
|
||||
<h1 class="text-center">~{resolvePathname(Astro.originPathname)}</h1>
|
||||
<slot />
|
||||
</main>
|
||||
<Footer />
|
||||
|
@ -19,10 +19,6 @@ const Links: Link[] = [
|
||||
label: m.myLinks,
|
||||
to: "/links",
|
||||
},
|
||||
{
|
||||
label: m.uses,
|
||||
to: "/uses",
|
||||
},
|
||||
{
|
||||
label: m.contactMe,
|
||||
to: "/contact",
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
import Layout from "@/layouts/Layout.astro"
|
||||
import UsesPage from "@/components/UsesPage.svelte"
|
||||
import UsesPage from "@/components/UsesPage.astro"
|
||||
import "@/styles/global.css"
|
||||
import { getCollection } from "astro:content"
|
||||
|
||||
@ -8,5 +8,5 @@ const uses = await getCollection("uses")
|
||||
---
|
||||
|
||||
<Layout title="Hardware" class="mx-auto max-w-[750px]">
|
||||
<UsesPage client:load uses={uses} />
|
||||
<UsesPage uses={uses} />
|
||||
</Layout>
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
import Layout from "../layouts/Layout.astro"
|
||||
import Greeting from "../components/Greeting.astro"
|
||||
import Layout from "@/layouts/Layout.astro"
|
||||
import Greeting from "@/components/Greeting.astro"
|
||||
|
||||
// https://slashpages.net/
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
import Layout from "@/layouts/Layout.astro"
|
||||
import UsesPage from "@/components/UsesPage.svelte"
|
||||
import UsesPage from "@/components/UsesPage.astro"
|
||||
import "@/styles/global.css"
|
||||
import { getCollection } from "astro:content"
|
||||
|
||||
@ -8,5 +8,5 @@ const uses = await getCollection("uses")
|
||||
---
|
||||
|
||||
<Layout title="Hardware" class="mx-auto max-w-[750px]">
|
||||
<UsesPage client:load uses={uses} />
|
||||
<UsesPage uses={uses} />
|
||||
</Layout>
|
||||
|
@ -1,28 +1,53 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
@plugin "@tailwindcss/typography";
|
||||
@plugin "daisyui";
|
||||
|
||||
@theme {
|
||||
--color-cat-rosewater: #f5e0dc;
|
||||
--color-cat-flamingo: #f2cdcd;
|
||||
--color-cat-pink: #f5c2e7;
|
||||
--color-cat-mauve: #cba6f7;
|
||||
--color-cat-red: #f38ba8;
|
||||
--color-cat-maroon: #eba0ac;
|
||||
--color-cat-peach: #fab387;
|
||||
--color-cat-yellow: #f9e2af;
|
||||
--color-cat-green: #a6e3a1;
|
||||
--color-cat-teal: #94e2d5;
|
||||
--color-cat-sky: #89dceb;
|
||||
--color-cat-sapphire: #74c7ec;
|
||||
--color-cat-blue: #89b4fa;
|
||||
--color-cat-lavender: #b4befe;
|
||||
--color-cat-text: #cdd6f4;
|
||||
--color-cat-surface0: #313244;
|
||||
--color-cat-base: #1e1e2e;
|
||||
--color-cat-mantle: #181825;
|
||||
}
|
||||
|
||||
@layer utilities {
|
||||
.debug {
|
||||
@apply border border-red-500;
|
||||
}
|
||||
.debug {
|
||||
@apply border border-red-500;
|
||||
}
|
||||
}
|
||||
|
||||
@layer base {
|
||||
br {
|
||||
br {
|
||||
@apply my-0.5;
|
||||
}
|
||||
|
||||
h1 {
|
||||
@apply text-4xl font-bold mb-2;
|
||||
}
|
||||
|
||||
h2 {
|
||||
@apply text-3xl font-bold mb-2;
|
||||
}
|
||||
|
||||
/* TODO change default style*/
|
||||
a {
|
||||
@apply link;
|
||||
}
|
||||
}
|
||||
|
||||
h1 {
|
||||
@apply text-4xl font-bold mb-2;
|
||||
}
|
||||
|
||||
h2 {
|
||||
@apply text-3xl font-bold mb-2;
|
||||
}
|
||||
|
||||
h3 {
|
||||
@apply text-2xl font-bold mb-2;
|
||||
}
|
||||
|
||||
/* TODO change default style*/
|
||||
a {
|
||||
@apply link;
|
||||
text-decoration-line: none;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user