Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subcategory patch #4

Merged
merged 3 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

gem 'jekyll-compose', group: [:jekyll_plugins]
gem 'jekyll-compose', group: [:jekyll_plugins]

gem "jekyll-archives", path: "assets/jekyll-archives"
7 changes: 4 additions & 3 deletions _layouts/categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<a href="{{ _category_url | relative_url }}" class="mx-2">{{ category_name }}</a>

<!-- content count -->
{% assign top_posts_size = site.categories[category_name] | size %}
{% assign top_posts_size = site.data["categories"][category_name] | size %}
<span class="text-muted small font-weight-light">
{% if sub_categories_size > 0 %}
{{ sub_categories_size }}
Expand Down Expand Up @@ -106,10 +106,11 @@
<li class="list-group-item">
<i class="far fa-folder fa-fw"></i>

{% capture _sub_ctg_url %}/categories/{{ sub_category | slugify | url_encode }}/{% endcapture %}
{% capture _sub_category_name %}{{ category_name }}-{{ sub_category }}{% endcapture %}
{% capture _sub_ctg_url %}/categories/{{ _sub_category_name | slugify | url_encode }}/{% endcapture %}
<a href="{{ _sub_ctg_url | relative_url }}" class="mx-2">{{ sub_category }}</a>

{% assign posts_size = site.categories[sub_category] | size %}
{% assign posts_size = site.data["categories"][_sub_category_name] | size %}
<span class="text-muted small font-weight-light">
{{ posts_size }}

Expand Down
8 changes: 8 additions & 0 deletions assets/jekyll-archives/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
_site/
.bundle
.jekyll-metadata
*.gem
Gemfile.lock
pkg/
test/destination
test/source/.jekyll-cache
28 changes: 28 additions & 0 deletions assets/jekyll-archives/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require: rubocop-jekyll

inherit_gem:
rubocop-jekyll: .rubocop.yml

AllCops:
TargetRubyVersion: 2.3
Exclude:
- vendor/**/*

Lint/ShadowingOuterLocalVariable:
Exclude:
- lib/jekyll-archives.rb

# Remove once Jekyll core has dropped explicit support for Ruby 2.2
Lint/SafeNavigationConsistency:
Exclude:
- lib/jekyll-archives/archive.rb

Metrics/BlockLength:
Exclude:
- test/**/*.rb

Metrics/LineLength:
Exclude:
- lib/jekyll-archives.rb
- lib/jekyll-archives/archive.rb
- test/**/*.rb
21 changes: 21 additions & 0 deletions assets/jekyll-archives/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: ruby
cache: bundler
rvm:
- &latest_ruby 2.7
- 2.5

env:
- JEKYLL_VERSION="~> 3.8"

matrix:
include:
- # GitHub Pages
rvm: 2.5.3
env: GH_PAGES=true
- rvm: *latest_ruby
env: JEKYLL_VERSION=">= 4.0.0"

before_install:
- gem update --system
- bundle update
script : script/cibuild
10 changes: 10 additions & 0 deletions assets/jekyll-archives/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

source "https://rubygems.org"
gemspec

if ENV["GH_PAGES"]
gem "github-pages"
elsif ENV["JEKYLL_VERSION"]
gem "jekyll", ENV["JEKYLL_VERSION"]
end
108 changes: 108 additions & 0 deletions assets/jekyll-archives/History.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
## HEAD

### Development Fixes

