forked from wafer-space/wafer-space.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
115 lines (100 loc) · 3.15 KB
/
Copy pathMakefile
File metadata and controls
115 lines (100 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Makefile for Jekyll site
# wafer-space.github.io
# Variables
JEKYLL := bundle exec jekyll
BUNDLE := bundle
SITE_DIR := _site
PATH := ${PATH}:/home/tim/.local/share/gem/ruby/3.2.0/bin
# Default target
.DEFAULT_GOAL := help
# Phony targets
.PHONY: help build serve clean install update verify dev production test prepimg
# Help target - shows available commands
help:
@echo "Available commands:"
@echo " make build - Build the Jekyll site"
@echo " make serve - Build and serve the site locally (default: http://localhost:4000)"
@echo " make dev - Alias for 'serve' - development mode with auto-regeneration"
@echo " make production - Build site in production mode (with JEKYLL_ENV=production)"
@echo " make clean - Remove generated site and caches"
@echo " make install - Install Ruby dependencies"
@echo " make update - Update Ruby dependencies"
@echo " make verify - Run verification script to check site output"
@echo " make test - Build site and run basic tests"
# Build the Jekyll site
build:
@echo "Building Jekyll site..."
@$(JEKYLL) build
@echo "✅ Site built successfully to $(SITE_DIR)/"
# Serve the site locally with auto-regeneration
serve:
@echo "Starting Jekyll server..."
@echo "Site will be available at http://localhost:4000"
@echo "Press Ctrl+C to stop"
@$(JEKYLL) serve --watch --incremental --future
# Alias for serve - development mode
dev: serve
# Build for production
production:
@echo "Building Jekyll site for production..."
@JEKYLL_ENV=production $(JEKYLL) build
@echo "✅ Production site built successfully to $(SITE_DIR)/"
# Clean generated files and caches
clean:
@echo "Cleaning generated files..."
@rm -rf $(SITE_DIR)
@rm -rf .jekyll-cache
@rm -rf .sass-cache
@rm -rf _site_reference _site_refactored_verify
@echo "✅ Clean complete"
# Install dependencies
install:
@echo "Installing Ruby dependencies..."
@$(BUNDLE) install
@echo "✅ Dependencies installed"
# Update dependencies
update:
@echo "Updating Ruby dependencies..."
@$(BUNDLE) update
@echo "✅ Dependencies updated"
# Run verification script if it exists
verify:
@if [ -f verify_identical_output.sh ]; then \
echo "Running verification script..."; \
./verify_identical_output.sh; \
else \
echo "❌ Verification script not found"; \
exit 1; \
fi
# Basic tests
test: build
@echo "Running basic tests..."
@echo -n "Checking HTML file count: "
@HTML_COUNT=$$(find $(SITE_DIR) -name "*.html" | wc -l); \
if [ $$HTML_COUNT -eq 17 ]; then \
echo "✅ $$HTML_COUNT HTML files (expected: 17)"; \
else \
echo "❌ $$HTML_COUNT HTML files (expected: 17)"; \
exit 1; \
fi
@echo -n "Checking theme plugin: "
@if [ -f _plugins/theme_plugin.rb ]; then \
echo "✅ Found"; \
else \
echo "❌ Not found"; \
exit 1; \
fi
@echo -n "Checking theme submodule: "
@if [ -d _theme ]; then \
echo "✅ Found"; \
else \
echo "❌ Not found"; \
exit 1; \
fi
@echo "✅ All tests passed"
# Quick build and serve (builds first, then serves)
quick: build serve
# Prepare image for website by stripping EXIF data and compressing it
prepimg:
-exif --remove $(img) -o $(img)
convert -quality 90% $(img) $(img)