Compare commits
36 Commits
dev
...
65a909ffea
| Author | SHA1 | Date | |
|---|---|---|---|
| 65a909ffea | |||
| 5e145e181b | |||
| 046a62f54b | |||
| 416fc9f122 | |||
| f4cf74cee9 | |||
| 4702e5bf89 | |||
| 3aca1afecb | |||
| fdff2c2688 | |||
| 97dcc9c909 | |||
| 7ef5d2bbb9 | |||
| fc23cb6e90 | |||
| c39f1d38e9 | |||
| c1ec367133 | |||
| 23a7243b58 | |||
| c11c49f0e2 | |||
| 92c598727a | |||
| a581d96eef | |||
| 716a9e6470 | |||
| 7b695d94f7 | |||
| 1ddff719cb | |||
| 6ba4541d87 | |||
| a08dfcf4c1 | |||
| f1fc074f1f | |||
| 77adf10d54 | |||
| 28987cdb2e | |||
| 1ea76ef718 | |||
| b490042c20 | |||
| 213d2a579f | |||
| 4d4bf30046 | |||
| 5714a40b25 | |||
| 36ebb57c97 | |||
| 3f2fb7cca2 | |||
| a360a0fafe | |||
| d95aa9d12c | |||
| 41966da44e | |||
| daa2e6a426 |
61
.gitea/workflows/build.yaml
Normal file
61
.gitea/workflows/build.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
|
||||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
Build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v5
|
||||
- name: Setup Node v20
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd ${{ gitea.workspace }}
|
||||
npm ci
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Save Build Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-artifact
|
||||
path: ${{ gitea.workspace }}/build/*
|
||||
include-hidden-files: true
|
||||
|
||||
Upload:
|
||||
runs-on: ubuntu-latest
|
||||
needs: Build
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: build-artifact
|
||||
path: ${{ gitea.workspace }}/build
|
||||
- name: setup ssh
|
||||
run: |
|
||||
mkdir -p ~/.ssh/
|
||||
echo "$SSH_PRIVATE_KEY" > ../private.key
|
||||
sudo chmod 600 ../private.key
|
||||
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
||||
shell: bash
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{secrets.SSH_KEY}}
|
||||
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
|
||||
- name: upload to web
|
||||
run: |
|
||||
scp -r -i ${{ gitea.workspace }}/../private.key -P ${{ secrets.BLOG_PORT }} build blog@madeio.net:/var/www/html/
|
||||
ssh -i ${{ gitea.workspace }}/../private.key -p ${{ secrets.BLOG_PORT }} blog@madeio.net "$PERM_COPY"
|
||||
env:
|
||||
PERM_COPY: chmod -R 775 /var/www/html/build; cp -r /var/www/html/build/* /var/www/html/; rm -r /var/www/html/build
|
||||
- name: cleanup ssh
|
||||
run: |
|
||||
rm ${{ gitea.workspace }}/../private.key
|
||||
rm ~/.ssh/known_hosts
|
||||
@@ -1,24 +0,0 @@
|
||||
|
||||
|
||||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
Build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v5
|
||||
- run: |
|
||||
cd ${{ gitea.workspace }}
|
||||
- run: npm i
|
||||
- run: npm run build
|
||||
- run: ls build
|
||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||
@@ -14,10 +14,13 @@
|
||||
<link rel="icon" href={favicon} />
|
||||
</svelte:head>
|
||||
|
||||
<nav>
|
||||
<nav class="media-margin">
|
||||
<a href="/">Home</a>
|
||||
<a href="/about">About</a>
|
||||
<a href="https://bsky.app/profile/amyt3a.bsky.social"
|
||||
<a
|
||||
href="https://bsky.app/profile/amyt3a.bsky.social"
|
||||
aria-label="Link to my Bluesky account"
|
||||
target="_blank"
|
||||
><svg fill="none" class="bsky" viewBox="0 0 64 57"
|
||||
><path
|
||||
fill="var(--rp-moon-pine)"
|
||||
@@ -27,3 +30,33 @@
|
||||
>
|
||||
</nav>
|
||||
{@render children?.()}
|
||||
|
||||
<style>
|
||||
nav {
|
||||
font-family: 'Fraunces', serif;
|
||||
font-optical-sizing: auto;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-variation-settings:
|
||||
'SOFT' 0,
|
||||
'WONK' 0;
|
||||
font-size: 1.728rem;
|
||||
}
|
||||
|
||||
.bsky {
|
||||
display: block;
|
||||
height: 2rem;
|
||||
float: right;
|
||||
}
|
||||
|
||||
nav a {
|
||||
margin: 1rem;
|
||||
margin-left: 0rem;
|
||||
padding-left: 0rem;
|
||||
#border-bottom: solid var(--rp-moon-foam);
|
||||
color: var(--rp-moon-foam);
|
||||
&:visited {
|
||||
color: var(--rp-moon-foam);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
42
src/routes/+page.server.ts
Normal file
42
src/routes/+page.server.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import type { SvelteComponent } from 'svelte';
|
||||
import type { MDsveXComponent } from '$lib/types';
|
||||
|
||||
export interface BlogEntry {
|
||||
title: string;
|
||||
src: string;
|
||||
src_target: string;
|
||||
img: string;
|
||||
date: string;
|
||||
desc: string;
|
||||
}
|
||||
|
||||
|
||||
export function load() {
|
||||
const blog_entries: BlogEntry[] =
|
||||
Object.entries(import.meta.glob('/src/routes/blogs/**/+page.svx', { eager: true }))
|
||||
.map(([key, value]) => [
|
||||
key.split('/src/routes').pop()?.split('/+page.svx').slice(0, -1).pop() as string,
|
||||
value as MDsveXComponent
|
||||
])
|
||||
.map(([link, val]) =>
|
||||
typeof val.metadata?.src !== 'undefined' ? [val.metadata?.src, val] : [link, val]
|
||||
)
|
||||
.map(([link, val]) => {
|
||||
val.metadata.date = Date.parse(val.metadata.date);
|
||||
return [link, val];
|
||||
})
|
||||
.sort(([link1, a], [link2, b]) => b.metadata?.date - a.metadata?.date)
|
||||
.map(([link, val]) => {
|
||||
return {
|
||||
src: link,
|
||||
src_target: (link.includes('https://') || link.includes('http://')) ? '_blank' : '',
|
||||
title: val.metadata.title,
|
||||
img: val.metadata.img,
|
||||
date: new Date(val.metadata.date).toDateString(),
|
||||
desc: val.metadata.desc
|
||||
}
|
||||
})
|
||||
return {
|
||||
blogs: blog_entries
|
||||
};
|
||||
}
|
||||
@@ -1,62 +1,48 @@
|
||||
<script lang="ts">
|
||||
import type { MDsveXComponent } from '$lib/types';
|
||||
import type { SvelteComponent } from 'svelte';
|
||||
import './style-entries.css';
|
||||
import type { BlogEntry } from './+page.server.ts';
|
||||
|
||||
let blog_entries: [string, SvelteComponent][] = Object.entries(
|
||||
import.meta.glob('/src/routes/blogs/**/+page.svx', { eager: true })
|
||||
).map(([key, value]) => [
|
||||
key.split('/src/routes').pop()?.split('/+page.svx').slice(0, -1).pop() as string,
|
||||
value as MDsveXComponent
|
||||
]).map(([link,val])=>
|
||||
typeof val.metadata?.src !== 'undefined' ? [val.metadata?.src, val] : [link,val]
|
||||
).map(([link,val])=>{
|
||||
if(val.metadata)
|
||||
val.metadata.date = Date.parse(val.metadata?.date);
|
||||
return [link,val];
|
||||
}
|
||||
).sort(([link1,a],[link2,b])=>b.metadata?.date-a.metadata?.date);
|
||||
console.log(blog_entries);
|
||||
let { data } = $props();
|
||||
let blogs = data.blogs as BlogEntry[];
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Home - Amys Blog</title>
|
||||
<meta property="og:title" content="Home - Amys Blog" />
|
||||
</svelte:head>
|
||||
|
||||
<main>
|
||||
<div class="start">
|
||||
<h1>Welcome to SvelteKit</h1>
|
||||
<p>
|
||||
Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation
|
||||
</p>
|
||||
</div>
|
||||
{#each blog_entries as [href, page]}
|
||||
<a {href}>
|
||||
<div class="blog-entry">
|
||||
<div>
|
||||
<h4>{page.metadata?.title}</h4>
|
||||
<p>{page.metadata?.desc}</p>
|
||||
<p class="date">{new Date(page.metadata?.date).toDateString()}</p>
|
||||
</div>
|
||||
<img src="blog-1.png" class="blog-image" />
|
||||
<div class="media-margin">
|
||||
<h1>Hi, I'm Amy</h1>
|
||||
<p>
|
||||
This is a collection of things I've set up and created that I think might interest others.
|
||||
</p>
|
||||
</div>
|
||||
{#each blogs as blog (blog.src)}
|
||||
<a href={blog.src} target={blog.src_target} class="blog-entry">
|
||||
<div>
|
||||
<h4>{blog.title}</h4>
|
||||
<p>{blog.desc}</p>
|
||||
<p class="date">{blog.date}</p>
|
||||
</div>
|
||||
<img src="blog-1.png" alt="Preview of the described article" />
|
||||
</a>
|
||||
<br />
|
||||
<!-- svelte:component this={page.default} /-->
|
||||
{/each}
|
||||
</main>
|
||||
|
||||
<style>
|
||||
|
||||
.start {
|
||||
padding: var(--d2);
|
||||
}
|
||||
|
||||
.blog-entry {
|
||||
display: block;
|
||||
margin: var(--d3) 0;
|
||||
background: var(--rp-moon-surface);
|
||||
border-radius: var(--border-round);
|
||||
width: 100%;
|
||||
color: var(--rp-moon-text);
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
box-shadow: 0px 0px 1rem 0px hsl(from var(--rp-moon-base) h s calc(l * 0.75));
|
||||
transition: 0.2s;
|
||||
box-shadow: 0px 0px 1rem 0px hsl(from var(--rp-moon-base) h s calc(l * 0.55));
|
||||
transition: 0.2s;
|
||||
}
|
||||
|
||||
.blog-entry:hover {
|
||||
@@ -66,8 +52,8 @@
|
||||
}
|
||||
|
||||
.blog-entry div {
|
||||
width: calc(100% - 15rem - var(--d2) * 2);
|
||||
padding: var(--d2);
|
||||
width: calc(100% - 15rem - var(--d3) * 2);
|
||||
padding: var(--d3);
|
||||
}
|
||||
|
||||
.blog-entry img {
|
||||
@@ -78,13 +64,14 @@
|
||||
|
||||
@media only screen and (max-width: 700px) {
|
||||
.blog-entry div {
|
||||
width: calc(100% - var(--d2) * 2);
|
||||
width: calc(100% - var(--d1) * 2);
|
||||
padding: var(--d1);
|
||||
}
|
||||
|
||||
.blog-entry img {
|
||||
width: 100%;
|
||||
max-height: 14rem;
|
||||
border-radius: 0 0rem var(--border-round) var(--border-round) ;
|
||||
border-radius: 0 0rem var(--border-round) var(--border-round);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<svelte:head>
|
||||
<title>About - Amys Blog</title>
|
||||
<meta property="og:title" content="About - Amys Blog" />
|
||||
</svelte:head>
|
||||
|
||||
<main>
|
||||
<div class="media-margin">
|
||||
<h1>About</h1>
|
||||
<p>
|
||||
Hi, I'm Amy Retzerau! I'm a computer science student who wants to share my hobby in the hope
|
||||
of helping like-minded people.
|
||||
</p>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
7
src/routes/blogs/a.svelte
Normal file
7
src/routes/blogs/a.svelte
Normal file
@@ -0,0 +1,7 @@
|
||||
<script lang="ts">
|
||||
export let href;
|
||||
|
||||
let target = href.includes('https://') || href.includes('http://') ? '_blank' : '';
|
||||
</script>
|
||||
|
||||
<a {href} {target}><slot /></a>
|
||||
@@ -1,9 +1,10 @@
|
||||
<script context="module">
|
||||
import img from './img.svelte';
|
||||
import a from './a.svelte';
|
||||
import h1 from './h1.svelte';
|
||||
import h2 from './h2.svelte';
|
||||
import h3 from './h3.svelte';
|
||||
export { img, h1, h2, h3 };
|
||||
export { img, a, h1, h2, h3 };
|
||||
</script>
|
||||
|
||||
<script>
|
||||
@@ -11,15 +12,20 @@
|
||||
export let date;
|
||||
export let desc;
|
||||
|
||||
let ddate = new Date(Date.parse(date));
|
||||
let ddate = new Date(Date.parse(date)).toDateString();
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>{title} - Amys Blog</title>
|
||||
<meta property="og:title" content={title} />
|
||||
</svelte:head>
|
||||
|
||||
<main>
|
||||
<div class="title">
|
||||
<div class="title media-margin">
|
||||
<!-- prettier-ignore -->
|
||||
<h1>{title}</h1><p class="date">Last updated {ddate.toDateString()}</p>
|
||||
<h1>{title}</h1><p class="date">Last updated {ddate}</p>
|
||||
</div>
|
||||
<div class="blog-text">
|
||||
<div class="blog-text media-margin">
|
||||
<p>{desc}</p>
|
||||
<slot>
|
||||
<!-- the mdsvex content will be slotted in here -->
|
||||
@@ -33,18 +39,8 @@
|
||||
border-radius: 1rem;
|
||||
}
|
||||
|
||||
.title {
|
||||
padding: 0 var(--d3) 0;
|
||||
#display: table;
|
||||
flex-wrap: row;
|
||||
#height: 5rem;
|
||||
margin-bottom: -12px;
|
||||
#white-space: nowrap;
|
||||
}
|
||||
|
||||
.title h1 {
|
||||
width: calc(100% - 15rem);
|
||||
margin: 0;
|
||||
vertical-align: baseline;
|
||||
display: inline-block;
|
||||
}
|
||||
@@ -57,6 +53,12 @@
|
||||
#float: right;
|
||||
}
|
||||
|
||||
.blog-text {
|
||||
border-radius: var(--border-round);
|
||||
#background: var(--rp-moon-surface);
|
||||
#box-shadow: 0px 0px 0.5rem 0px hsl(from var(--rp-moon-pine) h calc(s * 0.5) calc(l * 0.25));
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 700px) {
|
||||
.title {
|
||||
margin-bottom: -5.3px;
|
||||
@@ -71,11 +73,4 @@
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.blog-text {
|
||||
border-radius: var(--border-round);
|
||||
background: var(--rp-moon-surface);
|
||||
box-shadow: 0px 0px 0.5rem 0px hsl(from var(--rp-moon-pine) h calc(s * 0.5) calc(l * 0.25));
|
||||
padding: var(--d2) var(--d3) var(--d4);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
.blog-text{
|
||||
border-radius: 0.5rem;
|
||||
background: var(--rp-moon-surface);
|
||||
box-shadow: 0px 0px 1rem 0px hsl(from var(--rp-moon-base) h s calc(l * 0.85));
|
||||
margin: -1rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&display=swap');
|
||||
|
||||
@font-face {
|
||||
font-family: 'fira';
|
||||
font-style: normal;
|
||||
@@ -49,14 +47,14 @@ body {
|
||||
}
|
||||
|
||||
code {
|
||||
background: var(--rp-moon-base);
|
||||
background: var(--rp-moon-surface) !important;
|
||||
padding: 3px;
|
||||
border-radius: 0.5rem;
|
||||
font-family: fira;
|
||||
}
|
||||
|
||||
pre {
|
||||
background: var(--rp-moon-base);
|
||||
background: var(--rp-moon-surface) !important;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
@@ -78,35 +76,7 @@ h1,h2,h3,h4,p:first-child {
|
||||
}
|
||||
|
||||
|
||||
nav {
|
||||
margin-top: 1rem;
|
||||
|
||||
padding: 0 var(--d3) 0;
|
||||
|
||||
font-family: "Fraunces", serif;
|
||||
font-optical-sizing: auto;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-variation-settings:
|
||||
"SOFT" 0,
|
||||
"WONK" 0;
|
||||
font-size:1.728rem;
|
||||
}
|
||||
|
||||
nav a{
|
||||
margin: 1rem;
|
||||
margin-left: 0rem;
|
||||
padding-left: 0rem;
|
||||
color: var(--rp-moon-foam);
|
||||
#text-decoration: underline;
|
||||
&:visited {
|
||||
color: var(--rp-moon-foam);
|
||||
}
|
||||
}
|
||||
|
||||
main {
|
||||
#padding: 0 2rem 2rem;
|
||||
margin-top: var(--d3);
|
||||
width: 100%;
|
||||
#box-shadow: 0px 0px 1rem 0px hsl(from var(--rp-moon-base) h s calc(l * 0.85));
|
||||
}
|
||||
@@ -121,11 +91,6 @@ hr {
|
||||
color: var(--rp-moon-muted);
|
||||
}
|
||||
|
||||
.bsky{
|
||||
display:block;
|
||||
height: 2rem;
|
||||
float:right;
|
||||
}
|
||||
|
||||
h1{font-size: 2.986rem}
|
||||
h2{font-size: 2.488rem}
|
||||
@@ -147,4 +112,14 @@ h4{
|
||||
color: var(--rp-moon-foam);
|
||||
}
|
||||
|
||||
.media-margin{
|
||||
margin: var(--d3);
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 700px) {
|
||||
.media-margin{
|
||||
margin: var(--d3) var(--d1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user