zarchitect 1.0.1 → 1.0.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/zarchitect/post.rb +8 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9315ed3ab45cedda13e7521ce45c56a39d214187f8cd5813c913ef5bd948942
4
- data.tar.gz: e7328e7421f7443638e618be2968c9f1b7fb097cedf20c595540cc25866e3e01
3
+ metadata.gz: 30e062bb13035f3e8d254ca6b5870da49c05632db2216808053ad279fe502799
4
+ data.tar.gz: b1048c3eff90b5137c85a2fb369d5303613733b81a61dfae7dbe534a77613353
5
5
  SHA512:
6
- metadata.gz: dc10f2c7c575ea575e6c5ac0c91f621f17c14e797d34ff48d9732dc407bdd1b5640da5c7242cb3a60da86f9fbecbcb31a08da0009100365f4c9d78029e2bfbf4
7
- data.tar.gz: e6831aa4fd6cc2f60d1e51ee17bf3fead138b46358c3f4cb97696f648449c8b1318cd79dfdfb3cbb8e6b72329b4ae3375b9cdaacd8fae445f61266d647130753
6
+ metadata.gz: b88bdc7df4e7a605d57fa07c7074889706a47c76f541a38eade30e271417933a73e48998bc93524b11d4bc167c35b755d46a063325a0133a00acf0d7e1e1df34
7
+ data.tar.gz: 41342f6caf0325d422e6c698d2f576571b933c9bcd5e6d5711add11fe4c5422fb560f84b13e1c2e02a3b03c9d84e6f05e6218f6fdb612974d9756761143dcfaa
@@ -146,15 +146,21 @@ class Post < Zarchitect
146
146
 
147
147
  def set_description
148
148
  if @conf.has_option?('description')
149
- @description = @conf.description
149
+ @description = @conf.description << "..."
150
+ elsif @conf.has_option?('preview')
151
+ @description = @conf.preview << "..."
150
152
  else
151
153
  nodes = @content.nodes.select { |n| n.type == "p" }
152
154
  if nodes.count > 0
153
- @description = Sanitize.fragment(nodes[0])
155
+ @description = Sanitize.fragment(nodes[0].html)
156
+ if @description.length > 120
157
+ @description = @description[0..120]
158
+ end
154
159
  else
155
160
  @description = ""
156
161
  end
157
162
  end
163
+ @description << "..."
158
164
  end
159
165
 
160
166
  def setup_html
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zarchitect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ryu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-22 00:00:00.000000000 Z
11
+ date: 2021-12-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Yet another static website generator
14
14
  email: ryu@tohya.net