bridgetown-core 1.0.0.beta3 → 1.1.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -1
  3. data/lib/bridgetown-core/collection.rb +37 -20
  4. data/lib/bridgetown-core/commands/concerns/actions.rb +3 -2
  5. data/lib/bridgetown-core/commands/configure.rb +1 -1
  6. data/lib/bridgetown-core/commands/esbuild/esbuild.config.js +20 -16
  7. data/lib/bridgetown-core/commands/esbuild/esbuild.defaults.js.erb +95 -12
  8. data/lib/bridgetown-core/commands/new.rb +10 -9
  9. data/lib/bridgetown-core/commands/plugins.rb +2 -0
  10. data/lib/bridgetown-core/commands/start.rb +3 -0
  11. data/lib/bridgetown-core/commands/webpack/update.rb +3 -3
  12. data/lib/bridgetown-core/commands/webpack/webpack.defaults.js.erb +19 -14
  13. data/lib/bridgetown-core/component.rb +13 -7
  14. data/lib/bridgetown-core/concerns/localizable.rb +20 -0
  15. data/lib/bridgetown-core/concerns/prioritizable.rb +44 -0
  16. data/lib/bridgetown-core/concerns/publishable.rb +11 -1
  17. data/lib/bridgetown-core/concerns/site/configurable.rb +2 -10
  18. data/lib/bridgetown-core/concerns/site/localizable.rb +5 -1
  19. data/lib/bridgetown-core/concerns/site/ssr.rb +3 -3
  20. data/lib/bridgetown-core/concerns/site/writable.rb +28 -0
  21. data/lib/bridgetown-core/configuration.rb +2 -0
  22. data/lib/bridgetown-core/configurations/bt-postcss/postcss.config.js +5 -3
  23. data/lib/bridgetown-core/configurations/bt-postcss.rb +1 -1
  24. data/lib/bridgetown-core/configurations/gh-pages/gh-pages.yml +33 -0
  25. data/lib/bridgetown-core/configurations/gh-pages.rb +16 -0
  26. data/lib/bridgetown-core/configurations/lit/esbuild-plugins.js +21 -0
  27. data/lib/bridgetown-core/configurations/lit/happy-days.lit.js +26 -0
  28. data/lib/bridgetown-core/configurations/lit/lit-components-entry.js +1 -0
  29. data/lib/bridgetown-core/configurations/lit/lit-ssr.config.js +6 -0
  30. data/lib/bridgetown-core/configurations/lit.rb +95 -0
  31. data/lib/bridgetown-core/configurations/open-props/variables.css.erb +11 -0
  32. data/lib/bridgetown-core/configurations/open-props.rb +21 -0
  33. data/lib/bridgetown-core/configurations/ruby2js/hello_world.js.rb +9 -0
  34. data/lib/bridgetown-core/configurations/ruby2js.rb +67 -0
  35. data/lib/bridgetown-core/configurations/shoelace.rb +50 -0
  36. data/lib/bridgetown-core/configurations/tailwindcss.rb +16 -2
  37. data/lib/bridgetown-core/converters/markdown/kramdown_parser.rb +1 -1
  38. data/lib/bridgetown-core/drops/generated_page_drop.rb +2 -1
  39. data/lib/bridgetown-core/drops/resource_drop.rb +2 -1
  40. data/lib/bridgetown-core/errors.rb +5 -5
  41. data/lib/bridgetown-core/filters/translation_filters.rb +11 -0
  42. data/lib/bridgetown-core/filters/url_filters.rb +37 -10
  43. data/lib/bridgetown-core/filters.rb +3 -0
  44. data/lib/bridgetown-core/frontmatter_defaults.rb +14 -8
  45. data/lib/bridgetown-core/generated_page.rb +1 -0
  46. data/lib/bridgetown-core/kramdown/parser/gfm.rb +36 -0
  47. data/lib/bridgetown-core/model/base.rb +1 -2
  48. data/lib/bridgetown-core/plugin.rb +6 -37
  49. data/lib/bridgetown-core/plugin_manager.rb +3 -2
  50. data/lib/bridgetown-core/rack/boot.rb +5 -0
  51. data/lib/bridgetown-core/rack/logger.rb +14 -4
  52. data/lib/bridgetown-core/rack/roda.rb +102 -10
  53. data/lib/bridgetown-core/rack/routes.rb +87 -6
  54. data/lib/bridgetown-core/resource/base.rb +4 -6
  55. data/lib/bridgetown-core/resource/destination.rb +18 -0
  56. data/lib/bridgetown-core/resource/permalink_processor.rb +6 -4
  57. data/lib/bridgetown-core/resource/relations.rb +1 -1
  58. data/lib/bridgetown-core/utils/aux.rb +2 -1
  59. data/lib/bridgetown-core/utils/require_gems.rb +3 -6
  60. data/lib/bridgetown-core/utils.rb +25 -12
  61. data/lib/bridgetown-core/version.rb +2 -2
  62. data/lib/bridgetown-core/watcher.rb +19 -6
  63. data/lib/bridgetown-core.rb +8 -2
  64. data/lib/site_template/Gemfile.erb +1 -1
  65. data/lib/site_template/README.md +2 -2
  66. data/lib/site_template/TEMPLATES/erb/_components/shared/navbar.erb +4 -4
  67. data/lib/site_template/TEMPLATES/liquid/_components/navbar.liquid +4 -4
  68. data/lib/site_template/TEMPLATES/serbea/_components/shared/navbar.serb +4 -4
  69. data/lib/site_template/bridgetown.config.yml +10 -3
  70. data/lib/site_template/frontend/javascript/index.js.erb +1 -0
  71. data/lib/site_template/frontend/styles/syntax-highlighting.css +77 -0
  72. data/lib/site_template/package.json.erb +18 -18
  73. data/lib/site_template/server/roda_app.rb +3 -6
  74. data/lib/site_template/src/404.html +2 -1
  75. data/lib/site_template/src/500.html +10 -0
  76. metadata +20 -3
  77. data/lib/bridgetown-core/publisher.rb +0 -29
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta3
4
+ version: 1.1.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-18 00:00:00.000000000 Z
11
+ date: 2022-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -409,6 +409,8 @@ files:
409
409
  - lib/bridgetown-core/concerns/front_matter_importer.rb
410
410
  - lib/bridgetown-core/concerns/layout_placeable.rb
411
411
  - lib/bridgetown-core/concerns/liquid_renderable.rb
412
+ - lib/bridgetown-core/concerns/localizable.rb
413
+ - lib/bridgetown-core/concerns/prioritizable.rb
412
414
  - lib/bridgetown-core/concerns/publishable.rb
413
415
  - lib/bridgetown-core/concerns/site/configurable.rb
414
416
  - lib/bridgetown-core/concerns/site/content.rb
@@ -431,13 +433,25 @@ files:
431
433
  - lib/bridgetown-core/configurations/cypress/cypress_dir/support/commands.js
432
434
  - lib/bridgetown-core/configurations/cypress/cypress_dir/support/index.js
433
435
  - lib/bridgetown-core/configurations/cypress/cypress_tasks
436
+ - lib/bridgetown-core/configurations/gh-pages.rb
437
+ - lib/bridgetown-core/configurations/gh-pages/gh-pages.yml
438
+ - lib/bridgetown-core/configurations/lit.rb
439
+ - lib/bridgetown-core/configurations/lit/esbuild-plugins.js
440
+ - lib/bridgetown-core/configurations/lit/happy-days.lit.js
441
+ - lib/bridgetown-core/configurations/lit/lit-components-entry.js
442
+ - lib/bridgetown-core/configurations/lit/lit-ssr.config.js
434
443
  - lib/bridgetown-core/configurations/minitesting.rb
435
444
  - lib/bridgetown-core/configurations/netlify.rb
436
445
  - lib/bridgetown-core/configurations/netlify/netlify.sh
437
446
  - lib/bridgetown-core/configurations/netlify/netlify.toml
447
+ - lib/bridgetown-core/configurations/open-props.rb
448
+ - lib/bridgetown-core/configurations/open-props/variables.css.erb
438
449
  - lib/bridgetown-core/configurations/purgecss.rb
