bulmatown 1.0.0 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb0ffe4a2acca8312f34dbbf78fa5c591fd4ff6144eac218c489eb1dd9746766
4
- data.tar.gz: 7a45a597d789e0b1b38a7b164bc37797cd655a5f4af6923e5cda676cad181412
3
+ metadata.gz: ff24e6b8dc01e065dffbb38f338fdd954c320c78f8375a111d9e0444e1954410
4
+ data.tar.gz: 618f4bfa44cc4fe46cbf29242afbfbcc78d8c0d26f2f9aef5054d89935e205c1
5
5
  SHA512:
6
- metadata.gz: 8c76f1c258c15b7a1a1ca6678f07e24cee1a044e5fb83aac0b911f7cf4737efeae31d5a0ce038347391910b98fd7384ff9a0c35651e8bdfc099a1b6f6bb8da3c
7
- data.tar.gz: 7e4a40ed0afa14d3337ce409c99eed50e4a49efeb6f2b15507979e97b134da6e18fa6811d172dab61a557a2014560fcc1f42a4852e48107d66d954bcfeb7b20a
6
+ metadata.gz: a5b5fb68cf6d4ace9dd357136817d9df798bc77b63e8db1c3bdb5f8d55c0c9fb7ca1d43143f9ef64a428409cf6b56570fe14968e1d012981139fa8d4ae5da5fc
7
+ data.tar.gz: 6eb5ab2b27eef236e83beebda9682045e8498dfe5a6ca19563b6d4572dc36fd3bdc92fbde85523edab403c4fb1ac0afc5578d2e43854b35fe893b3d34de7878d
data/README.md CHANGED
@@ -1,53 +1,117 @@
1
- # Sample plugin for Bridgetown
1
+ # Bulmatown
2
+ ## A Bulma CSS starter theme for Bridgetown.
2
3
 
3
- _NOTE: This isn't a real plugin! Copy this sample code and use it to create your own Ruby gem! [Help guide here…](https://www.bridgetownrb.com/docs/plugins)_ 😃
4
+ [Bulma](https://bulma.io) is a clean, modern CSS framework for rapid prototyping of content-focused websites. Use this theme to start using Bulma in your new [Bridgetown](https://www.bridgetownrb.com) site quickly, while preserving _all_ of the advanced customization possibilities as if you configured Bulma manually.
4
5
 
5
- A Bridgetown plugin to [fill in the blank]
6
+ **[LIVE DEMO](https://bulmatown.vercel.app)**
7
+
8
+ ![Bulmatown Example](https://res.cloudinary.com/mariposta/image/upload/c_thumb,w_900/v1593195961/bulmatown/bulmatown-example.jpg)
6
9
 
7
10
  ## Installation
8
11
 
9
- Run this command to add this plugin to your site's Gemfile:
12
+ Bulmatown requires Bridgetown v0.15 or later
13
+
14
+ To install Bulmatown while creating a new Bridgetown site:
15
+
16
+ ```sh
17
+ bridgetown new mysite -a https://github.com/whitefusionhq/bulmatown
18
+ ```
19
+
20
+ Or to add it to your existing Bridgetown site:
10
21
 
11
- ```shell
12
- $ bundle add my-awesome-plugin -g bridgetown_plugins
22
+ ```sh
23
+ bundle exec bridgetown apply https://github.com/whitefusionhq/bulmatown
13
24
  ```
14
25
 
26
+ A few other (optional) plugins you might be interested in installing:
27
+
28
+ * [SEO Tag](https://github.com/bridgetownrb/bridgetown-seo-tag)
29
+ * [Atom Feed](https://github.com/bridgetownrb/bridgetown-feed)
30
+ * Check out [Bridgetown community automations](https://github.com/bridgetownrb/automations) for some extra goodies like PurgeCSS, Swup page transitions, a test suite, and more!
31
+
15
32
  ## Usage
16
33
 
17
- The plugin will
34
+ The installation process will prompt you to configure your site to use Bulmatown automatically. However, if you decline those changes, you can inspect the [example site](https://github.com/whitefusionhq/bulmatown/tree/master/example) in this repository.
18
35
 
19
- ### Optional configuration options
36
+ Bulmatown comes with a few color variations out of the box. You can use the `theme_variation` Sass variable to switch the variation. For example:
20
37
 
21
- The plugin will automatically use any of the following metadata variables if they are present in your site's `_data/site_metadata.yml` file.
38
+ ```scss
39
+ // frontend/styles/index.scss
22
40
 
23
-
41
+ $theme_variation: rust;
24
42
 
25
- ## Testing
43
+ @import "~bulmatown/frontend/styles"
44
+ ```
26
45
 
27
- * Run `bundle exec rspec` to run the test suite
28
- * Or run `script/cibuild` to validate with Rubocop and test with rspec together.
46
+ The available options are:
29
47
 
30
- ## Contributing
48
+ * `default`
49
+ * `rust`
50
+ * `fuchsia`
51
+ * `fineart`
31
52
 
32
- 1. Fork it (https://github.com/username/my-awesome-plugin/fork)
33
- 2. Clone the fork using `git clone` to your local development machine.
34
- 3. Create your feature branch (`git checkout -b my-new-feature`)
35
- 4. Commit your changes (`git commit -am 'Add some feature'`)
36
- 5. Push to the branch (`git push origin my-new-feature`)
37
- 6. Create a new Pull Request
53
+ Speaking of Sass variables, you can put all your custom Bulma variables right before the `@import` statement and Bulma will pick up all the changes. You can even override any of the variables defined by Bulmatown out-of-the-box. [Read the Bulma documentation for more information.](https://bulma.io/documentation/)
38
54
 
39
- ----
55
+ ### Hero Banners and Images
40
56
 
41
- ## Releasing (you can delete this section in your own plugin repo)
57
+ Bulmatown will automatically look for `image` front matter variables in your pages and documents and display those in the hero banners and in the card component for post previews. Check out the [bridgetown-cloudinary](https://github.com/bridgetownrb/bridgetown-cloudinary) plugin for an easy way to add advanced image asset handling to your site.
42
58
 
43
- To release a new version of the plugin, simply bump up the version number in both `version.rb` and
44
- `package.json`, and then run `script/release`. This will require you to have a registered account
45
- with both the [RubyGems.org](https://rubygems.org) and [NPM](https://www.npmjs.com) registries.
46
- You can optionally remove the `package.json` and `frontend` folder if you don't need to package frontend
47
- assets for Webpack.
59
+ If you wish, you can alter which variable is loaded for the cards and social embeds vs. the hero banners using metadata:
60
+
61
+ ```yaml
62
+ # src/_data/site_metadata.yml
63
+ bulmatown_theme:
64
+ image_sizes:
65
+ embed: image
66
+ hero: image_hero
67
+ ```
48
68
 
49
- If you run into any problems or need further guidance, please check out our [Bridgetown community resources](https://www.bridgetownrb.com/docs/community)
50
- where friendly folks are standing by to help you build and release your plugin or theme.
69
+ In addition, for a fun way to add some sparkle to a hero banner with an image background, you can put `rainbow_hero: true` in your front matter to display a nice colorful gradient.
70
+
71
+ ## Authors
72
+
73
+ To show author information at the top of a blog post, add `authors.yml` to your data folder. For example:
74
+
75
+ ```yaml
76
+ # src/_data/authors.yml
77
+ jared:
78
+ name: Jared White
79
+ avatar: /images/jared-white-avatar.jpg
80
+ twitter: jaredcwhite
81
+ website: https://jaredwhite.com
82
+ ```
51
83
 
52
- **NOTE:** make sure you add the `bridgetown-plugin` [topic](https://github.com/topics/bridgetown-plugin) to your
53
- plugin's GitHub repo so the plugin or theme will show up on [Bridgetown's official Plugin Directory](https://www.bridgetownrb.com/plugins)! (There may be a day or so delay before you see it appear.)
84
+ Then simply add `author: jared` to your post's front matter.
85
+
86
+ This will link to an `/authors/<authorname>` URL. You can create a page at that URL manually, or you can auto-generate author archives using a Prototype Page. ([See this example file.](https://github.com/whitefusionhq/bulmatown/blob/master/example/src/authors/author.html))
87
+
88
+ ## Overriding Layout Templates and Components
89
+
90
+ If you ever find yourself needing to override one or more of the layout templates or Liquid components provided by Bulmatown, you can use the `bridgetown plugins cd` command to drill down into the gem and copy files out to your own site. For example:
91
+
92
+ ```sh
93
+ # copy the layouts folder:
94
+
95
+ bundle exec bridgetown plugins cd Bulmatown/layouts
96
+
97
+ cp -r bulmatown $BRIDGETOWN_SITE/src/_layouts
98
+ exit
99
+
100
+ # copy the components folder:
101
+
102
+ bundle exec bridgetown plugins cd Bulmatown/components
103
+
104
+ cp -r bulmatown $BRIDGETOWN_SITE/src/_components
105
+ exit
106
+ ```
107
+
108
+ Then you can go to the `bulmatown` folder in your layouts or components folders and make the changes from there. Or instead of wholesale copying over `bulmatown` entirely, you can pick and choose which files you want to copy.
109
+
110
+ ## Contributing
111
+
112
+ 1. Fork it (https://github.com/whitefusionhq/bulmatown/fork)
113
+ 2. Clone the fork using `git clone` to your local development machine.
114
+ 3. Create your feature branch (`git checkout -b my-new-feature`)
115
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
116
+ 5. Push to the branch (`git push origin my-new-feature`)
117
+ 6. Create a new Pull Request
@@ -1,11 +1,97 @@
1
+ # Thanks to https://github.com/ParamagicDev for a bunch of the smarts in this
2
+ # automation :)
3
+
1
4
  add_bridgetown_plugin "bulmatown"
2
5
  add_bridgetown_plugin "bridgetown-quick-search"
3
- add_yarn_for_gem "bulmatown"
6
+
7
+ # 0.15 bug! :( can't use this:
8
+ #add_yarn_for_gem "bulmatown"
9
+
10
+ gem_version = (`bundle info bulmatown`).match(/\*.*\((.*?)\)/)[1]
11
+ run "yarn add bulmatown@#{gem_version}"
4
12
 
5
13
  require 'fileutils'
14
+ require 'shellwords'
6
15
 
7
16
  unless Dir.exist? "frontend/fonts"
8
17
  FileUtils.mkdir_p "frontend/fonts"
9
18
  end
10
19
 
11
- run "cp node_modules/fork-awesome/fonts/* frontend/fonts"
20
+ run "cp node_modules/fork-awesome/fonts/* frontend/fonts"
21
+
22
+ javascript_import 'import Bulmatown from "bulmatown"'
23
+
24
+ # *** Set up remote repo pull
25
+
26
+ # Dynamically determined due to having to load from the tempdir
27
+ @current_dir = File.expand_path(__dir__)
28
+
29
+ # If its a remote file, the branch is appended to the end, so go up a level
30
+ ROOT_PATH = if __FILE__ =~ %r{\Ahttps?://}
31
+ File.expand_path('../', __dir__)
32
+ else
33
+ File.expand_path(__dir__)
34
+ end
35
+
36
+ DIR_NAME = File.basename(ROOT_PATH)
37
+
38
+ # DIR_NAME = 'bulmtatown'
39
+ GITHUB_PATH = "https://github.com/whitefusionhq/#{DIR_NAME}.git"
40
+
41
+ # Copied from: https://github.com/mattbrictson/rails-template
42
+ # Add this template directory to source_paths so that Thor actions like
43
+ # copy_file and template resolve against our source files. If this file was
44
+ # invoked remotely via HTTP, that means the files are not present locally.
45
+ # In that case, use `git clone` to download them to a local temporary dir.
46
+ def add_template_repository_to_source_path
47
+ if __FILE__ =~ %r{\Ahttps?://}
48
+ require 'tmpdir'
49
+
50
+ source_paths.unshift(tempdir = Dir.mktmpdir(DIR_NAME + '-'))
51
+ at_exit { FileUtils.remove_entry(tempdir) }
52
+ run("git clone --quiet #{GITHUB_PATH.shellescape} #{tempdir.shellescape}")
53
+
54
+ if (branch = __FILE__[%r{#{DIR_NAME}/(.+)/bridgetown.automation.rb}, 1])
55
+ Dir.chdir(tempdir) { system("git checkout #{branch}") }
56
+ @current_dir = File.expand_path(tempdir)
57
+ end
58
+ else
59
+ source_paths.unshift(DIR_NAME)
60
+ end
61
+ end
62
+
63
+ if yes? "The Bulmatown installer can update styles, layouts, and page templates to use the new theme. You'll have the option to type 'a' to overwrite all existing files or 'd' to inspect each change. Would you like to proceed? (Y/N)"
64
+ add_template_repository_to_source_path
65
+
66
+ create_file "frontend/styles/index.scss", '@import "~bulmatown/frontend/styles"'
67
+
68
+ copy_file "example/src/_layouts/home.html", "src/_layouts/home.html"
69
+ copy_file "example/src/_layouts/page.html", "src/_layouts/page.html"
70
+ copy_file "example/src/_layouts/post.html", "src/_layouts/post.html"
71
+
72
+
73
+ gsub_file "src/_layouts/default.html", '{% render "footer", ', '{% render "footer", url: site.url, '
74
+
75
+ copy_file "example/src/index.md", "src/index.md"
76
+ copy_file "example/src/posts.md", "src/posts.md"
77
+ copy_file "example/src/404.html", "src/404.html"
78
+
79
+ copy_file "example/src/_components/navbar.liquid", "src/_components/navbar.liquid"
80
+ copy_file "example/src/_components/footer.liquid", "src/_components/footer.liquid"
81
+
82
+ inject_into_file "bridgetown.config.yml", "pagination:\n enabled: true\n", after: "permalink: pretty\n"
83
+ end
84
+
85
+ twitter = ask "Do you have a Twitter handle? If so, enter it here, otherwise type 'no'"
86
+
87
+ if twitter != "" && twitter != "no"
88
+ append_to_file "src/_data/site_metadata.yml" do
89
+ <<~YAML
90
+
91
+ twitter: #{twitter}
92
+
93
+ YAML
94
+ end
95
+ end
96
+
97
+ say_status :bulmatown, "Theme installation complete! Enjoy your fresh new design :)"
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.version = Bulmatown::VERSION
8
8
  spec.author = "Jared White"
9
9
  spec.email = "jared@whitefusion.io"
10
- spec.summary = "A Bumlma CSS starter theme for Bridgetown"
10
+ spec.summary = "A Bulma CSS starter theme for Bridgetown"
11
11
  spec.homepage = "https://github.com/whitefusionhq/bulmatown"
12
12
  spec.license = "MIT"
13
13
 
@@ -6,6 +6,7 @@ $gradient-bottom-right: transparentize(lighten(saturate(adjust-hue($dark, 10deg)
6
6
  .hero {
7
7
  background-size: cover;
8
8
  background-position: center center;
9
+ overflow: hidden;
9
10
  --overlay-center: #{$center};
10
11
  --overlay-top-left: #{$gradient-top-left};
11
12
  --overlay-bottom-right: #{$gradient-bottom-right};
@@ -21,6 +22,15 @@ $gradient-bottom-right: transparentize(lighten(saturate(adjust-hue($dark, 10deg)
21
22
  background-image: linear-gradient(141deg, var(--overlay-top-left) 0%, var(--overlay-center) 65%, var(--overlay-bottom-right) 100%);
22
23
  }
23
24
 
25
+ .container.is-fluid {
26
+ @include mobile {
27
+ margin-left: 0;
28
+ margin-right: 0;
29
+ padding-left: 0;
30
+ padding-right: 0;
31
+ }
32
+ }
33
+
24
34
  .title {
25
35
  text-shadow: 0px 2px 3px transparentize($black, 0.5);
26
36
  }
@@ -18,6 +18,10 @@
18
18
  }
19
19
  }
20
20
 
21
+ .navbar-brand {
22
+ font-weight: bold;
23
+ }
24
+
21
25
  .search-item input {
22
26
  font-size: 1em;
23
27
  height: 1.5em;
@@ -19,4 +19,4 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
19
19
  gem "bridgetown"
20
20
  gem "bridgetown-quick-search", "~> 1.0", :group => :bridgetown_plugins
21
21
 
22
- gem "bulmatown", path: "../../bulmatown", group: :bridgetown_plugins
22
+ gem "bulmatown", group: :bridgetown_plugins
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "bridgetown-quick-search": "1.0.3",
16
- "bulmatown": "../../bulmatown"
16
+ "bulmatown": "1.0.4"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@babel/core": "^7.9.0",
@@ -1,9 +1,8 @@
1
1
  ---
2
2
  permalink: /404.html
3
- layout: default
3
+ layout: page
4
+ title: 404 Not Found
4
5
  ---
5
6
 
6
- <h1>404</h1>
7
-
8
7
  <p><strong>Page not found :(</strong></p>
9
8
  <p>The requested page could not be found.</p>
@@ -9,7 +9,7 @@
9
9
  <a class="navbar-item" href="/posts">Articles</a>
10
10
  <a class="navbar-item" href="/about">About</a>
11
11
  <div class="navbar-item has-dropdown is-hoverable">
12
- <a class="navbar-link" href="/topics">
12
+ <a class="navbar-link" href="#">
13
13
  Topics
14
14
  </a>
15
15
  <div class="navbar-dropdown is-boxed">
@@ -0,0 +1,23 @@
1
+ ---
2
+ layout: page
3
+ title: Articles by :prototype-data-label
4
+ prototype:
5
+ term: author
6
+ data: authors
7
+ data_label: name
8
+ ---
9
+
10
+ {% assign author = page.author_data %}
11
+ <p class="mb-6 has-text-centered">
12
+ Connect with
13
+ {{ author.name }}
14
+ on the
15
+ <a href="{{ author.website }}" class="has-text-weight-bold">Web</a>
16
+ or
17
+ <a class="has-text-weight-bold" href="https://twitter.com/{{ author.twitter }}">Twitter</a>
18
+ </p>
19
+
20
+ {% assign posts = paginator.documents %}
21
+ {% render "bulmatown/collection", collection: posts, metadata: site.metadata %}
22
+
23
+ {% render "bulmatown/pagination", paginator: paginator %}
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  layout: page
3
3
  title: Articles
4
+ exclude_from_search: true
4
5
  pagination:
5
6
  enabled: true
6
7
  ---
@@ -1533,8 +1533,10 @@ bulma@^0.9:
1533
1533
  resolved "https://registry.yarnpkg.com/bulma/-/bulma-0.9.0.tgz#948c5445a49e9d7546f0826cb3820d17178a814f"
1534
1534
  integrity sha512-rV75CJkubNUroAt0qCRkjznZLoaXq/ctfMXsMvKSL84UetbSyx5REl96e8GoQ04G4Tkw0XF3STECffTOQrbzOQ==
1535
1535
 
1536
- bulmatown@../bulmatown:
1537
- version "0.1.0"
1536
+ bulmatown@1.0.4:
1537
+ version "1.0.4"
1538
+ resolved "https://registry.yarnpkg.com/bulmatown/-/bulmatown-1.0.4.tgz#3bdec47c9807ac724819636f32d147499ce68061"
1539
+ integrity sha512-bs401CtVnsobhELXd/mmc9lBBDaOJVm6eFYTvRB3donO3L7V6aRnu9QLJVi2zDQNVTxCIPW5Jj0KnWDtgRxqwA==
1538
1540
  dependencies:
1539
1541
  bridgetown-quick-search "^1.0.3"
1540
1542
  bulma "^0.9"
@@ -1,11 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bridgetown"
4
- require "bulmatown/builder"
4
+ require "bulmatown/version"
5
5
 
6
6
  Bridgetown::PluginManager.new_source_manifest(
7
7
  origin: Bulmatown,
8
8
  components: File.expand_path("../components", __dir__),
9
- content: File.expand_path("../content", __dir__),
10
9
  layouts: File.expand_path("../layouts", __dir__)
11
10
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bulmatown
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.5"
5
5
  end
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "bulmatown",
3
- "version": "1.0.0",
3
+ "description": "A Bulma CSS starter theme for Bridgetown",
4
+ "version": "1.0.5",
4
5
  "main": "frontend/javascript/index.js",
5
6
  "repository": {
6
7
  "type": "git",
@@ -11,6 +12,7 @@
11
12
  "license": "MIT",
12
13
  "private": false,
13
14
  "files": [
15
+ "components",
14
16
  "frontend"
15
17
  ],
16
18
  "dependencies": {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bulmatown
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared White
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-26 00:00:00.000000000 Z
11
+ date: 2020-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown
@@ -139,8 +139,6 @@ files:
139
139
  - components/bulmatown/navbar.liquid
140
140
  - components/bulmatown/navbar.scss
141
141
  - components/bulmatown/pagination.liquid
142
- - content/bulmatown/example_page.md
143
- - content/bulmatown/train-on-rails.jpeg
144
142
  - example/.gitignore
145
143
  - example/Gemfile
146
144
  - example/bridgetown.config.yml
@@ -167,6 +165,7 @@ files:
167
165
  - example/src/_posts/2020-06-13-this-is-groovy.md
168
166
  - example/src/_posts/2020-06-13-welcome-to-bridgetown.md
169
167
  - example/src/about.md
168
+ - example/src/authors/author.html
170
169
  - example/src/favicon.ico
171
170
  - example/src/images/jared-white-avatar.jpg
172
171
  - example/src/index.md
@@ -179,7 +178,6 @@ files:
179
178
  - layouts/bulmatown/page.html
180
179
  - layouts/bulmatown/post.html
181
180
  - lib/bulmatown.rb
182
- - lib/bulmatown/builder.rb
183
181
  - lib/bulmatown/version.rb
184
182
  - package.json
185
183
  - yarn.lock
@@ -187,7 +185,7 @@ homepage: https://github.com/whitefusionhq/bulmatown
187
185
  licenses:
188
186
  - MIT
189
187
  metadata:
190
- yarn-add: bulmatown@1.0.0
188
+ yarn-add: bulmatown@1.0.5
191
189
  post_install_message:
192
190
  rdoc_options: []
193
191
  require_paths:
@@ -206,5 +204,5 @@ requirements: []
206
204
  rubygems_version: 3.0.6
207
205
  signing_key:
208
206
  specification_version: 4
209
- summary: A Bumlma CSS starter theme for Bridgetown
207
+ summary: A Bulma CSS starter theme for Bridgetown
210
208
  test_files: []
@@ -1,8 +0,0 @@
1
- ---
2
- layout: default
3
- title: Example Page
4
- ---
5
-
6
- If all goes well, this page will be accessible as [`{{ page.url }}`]({{ page.url }}), and you will see a photo of a train:
7
-
8
- ![Train on Rails]({{ "/bulmatown/train-on-rails.jpeg" | relative_url }})
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Bulmatown
4
- class Builder < Bridgetown::Builder
5
- def build
6
- liquid_tag "sample_plugin" do
7
- "This plugin works!"
8
- end
9
- end
10
- end
11
- end
12
-
13
- Bulmatown::Builder.register