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
|
# Astro Resume
|
||||||
|
|
||||||
|
@ -176,7 +177,7 @@ console.log(now instanceof Date); // true
|
||||||
## Errors & Warning in `deserialize()`
|
## Errors & Warning in `deserialize()`
|
||||||
|
|
||||||
The `deserialize()` function may give you the following:
|
The `deserialize()` function may give you the following:
|
||||||
1. **ERR: No match found** - there are no `JSON` scripts with the given ID
|
1. **ERR: No match found** - there are no `JSON` scripts with the given ID
|
||||||
1. **WARNING: Multiple matches for <id>** - there were multiple `JSON` scripts found with the same ID
|
1. **WARNING: Multiple matches for <id>** - there were multiple `JSON` scripts found with the same ID
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
@ -204,4 +205,3 @@ See the [TODO tracker](https://todo.sr.ht/~ayoayco/astro-resume) for planned wor
|
||||||
## Reporting Issues
|
## 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)
|
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",
|
"name": "@ayco/astro-resume",
|
||||||
"author": "Ayo Ayco",
|
"author": "Ayo Ayco",
|
||||||
"homepage": "https://github.com/ayoayco/astro-resume",
|
"homepage": "https://ayco.io/sh/astro-resume",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/ayoayco/astro-resume"
|
"url": "https://git.sr.ht/~ayoayco/astro-resume"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.4.2",
|
"version": "0.4.3",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"astro-component",
|
"astro-component",
|
||||||
"css",
|
"css",
|
||||||
|
@ -35,6 +35,6 @@
|
||||||
"devalue": "^5.1.1"
|
"devalue": "^5.1.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"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,43 +2,43 @@
|
||||||
import Serialize from "../Serialize.astro";
|
import Serialize from "../Serialize.astro";
|
||||||
import { stringify } from "devalue";
|
import { stringify } from "devalue";
|
||||||
const data = {
|
const data = {
|
||||||
name: 'John Doe',
|
nameStr: "John Doe",
|
||||||
isOkay: true,
|
isOkayBool: true,
|
||||||
mood: null,
|
moodNull: null,
|
||||||
now: new Date(),
|
nowDate: new Date(),
|
||||||
age: BigInt('3218378192378')
|
ageBigInt: BigInt("3218378192378"),
|
||||||
}
|
};
|
||||||
export type Data = typeof data;
|
export type Data = typeof data;
|
||||||
---
|
---
|
||||||
|
|
||||||
<div id="render-here"></div>
|
<div id="render-here"></div>
|
||||||
<Serialize data={data} id="my-data" use={stringify}/>
|
<Serialize data={data} id="my-data" use={stringify} />
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { deserialize } from '../deserialize';
|
import { deserialize } from "../deserialize";
|
||||||
import { parse } from 'devalue';
|
import { parse } from "devalue";
|
||||||
import type { Data } from './index.astro';
|
import type { Data } from "./index.astro";
|
||||||
|
|
||||||
const data = deserialize<Data>('my-data', parse);
|
const data = deserialize<Data>("my-data", parse);
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|
||||||
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');
|
|
||||||
table.appendChild(tbody);
|
|
||||||
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);
|
|
||||||
|
|
||||||
|
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");
|
||||||
|
table.appendChild(tbody);
|
||||||
|
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);
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue