summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSkyArrow <tommy351@gmail.com>2012-01-24 18:15:25 +0100
committerSkyArrow <tommy351@gmail.com>2012-01-24 18:15:25 +0100
commit98d52c7c03e78c98cf2daa9729824e8752f8cb2a (patch)
tree61435b583fcbce884e128e20fd852b5f41154bca
parent4ab58d4e816bc5e998a936cc1ae5361f2dc46dfe (diff)
downloadoctopress-theme-jeyzu-98d52c7c03e78c98cf2daa9729824e8752f8cb2a.zip
octopress-theme-jeyzu-98d52c7c03e78c98cf2daa9729824e8752f8cb2a.tar.gz
picture caption
-rw-r--r--sass/parts/_article.scss7
-rw-r--r--source/_includes/custom/after_footer.html1
-rw-r--r--source/images/caption.pngbin0 -> 1266 bytes
-rw-r--r--source/javascripts/caption.js9
4 files changed, 17 insertions, 0 deletions
diff --git a/sass/parts/_article.scss b/sass/parts/_article.scss
index 6d880ce..09555f4 100644
--- a/sass/parts/_article.scss
+++ b/sass/parts/_article.scss
@@ -59,6 +59,13 @@ article{
img{
max-width: 100%;
height: auto;
+ & + .caption{
+ background: image-url('caption.png') 0 4px no-repeat;
+ display: block;
+ font-size: 12px;
+ color: #999;
+ padding-left: 25px;
+ }
}
blockquote{
background: $border;
diff --git a/source/_includes/custom/after_footer.html b/source/_includes/custom/after_footer.html
index 7796caf..059b593 100644
--- a/source/_includes/custom/after_footer.html
+++ b/source/_includes/custom/after_footer.html
@@ -1,3 +1,4 @@
<script src="{{ root_url }}/javascripts/jquery.easing.1.3.js"></script>
<script src="{{ root_url }}/javascripts/external.js"></script>
+<script src="{{ root_url }}/javascripts/caption.js"></script>
<script src="{{ root_url }}/javascripts/twitter.js"></script> \ No newline at end of file
diff --git a/source/images/caption.png b/source/images/caption.png
new file mode 100644
index 0000000..33e073a
--- /dev/null
+++ b/source/images/caption.png
Binary files differ
diff --git a/source/javascripts/caption.js b/source/javascripts/caption.js
new file mode 100644
index 0000000..271c428
--- /dev/null
+++ b/source/javascripts/caption.js
@@ -0,0 +1,9 @@
+(function($){
+ $('.entry img').each(function(){
+ var alt = $(this).attr('alt');
+
+ if (alt != ''){
+ $(this).after('<span class="caption">'+alt+'</span>');
+ }
+ });
+})(jQuery); \ No newline at end of file