Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Jekyll Plugin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
4
Merge Requests
4
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
F-Droid
Jekyll Plugin
Commits
78c4eeaf
Commit
78c4eeaf
authored
Apr 28, 2020
by
Hans-Christoph Steiner
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'category-browser' into 'master'
Browse by category See merge request
!52
parents
d6b8d7ae
fe215c83
Pipeline
#140777735
failed with stage
in 2 minutes and 28 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
87 additions
and
29 deletions
+87
-29
_layouts/category-packages.html
_layouts/category-packages.html
+14
-0
_pages/browse.html
_pages/browse.html
+0
-22
_pages/categories-overview.html
_pages/categories-overview.html
+18
-0
lib/jekyll-fdroid.rb
lib/jekyll-fdroid.rb
+1
-0
lib/jekyll/FDroidBrowsingPage.rb
lib/jekyll/FDroidBrowsingPage.rb
+1
-1
lib/jekyll/FDroidCategoryDetailPage.rb
lib/jekyll/FDroidCategoryDetailPage.rb
+47
-0
lib/jekyll/FDroidPackageDetailGenerator.rb
lib/jekyll/FDroidPackageDetailGenerator.rb
+6
-6
No files found.
_layouts/category-packages.html
0 → 100644
View file @
78c4eeaf
---
layout: page
title: " "
---
{% assign app_category_escaped = page.app_category | replace: '
&
', '
&
' %}
{% assign filtered_packages = site.packages | where_exp: "item", "item.categories contains app_category_escaped" | sort: "last_updated" | reverse %}
<h3>
{{ site.data.strings.app_categories[page.app_category] }}
</h3>
<div
id=
"package-list"
>
{% for package in filtered_packages %}
{% include package-list-item.html package=package %}
{% endfor %}
</div>
_pages/browse.html
deleted
100644 → 0
View file @
d6b8d7ae
---
layout: page
title: " "
pagination:
enabled: true
collection: packages
per_page: 30
trail:
before: 4
after: 4
permalink: '/:num/'
sort_field: 'title'
title: ':title'
---
<div
id=
"full-package-list"
>
{% for package in paginator.posts %}
{% include package-list-item.html package=package %}
{% endfor %}
{% include_cached browse-paginator-navigation.html paginator=paginator permalink=page.dir %}
</div>
_pages/categories-overview.html
0 → 100644
View file @
78c4eeaf
---
layout: page
title: " "
---
{% for app_category in site.app_categories %}
{% assign app_category_escaped = app_category | replace: '
&
', '
&
' %}
{% assign filtered_packages = site.packages | where_exp: "item", "item.categories contains app_category_escaped" | sort: "last_updated" | reverse %}
{% if filtered_packages.size > 0 %}
<h3>
{{ site.data.strings.app_categories[app_category] }}
</h3>
<div
id=
"package-list"
>
{% for package in filtered_packages limit: 3 %}
{% include package-list-item.html package=package %}
{% endfor %}
</div>
{% assign app_category_url = app_category | replace: '
&
', '_' %}
<p><a
href=
"{{ site.baseurl }}/categories/{{ app_category_url }}/"
>
{{ site.data.strings.app_categories.show_all_packages | replace: '%d', filtered_packages.size }}
</a></p>
{% endif %}
{% endfor %}
lib/jekyll-fdroid.rb
View file @
78c4eeaf
...
...
@@ -22,4 +22,5 @@ require "jekyll/FDroidLastUpdatedPackagesTag"
require
"jekyll/FDroidLatestPackagesTag"
require
"jekyll/FDroidPackageDetailGenerator"
require
"jekyll/FDroidPackageDetailPage"
require
"jekyll/FDroidCategoryDetailPage"
require
"jekyll/FDroidRepoInfoTag"
lib/jekyll/FDroidBrowsingPage.rb
View file @
78c4eeaf
...
...
@@ -24,7 +24,7 @@ module Jekyll
@name
=
"index.html"
self
.
process
(
@name
)
self
.
read_yaml
((
File
.
expand_path
"../../_pages"
,
File
.
dirname
(
__FILE__
)),
'
browse
.html'
)
self
.
read_yaml
((
File
.
expand_path
"../../_pages"
,
File
.
dirname
(
__FILE__
)),
'
categories-overview
.html'
)
end
end
end
lib/jekyll/FDroidCategoryDetailPage.rb
0 → 100644
View file @
78c4eeaf
# F-Droid's Jekyll Plugin
#
# Copyright (C) 2017 Nico Alt
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
module
Jekyll
class
FDroidCategoryDetailPage
<
ReadYamlPage
# @param [Jekyll::Site] site
# @param [string] base
# @param [string] app_category
def
initialize
(
site
,
base
,
app_category
)
@site
=
site
@base
=
base
@dir
=
'categories'
# Avoid special characters in URL, otherwise language support doesn't work
app_category_url
=
app_category
.
dup
app_category_url
.
sub!
' & '
,
'_'
@name
=
"
#{
app_category_url
}
/index.html"
self
.
process
(
@name
)
self
.
read_yaml
(
get_layout_dir
,
'category-packages.html'
)
self
.
data
[
'app_category'
]
=
app_category
end
def
get_layout_dir
()
layout_dir_override
=
File
.
join
(
site
.
source
,
'_layouts'
)
if
File
.
exists?
File
.
join
(
layout_dir_override
,
'category-packages.html'
)
layout_dir_override
else
File
.
expand_path
'../../_layouts'
,
File
.
dirname
(
__FILE__
)
end
end
end
end
lib/jekyll/FDroidPackageDetailGenerator.rb
View file @
78c4eeaf
...
...
@@ -37,12 +37,6 @@ module Jekyll
site
.
config
[
"sass"
][
"load_paths"
]
<<
(
File
.
expand_path
"../../_sass"
,
File
.
dirname
(
__FILE__
))
end
# Enable pagination
if
site
.
config
[
"pagination"
].
nil?
||
site
.
config
[
"pagination"
].
empty?
site
.
config
[
"pagination"
]
=
Hash
.
new
end
site
.
config
[
"pagination"
][
"enabled"
]
=
true
index
=
FDroid
::
IndexV1
.
download
(
site
.
config
[
"fdroid-repo"
],
site
.
active_lang
||
'en_US'
)
# Generate detail page for every package
...
...
@@ -56,6 +50,12 @@ module Jekyll
site
.
pages
<<
FDroidPackageDetailPage
.
new
(
site
,
site
.
source
,
package
)
site
.
collections
[
"packages"
].
docs
<<
FDroidPackageDetailPage
.
new
(
site
,
site
.
source
,
package
)
end
# Generate category pages with filtered package list
site
.
config
[
"app_categories"
].
each
do
|
category
|
site
.
pages
<<
FDroidCategoryDetailPage
.
new
(
site
,
site
.
source
,
category
)
end
# Generate browsing pages
site
.
includes_load_paths
<<
(
File
.
expand_path
"../../_includes"
,
File
.
dirname
(
__FILE__
))
site
.
pages
<<
FDroidBrowsingPage
.
new
(
site
,
site
.
source
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment