jekyll-og-image 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.
- checksums.yaml +4 -4
 - data/lib/jekyll_og_image/generator.rb +3 -4
 - data/lib/jekyll_og_image/version.rb +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 4abcfee52f43ab5b0a56cbfb1386797c89f183ce031f610ae80c15d9fdb4152a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 862a6a8209e19993e5f13c9da57a7d2896a695823b8007628a28741f212796cb
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 9867e3036591d613972c9fd86aa078aa29b79f938c63d089b017c44cce8e8c0d881852e6456bc93c19e770170eec6b535ac807f5957e55bf57c0512dbebb7554
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 691710ca4af48c7a032f37adc1a743fff47d943c1131ffd574832d7ffc48e1c46058bd2149cbadb16735a52cb3575f2d2b42af643fa60e7ab7f8cbc84f1c6546
         
     | 
| 
         @@ -5,15 +5,14 @@ class JekyllOgImage::Generator < Jekyll::Generator 
     | 
|
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
              def generate(site)
         
     | 
| 
       7 
7 
     | 
    
         
             
                base_path = File.join(
         
     | 
| 
       8 
     | 
    
         
            -
                  site.config["source"],
         
     | 
| 
       9 
8 
     | 
    
         
             
                  JekyllOgImage.config.output_dir,
         
     | 
| 
       10 
9 
     | 
    
         
             
                  "posts"
         
     | 
| 
       11 
10 
     | 
    
         
             
                )
         
     | 
| 
       12 
11 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
                FileUtils.mkdir_p base_path
         
     | 
| 
      
 12 
     | 
    
         
            +
                FileUtils.mkdir_p File.join(site.config["source"], base_path)
         
     | 
| 
       14 
13 
     | 
    
         | 
| 
       15 
14 
     | 
    
         
             
                site.posts.docs.each do |post|
         
     | 
| 
       16 
     | 
    
         
            -
                  path = File.join(base_path, "#{post.data['slug']}.png")
         
     | 
| 
      
 15 
     | 
    
         
            +
                  path = File.join(site.config["source"], base_path, "#{post.data['slug']}.png")
         
     | 
| 
       17 
16 
     | 
    
         | 
| 
       18 
17 
     | 
    
         
             
                  if !File.exist?(path) || JekyllOgImage.config.force?
         
     | 
| 
       19 
18 
     | 
    
         
             
                    generate_image_for_post(site, post, path)
         
     | 
| 
         @@ -22,7 +21,7 @@ class JekyllOgImage::Generator < Jekyll::Generator 
     | 
|
| 
       22 
21 
     | 
    
         
             
                  end
         
     | 
| 
       23 
22 
     | 
    
         | 
| 
       24 
23 
     | 
    
         
             
                  post.data["image"] ||= {
         
     | 
| 
       25 
     | 
    
         
            -
                    "path" =>  
     | 
| 
      
 24 
     | 
    
         
            +
                    "path" => File.join(base_path, "#{post.data['slug']}.png"),
         
     | 
| 
       26 
25 
     | 
    
         
             
                    "width" => 1200,
         
     | 
| 
       27 
26 
     | 
    
         
             
                    "height" => 600,
         
     | 
| 
       28 
27 
     | 
    
         
             
                    "alt" => post.data["title"]
         
     |