forked from mmistakes/minimal-mistakes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate hard-coded version numbers where possible
Now only 4 files left untouchable. Search README.md for "Dev note" for details.
- Loading branch information
Showing
14 changed files
with
106 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,22 +115,42 @@ To install: | |
|
||
2. Add `jekyll-include-cache` to the `plugins` array of your `_config.yml`. | ||
|
||
3. Fetch and update bundled gems by running the following [Bundler](http://bundler.io/) command: | ||
3. Fetch and update bundled gems by running the following [Bundler](https://bundler.io/) command: | ||
|
||
```bash | ||
bundle | ||
``` | ||
|
||
4. Add `remote_theme: "mmistakes/[email protected]"` to your `_config.yml` file. Remove any other `theme:` or `remote_theme:` entry. | ||
|
||
<!-- | ||
Dev note: The version number is currently hard-coded in these files: | ||
|
||
- README.md (this file) | ||
- package.json | ||
- docs/_config.yml (as theme_version) | ||
- docs/_pages/home.md (in Front Matter "excerpt") | ||
|
||
For every release, files listed above should be manually updated with the new version number. | ||
|
||
Additionally, the license year is hard-coded in these files: | ||
|
||
- README.md (this file, near the end) | ||
- LICENSE | ||
|
||
The following files should also be regenerated: | ||
|
||
- _includes/copyright.html, _includes/copyright.js, _sass/minimal-mistakes/_copyright.scss | ||
(Run `bundle exec rake clean` then `bundle exec rake copyright` - all three references `package.json`) | ||
- assets/js/main.min.js (Run `npm run build:js`, references `_includes/copyright.js`) | ||
--> | ||
|
||
**Looking for an example?** Use the [Minimal Mistakes remote theme starter](https://github.com/mmistakes/mm-github-pages-starter/generate) for the quickest method of getting a GitHub Pages hosted site up and running. Generate a new repository from the starter, replace sample content with your own, and configure as needed. | ||
|
||
## Usage | ||
|
||
For detailed instructions on how to configure, customize, add/migrate content, and more read the [theme's documentation](https://mmistakes.github.io/minimal-mistakes/docs/quick-start-guide/). | ||
|
||
--- | ||
|
||
## Contributing | ||
|
||
Found a typo in the documentation or interested in [fixing a bug](https://github.com/mmistakes/minimal-mistakes/issues)? Then by all means [submit an issue](https://github.com/mmistakes/minimal-mistakes/issues/new) or [pull request](https://help.github.com/articles/using-pull-requests/). If this is your first pull request, it may be helpful to read up on the [GitHub Flow](https://guides.github.com/introduction/flow/) first. | ||
|
@@ -153,8 +173,6 @@ To set up your environment to develop this theme, run `bundle install`. | |
|
||
To test the theme, run `bundle exec rake preview` and open your browser at `http://localhost:4000/test/`. This starts a Jekyll server using content in the `test/` directory. As modifications are made to the theme and test site, it will regenerate and you should see the changes in the browser after a refresh. | ||
|
||
--- | ||
|
||
## Credits | ||
|
||
### Creator | ||
|
@@ -167,7 +185,7 @@ To test the theme, run `bundle exec rake preview` and open your browser at `http | |
|
||
### Icons + Demo Images: | ||
|
||
- [The Noun Project](https://thenounproject.com) -- Garrett Knoll, Arthur Shlain, and [tracy tam](https://thenounproject.com/tracytam) | ||
- [The Noun Project](https://thenounproject.com) - Garrett Knoll, Arthur Shlain, and [tracy tam](https://thenounproject.com/tracytam) | ||
- [Font Awesome](http://fontawesome.io/) | ||
- [Unsplash](https://unsplash.com/) | ||
|
||
|
@@ -185,8 +203,6 @@ To test the theme, run `bundle exec rake preview` and open your browser at `http | |
- [jQuery throttle / debounce](http://benalman.com/projects/jquery-throttle-debounce-plugin/) | ||
- [Lunr](http://lunrjs.com) | ||
|
||
--- | ||
|
||
## License | ||
|
||
The MIT License (MIT) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!-- | ||
Minimal Mistakes Jekyll Theme 4.24.0 by Michael Rose | ||
Copyright 2013-2020 Michael Rose - mademistakes.com | @mmistakes | ||
Free for personal and commercial use under the MIT license | ||
https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/*! | ||
* Minimal Mistakes Jekyll Theme 4.24.0 by Michael Rose | ||
* Copyright 2013-2020 Michael Rose - mademistakes.com | @mmistakes | ||
* Free for personal and commercial use under the MIT license | ||
* https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/*! | ||
* Minimal Mistakes Jekyll Theme 4.24.0 by Michael Rose | ||
* Copyright 2013-2020 Michael Rose - mademistakes.com | @mmistakes | ||
* Free for personal and commercial use under the MIT license | ||
* https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,7 @@ | ||
const fs = require("fs"); | ||
const pkg = require("./package.json"); | ||
const filename = "assets/js/main.min.js"; | ||
const script = fs.readFileSync(filename); | ||
const padStart = str => ("0" + str).slice(-2); | ||
const dateObj = new Date(); | ||
const date = `${dateObj.getFullYear()}-${padStart( | ||
dateObj.getMonth() + 1 | ||
)}-${padStart(dateObj.getDate())}`; | ||
const banner = `/*! | ||
* Minimal Mistakes Jekyll Theme ${pkg.version} by ${pkg.author} | ||
* Copyright 2013-${dateObj.getFullYear()} Michael Rose - mademistakes.com | @mmistakes | ||
* Licensed under ${pkg.license} | ||
*/ | ||
`; | ||
const script = fs.readFileSync("assets/js/main.min.js"); | ||
const banner = fs.readFileSync("_includes/copyright.js"); | ||
|
||
if (script.slice(0, 3) != "/**") { | ||
if (script.slice(0, 3) != "/*!") { | ||
fs.writeFileSync(filename, banner + script); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,8 @@ | |
# For technical reasons, this file is *NOT* reloaded automatically when you use | ||
# `jekyll serve`. If you change this file, please restart the server process. | ||
|
||
remote_theme : "mmistakes/[email protected]" | ||
remote_theme : "mmistakes/minimal-mistakes@master" | ||
theme_version : "4.24.0" | ||
|
||
minimal_mistakes_skin : "default" # "air", "aqua", "contrast", "dark", "dirt", "neon", "mint", "plum", "sunrise" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,7 @@ To install as a remote theme: | |
bundle | ||
``` | ||
|
||
4. Add `remote_theme: "mmistakes/minimal-mistakes@4.24.0"` to your `_config.yml` file. Remove any other `theme:` or `remote_theme:` entry. | ||
4. Add `remote_theme: "mmistakes/minimal-mistakes@{{ site.theme_version }}"` to your `_config.yml` file. Remove any other `theme:` or `remote_theme:` entry. | ||
|
||
You may also optionally specify a branch, [tag](https://github.com/mmistakes/minimal-mistakes/tags), or commit to use by appending an @ and the Git ref (e.g., `mmistakes/[email protected]` or `mmistakes/minimal-mistakes@bbf3cbc5fd64a3e1885f3f99eb90ba92af84063d`). This is useful when rolling back to older versions of the theme. If you don't specify a Git ref, the latest on `master` will be used. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,21 +2,16 @@ | |
title: "Upgrading" | ||
permalink: /docs/upgrading/ | ||
excerpt: "Instructions and suggestions for upgrading the theme." | ||
last_modified_at: 2021-06-23T08:15:34-04:00 | ||
last_modified_at: 2024-04-23T00:43:19+08:00 | ||
toc: true | ||
--- | ||
|
||
If you're using the [Ruby Gem]({{ "/docs/quick-start-guide/#gem-based-method" | relative_url }}) or [remote theme]({{ "/docs/quick-start-guide/#remote-theme-method" | relative_url }}) versions of Minimal Mistakes, upgrading is fairly painless. | ||
|
||
To check which version you are currently using, view the source of your built site and you should see something similar to: | ||
|
||
``` | ||
<!-- | ||
Minimal Mistakes Jekyll Theme 4.24.0 by Michael Rose | ||
Copyright 2013-2020 Michael Rose - mademistakes.com | @mmistakes | ||
Free for personal and commercial use under the MIT license | ||
https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE | ||
--> | ||
```text | ||
{% include "copyright.html" %} | ||
``` | ||
|
||
At the top of every `.html` file, `/assets/css/main.css`, and `/assets/js/main.min.js`. | ||
|
@@ -28,14 +23,14 @@ Simply run `bundle update` if you're using Bundler (have a `Gemfile`) or `gem up | |
When using Bundler you can downgrade or lock the theme to a specific release ([tag](https://github.com/mmistakes/minimal-mistakes/tags)), branch, or commit. Instead of `gem "minimal-mistakes-jekyll"` you'd add the following to your `Gemfile`: | ||
|
||
```ruby | ||
gem "minimal-mistakes-jekyll", :git => "https://github.com/mmistakes/minimal-mistakes.git", :tag => "4.24.0" | ||
gem "minimal-mistakes-jekyll", :git => "https://github.com/mmistakes/minimal-mistakes.git", :tag => "{{ site.theme_version }}" | ||
``` | ||
|
||
For more information on [installing gems from git repositories](http://bundler.io/v1.16/guides/git.html) consult Bundler's documentation. | ||
|
||
## Remote theme | ||
|
||
When setting `remote_theme: "mmistakes/minimal-mistakes@4.24.0"` in your `_config.yml` you may also optionally specify a branch, [tag](https://github.com/mmistakes/minimal-mistakes/tags), or commit to use by appending an @ and the Git ref. | ||
When setting `remote_theme: "mmistakes/minimal-mistakes@{{ site.theme_version }}"` in your `_config.yml` you may also optionally specify a branch, [tag](https://github.com/mmistakes/minimal-mistakes/tags), or commit to use by appending an @ and the Git ref. | ||
|
||
For example you can roll back to release 4.8.1 with `mmistakes/[email protected]` or a specific commit with `mmistakes/minimal-mistakes@bbf3cbc5fd64a3e1885f3f99eb90ba92af84063d`). For a complete list of theme versions consult the [releases page](https://github.com/mmistakes/minimal-mistakes/releases). | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters