bridgetown-core 0.21.2 → 1.0.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +35 -0
- data/Rakefile +5 -5
- data/bin/bridgetown +2 -0
- data/bridgetown-core.gemspec +3 -0
- data/lib/bridgetown-core/cache.rb +3 -5
- data/lib/bridgetown-core/cleaner.rb +2 -10
- data/lib/bridgetown-core/collection.rb +62 -86
- data/lib/bridgetown-core/commands/base.rb +62 -2
- data/lib/bridgetown-core/commands/build.rb +33 -12
- data/lib/bridgetown-core/commands/concerns/actions.rb +2 -2
- data/lib/bridgetown-core/commands/concerns/build_options.rb +3 -10
- data/lib/bridgetown-core/commands/concerns/configuration_overridable.rb +3 -1
- data/lib/bridgetown-core/commands/console.rb +3 -3
- data/lib/bridgetown-core/commands/doctor.rb +13 -11
- data/lib/bridgetown-core/commands/new.rb +14 -6
- data/lib/bridgetown-core/commands/plugins.rb +8 -11
- data/lib/bridgetown-core/commands/serve/servlet.rb +4 -4
- data/lib/bridgetown-core/commands/serve.rb +37 -37
- data/lib/bridgetown-core/commands/start.rb +106 -0
- data/lib/bridgetown-core/commands/webpack/webpack.defaults.js.erb +2 -2
- data/lib/bridgetown-core/commands/webpack.rb +1 -1
- data/lib/bridgetown-core/component.rb +1 -5
- data/lib/bridgetown-core/concerns/site/configurable.rb +1 -13
- data/lib/bridgetown-core/concerns/site/content.rb +17 -118
- data/lib/bridgetown-core/concerns/site/extensible.rb +3 -4
- data/lib/bridgetown-core/concerns/site/localizable.rb +3 -1
- data/lib/bridgetown-core/concerns/site/processable.rb +9 -20
- data/lib/bridgetown-core/concerns/site/renderable.rb +19 -30
- data/lib/bridgetown-core/concerns/site/ssr.rb +53 -0
- data/lib/bridgetown-core/concerns/site/writable.rb +6 -9
- data/lib/bridgetown-core/configuration.rb +19 -48
- data/lib/bridgetown-core/configurations/minitesting.rb +1 -1
- data/lib/bridgetown-core/configurations/turbo.rb +1 -1
- data/lib/bridgetown-core/converter.rb +1 -0
- data/lib/bridgetown-core/converters/erb_templates.rb +3 -2
- data/lib/bridgetown-core/converters/liquid_templates.rb +3 -2
- data/lib/bridgetown-core/converters/markdown/kramdown_parser.rb +1 -1
- data/lib/bridgetown-core/converters/smartypants.rb +1 -0
- data/lib/bridgetown-core/current.rb +4 -0
- data/lib/bridgetown-core/drops/collection_drop.rb +1 -1
- data/lib/bridgetown-core/drops/drop.rb +4 -4
- data/lib/bridgetown-core/drops/generated_page_drop.rb +23 -0
- data/lib/bridgetown-core/drops/resource_drop.rb +3 -3
- data/lib/bridgetown-core/drops/site_drop.rb +3 -47
- data/lib/bridgetown-core/entry_filter.rb +1 -0
- data/lib/bridgetown-core/errors.rb +0 -2
- data/lib/bridgetown-core/filters/url_filters.rb +2 -0
- data/lib/bridgetown-core/filters.rb +11 -12
- data/lib/bridgetown-core/frontmatter_defaults.rb +52 -90
- data/lib/bridgetown-core/{page.rb → generated_page.rb} +34 -60
- data/lib/bridgetown-core/generators/prototype_generator.rb +49 -61
- data/lib/bridgetown-core/helpers.rb +8 -3
- data/lib/bridgetown-core/hooks.rb +2 -2
- data/lib/bridgetown-core/layout.rb +15 -4
- data/lib/bridgetown-core/liquid_renderer.rb +1 -3
- data/lib/bridgetown-core/log_adapter.rb +1 -1
- data/lib/bridgetown-core/log_writer.rb +7 -1
- data/lib/bridgetown-core/model/base.rb +12 -4
- data/lib/bridgetown-core/model/builder_origin.rb +23 -11
- data/lib/bridgetown-core/model/origin.rb +3 -0
- data/lib/bridgetown-core/model/plugin_origin.rb +34 -0
- data/lib/bridgetown-core/model/repo_origin.rb +1 -1
- data/lib/bridgetown-core/plugin_manager.rb +10 -10
- data/lib/bridgetown-core/publisher.rb +1 -1
- data/lib/bridgetown-core/rack/boot.rb +47 -0
- data/lib/bridgetown-core/rack/logger.rb +22 -0
- data/lib/bridgetown-core/rack/roda.rb +66 -0
- data/lib/bridgetown-core/rack/routes.rb +88 -0
- data/lib/bridgetown-core/rack/static_indexes.rb +30 -0
- data/lib/bridgetown-core/reader.rb +20 -47
- data/lib/bridgetown-core/readers/layout_reader.rb +2 -2
- data/lib/bridgetown-core/readers/plugin_content_reader.rb +8 -7
- data/lib/bridgetown-core/renderer.rb +2 -12
- data/lib/bridgetown-core/resource/base.rb +51 -27
- data/lib/bridgetown-core/resource/permalink_processor.rb +23 -12
- data/lib/bridgetown-core/resource/relations.rb +2 -3
- data/lib/bridgetown-core/resource/taxonomy_term.rb +1 -5
- data/lib/bridgetown-core/resource/transformer.rb +8 -6
- data/lib/bridgetown-core/ruby_template_view.rb +6 -8
- data/lib/bridgetown-core/site.rb +4 -8
- data/lib/bridgetown-core/static_file.rb +14 -21
- data/lib/bridgetown-core/tags/find.rb +6 -6
- data/lib/bridgetown-core/tags/highlight.rb +5 -5
- data/lib/bridgetown-core/tags/include.rb +22 -32
- data/lib/bridgetown-core/tags/link.rb +4 -0
- data/lib/bridgetown-core/tags/live_reload_dev_js.rb +13 -0
- data/lib/bridgetown-core/tags/post_url.rb +9 -14
- data/lib/bridgetown-core/tags/render_content.rb +2 -2
- data/lib/bridgetown-core/tasks/bridgetown_tasks.rake +54 -0
- data/lib/bridgetown-core/url.rb +5 -4
- data/lib/bridgetown-core/utils/aux.rb +57 -0
- data/lib/bridgetown-core/utils/ruby_exec.rb +3 -45
- data/lib/bridgetown-core/utils/ruby_front_matter.rb +22 -7
- data/lib/bridgetown-core/utils.rb +60 -33
- data/lib/bridgetown-core/version.rb +2 -2
- data/lib/bridgetown-core/watcher.rb +4 -6
- data/lib/bridgetown-core.rb +16 -23
- data/lib/site_template/Gemfile.erb +6 -2
- data/lib/site_template/README.md +6 -6
- data/lib/site_template/Rakefile +49 -0
- data/lib/site_template/bridgetown.config.yml +2 -3
- data/lib/site_template/config/puma.rb +27 -0
- data/lib/site_template/config.ru +7 -0
- data/lib/site_template/frontend/javascript/index.js.erb +3 -3
- data/lib/site_template/package.json.erb +7 -12
- data/lib/site_template/server/roda_app.rb +22 -0
- data/lib/site_template/server/routes/hello.rb.sample +10 -0
- data/lib/site_template/src/_components/head.liquid +2 -1
- data/lib/site_template/src/about.md +0 -1
- data/lib/site_template/src/posts.md +2 -3
- metadata +63 -18
- data/lib/bridgetown-core/concerns/data_accessible.rb +0 -20
- data/lib/bridgetown-core/concerns/validatable.rb +0 -56
- data/lib/bridgetown-core/document.rb +0 -437
- data/lib/bridgetown-core/drops/document_drop.rb +0 -80
- data/lib/bridgetown-core/drops/excerpt_drop.rb +0 -19
- data/lib/bridgetown-core/drops/page_drop.rb +0 -18
- data/lib/bridgetown-core/excerpt.rb +0 -200
- data/lib/bridgetown-core/readers/data_reader.rb +0 -89
- data/lib/bridgetown-core/readers/page_reader.rb +0 -26
- data/lib/bridgetown-core/readers/post_reader.rb +0 -109
- data/lib/bridgetown-core/regenerator.rb +0 -202
- data/lib/bridgetown-core/related_posts.rb +0 -55
- data/lib/site_template/config/.keep +0 -0
- data/lib/site_template/start.js +0 -17
- data/lib/site_template/sync.js +0 -35
data/lib/site_template/README.md
CHANGED
@@ -18,9 +18,9 @@ Welcome to your new Bridgetown website! You can update this README file to provi
|
|
18
18
|
- [Ruby](https://www.ruby-lang.org/en/downloads/)
|
19
19
|
- `>= 2.5`
|
20
20
|
- [Bridgetown Gem](https://rubygems.org/gems/bridgetown)
|
21
|
-
- `gem install
|
21
|
+
- `gem install bridgetown -N`
|
22
22
|
- [Node](https://nodejs.org)
|
23
|
-
- `>=
|
23
|
+
- `>= 12`
|
24
24
|
- [Yarn](https://yarnpkg.com)
|
25
25
|
|
26
26
|
## Install
|
@@ -33,7 +33,7 @@ bundle install && yarn install
|
|
33
33
|
|
34
34
|
## Development
|
35
35
|
|
36
|
-
To start your site in development mode, run `
|
36
|
+
To start your site in development mode, run `bin/bridgetown start` and navigate to [localhost:4000](https://localhost:4000/)!
|
37
37
|
|
38
38
|
Use a [theme](https://github.com/topics/bridgetown-theme), add some [plugins](https://www.bridgetownrb.com/plugins/), and/or run some [automations](https://github.com/topics/bridgetown-automation) to get started quickly.
|
39
39
|
|
@@ -41,13 +41,13 @@ Use a [theme](https://github.com/topics/bridgetown-theme), add some [plugins](ht
|
|
41
41
|
|
42
42
|
```sh
|
43
43
|
# running locally
|
44
|
-
|
44
|
+
bin/bridgetown start
|
45
45
|
|
46
46
|
# build & deploy to production
|
47
|
-
|
47
|
+
bin/bridgetown deploy
|
48
48
|
|
49
49
|
# load the site up within a Ruby console (IRB)
|
50
|
-
|
50
|
+
bin/bridgetown console
|
51
51
|
```
|
52
52
|
|
53
53
|
> Learn more: [Bridgetown CLI Documentation](https://www.bridgetownrb.com/docs/command-line-usage)
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require "bridgetown"
|
2
|
+
|
3
|
+
Bridgetown.load_tasks
|
4
|
+
|
5
|
+
#
|
6
|
+
# Standard set of tasks, which you can customize if you wish:
|
7
|
+
#
|
8
|
+
desc "Build the Bridgetown site for deployment"
|
9
|
+
task :deploy => [:clean, "frontend:build"] do
|
10
|
+
Bridgetown::Commands::Build.start
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Build the site in a test environment"
|
14
|
+
task :test do
|
15
|
+
ENV["BRIDGETOWN_ENV"] = "test"
|
16
|
+
Bridgetown::Commands::Build.start
|
17
|
+
end
|
18
|
+
|
19
|
+
desc "Runs the clean command"
|
20
|
+
task :clean do
|
21
|
+
Bridgetown::Commands::Clean.start
|
22
|
+
end
|
23
|
+
|
24
|
+
namespace :frontend do
|
25
|
+
desc "Build the frontend with Webpack for deployment"
|
26
|
+
task :build do
|
27
|
+
sh "yarn run webpack-build"
|
28
|
+
end
|
29
|
+
|
30
|
+
desc "Watch the frontend with Webpack during development"
|
31
|
+
task :dev do
|
32
|
+
sh "yarn run webpack-dev --color"
|
33
|
+
rescue Interrupt
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# Add your own Rake tasks here! You can use `environment` as a prerequisite
|
39
|
+
# in order to write automations or other commands requiring a loaded site.
|
40
|
+
#
|
41
|
+
# task :my_task => :environment do
|
42
|
+
# puts site.root_dir
|
43
|
+
# automation do
|
44
|
+
# say_status :rake, "I'm a Rake tast =) #{site.config.url}"
|
45
|
+
# end
|
46
|
+
# end
|
47
|
+
|
48
|
+
# Run rake without specifying any command to execute a deploy build by default.
|
49
|
+
task default: :deploy
|
@@ -4,11 +4,10 @@
|
|
4
4
|
# which you are expected to set up once and rarely edit after that.
|
5
5
|
#
|
6
6
|
# For technical reasons, this file is *NOT* reloaded automatically when you use
|
7
|
-
#
|
8
|
-
# server process.
|
7
|
+
# `bin/bridgetown start`. If you change this file, please restart the server process.
|
9
8
|
#
|
10
9
|
# For reloadable site metadata like title, SEO description, social media
|
11
|
-
# handles, etc., take a look at src/_data/site_metadata.yml
|
10
|
+
# handles, etc., take a look at `src/_data/site_metadata.yml`
|
12
11
|
#
|
13
12
|
# If you need help with YAML syntax, here are some quick references for you:
|
14
13
|
# https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# Puma is a fast, concurrent web server for Ruby & Rack
|
2
|
+
#
|
3
|
+
# Learn more at: https://puma.io
|
4
|
+
#
|
5
|
+
port ENV.fetch("BRIDGETOWN_PORT") { 4000 }
|
6
|
+
|
7
|
+
# You can adjust the number of workers (separate processes) and threads
|
8
|
+
# (per process) based on your production system
|
9
|
+
#
|
10
|
+
if ENV["BRIDGETOWN_ENV"] == "production"
|
11
|
+
workers ENV.fetch("BRIDGETOWN_CONCURRENCY") { 4 }
|
12
|
+
end
|
13
|
+
|
14
|
+
max_threads_count = ENV.fetch("BRIDGETOWN_MAX_THREADS") { 5 }
|
15
|
+
min_threads_count = ENV.fetch("BRIDGETOWN_MIN_THREADS") { max_threads_count }
|
16
|
+
threads min_threads_count, max_threads_count
|
17
|
+
|
18
|
+
# Preload the application for maximum performance
|
19
|
+
#
|
20
|
+
preload_app!
|
21
|
+
|
22
|
+
# Use the Bridgetown logger format
|
23
|
+
#
|
24
|
+
require "bridgetown-core/rack/logger"
|
25
|
+
log_formatter do |msg|
|
26
|
+
Bridgetown::Rack::Logger.message_with_prefix msg
|
27
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
<%- if options["use-postcss"] -%>
|
2
2
|
import "index.css"
|
3
|
-
|
3
|
+
<%- else -%>
|
4
4
|
import "index.scss"
|
5
|
-
|
5
|
+
<%- end -%>
|
6
6
|
|
7
7
|
// Import all javascript files from src/_components
|
8
8
|
const componentsContext = require.context("bridgetownComponents", true, /.js$/)
|
@@ -3,35 +3,30 @@
|
|
3
3
|
"version": "1.0.0",
|
4
4
|
"private": true,
|
5
5
|
"scripts": {
|
6
|
-
"build": "bundle exec bridgetown build",
|
7
|
-
"serve": "bundle exec bridgetown serve",
|
8
|
-
"clean": "bundle exec bridgetown clean",
|
9
6
|
"webpack-build": "webpack --mode production",
|
10
|
-
"webpack-dev": "webpack --mode development -w"
|
11
|
-
"deploy": "yarn clean && yarn webpack-build && yarn build",
|
12
|
-
"sync": "node sync.js",
|
13
|
-
"start": "node start.js"
|
7
|
+
"webpack-dev": "webpack --mode development -w"
|
14
8
|
},
|
15
9
|
"devDependencies": {
|
16
|
-
"browser-sync": "^2.26.7",
|
17
|
-
"concurrently": "^5.2.0",
|
18
10
|
"css-loader": "^4.3.0",
|
19
11
|
"esbuild": "^0.12.7",
|
20
12
|
"esbuild-loader": "^2.13.1",
|
21
13
|
"file-loader": "^6.2.0",
|
22
14
|
"mini-css-extract-plugin": "^1.3.1",
|
23
|
-
|
15
|
+
<%- if options["use-postcss"] -%>
|
24
16
|
"postcss": "^8.3.0",
|
25
17
|
"postcss-flexbugs-fixes": "^4.1.0",
|
26
18
|
"postcss-loader": "^4.3.0",
|
27
19
|
"postcss-preset-env": "^6.7.0",
|
28
|
-
|
20
|
+
<%- else -%>
|
29
21
|
"sass": "^1.32.8",
|
30
22
|
"sass-loader": "^8.0.2",
|
31
|
-
|
23
|
+
<%- end -%>
|
32
24
|
"webpack": "^5.39.1",
|
33
25
|
"webpack-cli": "^4.7.2",
|
34
26
|
"webpack-manifest-plugin": "^3.1.1",
|
35
27
|
"webpack-merge": "^5.8.0"
|
28
|
+
},
|
29
|
+
"resolutions": {
|
30
|
+
"postcss-focus-within": "^4.0.0"
|
36
31
|
}
|
37
32
|
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Roda is a simple Rack-based framework with a flexible architecture based
|
2
|
+
# on the concept of a routing tree. Bridgetown uses it for its development
|
3
|
+
# server, but you can also run it in production for fast, dynamic applications.
|
4
|
+
#
|
5
|
+
# Learn more at: http://roda.jeremyevans.net
|
6
|
+
|
7
|
+
# Uncomment to use the file-based routing for Bridgetown SSR:
|
8
|
+
# require "bridgetown-routes"
|
9
|
+
|
10
|
+
class RodaApp < Bridgetown::Rack::Roda
|
11
|
+
# Add additional Roda configuration here if needed
|
12
|
+
|
13
|
+
# Uncomment to use Bridgetown SSR:
|
14
|
+
# plugin :bridgetown_ssr
|
15
|
+
# plugin :bridgetown_routes
|
16
|
+
|
17
|
+
route do |r|
|
18
|
+
# Load all files in server/routes and src/_routes if "bridgetown-routes" is loaded
|
19
|
+
# (see server/routes/hello.rb.sample)
|
20
|
+
Bridgetown::Rack::Routes.start! self
|
21
|
+
end
|
22
|
+
end
|
@@ -1,9 +1,10 @@
|
|
1
1
|
<meta charset="utf-8" />
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
3
3
|
{% capture page_title %}{{ title | strip_html | strip_newlines }}{% endcapture %}
|
4
|
-
<title>{% if page_title != "" %}{{ page_title | escape }} | {{ metadata.title | escape }}{% else %}{{ metadata.title | escape }}: {{ metadata.tagline | escape }}{% endif %}</title>
|
4
|
+
<title>{% if page_title != "Index" %}{{ page_title | escape }} | {{ metadata.title | escape }}{% else %}{{ metadata.title | escape }}: {{ metadata.tagline | escape }}{% endif %}</title>
|
5
5
|
|
6
6
|
<meta name="description" content="{{ metadata.description }}" />
|
7
7
|
|
8
8
|
<link rel="stylesheet" href="{% webpack_path css %}" />
|
9
9
|
<script src="{% webpack_path js %}" defer></script>
|
10
|
+
{% live_reload_dev_js %}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
---
|
2
2
|
layout: page
|
3
3
|
title: About
|
4
|
-
permalink: /about/
|
5
4
|
---
|
6
5
|
|
7
6
|
This is the basic Bridgetown site template. You can find out more info about customizing your Bridgetown site, as well as basic Bridgetown usage documentation at [bridgetownrb.com](https://bridgetownrb.com/)
|
@@ -1,13 +1,12 @@
|
|
1
1
|
---
|
2
2
|
layout: page
|
3
3
|
title: Posts
|
4
|
-
permalink: /posts/
|
5
4
|
---
|
6
5
|
|
7
6
|
<ul>
|
8
|
-
{% for post in
|
7
|
+
{% for post in collections.posts.resources %}
|
9
8
|
<li>
|
10
|
-
<a href="{{ post.
|
9
|
+
<a href="{{ post.relative_url }}">{{ post.title }}</a>
|
11
10
|
</li>
|
12
11
|
{% endfor %}
|
13
12
|
</ul>
|
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: 0.
|
4
|
+
version: 1.0.0.alpha2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bridgetown Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -220,6 +220,48 @@ dependencies:
|
|
220
220
|
- - "~>"
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '3.0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: rack-indifferent
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: 1.2.0
|
230
|
+
type: :runtime
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: 1.2.0
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: rake
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ">="
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '13.0'
|
244
|
+
type: :runtime
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '13.0'
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: roda
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - "~>"
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '3.46'
|
258
|
+
type: :runtime
|
259
|
+
prerelease: false
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - "~>"
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '3.46'
|
223
265
|
- !ruby/object:Gem::Dependency
|
224
266
|
name: rouge
|
225
267
|
requirement: !ruby/object:Gem::Requirement
|
@@ -298,6 +340,7 @@ executables:
|
|
298
340
|
extensions: []
|
299
341
|
extra_rdoc_files: []
|
300
342
|
files:
|
343
|
+
- ".rubocop.yml"
|
301
344
|
- ".yardopts"
|
302
345
|
- Rakefile
|
303
346
|
- bin/bridgetown
|
@@ -323,6 +366,7 @@ files:
|
|
323
366
|
- lib/bridgetown-core/commands/registrations.rb
|
324
367
|
- lib/bridgetown-core/commands/serve.rb
|
325
368
|
- lib/bridgetown-core/commands/serve/servlet.rb
|
369
|
+
- lib/bridgetown-core/commands/start.rb
|
326
370
|
- lib/bridgetown-core/commands/webpack.rb
|
327
371
|
- lib/bridgetown-core/commands/webpack/enable-postcss.rb
|
328
372
|
- lib/bridgetown-core/commands/webpack/setup.rb
|
@@ -330,7 +374,6 @@ files:
|
|
330
374
|
- lib/bridgetown-core/commands/webpack/webpack.config.js
|
331
375
|
- lib/bridgetown-core/commands/webpack/webpack.defaults.js.erb
|
332
376
|
- lib/bridgetown-core/component.rb
|
333
|
-
- lib/bridgetown-core/concerns/data_accessible.rb
|
334
377
|
- lib/bridgetown-core/concerns/front_matter_importer.rb
|
335
378
|
- lib/bridgetown-core/concerns/layout_placeable.rb
|
336
379
|
- lib/bridgetown-core/concerns/liquid_renderable.rb
|
@@ -341,8 +384,8 @@ files:
|
|
341
384
|
- lib/bridgetown-core/concerns/site/localizable.rb
|
342
385
|
- lib/bridgetown-core/concerns/site/processable.rb
|
343
386
|
- lib/bridgetown-core/concerns/site/renderable.rb
|
387
|
+
- lib/bridgetown-core/concerns/site/ssr.rb
|
344
388
|
- lib/bridgetown-core/concerns/site/writable.rb
|
345
|
-
- lib/bridgetown-core/concerns/validatable.rb
|
346
389
|
- lib/bridgetown-core/configuration.rb
|
347
390
|
- lib/bridgetown-core/configurations/.keep
|
348
391
|
- lib/bridgetown-core/configurations/bt-postcss.rb
|
@@ -369,13 +412,10 @@ files:
|
|
369
412
|
- lib/bridgetown-core/core_ext/psych.rb
|
370
413
|
- lib/bridgetown-core/current.rb
|
371
414
|
- lib/bridgetown-core/deprecator.rb
|
372
|
-
- lib/bridgetown-core/document.rb
|
373
415
|
- lib/bridgetown-core/drops/bridgetown_drop.rb
|
374
416
|
- lib/bridgetown-core/drops/collection_drop.rb
|
375
|
-
- lib/bridgetown-core/drops/document_drop.rb
|
376
417
|
- lib/bridgetown-core/drops/drop.rb
|
377
|
-
- lib/bridgetown-core/drops/
|
378
|
-
- lib/bridgetown-core/drops/page_drop.rb
|
418
|
+
- lib/bridgetown-core/drops/generated_page_drop.rb
|
379
419
|
- lib/bridgetown-core/drops/relations_drop.rb
|
380
420
|
- lib/bridgetown-core/drops/resource_drop.rb
|
381
421
|
- lib/bridgetown-core/drops/site_drop.rb
|
@@ -384,7 +424,6 @@ files:
|
|
384
424
|
- lib/bridgetown-core/drops/url_drop.rb
|
385
425
|
- lib/bridgetown-core/entry_filter.rb
|
386
426
|
- lib/bridgetown-core/errors.rb
|
387
|
-
- lib/bridgetown-core/excerpt.rb
|
388
427
|
- lib/bridgetown-core/filters.rb
|
389
428
|
- lib/bridgetown-core/filters/condition_helpers.rb
|
390
429
|
- lib/bridgetown-core/filters/date_filters.rb
|
@@ -392,6 +431,7 @@ files:
|
|
392
431
|
- lib/bridgetown-core/filters/grouping_filters.rb
|
393
432
|
- lib/bridgetown-core/filters/url_filters.rb
|
394
433
|
- lib/bridgetown-core/frontmatter_defaults.rb
|
434
|
+
- lib/bridgetown-core/generated_page.rb
|
395
435
|
- lib/bridgetown-core/generator.rb
|
396
436
|
- lib/bridgetown-core/generators/prototype_generator.rb
|
397
437
|
- lib/bridgetown-core/helpers.rb
|
@@ -408,20 +448,20 @@ files:
|
|
408
448
|
- lib/bridgetown-core/model/base.rb
|
409
449
|
- lib/bridgetown-core/model/builder_origin.rb
|
410
450
|
- lib/bridgetown-core/model/origin.rb
|
451
|
+
- lib/bridgetown-core/model/plugin_origin.rb
|
411
452
|
- lib/bridgetown-core/model/repo_origin.rb
|
412
|
-
- lib/bridgetown-core/page.rb
|
413
453
|
- lib/bridgetown-core/plugin.rb
|
414
454
|
- lib/bridgetown-core/plugin_manager.rb
|
415
455
|
- lib/bridgetown-core/publisher.rb
|
456
|
+
- lib/bridgetown-core/rack/boot.rb
|
457
|
+
- lib/bridgetown-core/rack/logger.rb
|
458
|
+
- lib/bridgetown-core/rack/roda.rb
|
459
|
+
- lib/bridgetown-core/rack/routes.rb
|
460
|
+
- lib/bridgetown-core/rack/static_indexes.rb
|
416
461
|
- lib/bridgetown-core/reader.rb
|
417
|
-
- lib/bridgetown-core/readers/data_reader.rb
|
418
462
|
- lib/bridgetown-core/readers/defaults_reader.rb
|
419
463
|
- lib/bridgetown-core/readers/layout_reader.rb
|
420
|
-
- lib/bridgetown-core/readers/page_reader.rb
|
421
464
|
- lib/bridgetown-core/readers/plugin_content_reader.rb
|
422
|
-
- lib/bridgetown-core/readers/post_reader.rb
|
423
|
-
- lib/bridgetown-core/regenerator.rb
|
424
|
-
- lib/bridgetown-core/related_posts.rb
|
425
465
|
- lib/bridgetown-core/renderer.rb
|
426
466
|
- lib/bridgetown-core/resource/base.rb
|
427
467
|
- lib/bridgetown-core/resource/destination.rb
|
@@ -438,14 +478,17 @@ files:
|
|
438
478
|
- lib/bridgetown-core/tags/highlight.rb
|
439
479
|
- lib/bridgetown-core/tags/include.rb
|
440
480
|
- lib/bridgetown-core/tags/link.rb
|
481
|
+
- lib/bridgetown-core/tags/live_reload_dev_js.rb
|
441
482
|
- lib/bridgetown-core/tags/post_url.rb
|
442
483
|
- lib/bridgetown-core/tags/render_content.rb
|
443
484
|
- lib/bridgetown-core/tags/t.rb
|
444
485
|
- lib/bridgetown-core/tags/webpack_path.rb
|
445
486
|
- lib/bridgetown-core/tags/with.rb
|
487
|
+
- lib/bridgetown-core/tasks/bridgetown_tasks.rake
|
446
488
|
- lib/bridgetown-core/url.rb
|
447
489
|
- lib/bridgetown-core/utils.rb
|
448
490
|
- lib/bridgetown-core/utils/ansi.rb
|
491
|
+
- lib/bridgetown-core/utils/aux.rb
|
449
492
|
- lib/bridgetown-core/utils/require_gems.rb
|
450
493
|
- lib/bridgetown-core/utils/ruby_exec.rb
|
451
494
|
- lib/bridgetown-core/utils/ruby_front_matter.rb
|
@@ -455,8 +498,10 @@ files:
|
|
455
498
|
- lib/site_template/.gitignore
|
456
499
|
- lib/site_template/Gemfile.erb
|
457
500
|
- lib/site_template/README.md
|
501
|
+
- lib/site_template/Rakefile
|
458
502
|
- lib/site_template/bridgetown.config.yml
|
459
|
-
- lib/site_template/config
|
503
|
+
- lib/site_template/config.ru
|
504
|
+
- lib/site_template/config/puma.rb
|
460
505
|
- lib/site_template/frontend/javascript/index.js.erb
|
461
506
|
- lib/site_template/frontend/styles/index.css
|
462
507
|
- lib/site_template/frontend/styles/index.scss
|
@@ -464,6 +509,8 @@ files:
|
|
464
509
|
- lib/site_template/plugins/builders/.keep
|
465
510
|
- lib/site_template/plugins/site_builder.rb
|
466
511
|
- lib/site_template/postcss.config.js.erb
|
512
|
+
- lib/site_template/server/roda_app.rb
|
513
|
+
- lib/site_template/server/routes/hello.rb.sample
|
467
514
|
- lib/site_template/src/404.html
|
468
515
|
- lib/site_template/src/_components/footer.liquid
|
469
516
|
- lib/site_template/src/_components/head.liquid
|
@@ -479,8 +526,6 @@ files:
|
|
479
526
|
- lib/site_template/src/images/.keep
|
480
527
|
- lib/site_template/src/index.md
|
481
528
|
- lib/site_template/src/posts.md
|
482
|
-
- lib/site_template/start.js
|
483
|
-
- lib/site_template/sync.js
|
484
529
|
homepage: https://www.bridgetownrb.com
|
485
530
|
licenses:
|
486
531
|
- MIT
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Bridgetown
|
4
|
-
# TODO: to be retired once the Resource engine is made official
|
5
|
-
module DataAccessible
|
6
|
-
# Returns the contents as a String.
|
7
|
-
def to_s
|
8
|
-
output || content || ""
|
9
|
-
end
|
10
|
-
|
11
|
-
# Accessor for data properties by Liquid.
|
12
|
-
#
|
13
|
-
# property - The String name of the property to retrieve.
|
14
|
-
#
|
15
|
-
# Returns the String value or nil if the property isn't included.
|
16
|
-
def [](property)
|
17
|
-
data[property]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Bridgetown
|
4
|
-
# TODO: to be retired once the Resource engine is made official
|
5
|
-
module Validatable
|
6
|
-
# Read the YAML frontmatter.
|
7
|
-
#
|
8
|
-
# base - The String path to the dir containing the file.
|
9
|
-
# name - The String filename of the file.
|
10
|
-
# opts - optional parameter to File.read, default at site configs
|
11
|
-
#
|
12
|
-
# Returns nothing.
|
13
|
-
# rubocop:disable Metrics/AbcSize
|
14
|
-
def read_yaml(base, name, opts = {})
|
15
|
-
filename = File.join(base, name)
|
16
|
-
|
17
|
-
begin
|
18
|
-
self.content = File.read(@path || site.in_source_dir(base, name),
|
19
|
-
**Utils.merged_file_read_opts(site, opts))
|
20
|
-
if content =~ Document::YAML_FRONT_MATTER_REGEXP
|
21
|
-
self.content = $POSTMATCH
|
22
|
-
self.data = YAMLParser.load(Regexp.last_match(1))&.with_dot_access
|
23
|
-
end
|
24
|
-
rescue Psych::SyntaxError => e
|
25
|
-
Bridgetown.logger.warn "YAML Exception reading #{filename}: #{e.message}"
|
26
|
-
raise e if site.config["strict_front_matter"]
|
27
|
-
rescue StandardError => e
|
28
|
-
Bridgetown.logger.warn "Error reading file #{filename}: #{e.message}"
|
29
|
-
raise e if site.config["strict_front_matter"]
|
30
|
-
end
|
31
|
-
|
32
|
-
self.data ||= HashWithDotAccess::Hash.new
|
33
|
-
|
34
|
-
validate_data! filename
|
35
|
-
validate_permalink! filename
|
36
|
-
|
37
|
-
self.data
|
38
|
-
end
|
39
|
-
# rubocop:enable Metrics/AbcSize
|
40
|
-
|
41
|
-
# FIXME: why doesn't Document validate data too?
|
42
|
-
def validate_data!(filename)
|
43
|
-
unless self.data.is_a?(Hash)
|
44
|
-
raise Errors::InvalidYAMLFrontMatterError,
|
45
|
-
"Invalid YAML front matter in #{filename}"
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# FIXME: Layouts don't have permalinks...d'oh
|
50
|
-
def validate_permalink!(filename)
|
51
|
-
if self.data["permalink"]&.to_s&.empty?
|
52
|
-
raise Errors::InvalidPermalinkError, "Invalid permalink in #{filename}"
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|