octopress-image-caption-tag 0.0.5 → 0.0.6
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/README.md +52 -8
- data/lib/octopress-image-caption-tag.rb +3 -3
- data/lib/octopress-image-caption-tag/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 881fc86da2b6e9eea5d48c5df0cc6a449faa43ee
|
4
|
+
data.tar.gz: 2fcb19fc4fbb72de99af758e5f3d2f377176b153
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4879a1467bc1f3d68fab416dfd5f213f3e7388bdc87e110c15c7d617af55ab6ae1950107b31a51df9910b457ae52042ba1ba319e1af94aa556828d463b8dbb9f
|
7
|
+
data.tar.gz: 5f864d36fde29c79833eff40aa95d27b1dcb0639d6bee7766aea7f379f3dbd97ffa8d1f57b58a16e1f27cd8fddaf6470d70a94d1c61eb7d35719a95445347d97
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ and wraps it all up in a gem.
|
|
6
6
|
|
7
7
|
## Using the Tag version
|
8
8
|
```liquid
|
9
|
-
{% imgcap [right|left|center] url_or_path 200 200 ["Some Title Text" ["Some alt text"]] %}
|
9
|
+
{% imgcap [right|left|center] [custom classes] url_or_path 200 200 ["Some Title Text" ["Some alt text"]] %}
|
10
10
|
```
|
11
11
|
Width and height can be either absolute or as a percentage. By default, width is
|
12
12
|
set to 33% for right and left aligned and 100% for centered images, and height
|
@@ -17,7 +17,7 @@ for the caption.
|
|
17
17
|
|
18
18
|
## Using the Block version
|
19
19
|
```liquid
|
20
|
-
{% imgcaption [right|left|center] url_or_path 200 200 ["Some Title Text" ["Some alt text"]] %}
|
20
|
+
{% imgcaption [right|left|center] [custom classes] url_or_path 200 200 ["Some Title Text" ["Some alt text"]] %}
|
21
21
|
**Any** standard [Markdown][md] text can be used in captions using the block
|
22
22
|
version.
|
23
23
|
{% endimgcaption %}
|
@@ -27,9 +27,11 @@ the title text for the caption, a block is taken to allow Markdown formatting
|
|
27
27
|
in the caption text.
|
28
28
|
|
29
29
|
## Output
|
30
|
-
The output for either version is the same,
|
30
|
+
The output for either version is the same, except that CAPTION in the version
|
31
|
+
form as wrapped in a <p> and contains markup. If absolute sizes are used, the
|
32
|
+
`.image-caption-absolute` class is added to the enclosing figure.
|
31
33
|
```html
|
32
|
-
<figure class='caption-
|
34
|
+
<figure class='image-caption [image-caption-absolute] right|left|center [custom classes]'>
|
33
35
|
<a class='image-popup' href='IMGSRC'>
|
34
36
|
<img class='caption' src='IMGSRC' width='100%' title='TITLE' alt='ALT'>
|
35
37
|
</a>
|
@@ -38,10 +40,52 @@ The output for either version is the same, and of the form:
|
|
38
40
|
```
|
39
41
|
|
40
42
|
## Styling
|
41
|
-
This gem does not include stylesheets for the image captions.
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
This gem does not include stylesheets for the image captions. A basic sample
|
44
|
+
stylesheet is shown below that can be adapted to your site. As of version
|
45
|
+
0.0.6 inline widths were removed from the enclosing figure to allow for
|
46
|
+
better responsive design.
|
47
|
+
```scss
|
48
|
+
figure.image-caption {
|
49
|
+
// Sizing only done on larger tablets and larger
|
50
|
+
@media only screen and (min-width: 480px) {
|
51
|
+
&.right {
|
52
|
+
float: right;
|
53
|
+
width: 33%;
|
54
|
+
}
|
55
|
+
&.left {
|
56
|
+
float: left;
|
57
|
+
width: 33%;
|
58
|
+
}
|
59
|
+
&.center {
|
60
|
+
margin: 0 auto;
|
61
|
+
}
|
62
|
+
// Example of custom class
|
63
|
+
&.half {
|
64
|
+
width: 50%;
|
65
|
+
}
|
66
|
+
&.image-caption-absolute {
|
67
|
+
width:unset;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
// Center image within the figure
|
71
|
+
img {
|
72
|
+
display: block;
|
73
|
+
margin: 0 auto;
|
74
|
+
}
|
75
|
+
// Image should fill space given when not specifically sized
|
76
|
+
&:not(.image-caption-absolute) {
|
77
|
+
img {
|
78
|
+
width: 100%;
|
79
|
+
height: 100%;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
figcaption {
|
83
|
+
text-align: center;
|
84
|
+
font-style: italic;
|
85
|
+
font-size: 0.75em;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
```
|
45
89
|
|
46
90
|
[md]: https://daringfireball.net/projects/markdown/
|
47
91
|
[img]: https://github.com/octopress/image-tag
|
@@ -35,11 +35,11 @@ module Octopress
|
|
35
35
|
|
36
36
|
def absolute_sized_figure
|
37
37
|
<<-EOS.gsub(/^ {10}/, '') # gsubm is to pretty up source by indenting
|
38
|
-
<figure class='caption-
|
38
|
+
<figure class='image-caption image-caption-absolute #{@class.rstrip}'>
|
39
39
|
<a class='image-popup' href='#{@img}'>
|
40
40
|
<img class='caption' src='#{@img}' width='#{@width}' height='#{@height}' title='#{@title}' alt='#{@alt}'>
|
41
41
|
</a>
|
42
|
-
<figcaption class='caption-text'
|
42
|
+
<figcaption class='caption-text'>
|
43
43
|
#{@caption}
|
44
44
|
</figcaption>
|
45
45
|
</figure>
|
@@ -48,7 +48,7 @@ module Octopress
|
|
48
48
|
|
49
49
|
def relative_sized_figure
|
50
50
|
<<-EOS.gsub(/^ {10}/, '') # gsubm is to pretty up source by indenting
|
51
|
-
<figure class='caption
|
51
|
+
<figure class='image-caption #{@class.rstrip}'>
|
52
52
|
<a class='image-popup' href='#{@img}'>
|
53
53
|
<img class='caption' src='#{@img}' width='100%' height='100%' title='#{@title}' alt='#{@alt}'>
|
54
54
|
</a>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-image-caption-tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Beynon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|