Compare commits
5 commits
Author | SHA1 | Date | |
---|---|---|---|
c1b24a1d5f | |||
6494a3bbed | |||
08bcc85c93 | |||
62862b560f | |||
4c4730e812 |
5 changed files with 854 additions and 883 deletions
11
.build.yml
Normal file
11
.build.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
image: alpine/edge
|
||||
secrets:
|
||||
- bbfcb6dc-7c4a-42ee-a11a-022f0339a133
|
||||
environment:
|
||||
REPO: astro-resume
|
||||
GH_USER: ayoayco
|
||||
tasks:
|
||||
- push-mirror: |
|
||||
cd ~/"${REPO}"
|
||||
git config --global credential.helper store
|
||||
git push --mirror "https://github.com/${GH_USER}/${REPO}"
|
|
@ -1,4 +1,5 @@
|
|||
> **>>> TL;DR:** This facilitates the *creation* and *usage* of global, immutable data for [Astro](https://astro.build) apps
|
||||
> [!NOTE]
|
||||
> This project moved to [SourceHut](https://git.sr.ht/~ayoayco/astro-resume).
|
||||
|
||||
# Astro Resume
|
||||
|
||||
|
@ -204,4 +205,3 @@ See the [TODO tracker](https://todo.sr.ht/~ayoayco/astro-resume) for planned wor
|
|||
## Reporting Issues
|
||||
|
||||
To report issues or request features, send a plain text email to [~ayoayco/astro-resume@todo.sr.ht](mailto:~ayoayco/astro-resume@todo.sr.ht) or file a ticket via [SourceHut](https://todo.sr.ht/~ayoayco/astro-resume)
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"name": "@ayco/astro-resume",
|
||||
"author": "Ayo Ayco",
|
||||
"homepage": "https://github.com/ayoayco/astro-resume",
|
||||
"homepage": "https://ayco.io/sh/astro-resume",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ayoayco/astro-resume"
|
||||
"url": "https://git.sr.ht/~ayoayco/astro-resume"
|
||||
},
|
||||
"type": "module",
|
||||
"version": "0.4.2",
|
||||
"version": "0.4.3",
|
||||
"keywords": [
|
||||
"astro-component",
|
||||
"css",
|
||||
|
@ -35,6 +35,6 @@
|
|||
"devalue": "^5.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^4.12.2"
|
||||
"astro": "^5"
|
||||
}
|
||||
}
|
||||
|
|
1652
pnpm-lock.yaml
1652
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -2,12 +2,12 @@
|
|||
import Serialize from "../Serialize.astro";
|
||||
import { stringify } from "devalue";
|
||||
const data = {
|
||||
name: 'John Doe',
|
||||
isOkay: true,
|
||||
mood: null,
|
||||
now: new Date(),
|
||||
age: BigInt('3218378192378')
|
||||
}
|
||||
nameStr: "John Doe",
|
||||
isOkayBool: true,
|
||||
moodNull: null,
|
||||
nowDate: new Date(),
|
||||
ageBigInt: BigInt("3218378192378"),
|
||||
};
|
||||
export type Data = typeof data;
|
||||
---
|
||||
|
||||
|
@ -15,30 +15,30 @@ export type Data = typeof data;
|
|||
<Serialize data={data} id="my-data" use={stringify} />
|
||||
|
||||
<script>
|
||||
import { deserialize } from '../deserialize';
|
||||
import { parse } from 'devalue';
|
||||
import type { Data } from './index.astro';
|
||||
import { deserialize } from "../deserialize";
|
||||
import { parse } from "devalue";
|
||||
import type { Data } from "./index.astro";
|
||||
|
||||
const data = deserialize<Data>('my-data', parse);
|
||||
const data = deserialize<Data>("my-data", parse);
|
||||
console.log(data);
|
||||
|
||||
Object.keys(data).forEach(key => console.log(key, data[key], typeof data[key]))
|
||||
Object.keys(data).forEach((key) =>
|
||||
console.log(key, data[key], typeof data[key])
|
||||
);
|
||||
|
||||
// render table to render-here
|
||||
const table = document.createElement('table');
|
||||
const tbody = document.createElement('tbody');
|
||||
const table = document.createElement("table");
|
||||
const tbody = document.createElement("tbody");
|
||||
table.appendChild(tbody);
|
||||
Object.keys(data).forEach(key => {
|
||||
const tr = document.createElement('tr');
|
||||
const tdKey = document.createElement('td');
|
||||
const tdValue = document.createElement('td');
|
||||
Object.keys(data).forEach((key) => {
|
||||
const tr = document.createElement("tr");
|
||||
const tdKey = document.createElement("td");
|
||||
const tdValue = document.createElement("td");
|
||||
tdKey.textContent = key;
|
||||
tdValue.textContent = data[key];
|
||||
tr.appendChild(tdKey);
|
||||
tr.appendChild(tdValue);
|
||||
tbody.appendChild(tr);
|
||||
});
|
||||
document.getElementById('render-here').appendChild(table);
|
||||
|
||||
|
||||
document.getElementById("render-here").appendChild(table);
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue