blog_boi 0.0.5 → 0.0.6

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: d20c71bf44bd54182bb27c3c9e9503b93b377a2fdc3cceb94101fc313bd804e0
4
- data.tar.gz: 5b05475be7886c76258e8045a85233d0743a72e4a32996332c29c02ca1a8b0e4
3
+ metadata.gz: 9c5cc595c8dd15f8c7a97ab65949edfe3bf19b160361f7aaa9538e2e1e100fea
4
+ data.tar.gz: 925ed2e0e1e534a2fbbdb9d825fc3a8a180198286425771bd9c05341588272a0
5
5
  SHA512:
6
- metadata.gz: df36604827ecd2b399083362b629653a8f8667172e83abeeadfce5ebf1a4e9410480f15a1b562391acf7c3d3f4dbae84487805450e920cbe3757970c7d3abfe1
7
- data.tar.gz: e8d42f49c239635566d74fe7375b758992a33a8684e8f51651b2cd2762a0fc6b856d6daeb6e10f5907f67fcf127b9fb4668638aa6337e07f6b342c3b976a6efc
6
+ metadata.gz: 208f56f327f2f73ef8ac38796b82a6f2df03057f7c9fc04234c198d3f12f085ef73f31b52c9d8161c679c8b505aa0fabd1390f0065a3f9c355c95ee59e4fa505
7
+ data.tar.gz: 13ed0d6b30ee39cd2a34631bd5ac62c917b43206efba174d33d61f73e3d2919603321572fa5a43dc33ed136d128ee5c1b135b43a02bb4db49d47b7421cc4076a
data/README.md CHANGED
@@ -2,7 +2,9 @@ By [Charlie Reese](https://charliereese.ca/about) at [Clientelify](https://clien
2
2
 
3
3
  # BlogBoi
4
4
 
5
- BlogBoi is a rails gem / engine that provides out-of-the-box blogging functionality to your rails application
5
+ BlogBoi is a rails gem / engine that provides out-of-the-box blogging functionality to your rails application.
6
+
7
+ It requires active_storage for photo upload / storage.
6
8
 
7
9
  ## Installation
8
10
 
@@ -12,8 +14,6 @@ BlogBoi is a rails gem / engine that provides out-of-the-box blogging functional
12
14
  gem 'blog_boi', '~> 0'
13
15
  ```
14
16
 
15
- _Note: path may move to github and not be relative_
16
-
17
17
  2. Add these lines to your config/application.rb file:
18
18
 
19
19
  ```ruby
@@ -63,7 +63,7 @@ mount BlogBoi::Engine, at: "/blog"
63
63
  BlogBoi.author_class = "User" # name of active record model containing authors with property called name (for author's name)
64
64
  ```
65
65
 
66
- See lib/blog_boi.rb for all customization options.
66
+ See lib/blog_boi.rb for all customization options (like setting your Blog's meta description / image).
67
67
 
68
68
  7. Finally, your parent application must define the method `admin_signed_in?`. If you are using Devise, this method may already exist. It should return true if the blog admin is signed in, and false if not. When it returns true, you may create, update, and destroy blog articles. It should be available in controllers and views; it should be defined in ApplicationController, and should be marked a helper method. E.g.
69
69
 
@@ -21,7 +21,9 @@ module BlogBoi
21
21
  end
22
22
 
23
23
  def create_meta_tags_obj
24
- @meta_tags = {}
24
+ @meta_tags = {
25
+ image: helpers.image_url(BlogBoi.blog_meta_image)
26
+ }
25
27
  end
26
28
 
27
29
  end
@@ -15,7 +15,11 @@ module BlogBoi
15
15
 
16
16
  # GET /articles/1
17
17
  def show
18
- @meta_tags[:title] = @article[:title]
18
+ @meta_tags = {
19
+ title: @article.title,
20
+ description: @article.description,
21
+ image: @article.image.attached? ? main_app.url_for(@article.image) : nil,
22
+ }
19
23
  end
20
24
 
21
25
  # GET /articles/new
@@ -3,7 +3,7 @@
3
3
  <%= render partial: 'category', collection: article.categories %>
4
4
 
5
5
  <a class="d-block article mt-2"
6
- href="/blog/<%= article.slug %>">
6
+ href="<%= root_url + article.slug %>">
7
7
 
8
8
  <h2 class="text-blue mb-0">
9
9
  <%= article.title %>
@@ -24,6 +24,11 @@
24
24
  <%= form.text_field :title, placeholder: 'e.g. Great Title: 3 Reasons Why', class: 'form-control' %>
25
25
  </div>
26
26
 
27
+ <div class="field mt-3">
28
+ <%= form.label :description %>
29
+ <%= form.text_field :description, placeholder: 'e.g. The 3 reasons why you must use the BlogBoi engine', class: 'form-control' %>
30
+ </div>
31
+
27
32
  <div class="field mt-3">
28
33
  <%= form.label :slug %>
29
34
  <%= form.text_field :slug, placeholder: 'e.g. appointment-reminders-for-dentists', class: 'form-control' %>
@@ -11,7 +11,7 @@
11
11
  <%= render 'form', article: @article %>
12
12
 
13
13
  <div class="mt-3">
14
- <%= link_to 'Show', @article %> |
14
+ <%= link_to 'Show', root_url + @article.slug %> |
15
15
  <%= link_to 'Back', articles_path %>
16
16
  </div>
17
17
 
@@ -1,7 +1,12 @@
1
- <title><%= @meta_tags[:title] || company_name + ' Blog' %></title>
1
+ <title>
2
+ <%= @meta_tags[:title] || company_name + ' Blog' %>
3
+ </title>
2
4
  <meta property="og:title" content="<%= @meta_tags[:title] || blog_seo_title %>" />
3
5
 
6
+ <meta name="description" content="<%= @meta_tags[:description] || blog_seo_description %>" />
7
+ <meta property="og:description" content="<%= @meta_tags[:description] || blog_seo_description %>" />
8
+
4
9
  <meta property="og:site_name" content="<%= company_name %>" />
10
+ <meta property="og:type" content="article">
5
11
 
6
- <meta name="description" content="<%= @meta_tags[:description] || blog_seo_description %>" />
7
- <meta property="og:description" content="<%= @meta_tags[:description] || blog_seo_description %>" />
12
+ <meta property="og:image" content="<%= @meta_tags[:image] %>"/>
@@ -16,7 +16,7 @@
16
16
 
17
17
  <div class="col-12 col-md-6 col-lg-5 text-primary-light font-weight-light mt-3 mt-md-0">
18
18
  <em>
19
- Brought to you by <a href="/" class="text-orange"><%= company_name %></a>, a <%= company_description %>
19
+ Brought to you by <a href="/" class="text-orange"><%= company_name %></a>, <%= company_description %>
20
20
  </em>
21
21
  </div>
22
22
 
@@ -3,7 +3,7 @@ require "blog_boi/error_classes"
3
3
 
4
4
  module BlogBoi
5
5
  mattr_accessor :author_class, :company_name, :company_logo_path, :company_description, :blog_description,
6
- :blog_seo_description, :blog_seo_title
6
+ :blog_seo_description, :blog_seo_title, :blog_meta_image
7
7
 
8
8
  class << self
9
9
  def author_class
@@ -20,11 +20,12 @@ module BlogBoi
20
20
 
21
21
  # Company info
22
22
  self.company_name = 'SaaSy'
23
- self.company_description = 'business that does xyz'
23
+ self.company_description = 'A business that does xyz'
24
24
  self.company_logo_path = 'blog_boi/logo'
25
25
 
26
26
  # Blog info
27
27
  self.blog_description = 'We help your business reduce no-shows, get more reviews, and increase sales and productivity: detailed tutorials and insight from business owners and experts'
28
28
  self.blog_seo_description = blog_description
29
29
  self.blog_seo_title = blog_seo_title
30
+ self.blog_meta_image = 'blog_boi/logo'
30
31
  end
@@ -1,3 +1,3 @@
1
1
  module BlogBoi
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blog_boi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charlie Reese
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-07 00:00:00.000000000 Z
11
+ date: 2019-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown