Skip to content

Commit 610f325

Browse files
committed
Upgrading to v7.4.1: Adding Upgrade.md
1 parent d360495 commit 610f325

File tree

1 file changed

+168
-0
lines changed

1 file changed

+168
-0
lines changed

upgrade.MD

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Upgrade Guide: Jekyll Chirpy Theme
2+
3+
This guide provides instructions to upgrade the Jekyll Chirpy theme from version 6.2 to the latest version, 7.4.1.
4+
5+
This guide will also be used as reference on future upgrades.
6+
7+
## Prerequisites
8+
9+
- Git installed
10+
- Ruby and Bundler installed
11+
12+
## Upgrade Steps
13+
14+
### 0. Compare the current version with latest ()
15+
Current Version: v6.2.2
16+
Latest Version: v7.4.1
17+
https://github.com/cotes2020/chirpy-starter/compare/v6.2.2...v7.4.1
18+
19+
### 1. Add the Upstream Remote
20+
21+
If you haven't done so before, add the `chirpy-starter` repository as a remote to your local Git repository.
22+
23+
```bash
24+
git remote add chirpy https://github.com/cotes2020/chirpy-starter.git
25+
```
26+
27+
To verify the remote was added successfully, run:
28+
29+
```bash
30+
git remote -v
31+
```
32+
33+
You should see `chirpy` in the output.
34+
35+
### 2. Fetch the Latest Updates
36+
37+
Fetch all the tags from the upstream `chirpy` remote:
38+
39+
```bash
40+
git fetch chirpy --tags
41+
```
42+
43+
### 3. Merge the Latest Version
44+
45+
Merge the latest tag from upstream into your local branch.
46+
47+
```bash
48+
git merge v7.4.1 --squash --allow-unrelated-histories
49+
```
50+
51+
**Note:** The `--squash` flag combines all the changes from upstream into a single commit, keeping your commit history clean. The `--allow-unrelated-histories` flag is necessary if your local branch and the upstream theme do not share a common Git history.
52+
53+
### 4. Resolve Merge Conflicts
54+
55+
It is common to encounter merge conflicts, especially if you have made customizations to the theme files. You will need to manually resolve these conflicts.
56+
57+
- Run `git status` to see a list of unmerged files.
58+
- Open each conflicting file in a text editor. You will see the conflicting changes marked with `<<<<<<<`, `=======`, and `>>>>>>>`.
59+
- Edit the files to keep your changes, the theme's updates, or a combination of both. Remove the conflict markers.
60+
- Once you have resolved the conflicts in a file, stage it using `git add <filename>`.
61+
62+
### 5. Commit the Changes
63+
64+
After resolving all conflicts, commit the changes to your local repository:
65+
66+
```bash
67+
git commit -m "Upgrade to v7.4.1"
68+
```
69+
70+
### 6. Update Dependencies
71+
72+
Finally, update your local theme gems:
73+
74+
```bash
75+
bundle update
76+
```
77+
78+
## Post-Upgrade
79+
80+
### Check for Breaking Changes
81+
82+
Before upgrading, it's a good practice to check the release notes on GitHub for any breaking changes or specific instructions for the new version.
83+
84+
### Local Testing
85+
86+
After upgrading, always test your website locally to ensure everything works as expected before deploying the changes. You can run your site locally with:
87+
88+
```bash
89+
bundle exec jekyll serve -l
90+
OR
91+
bash tools/run.sh
92+
```
93+
94+
## Rollback Process
95+
96+
If the upgrade introduces issues or does not work as expected, you can revert the changes using Git.
97+
98+
### 1. Revert the Merge Commit
99+
100+
If you followed the upgrade steps and created a single merge commit (as suggested with `--squash`), you can revert this commit:
101+
102+
```bash
103+
git revert <commit-hash-of-upgrade>
104+
```
105+
106+
To find the commit hash, you can use `git log`. Look for the commit message "Upgrade to v7.4.1" (or whatever message you used).
107+
108+
### 2. Reset to a Previous State (Use with Caution)
109+
110+
If you need to discard all changes since the last good commit before the upgrade, you can perform a hard reset. **Be extremely careful with this command as it will discard all uncommitted changes and revert your working directory to the state of the specified commit.**
111+
112+
```bash
113+
git reset --hard <commit-hash-before-upgrade>
114+
```
115+
116+
Replace `<commit-hash-before-upgrade>` with the hash of the commit *before* you started the upgrade process.
117+
118+
### 3. Clean Up Dependencies
119+
120+
After reverting the code, you might also need to revert your `Gemfile.lock` or run `bundle install` to ensure your dependencies match the reverted state.
121+
122+
```bash
123+
bundle install
124+
```
125+
126+
## Results
127+
128+
The upgrade to Jekyll Chirpy theme version 7.4.1 was successfully completed, but it encountered and resolved several issues:
129+
130+
### Issues Encountered
131+
132+
1. **Native gem compilation errors**: During `bundle update`, the process failed when trying to compile the `json` (version 2.15.2) and `racc` (version 1.8.1) gems. The error was caused by a missing `gmkdir` utility in the build process on macOS.
133+
134+
2. **YAML syntax error**: After resolving the gem compilation issues, starting the Jekyll server revealed a YAML syntax error in `_data/share.yml` at line 5, column 27. The first entry had improperly formatted inline syntax where `icon` was on the same line as `type`.
135+
136+
3. **Incorrect Image Paths**: After upgrading, the images on each post were not being rendered.
137+
138+
### Solutions Applied
139+
140+
1. **Fixed native gem compilation**:
141+
- Installed the `coreutils` package via `brew install coreutils` to provide the missing `gmkdir` utility
142+
- Installed the problematic gems individually: `gem install json -v '2.15.2'` and `gem install racc -v '1.8.1'`
143+
- Then successfully ran `bundle update` to complete the dependency updates
144+
145+
2. **Fixed YAML syntax error**:
146+
- Corrected the formatting in `_data/share.yml` where the LinkedIn platform entry had invalid inline syntax
147+
- Changed from `type: Linkedin icon: "fab fa-linkedin"` to separate lines:
148+
```yaml
149+
- type: Linkedin
150+
icon: "fab fa-linkedin"
151+
link: "https://www.linkedin.com/sharing/share-offsite/?url=URL"
152+
```
153+
3. **Incorrect Image Paths**:
154+
155+
BEFORE:
156+
157+
![Maintenance's Logical Diagram](2020-09-21/fig2-maintenance-changes.webp){: w="900" h="600" }
158+
159+
AFTER
160+
![Maintenance's Logical Diagram](/assets/img/posts/2020-09-21/fig2-maintenance-changes.webp){: w="900" h="600" }
161+
162+
### Final Status
163+
164+
- Jekyll theme successfully upgraded to Chirpy v7.4.1
165+
- All dependencies updated and compatible
166+
- Local Jekyll server running successfully at http://127.0.0.1:4000
167+
- Site builds without errors
168+
- Ready for deployment

0 commit comments

Comments
 (0)