Skip to content

Commit

Permalink
Migrated repo
Browse files Browse the repository at this point in the history
  • Loading branch information
gunbux committed Apr 2, 2024
0 parents commit 77dd709
Show file tree
Hide file tree
Showing 26 changed files with 10,642 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .direnv/bin/nix-direnv-reload
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
if [[ ! -d "/home/chun/repo/self-hosting" ]]; then
echo "Cannot find source directory; Did you move it?"
echo "(Looking for "/home/chun/repo/self-hosting")"
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
exit 1
fi

# rebuild the cache forcefully
_nix_direnv_force_reload=1 direnv exec "/home/chun/repo/self-hosting" true

# Update the mtime for .envrc.
# This will cause direnv to reload again - but without re-building.
touch "/home/chun/repo/self-hosting/.envrc"

# Also update the timestamp of whatever profile_rc we have.
# This makes sure that we know we are up to date.
touch -r "/home/chun/repo/self-hosting/.envrc" "/home/chun/repo/self-hosting/.direnv"/*.rc
1 change: 1 addition & 0 deletions .direnv/nix-profile-pre579329.e92b60158819
1,893 changes: 1,893 additions & 0 deletions .direnv/nix-profile-pre579329.e92b60158819.rc

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy pages

on:
workflow_dispatch: {}
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest

permissions:
contents: read
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 'lts/*'

- name: Install dependencies
run: npm install

- name: Build
run: npm run build -- --base /self-hosting/

- uses: actions/configure-pages@v4

- uses: actions/upload-pages-artifact@v3
with:
path: dist

- name: Deploy
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
direnv
node_modules
dist
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
To build slides, do

```bash
npm run build -- --base hackertools_materials/self-hosting
```

Then, copy the `dist/` folder into the main subdirectory

```bash
cp -r dist/* ..
```

> Note: This is buggy since slidev was not designed to work in subdirectories, stuff like download is broken.
37 changes: 37 additions & 0 deletions components/Counter.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script setup lang="ts">
import { ref } from 'vue'
const props = defineProps({
count: {
default: 0,
},
})
const counter = ref(props.count)
</script>

<template>
<div flex="~" w="min" border="~ main rounded-md">
<button
border="r main"
p="2"
font="mono"
outline="!none"
hover:bg="gray-400 opacity-20"
@click="counter -= 1"
>
-
</button>
<span m="auto" p="2">{{ counter }}</span>
<button
border="l main"
p="2"
font="mono"
outline="!none"
hover:bg="gray-400 opacity-20"
@click="counter += 1"
>
+
</button>
</div>
</template>
16 changes: 16 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[build]
publish = "dist"
command = "npm run build"

[build.environment]
NODE_VERSION = "18"

[[redirects]]
from = "/.well-known/*"
to = "/.well-known/:splat"
status = 200

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
Loading

0 comments on commit 77dd709

Please sign in to comment.