* Initialize Archives generator with a hash (#135)
* Remove support for legacy Jekyll versions (#136)
* Read-in site&#39;s tags and categories attributes (#137)
* Simplify checking if an archive type is enabled (#149)
* Use private helper to append enabled archive type (#150)
* Access nested Hash values with `Hash#dig` (#151)
* Generate custom post_attr_hash with private helper (#152)

### Bug Fixes

* Return unless &#39;jekyll-archives&#39; config is a Hash (#139)

### Documentation

* s/gems/plugins/ (#143)

### Minor Enhancements

* Memoize relative_path attribute of archive pages (#153)
* Memoize date attribute of date-type archive pages (#154)
* Allow creating slugs for emoji characters. (#129)
* Use Liquid drop to expose attributes to templates (#158)

## 2.2.1

### Minor Enhancements

* Make Archive subclass of Page (#67)
* Don't limit slugs/title to strings (#41)
* Enable incremental operation (#58)
* Remove deprecated defs (#89)

### Development Fixes

* Target Ruby 2.3
* Allow testing and using with Jekyll 4.x (#133)
* Update Travis config and Gemfile for Ruby < 2.2.2 support (#68)
* Consolidate History file to work with jekyllbot (#80)
* Remove Travis test for Ruby 1.9 (#87)
* Inherit Jekyll's rubocop config for consistency (#65)
* Bump travis ruby versions (#91)
* Fix Travis build error (#93)
* Define path with __dir__ (#105)
* Appease Rubocop (#104)
* update Rubocop and Travis config (#110)
* Update .travis.yml (#111)
* Modernize tests &amp; linting (#114)
* Test against Ruby 2.5 (#118)
* Lint with rubocop-jekyll (#128)

### Documentation

* Update Installation Guide (#116)
* docs/configuration: GitHub table display was messed up (#96)
* Small updates for consistency across document (#130)

## 2.1.0

### Minor Enhancements

* Update Jekyll dependency to allow Jekyll 3 (#33)
* Update docs to reflect changes in v2.0.0 (#31)
* Add compatibility with Jekyll 3 (#48)
* Update to reflect release of Jekyll 3 (#52)
* Support revised documents/collections in Jekyll 3 (#53)

### Development Fixes

* Test against Jekyll 2, 3, and GitHub Pages (#48)

## 2.0.0 / 2015-01-06

### Minor Enhancements

* Move Date object from `page.title` to `page.date` (#26)
* Add documentation to repository (#25)

### Bug Fixes

* Change Jekyll dependency to ~> 2.4 (#23)

## 1.0.0 / 2014-09-26

### Major Enhancements

* Support type-specific layouts
* Pass `Date` object to Liquid in case of date-based archives
* Liquid `{{ site.archives }}` support
* Generate month and day archives

### Minor Enhancements

* Add version file and move everything into `Archives` module
* Use `Jekyll::Utils.slugify` for slugging
* Require use to specify what types of archives are enabled

## 0.1.0 / 2014-08-17

* First release
* Generate year, category, and tag archives

## 0.0.0 / 2014-08-17

* Birthday!
21 changes: 21 additions & 0 deletions assets/jekyll-archives/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014-present Alfred Xing and the jekyll-archives 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
26 changes: 26 additions & 0 deletions assets/jekyll-archives/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# frozen_string_literal: true

require "rubygems"
require "bundler"
require "bundler/gem_tasks"

begin
Bundler.setup(:default, :development, :test)
rescue Bundler::BundlerError => e
warn e.message
warn "Run `bundle install` to install missing gems"
exit e.status_code
end

# Test task

require "rake"
require "rake/testtask"

Rake::TestTask.new(:test) do |test|
test.libs << "lib" << "test"
test.pattern = "test/**/test_*.rb"
test.warning = false
end

task :default => "test"
32 changes: 32 additions & 0 deletions assets/jekyll-archives/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## About Jekyll Archives

Automatically generate post archives by dates, tags, and categories.

[![Gem Version](https://badge.fury.io/rb/jekyll-archives.svg)](http://badge.fury.io/rb/jekyll-archives)
[![Build Status](https://travis-ci.org/jekyll/jekyll-archives.svg?branch=master)](https://travis-ci.org/jekyll/jekyll-archives)

## Getting started

### Installation

1. Add `gem 'jekyll-archives'` to your site's Gemfile
2. Add the following to your site's `_config.yml`:

```yml
plugins:
- jekyll-archives
```

### Configuration

Archives can be configured by using the `jekyll-archives` key in the Jekyll configuration (`_config.yml`) file. See the [Configuration](configuration.md) page for a full list of configuration options.

All archives are rendered with specific layouts using certain metadata available to the archive page. The [Layouts](layouts.md) page will show you how to create a layout for use with Archives.

## Documentation

For more information, see:

* [Getting-started](getting-started.md)
* [Configuration](configuration.md)
* [Layouts](layouts.md)
10 changes: 10 additions & 0 deletions assets/jekyll-archives/docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: Jekyll Archives
description: Automatically generate post archives by dates, tags, and categories.

permalink: pretty

plugins:
- jekyll-seo-tag
- jekyll-sitemap

theme: jekyll-theme-primer
17 changes: 17 additions & 0 deletions assets/jekyll-archives/docs/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}" rel="stylesheet">
{% seo %}
</head>
<body>
<div class="container markdown-body">
<h1>{{ site.title }}</h1>
{{ content }}
</div>
<script src="{{ "assets/javascript/anchor-js/anchor.min.js" | relative_url }}"></script>
<script>anchors.add();</script>
</body>
</html>
Loading
Loading