Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…hub.io into 0506
  • Loading branch information
JackSmith-c committed May 5, 2024
2 parents 7cb9185 + dc965c5 commit a41f5df
Show file tree
Hide file tree
Showing 49 changed files with 1,025 additions and 325 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
*~
*.sw[p_]

# IntelliJ IDEA
*.idea

# Sublime Text
*.sublime-project
*.sublime-workspace
Expand Down
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,70 @@

### Bug Fixes

# Changelog

## [4.26.0](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.26.0)

### Bug Fixes

- Fix an unclosed `<p>` tag in `page__hero.html`, near `page.header.actions`.
- Remove overlay and revert X to hamburger icon when popup disappears. [#3958](https://github.com/mmistakes/minimal-mistakes/pull/3958)
- Fix SEO title when it contains a vertical bar. [#3094](https://github.com/mmistakes/minimal-mistakes/pull/3094) [#3113](https://github.com/mmistakes/minimal-mistakes/pull/3113)
- Remove "sticky sidebar" JS as it's now completely based on CSS media queries. [#4245](https://github.com/mmistakes/minimal-mistakes/issues/4245) [#4645](https://github.com/mmistakes/minimal-mistakes/pull/4645)

### Enhancements

- Add support for [Jekyll Paginate V2](https://github.com/sverrirs/jekyll-paginate-v2) 🎉 [#2636](https://github.com/mmistakes/minimal-mistakes/pull/2636)
- Add "copy to clipboard" button for code blocks 🎉 [#2812](https://github.com/mmistakes/minimal-mistakes/pull/2812)
- Auto scroll sticky ToC with content. [#3115](https://github.com/mmistakes/minimal-mistakes/pull/3115)
- Replace "hidden" check in Liquid templates with `where_exp: "item", "item.hidden != true"`.
- Remove deprecated `page.header.cta_url` setting. [#4821](https://github.com/mmistakes/minimal-mistakes/pull/4821)
- Allow multiple nav lists in sidebar. [#2843](https://github.com/mmistakes/minimal-mistakes/pull/2843)
- Add popup parameter to `{% include figure %}` to enable Magnific Popup. [#3119](https://github.com/mmistakes/minimal-mistakes/pull/3119)
- Add target attribute for navigation link. [#3056](https://github.com/mmistakes/minimal-mistakes/pull/3056)
- Split schema to a separate include file. [#3085](https://github.com/mmistakes/minimal-mistakes/pull/3085)
- Cleanup `_includes/seo.html`.

### Documentation & Maintenance

- Rewrite skin previews on `05-configuration.md` in Liquid template.
- Remove unused classes from `_layouts/single.html`.
- Migrate npm run scripts to Ruby Rake tasks.
- Add Rake task `version` for updating all hard-coded version numbers from `package.json` all at once.
- Merge `categories` and `tags` layout into `_includes/posts-taxonomy.html`.
- Update Social Sharing links section. [#4066](https://github.com/mmistakes/minimal-mistakes/pull/4066)

## [4.25.1](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.25.1)

### Bug Fixes

- "You may also enjoy" no longer recommends hidden posts. [#4653](https://github.com/mmistakes/minimal-mistakes/issues/4653)
- Replaced dead link to "Viewport and Media Queries" slides. [#4421](https://github.com/mmistakes/minimal-mistakes/discussions/4421)
- Fix broken `where_exp` in `lunr-store.js` for Jekyll &lt; 4.0. [#4808](https://github.com/mmistakes/minimal-mistakes/issues/4808)

### Enhancements

- Add Ukrainian translations. [#4273](https://github.com/mmistakes/minimal-mistakes/pull/4273)
- Add more configuration for Giscus. [#4274](https://github.com/mmistakes/minimal-mistakes/pull/4274)
- Bump jekyll-toc to [v1.2.1](https://github.com/allejo/jekyll-toc/releases/tag/v1.2.1).

### Documentation & Maintenance

- Bump shell-quote from 1.7.1 to 1.7.3 [#3692](https://github.com/mmistakes/minimal-mistakes/issues/3692)
- Add `after-content.html` and `before-related.html` includes to ease docs site overrides.
- GitHub Workflows security hardening [#3884](https://github.com/mmistakes/minimal-mistakes/issues/3884)
- Replace Font Awesome v5 search page with v6.
- Try adding an FAQ page.
- Update remote theme reference in Quick-Start Guide to point to 4.25.0. [#4809](https://github.com/mmistakes/minimal-mistakes/issues/4809)

## [4.25.0](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.25.0)

### Bug Fixes

- Fix Linkedin social share link [#4754](https://github.com/mmistakes/minimal-mistakes/issues/4754)
- Fix non-English characters being url encoded in breadcrumb [#3819](https://github.com/mmistakes/minimal-mistakes/issues/3819)
- Fix wrong `first_page_path` because of hard-coded `page:num` [#3778](https://github.com/mmistakes/minimal-mistakes/issues/3778)
- Remove JS and other files from search index [#4000](https://github.com/mmistakes/minimal-mistakes/pull/4000)
- Fix unlisted YouTube video embeds in documentation/test sites. [#3649](https://github.com/mmistakes/minimal-mistakes/issues/3649)
- Fix error in Algolia search script when returning a hit that without `html` and `hightlight.html`. [#3101](https://github.com/mmistakes/minimal-mistakes/issues/3101) [#3102](https://github.com/mmistakes/minimal-mistakes/pull/3102)
- Fix links to Font Awesome gallery. [#3599](https://github.com/mmistakes/minimal-mistakes/pull/3599)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
source "https://rubygems.org"
gemspec
gemspec
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2020 Michael Rose and contributors
Copyright (c) 2013-2024 Michael Rose and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,31 @@ To install:
bundle
```

4. Add `remote_theme: "mmistakes/[email protected]"` to your `_config.yml` file. Remove any other `theme:` or `remote_theme:` entry.
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:

- package.json
- README.md (this file)
- docs/_data/theme.yml
- docs/_pages/home.md (in Front Matter "excerpt")

`package.json` holds the authoritative version number, and the others can be updated with `bundle exec rake version`.

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 `bundle exec rake js`, references `_includes/copyright.js`)

*Tip*: The default Rake task will update all of the above files at once.

Additionally, the license year is hard-coded in these files and are NOT covered by a Rake task:

- README.md (this file, near the end)
- LICENSE
-->

**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.

Expand Down Expand Up @@ -195,14 +219,15 @@ To test the theme, run `bundle exec rake preview` and open your browser at `http
- [Gumshoe](https://github.com/cferdinandi/gumshoe)
- [jQuery throttle / debounce](http://benalman.com/projects/jquery-throttle-debounce-plugin/)
- [Lunr](http://lunrjs.com)
- [Clipboard.js](https://clipboardjs.com)

---

## License

The MIT License (MIT)

Copyright (c) 2013-2020 Michael Rose and contributors
Copyright (c) 2013-2024 Michael Rose and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -275,3 +300,7 @@ Pure Liquid Jekyll Table of Contents is distributed under the terms of the [MIT
Minimal Mistakes incorporates [Lunr](http://lunrjs.com),
Copyright (c) 2018 Oliver Nightingale.
Lunr is distributed under the terms of the [MIT License](http://opensource.org/licenses/MIT).

Minimal Mistakes incorporates [clipboard.js](https://clipboardjs.com/),
Copyright (c) 2021 Zeno Rocha.
Clipboard.js is distributed under the terms of the [MIT License](https://opensource.org/licenses/MIT).
134 changes: 132 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ require "bundler/gem_tasks"
require "jekyll"
require "listen"

require "rake/clean"
require "shellwords"
require "time"
require "yaml"

task :default => %i[copyright changelog js version]

package_json = JSON.parse(File.read("package.json"))

def listen_ignore_paths(base, options)
[
/_config\.ya?ml/,
Expand Down Expand Up @@ -65,12 +74,133 @@ task :preview do
puts " Halting auto-regeneration."
exit 0
end

loop { sleep 1000 }
sleep
end
rescue ThreadError
# You pressed Ctrl-C, oh my!
end

Jekyll::Commands::Serve.process(options)
end


task :history => :changelog
task :changelog => "docs/_docs/18-history.md"
file "docs/_docs/18-history.md" => "CHANGELOG.md" do |t|
front_matter = {
title: "History",
classes: "wide",
permalink: "/docs/history/",
excerpt: "Change log of enhancements and bug fixes made to the theme.",
sidebar: {
nav: "docs",
},
last_modified_at: Time.now.iso8601,
toc: false,
}
# https://stackoverflow.com/a/49553523/5958455
front_matter = JSON.parse(JSON.dump(front_matter))
File.open(t.name, "w") do |f|
f.puts front_matter.to_yaml
f.puts "---"
f.puts ""
f.puts "<!--\n Sourced from CHANGELOG.md\n See Rakefile `task :changelog` for details\n-->"
f.puts ""
f.puts "{% raw %}"
# Remove H1
changelog = File.read(t.prerequisites.first).gsub(/^# [^\n]*$/m, "").strip
f.write changelog
f.puts ""
f.puts "{% endraw %}"
end
end

COPYRIGHT_LINES = [
"Minimal Mistakes Jekyll Theme #{package_json["version"]} by Michael Rose",
"Copyright 2013-#{Time.now.year} Michael Rose - mademistakes.com | @mmistakes",
"Free for personal and commercial use under the MIT license",
"https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE",
]

COPYRIGHT_FILES = [
"_includes/copyright.html",
"_includes/copyright.js",
"_sass/minimal-mistakes/_copyright.scss",
]

def genenerate_copyright_file(filename, header, prefix, footer)
File.open(filename, "w") do |f|
f.puts header
COPYRIGHT_LINES.each do |line|
f.puts "#{prefix}#{line}"
end
f.puts footer
end
end

file "_includes/copyright.html" => "package.json" do |t|
genenerate_copyright_file(t.name, "<!--", " ", "-->")
end

file "_includes/copyright.js" => "package.json" do |t|
genenerate_copyright_file(t.name, "/*!", " * ", " */")
end

file "_sass/minimal-mistakes/_copyright.scss" => "package.json" do |t|
genenerate_copyright_file(t.name, "/*!", " * ", " */")
end

task :copyright => COPYRIGHT_FILES

CLEAN.include(*COPYRIGHT_FILES)

JS_FILES = ["assets/js/vendor/jquery/jquery-3.6.0.js"] + Dir.glob("assets/js/plugins/*.js") + ["assets/js/_main.js"]
JS_TARGET = "assets/js/main.min.js"
task :js => JS_TARGET
file JS_TARGET => ["_includes/copyright.js"] + JS_FILES do |t|
sh Shellwords.join(%w[npx uglifyjs -c --comments /@mmistakes/ --source-map -m -o] +
[t.name] + t.prerequisites)
end

task :watch_js do
listener = Listen.to(
"assets/js",
ignore: /main\.min\.js$/,
) do |modified, added, removed|
Rake::Task[:js].invoke
end

trap("INT") do
listener.stop
exit 0
end

begin
listener.start
sleep
rescue ThreadError
end
end

task :version => ["docs/_data/theme.yml", "README.md", "docs/_pages/home.md"]

file "docs/_data/theme.yml" => "package.json" do |t|
theme = { "version" => package_json["version"] }
File.open(t.name, "w") do |f|
f.puts "# for use with in-page templates"
f.puts theme.to_yaml
end
end

file "README.md" => "package.json" do |t|
content = File.read(t.name)
content = content.gsub(/(mmistakes\/minimal-mistakes@)[\d.]+/, '\1' + package_json["version"])
File.write(t.name, content)
end

file "docs/_pages/home.md" => "package.json" do |t|
content = File.read(t.name)
content = content.gsub(/(\breleases\/tag\/|Latest release v)[\d.]+/, '\1' + package_json["version"])
File.write(t.name, content)
end

26 changes: 25 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,33 @@ sass:

# Outputting
permalink: /:categories/:title/
timezone: # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones


# Pagination with jekyll-paginate
paginate: 5 # amount of posts to show
paginate_path: /page:num/
timezone: # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

# Pagination with jekyll-paginate-v2
# See https://github.com/sverrirs/jekyll-paginate-v2/blob/master/README-GENERATOR.md#site-configuration
# for configuration details
pagination:
# Set enabled to true to use paginate v2
# enabled: true
debug: false
collection: 'posts'
per_page: 10
permalink: '/page/:num/'
title: ':title - page :num'
limit: 0
sort_field: 'date'
sort_reverse: true
category: 'posts'
tag: ''
locale: ''
trail:
before: 2
after: 2

# Plugins (previously gems:)
plugins:
Expand Down
6 changes: 6 additions & 0 deletions _includes/copyright.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!--
Minimal Mistakes Jekyll Theme 4.26.0 by Michael Rose
Copyright 2013-2024 Michael Rose - mademistakes.com | @mmistakes
Free for personal and commercial use under the MIT license
https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE
-->
6 changes: 6 additions & 0 deletions _includes/copyright.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*!
* Minimal Mistakes Jekyll Theme 4.26.0 by Michael Rose
* Copyright 2013-2024 Michael Rose - mademistakes.com | @mmistakes
* Free for personal and commercial use under the MIT license
* https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE
*/
6 changes: 2 additions & 4 deletions _includes/documents-collection.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% assign entries = site[include.collection] %}
{% assign entries = site[include.collection] | where_exp: "post", "post.hidden != true" %}

{% if include.sort_by %}
{% assign entries = entries | sort: include.sort_by %}
Expand All @@ -9,7 +9,5 @@
{% endif %}

{%- for post in entries -%}
{%- unless post.hidden -%}
{% include archive-single.html %}
{%- endunless -%}
{% include archive-single.html %}
{%- endfor -%}
2 changes: 2 additions & 0 deletions _includes/figure
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<figure class="{{ include.class }}">
{%- if include.popup -%}<a href="{{ include.image_path | relative_url }}" class="image-popup" title="{% if include.caption %}{{ include.caption | markdownify | remove: "<p>" | remove: "</p>" }}{% endif %}">{%- endif -%}
<img src="{{ include.image_path | relative_url }}"
alt="{% if include.alt %}{{ include.alt }}{% endif %}">
{%- if include.popup -%}</a>{%- endif -%}
{%- if include.caption -%}
<figcaption>
{{ include.caption | markdownify | remove: "<p>" | remove: "</p>" }}
Expand Down
5 changes: 4 additions & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
<!-- https://t.co/dKP3o1e -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<script>
<script type="text/javascript">
document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js ';
{% if site.enable_copy_code_button -%}
window.enable_copy_code_button = true;
{%- endif %}
</script>

<!-- For all browsers -->
Expand Down
Loading

0 comments on commit a41f5df

Please sign in to comment.