dimples 10.1.1 → 10.1.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/dimples/sources/base.rb +6 -4
- data/lib/dimples/sources/page.rb +1 -1
- data/lib/dimples/sources/post.rb +5 -1
- data/lib/dimples/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 3b53c9172b38c343af3d3dbb59e6afad5ae83b69dc67fd8ac3ac54235f1b84dc
         | 
| 4 | 
            +
              data.tar.gz: 1fe366c13c8c0c78229c24c5fc8077a356688232b9c5753ca017c94ee0d04d63
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 035ac6bfdd3cb492b1959767405a7e0f17502226fa0df2795563b929a03a5c83221600ae33932aac7135553f9a730a5a44832652886a5b26a4ee50568556c748
         | 
| 7 | 
            +
              data.tar.gz: 41c5bfabcce91caf99ef62ed3c92b5dbf8f338538c424d8d5e1ef087ac31e8f574f41cf0931862d75e2cf32d24f66300315ca3d6db1a4d633af82df61d91ee7c
         | 
    
        data/lib/dimples/sources/base.rb
    CHANGED
    
    | @@ -31,11 +31,13 @@ module Dimples | |
| 31 31 | 
             
                  end
         | 
| 32 32 |  | 
| 33 33 | 
             
                  def write(output_path = nil, metadata = {})
         | 
| 34 | 
            -
                    output = render(metadata)
         | 
| 35 | 
            -
             | 
| 36 34 | 
             
                    output_path = File.join(output_directory, filename) if output_path.nil?
         | 
| 37 35 | 
             
                    output_dir = File.dirname(output_path)
         | 
| 38 36 |  | 
| 37 | 
            +
                    @metadata[:url] = url_for(output_dir)
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                    output = render(metadata)
         | 
| 40 | 
            +
             | 
| 39 41 | 
             
                    FileUtils.mkdir_p(output_dir) unless File.directory?(output_dir)
         | 
| 40 42 | 
             
                    File.write(output_path, output)
         | 
| 41 43 | 
             
                  end
         | 
| @@ -54,8 +56,8 @@ module Dimples | |
| 54 56 | 
             
                    @site.config[:output][:root]
         | 
| 55 57 | 
             
                  end
         | 
| 56 58 |  | 
| 57 | 
            -
                  def  | 
| 58 | 
            -
                     | 
| 59 | 
            +
                  def url_for(path)
         | 
| 60 | 
            +
                    path.gsub(@site.config[:output][:root], '').concat('/')
         | 
| 59 61 | 
             
                  end
         | 
| 60 62 |  | 
| 61 63 | 
             
                  def template
         | 
    
        data/lib/dimples/sources/page.rb
    CHANGED
    
    
    
        data/lib/dimples/sources/post.rb
    CHANGED
    
    | @@ -8,7 +8,11 @@ module Dimples | |
| 8 8 | 
             
                    @output_directory ||= File.dirname(@path).gsub(
         | 
| 9 9 | 
             
                      @site.config[:sources][:posts],
         | 
| 10 10 | 
             
                      @site.config[:output][:posts]
         | 
| 11 | 
            -
                    ).concat("/#{ | 
| 11 | 
            +
                    ).concat("/#{slug}/")
         | 
| 12 | 
            +
                  end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                  def slug
         | 
| 15 | 
            +
                    File.basename(@path)
         | 
| 12 16 | 
             
                  end
         | 
| 13 17 |  | 
| 14 18 | 
             
                  def template
         | 
    
        data/lib/dimples/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: dimples
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 10.1. | 
| 4 | 
            +
              version: 10.1.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Daniel Bogan
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2024-02- | 
| 11 | 
            +
            date: 2024-02-07 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: erb
         |