Skip to content

Commit b8d8bb6

Browse files
committed
Generated a temp story for each point. As well I add a generate step for the json file
1 parent 5e1745a commit b8d8bb6

74 files changed

Lines changed: 562 additions & 449 deletions

Some content is hidden

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

.github/workflows/deploy.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,20 @@ jobs:
3131
- name: Setup Pages
3232
uses: actions/configure-pages@v4
3333

34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: '18'
38+
3439
- name: Build site
3540
run: |
3641
echo "Building static site..."
37-
# Since this is a static site, we just need to prepare the files
38-
# Remove any development-only files if needed
42+
# Generate tips.json from markdown files
43+
node scripts/build-tips.js
44+
# Remove any development-only files
3945
find . -name ".DS_Store" -delete 2>/dev/null || true
46+
# Remove build scripts from deployment
47+
rm -rf scripts/
4048
4149
- name: Upload artifact
4250
uses: actions/upload-pages-artifact@v3

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated files
2+
data/tips.json
3+
4+
# OS generated files
5+
.DS_Store
6+
.DS_Store?
7+
._*
8+
.Spotlight-V100
9+
.Trashes
10+
ehthumbs.db
11+
Thumbs.db
12+
13+
# Editor files
14+
.vscode/
15+
.idea/
16+
*.swp
17+
*.swo
18+
*~
19+
20+
# Node modules (if any build tools are added later)
21+
node_modules/
22+
npm-debug.log
23+
yarn-error.log

CLAUDE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,16 @@ The Pragmatic Cheatsheet is a static GitHub Pages website that provides an inter
1111
- **Story format**: Stories are separated by `---` and can reference multiple tips using tag system `[34,45]`
1212
- **Deployment**: GitHub Actions builds and deploys to `gh-pages` branch
1313

14+
## Development Commands
15+
Since this is a static site with a build step:
16+
- **Local development**: `python -m http.server 8000` or `npx serve .`
17+
- **Build data**: `node scripts/build-tips.js` (generates `data/tips.json` from story files)
18+
- **Testing**: Open `index.html` in browser after building
19+
- **Deployment**: Trigger manual GitHub Actions workflow "Deploy to GitHub Pages"
20+
1421
## Development Workflow
22+
- **Content editing**: Edit markdown files in `stories/` directory
23+
- **Build process**: GitHub Actions runs `build-tips.js` to generate `tips.json` from markdown
1524
- **Main branch**: Development work
1625
- **gh-pages branch**: Deployment target (auto-generated)
1726
- **Style consistency**: Follow Acorn website design patterns (https://www.acorntechnology.se/)

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ The repository includes a GitHub Actions workflow for manual deployment to the `
6767
5. **Click "Run workflow"** to start deployment
6868

6969
The workflow will automatically:
70+
- Generate `data/tips.json` from markdown story files
7071
- Build the static site (cleanup development files)
7172
- Create/update the `gh-pages` branch
7273
- Deploy to GitHub Pages
@@ -86,13 +87,19 @@ If you encounter workflow permission errors:
8687
## Local Development
8788
To run the website locally:
8889
1. Clone the repository
89-
2. Open `index.html` in a web browser or use a local server:
90+
2. **Build the data file**: Generate `tips.json` from markdown stories
91+
```bash
92+
node scripts/build-tips.js
93+
```
94+
3. Start a local server:
9095
```bash
9196
python -m http.server 8000
9297
# or
9398
npx serve .
9499
```
95-
3. Navigate to `http://localhost:8000`
100+
4. Navigate to `http://localhost:8000`
101+
102+
**Note**: The `data/tips.json` file is generated from markdown files in the `stories/` directory and should not be edited directly.
96103

97104
## Future Improvements
98105
The following features could enhance the user experience:

data/.gitkeep

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file ensures the data/ directory is tracked in git
2+
# The actual tips.json file is generated by scripts/build-tips.js

0 commit comments

Comments
 (0)