datalog-theme 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +188 -0
- data/CITATION.cff +2 -2
- data/README.md +25 -17
- data/_data/cdn-integrity.yml +0 -30
- data/_data/i18n/en.yml +297 -0
- data/_data/i18n/es.yml +297 -0
- data/_data/i18n/pt.yml +297 -0
- data/_data/js_manifest.json +16 -0
- data/_includes/analytics/dashboard.html +3 -1
- data/_includes/components/api-function.html +20 -1
- data/_includes/components/author-bio.html +21 -11
- data/_includes/components/author-list.html +32 -0
- data/_includes/components/citation-tools.html +33 -25
- data/_includes/components/comments-thread.html +90 -0
- data/_includes/components/contact-form.html +120 -0
- data/_includes/components/correction-report.html +82 -0
- data/_includes/components/enhanced-code-block.html +1 -1
- data/_includes/components/enhanced-toc.html +6 -7
- data/_includes/components/license-link.html +13 -0
- data/_includes/components/license-notice.html +28 -0
- data/_includes/components/moderation-inbox.html +139 -0
- data/_includes/components/reactions.html +49 -0
- data/_includes/components/reading-list.html +31 -0
- data/_includes/components/reading-mode-toggle.html +65 -0
- data/_includes/components/reading-state-bookmark.html +27 -0
- data/_includes/components/reading-state-panel.html +71 -0
- data/_includes/components/reproducibility.html +61 -0
- data/_includes/components/responsive-image.html +3 -3
- data/_includes/components/revision-history.html +39 -0
- data/_includes/components/revision-notice.html +35 -0
- data/_includes/components/series-nav.html +64 -0
- data/_includes/components/subscribe-form.html +88 -0
- data/_includes/components/subscription-manage.html +68 -0
- data/_includes/components/webmentions.html +48 -0
- data/_includes/csp-meta.html +135 -11
- data/_includes/footer.html +22 -20
- data/_includes/head.html +111 -63
- data/_includes/header/navigation.html +12 -15
- data/_includes/header.html +28 -19
- data/_includes/layouts/default/article.html +9 -7
- data/_includes/meta/dynamic-services-config.html +14 -0
- data/_includes/meta/math-config.html +18 -10
- data/_includes/meta/person-json.html +27 -0
- data/_includes/meta/publisher.html +45 -0
- data/_includes/meta/schema.html +67 -30
- data/_includes/meta/scholarly.html +121 -0
- data/_includes/meta/scripts-loader.html +18 -32
- data/_includes/meta/webmention-discovery.html +14 -0
- data/_includes/post/related-posts.html +4 -7
- data/_includes/scripts.html +57 -0
- data/_includes/search/index-data.json +9 -34
- data/_layouts/dataset.html +5 -3
- data/_layouts/default.html +16 -8
- data/_layouts/notebook.html +1 -0
- data/_layouts/package.html +4 -2
- data/_layouts/page.html +15 -0
- data/_layouts/portfolio.html +1 -0
- data/_layouts/post.html +102 -23
- data/_layouts/project.html +4 -3
- data/_layouts/research.html +20 -8
- data/_plugins/analytics_dashboard.rb +9 -3
- data/_plugins/authors.rb +133 -0
- data/_plugins/config_validator.rb +231 -23
- data/_plugins/critical_css_check.rb +42 -0
- data/_plugins/csp_generator.rb +18 -28
- data/_plugins/datalog_bibliography.rb +9 -7
- data/_plugins/datalog_comments.rb +8 -5
- data/_plugins/datalog_slides.rb +9 -8
- data/_plugins/i18n.rb +13 -12
- data/_plugins/image_optimizer.rb +241 -178
- data/_plugins/licenses.rb +135 -0
- data/_plugins/math_preprocessor.rb +59 -7
- data/_plugins/notebook_converter.rb +23 -4
- data/_plugins/plugin_loader.rb +3 -1
- data/_plugins/publications_generator.rb +8 -2
- data/_plugins/references.rb +238 -0
- data/_plugins/reproducibility.rb +150 -0
- data/_plugins/revisions.rb +101 -0
- data/_plugins/rouge_highlight_filter.rb +42 -0
- data/_plugins/scholarly.rb +50 -0
- data/_plugins/search_code_blocks.rb +30 -0
- data/_plugins/search_normalizer.rb +15 -53
- data/_plugins/search_pages.rb +3 -4
- data/_plugins/series.rb +104 -0
- data/_plugins/statements.rb +87 -0
- data/_sass/_academic-dashboard.scss +262 -0
- data/_sass/_base.scss +20 -1
- data/_sass/_comments-thread.scss +159 -0
- data/_sass/_components.scss +64 -1153
- data/_sass/_features.scss +17 -0
- data/_sass/_layout.scss +385 -1
- data/_sass/_mathematical.scss +27 -0
- data/_sass/_moderation.scss +222 -0
- data/_sass/_notebooks.scss +322 -0
- data/_sass/_open-science-badges.scss +56 -0
- data/_sass/{_phase1-enhancements.scss → _post-components.scss} +5 -3
- data/_sass/_print.scss +291 -0
- data/_sass/_reactions.scss +89 -0
- data/_sass/_reading-state.scss +290 -0
- data/_sass/_search-page.scss +530 -0
- data/_sass/_search.scss +46 -0
- data/_sass/_service-forms.scss +204 -0
- data/_sass/_subscriptions.scss +140 -0
- data/_sass/_syntax-highlighting.scss +212 -97
- data/_sass/_theme.scss +40 -19
- data/_sass/_typography.scss +130 -0
- data/_sass/_utilities.scss +5 -0
- data/_sass/_variables.scss +6 -0
- data/_sass/_webmentions.scss +125 -0
- data/assets/css/main.scss +14 -0
- data/assets/js/dist/academic.js +1 -1
- data/assets/js/dist/analytics-dashboard.js +1 -1
- data/assets/js/dist/chunks/chunk-2DYDWUFX.js +1 -0
- data/assets/js/dist/chunks/chunk-PATLC23F.js +1 -0
- data/assets/js/dist/chunks/chunk-V7734B2G.js +1 -0
- data/assets/js/dist/comments.js +2 -0
- data/assets/js/dist/contact.js +1 -0
- data/assets/js/dist/core.js +1 -1
- data/assets/js/dist/corrections.js +1 -0
- data/assets/js/dist/loader.js +1 -1
- data/assets/js/dist/math.js +1 -1
- data/assets/js/dist/moderation.js +1 -0
- data/assets/js/dist/notebook.js +1 -1
- data/assets/js/dist/reactions.js +1 -0
- data/assets/js/dist/reading-state.js +1 -0
- data/assets/js/dist/search.js +1 -1
- data/assets/js/dist/sources.json +52 -0
- data/assets/js/dist/subscriptions.js +1 -0
- data/assets/js/dist/visualizations.js +11 -2
- data/assets/js/dist/webmentions.js +1 -0
- data/assets/js/loader.js +37 -1
- data/datalog-theme.gemspec +35 -23
- data/lib/datalog/cli.rb +43 -15
- data/lib/datalog/critical_css.rb +168 -0
- data/lib/datalog/plugin_system/dependency_resolver.rb +0 -2
- data/lib/datalog/plugins/comments.rb +33 -3
- data/lib/datalog/theme/installed_files.rb +113 -0
- data/lib/datalog/theme/package.rb +57 -0
- data/lib/datalog/theme/repository_checkout.rb +94 -0
- data/lib/datalog/theme/version.rb +5 -1
- data/lib/datalog/warning_filter.rb +5 -11
- data/lib/datalog-theme.rb +6 -0
- metadata +96 -147
- data/_data/academic.yml +0 -217
- data/_data/config/author.yml +0 -121
- data/_data/datasets.yml +0 -28
- data/_data/js_meta.json +0 -371
- data/_data/navigation.yml +0 -145
- data/_data/projects.yml +0 -41
- data/_data/publications.yml +0 -28
- data/_data/social.yml +0 -73
- data/_data/visualizations.yml +0 -51
- data/_includes/components/advanced-search.html +0 -682
- data/_includes/components/bookmark-system.html +0 -96
- data/_includes/components/comments.html +0 -244
- data/_includes/components/content-recommendations.html +0 -228
- data/_includes/components/email-preferences.html +0 -200
- data/_includes/components/enhanced-metadata.html +0 -228
- data/_includes/components/language-switcher.html +0 -396
- data/_includes/components/navigation-enhancements.html +0 -454
- data/_includes/components/newsletter-signup.html +0 -178
- data/_includes/components/popular-posts.html +0 -233
- data/_includes/components/reading-progress.html +0 -133
- data/_includes/components/reading-time.html +0 -121
- data/_includes/components/series-navigation.html +0 -124
- data/_includes/components/social-proof.html +0 -34
- data/_includes/components/user-preferences.html +0 -566
- data/_includes/meta/syntax-config.html +0 -19
- data/_layouts/archive.html +0 -282
- data/_layouts/post-sidebar.html +0 -183
- data/_sass/_phase3-enhancements.scss +0 -874
- data/_sass/_phase4-enhancements.scss +0 -1214
- data/_sass/_phase5-enhancements.scss +0 -414
- data/assets/js/academic.js +0 -262
- data/assets/js/analytics-dashboard.js +0 -382
- data/assets/js/core/dark-mode.js +0 -79
- data/assets/js/core/github-cards.js +0 -123
- data/assets/js/core/language-filter.js +0 -69
- data/assets/js/core/navigation.js +0 -184
- data/assets/js/core/scroll-progress.js +0 -45
- data/assets/js/core/search-hotkeys.js +0 -62
- data/assets/js/core/skip-links.js +0 -62
- data/assets/js/dist/manifest.json +0 -22
- data/assets/js/dist/meta.json +0 -371
- data/assets/js/main.js +0 -23
- data/assets/js/math.js +0 -818
- data/assets/js/notebook.js +0 -158
- data/assets/js/search/analytics.js +0 -91
- data/assets/js/search/app.js +0 -271
- data/assets/js/search/autocomplete.js +0 -120
- data/assets/js/search/engine.js +0 -260
- data/assets/js/search/filters.js +0 -45
- data/assets/js/search/render.js +0 -217
- data/assets/js/search/utils.js +0 -99
- data/assets/js/search.js +0 -354
- data/assets/js/visualizations.js +0 -816
- data/assets/publications/datalog-publications.bib +0 -8
- data/assets/publications/datalog-publications.ris +0 -9
- data/assets/publications/publications.bib +0 -30
- data/assets/templates/diogo-ribeiro-cv.md +0 -31
- data/assets/templates/diogo-ribeiro-cv.tex +0 -32
- data/lib/datalog/theme/theme.rb +0 -18
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "jekyll"
|
|
4
|
+
require_relative "package"
|
|
5
|
+
|
|
6
|
+
module Datalog
|
|
7
|
+
module Theme
|
|
8
|
+
# A site that installs the theme from a Git checkout or a local path
|
|
9
|
+
# (`gem "datalog-theme", github: ...` or `path: ...`) gets the whole
|
|
10
|
+
# repository as its theme, and the repository is also the demo site. Jekyll
|
|
11
|
+
# merges the demo's _config.yml into the site's configuration, reads the
|
|
12
|
+
# demo's _data as theme data and copies the demo's downloads from assets/.
|
|
13
|
+
# The site then inherits the maintainer's name, contact addresses and social
|
|
14
|
+
# profiles, and jekyll-feed stops the build on a datasets feed for a
|
|
15
|
+
# collection the site does not have. The packaged gem contains none of those
|
|
16
|
+
# files; these hooks give a checkout the same contents.
|
|
17
|
+
module RepositoryCheckout
|
|
18
|
+
module_function
|
|
19
|
+
|
|
20
|
+
# The packaged gem ships no _config.yml, so one at the theme root means
|
|
21
|
+
# the theme is a copy of the repository.
|
|
22
|
+
def applies_to?(site)
|
|
23
|
+
theme = site.theme
|
|
24
|
+
!theme.nil? && theme.name == "datalog-theme" && File.file?(File.join(theme.root, "_config.yml"))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Jekyll merges the theme configuration before any theme code runs, so it
|
|
28
|
+
# cannot be taken back out here: Jekyll's own `ignore_theme_config` switch
|
|
29
|
+
# is the only way to keep it out. A site that sets the switch to false has
|
|
30
|
+
# chosen to inherit the demo configuration.
|
|
31
|
+
def check_configuration(site)
|
|
32
|
+
return unless applies_to?(site)
|
|
33
|
+
return if site.config.key?("ignore_theme_config")
|
|
34
|
+
|
|
35
|
+
raise Jekyll::Errors::FatalException, <<~MESSAGE
|
|
36
|
+
datalog-theme is installed from a copy of its repository (#{site.theme.root}),
|
|
37
|
+
which is also the theme's demo site. Jekyll merges the demo's _config.yml into
|
|
38
|
+
your configuration, so your site would carry the demo's author, contact
|
|
39
|
+
addresses, social profiles and feeds.
|
|
40
|
+
|
|
41
|
+
Add this line to your _config.yml:
|
|
42
|
+
|
|
43
|
+
ignore_theme_config: true
|
|
44
|
+
|
|
45
|
+
The theme then also leaves out the demo's _data files and downloads. Set it to
|
|
46
|
+
false instead only if you mean to inherit the demo configuration.
|
|
47
|
+
MESSAGE
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def remove_demo_content(site)
|
|
51
|
+
return unless applies_to?(site) && site.config["ignore_theme_config"] == true
|
|
52
|
+
|
|
53
|
+
remove_demo_assets(site)
|
|
54
|
+
remove_demo_data(site)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# A checkout also holds the script sources the bundles are built from,
|
|
58
|
+
# which no page loads. The site gets the theme assets the gem would give it.
|
|
59
|
+
def remove_demo_assets(site)
|
|
60
|
+
root = File.join(site.theme.root, "")
|
|
61
|
+
site.static_files.reject! do |file|
|
|
62
|
+
file.path.start_with?(root) && !Package.theme_file?(file.path.delete_prefix(root))
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# site.data holds the theme's data with the site's merged over it. Each key
|
|
67
|
+
# the demo contributed goes back to the site's own value, or away.
|
|
68
|
+
def remove_demo_data(site)
|
|
69
|
+
theme_data_dir = File.join(site.theme.root, "_data")
|
|
70
|
+
return unless File.directory?(theme_data_dir)
|
|
71
|
+
|
|
72
|
+
demo_keys = Dir.children(theme_data_dir).map { |name| File.basename(name, ".*") } - Package.data_keys
|
|
73
|
+
return if demo_keys.empty?
|
|
74
|
+
|
|
75
|
+
own = Jekyll::DataReader.new(site).read(site.config["data_dir"])
|
|
76
|
+
demo_keys.each do |key|
|
|
77
|
+
if own.key?(key)
|
|
78
|
+
site.data[key] = own[key]
|
|
79
|
+
else
|
|
80
|
+
site.data.delete(key)
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
Jekyll::Hooks.register :site, :after_init do |site|
|
|
89
|
+
Datalog::Theme::RepositoryCheckout.check_configuration(site)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
Jekyll::Hooks.register :site, :post_read do |site|
|
|
93
|
+
Datalog::Theme::RepositoryCheckout.remove_demo_content(site)
|
|
94
|
+
end
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
module Datalog
|
|
4
4
|
module Theme
|
|
5
|
-
VERSION = "0.
|
|
5
|
+
VERSION = "0.9.0" unless const_defined?(:VERSION)
|
|
6
|
+
# The Ruby the gem installs on, for the gemspec and `datalog check`. The
|
|
7
|
+
# release workflow rewrites every quoted version assigned to a name ending
|
|
8
|
+
# in VERSION in this file, so this name must not end that way.
|
|
9
|
+
RUBY_REQUIREMENT = ">= 3.2" unless const_defined?(:RUBY_REQUIREMENT)
|
|
6
10
|
end
|
|
7
11
|
end
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Datalog
|
|
4
|
+
# Silences two warnings that every build repeats. Kernel#warn reports through
|
|
5
|
+
# Warning.warn, so prepending here covers both. A Kernel#warn override used to
|
|
6
|
+
# sit alongside it, and it printed keyword arguments such as `uplevel:` and
|
|
7
|
+
# `category:` as a hash after the message instead of honouring them.
|
|
4
8
|
module WarningFilter
|
|
5
9
|
FILTERS = [
|
|
6
10
|
/literal string will be frozen/,
|
|
7
11
|
/already initialized constant Datalog::Theme::VERSION/
|
|
8
12
|
].freeze
|
|
9
13
|
|
|
10
|
-
def warn(message)
|
|
14
|
+
def warn(message, **options)
|
|
11
15
|
return if FILTERS.any? { |pattern| pattern.match?(message) }
|
|
12
16
|
|
|
13
17
|
super
|
|
@@ -16,13 +20,3 @@ module Datalog
|
|
|
16
20
|
end
|
|
17
21
|
|
|
18
22
|
Warning.singleton_class.prepend(Datalog::WarningFilter) if defined?(Warning)
|
|
19
|
-
|
|
20
|
-
module Kernel
|
|
21
|
-
alias __datalog_warn warn
|
|
22
|
-
|
|
23
|
-
def warn(message = nil, *args)
|
|
24
|
-
return if message && Datalog::WarningFilter::FILTERS.any? { |pattern| pattern.match?(message) }
|
|
25
|
-
|
|
26
|
-
__datalog_warn(message, *args)
|
|
27
|
-
end
|
|
28
|
-
end
|
data/lib/datalog-theme.rb
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative "datalog/theme/version"
|
|
4
|
+
# The layouts render their page-independent includes with {% include_cached %},
|
|
5
|
+
# which comes from jekyll-include-cache rather than Jekyll itself.
|
|
6
|
+
require "jekyll-include-cache"
|
|
4
7
|
|
|
5
8
|
module Datalog
|
|
6
9
|
module Theme
|
|
@@ -31,3 +34,6 @@ module Datalog
|
|
|
31
34
|
end
|
|
32
35
|
|
|
33
36
|
Datalog::Theme.load_plugins
|
|
37
|
+
|
|
38
|
+
require_relative "datalog/theme/repository_checkout"
|
|
39
|
+
require_relative "datalog/theme/installed_files"
|