439
450
  - lib/bridgetown-core/configurations/render.rb
440
451
  - lib/bridgetown-core/configurations/render/render.yaml.erb
452
+ - lib/bridgetown-core/configurations/ruby2js.rb
453
+ - lib/bridgetown-core/configurations/ruby2js/hello_world.js.rb
454
+ - lib/bridgetown-core/configurations/shoelace.rb
441
455
  - lib/bridgetown-core/configurations/stimulus.rb
442
456
  - lib/bridgetown-core/configurations/tailwindcss.rb
443
457
  - lib/bridgetown-core/configurations/tailwindcss/css_imports.css
@@ -476,6 +490,7 @@ files:
476
490
  - lib/bridgetown-core/filters/date_filters.rb
477
491
  - lib/bridgetown-core/filters/from_liquid.rb
478
492
  - lib/bridgetown-core/filters/grouping_filters.rb
493
+ - lib/bridgetown-core/filters/translation_filters.rb
479
494
  - lib/bridgetown-core/filters/url_filters.rb
480
495
  - lib/bridgetown-core/frontmatter_defaults.rb
481
496
  - lib/bridgetown-core/generated_page.rb
@@ -483,6 +498,7 @@ files:
483
498
  - lib/bridgetown-core/generators/prototype_generator.rb
484
499
  - lib/bridgetown-core/helpers.rb
485
500
  - lib/bridgetown-core/hooks.rb
501
+ - lib/bridgetown-core/kramdown/parser/gfm.rb
486
502
  - lib/bridgetown-core/layout.rb
487
503
  - lib/bridgetown-core/liquid_extensions.rb
488
504
  - lib/bridgetown-core/liquid_renderer.rb
@@ -499,7 +515,6 @@ files:
499
515
  - lib/bridgetown-core/model/repo_origin.rb
500
516
  - lib/bridgetown-core/plugin.rb
501
517
  - lib/bridgetown-core/plugin_manager.rb
502
- - lib/bridgetown-core/publisher.rb
503
518
  - lib/bridgetown-core/rack/boot.rb
504
519
  - lib/bridgetown-core/rack/logger.rb
505
520
  - lib/bridgetown-core/rack/roda.rb
@@ -570,6 +585,7 @@ files:
570
585
  - lib/site_template/config/puma.rb
571
586
  - lib/site_template/frontend/javascript/index.js.erb
572
587
  - lib/site_template/frontend/styles/index.css
588
+ - lib/site_template/frontend/styles/syntax-highlighting.css
573
589
  - lib/site_template/package.json.erb
574
590
  - lib/site_template/plugins/builders/.keep
575
591
  - lib/site_template/plugins/site_builder.rb
@@ -578,6 +594,7 @@ files:
578
594
  - lib/site_template/server/roda_app.rb
579
595
  - lib/site_template/server/routes/hello.rb.sample
580
596
  - lib/site_template/src/404.html
597
+ - lib/site_template/src/500.html
581
598
  - lib/site_template/src/_data/site_metadata.yml
582
599
  - lib/site_template/src/_posts/0000-00-00-welcome-to-bridgetown.md.erb
583
600
  - lib/site_template/src/about.md
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bridgetown
4
- class Publisher
5
- # @param site [Bridgetown::Site]
6
- def initialize(site)
7
- @site = site
8
- end
9
-
10
- def publish?(thing)
11
- can_be_published?(thing) && !hidden_in_the_future?(thing)
12
- end
13
-
14
- def hidden_in_the_future?(thing)
15
- return false unless thing.respond_to?(:date)
16
-
17
- future_allowed =
18
- (thing.respond_to?(:collection) && thing.collection.metadata.future) || @site.config.future
19
- thing_time = thing.date.is_a?(Date) ? thing.date.to_time.to_i : thing.date.to_i
20
- !future_allowed && thing_time > @site.time.to_i
21
- end
22
-
23
- private
24
-
25
- def can_be_published?(thing)
26
- thing.data.fetch("published", true) || @site.config.unpublished
27
- end
28
- end
29
- end