Skip to content

Commit 529db54

Browse files
committed
update
1 parent 44c0dff commit 529db54

File tree

299 files changed

+424
-32
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

299 files changed

+424
-32
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
POSTS_PATH=/Users/alantseng/Library/Mobile\ Documents/iCloud\~md\~obsidian/Documents/Alanhc/alanhc.github.io

.github/workflows/gh-pages.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: github pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-20.04
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Setup mdBook
18+
uses: peaceiris/actions-mdbook@v2
19+
with:
20+
mdbook-version: '0.4.10'
21+
# mdbook-version: 'latest'
22+
23+
- run: mdbook build
24+
25+
- name: Deploy
26+
uses: peaceiris/actions-gh-pages@v3
27+
if: ${{ github.ref == 'refs/heads/main' }}
28+
with:
29+
github_token: ${{ secrets.GITHUB_TOKEN }}
30+
publish_dir: ./book

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.env
1+
book

README.md

Lines changed: 2 additions & 1 deletion

book.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[book]
2+
authors = ["alanhc"]
3+
language = "en"
4+
multilingual = false
5+
src = "src"
6+
title = "alanhc-til"

posts/.DS_Store

-22 KB
Binary file not shown.

posts/20240114-product-insight.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

scripts/book.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
generate_links() {
2+
local dir="$1"
3+
local level="$2"
4+
local output_file="$3"
5+
6+
local has_files=false
7+
for file in "$dir"/*; do
8+
# local filename=$(basename "$file")
9+
if [ -d "$file" ]; then
10+
local filename=$(basename "$file")
11+
local name="${filename%.*}"
12+
echo "# $name" >> "$output_file"
13+
14+
for f in "$file"/*; do
15+
local filename=$(basename "$f")
16+
local name="${filename%.*}"
17+
#local file_out="$(printf ' %.0s' $(seq 0 $level))- [$name]($f)"
18+
formatted_path=$(echo "$f" | sed -E 's|^\./src/||; s|//|/|g')
19+
local file_out="- [$name]($formatted_path)"
20+
echo "$file_out" >> "$output_file"
21+
# echo "- [$name]($link)"
22+
# echo "- [$name]()"
23+
done
24+
25+
elif [ -f "$file" ]; then
26+
27+
local filename=$(basename "$file")
28+
local name="${filename%.*}"
29+
#local file_out="$(printf ' %.0s' $(seq 0 $level))- [$name]($f)"
30+
formatted_path=$(echo "$file" | sed -E 's|^\./src/||; s|//|/|g')
31+
local file_out="- [$name]($formatted_path)"
32+
echo "$file_out" >> "$output_file"
33+
fi
34+
done
35+
36+
}

src/SUMMARY.md

Lines changed: 206 additions & 0 deletions

src/posts/.DS_Store

22 KB
Binary file not shown.

0 commit comments

Comments
 (0)