hacks-guide-minimal-mistake.../_docs/04-upgrading.md

50 lines
2.4 KiB
Markdown
Raw Normal View History

2016-04-04 22:36:26 +02:00
---
title: "Upgrading"
permalink: /docs/upgrading/
2016-04-14 15:20:44 +02:00
excerpt: "Instructions and suggestions for upgrading the theme."
2016-04-04 22:36:26 +02:00
sidebar:
2016-04-06 03:50:10 +02:00
title: "v3.0"
2016-04-04 22:36:26 +02:00
nav: docs
2016-04-13 23:10:01 +02:00
modified: 2016-04-13T15:54:02-04:00
2016-04-04 22:36:26 +02:00
---
{% include base_path %}
2016-04-06 04:35:15 +02:00
Currently there is no good way of upgrading the theme without doing a bit of manual work. The future looks promising with [**gem based themes**](https://github.com/jekyll/jekyll/pull/4595) on the horizon, but for now here's some suggestions on how handle theme updates.
2016-04-04 22:36:26 +02:00
## Use Git
2016-04-14 04:38:28 +02:00
If you want to get the most out of the Jekyll + GitHub Pages workflow, then you'll need to utilize Git. To pull down theme updates you must first ensure there's an upstream remote. If you forked the theme's repo then you're likely good to go.
2016-04-06 04:35:15 +02:00
2016-04-12 20:34:36 +02:00
To double check, run `git remote -v` and verify that you can fetch from `origin {{ site.gh_repo }}/minimal-mistakes.git`.
2016-04-06 04:35:15 +02:00
To add it you can do the following:
```bash
2016-04-12 20:34:36 +02:00
$ git remote add upstream {{ site.gh_repo }}/minimal-mistakes.git
2016-04-06 04:35:15 +02:00
```
### Pull Down Updates
2016-04-14 04:38:28 +02:00
Now you can pull any commits made to theme's `master` branch with:
2016-04-06 04:35:15 +02:00
```bash
$ git pull upstream master
```
2016-04-14 04:38:28 +02:00
Depending on the amount of customizations you've made after forking, there's likely to be merge conflicts. Work through any conflicting files Git flags, stagging the changes you wish to keep, and then commit them.
2016-04-06 04:35:15 +02:00
## Update Files Manually
2016-04-14 04:38:28 +02:00
Another way of dealing with updates is [downloading the theme]({{ site.gh_repo }}/archive/master.zip) --- replacing your layouts, includes, and assets with the newer ones manually. To be sure that you don't miss any changes it's probably a good idea to review the theme's [commit history]({{ site.gh_repo }}/commits/master) to see what's changed since.
2016-04-06 04:35:15 +02:00
2016-04-06 21:50:42 +02:00
Here's a quick checklist of the important folders/files you'll want to be mindful of:
2016-04-06 04:35:15 +02:00
2016-04-14 04:38:28 +02:00
| Name | |
| ---- | --- |
| `_layouts` | Replace all. Apply edits if you customized any layouts. |
| `_includes` | Replace all. Apply edits if you customized any includes. |
| `assets` | Replace all. Apply edits if you customized stylesheets or scripts. |
| `_data/navigation.yml` | Safe to keep. Verify that there were no major structural changes or additions. |
| `_data/ui-text.yml` | Safe to keep. Verify that there were no major structural changes or additions. |
| `_config.yml` | Safe to keep. Verify that there were no major structural changes or additions. |