Browse Source

add all necessary stuffs

master
sipp11 10 years ago
parent
commit
b09b2e23b8
  1. 1
      .gitignore
  2. 2
      _config.yml
  3. 25
      _includes/paginator.html
  4. 22
      _layouts/default.html
  5. 10
      _layouts/page.html
  6. 10
      _layouts/post.html
  7. 2
      _posts/2009-07-06-panoramic-photo.markdown
  8. 41
      archive.html
  9. 35
      css/main.scss
  10. 34
      index.html
  11. 3
      robots.txt
  12. 11
      sync_to_prod.sh
  13. 29
      tags.html

1
.gitignore vendored

@ -1,2 +1,3 @@
_site
.sass-cache
.DS_Store

2
_config.yml

@ -12,7 +12,7 @@ github_username:
markdown: kramdown
permalink: /:year/:month/:title/
paginate: 8
paginate: 5
paginate_path: "post/page/:num/"
sass:

25
_includes/paginator.html

@ -0,0 +1,25 @@
{% if paginator.total_pages > 1 %}
<div class="pagination">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">&laquo; Prev</a>
{% else %}
<span>&laquo; Prev</span>
{% endif %}
{{ site.baseurl }}
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<em>{{ page }}</em>
{% elsif page == 1 %}
<a href="{{ '/index.html' }}">{{ page }}</a>
{% else %}
<a href="/{{ site.paginate_path | replace: ':num', page }}"> {{ page }}</a>
{% endif %}
{% endfor %}
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next &raquo;</a>
{% else %}
<span>Next &raquo;</span>
{% endif %}
</div>
{% endif %}

22
_layouts/default.html

@ -13,22 +13,16 @@
</div>
</div>
<div id="disqus_thread"></div>
{% include footer.html %}
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'maamnote'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-3189083-7', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>

10
_layouts/page.html

@ -11,4 +11,14 @@ layout: default
{{ content }}
</article>
<div id="disqus_thread"></div>
<script>
var disqus_shortname = 'maamnote';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
</div>

10
_layouts/post.html

@ -12,4 +12,14 @@ layout: default
{{ content }}
</article>
<div id="disqus_thread"></div>
<script>
var disqus_shortname = 'maamnote';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
</div>

2
_posts/2009-07-06-panoramic-photo.markdown

@ -15,8 +15,6 @@ wordpress_id: 454
wordpress_url: http://maamnote.10ninox.com/2009/07/panoramic-photo/
date: '2009-07-06 09:42:55 +0700'
date_gmt: '2009-07-06 16:42:55 +0700'
tags:
- lesson
- windows live photo gallery

41
archive.html

@ -0,0 +1,41 @@
---
layout: default
title : Archive
---
<section id="archive">
{% assign posts_collate = site.posts %}
{% for post in posts_collate %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture this_month %}{{ post.date | date: "%B" }}{% endcapture %}
{% capture this_month_num %}{{ post.date | date: "%m" }}{% endcapture %}
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
{% capture next_month %}{{ post.previous.date | date: "%B" }}{% endcapture %}
{% if forloop.first %}
<h1 id="{{this_year}}">{{this_year}}</h1>
<h2 id ="{{this_year}}:{{this_month_num}}">{{this_month}}</h2>
<ul>
{% endif %}
<li id="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %e, %Y" }} &raquo; <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% if forloop.last %}
</ul>
{% else %}
{% if this_year != next_year %}
</ul>
<h1 id="{{ next_year }}">{{next_year}}</h1>
<h2 id="{{ next_year }}:{{ next_month }}">{{next_month}}</h2>
<ul>
{% else %}
{% if this_month != next_month %}
</ul>
<h2 id="{{ next_year }}:{{ next_month }}">{{next_month}}</h2>
<ul>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% assign posts_collate = nil %}
</section>

35
css/main.scss

@ -42,7 +42,42 @@ $on-laptop: 800px;
}
}
ul.post-list>li {
display: block;
padding-top: 1em;
padding-bottom: 1em;
border-bottom: 1px solid $grey-color-light;
}
ul.tag_box {
list-style: none;
}
ul.tag_box>li {
display: inline-block;
}
li.label-success {
background-color: $grey-color;
}
li.label-success a, li.label-success a:hover {
color: rgb(255, 255, 255);
text-decoration: none;
}
li.label {
display: inline;
padding: 0.2em 0.6em 0.3em;
font-size: 75%;
font-weight: 700;
line-height: 1;
color: rgb(255, 255, 255);
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: 0.25em;
}
// Import partials from `sass_dir` (defaults to `_sass`)
@import

34
index.html

@ -4,20 +4,30 @@ layout: default
<div class="home">
<h1 class="page-heading">Posts</h1>
{% include paginator.html %}
<ul class="post-list">
{% for post in site.posts %}
<li>
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>
{% for post in paginator.posts %}
<li>
<h2><a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h2>
<span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}<small> • {{ post.tags | array_to_sentence_string }} • <a href="{{ post.url | prepend: site.baseurl }}#disqus_thread">comments</a></small></span>
{{ post.content }}
</li>
{% endfor %}
<h2>
<a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
</h2>
</li>
{% endfor %}
</ul>
<p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | prepend: site.baseurl }}">via RSS</a></p>
{% include paginator.html %}
</div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'maamnote'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>

3
robots.txt

@ -0,0 +1,3 @@
# robotstxt.org/
User-agent: *

11
sync_to_prod.sh

@ -0,0 +1,11 @@
#!/bin/sh
RUSER=sipp11
RHOST=do3
PORT=22
RPATH=/opt/www/maamnote
LPATH=./_site/
rsync -avu -e "ssh -p $PORT" $LPATH $RUSER@$RHOST:$RPATH \
--exclude=.DS_Store --exclude=*.sh --exclude=*.pyc \
--exclude=migrations --exclude=scripts

29
tags.html

@ -0,0 +1,29 @@
---
layout: default
title: Tags
---
<!--TODO: Find a fix to tags with spaces-->
<ul class="tag_box inline">
{% if site.tags.first[0] != null %}{% comment %} If tags exist {% endcomment %}
{% for tag in site.tags %}{% comment %} add an element like the following for each tag item {% endcomment %}
<li class="label label-success"><a href="#{{ tag[0] }}">{{ tag[0] }}{% comment %} This is just the tag name {% endcomment %}
<span>{{ tag[1].size }}</span>{% comment %} This counts the number of posts in a given tag {% endcomment %}
</a></li>
{% endfor %}
{% endif %}
</ul>
{% for tag in site.tags %}
<h1 id="{{ tag[0] }}">{{ tag[0] }}</h1>
<ul>
{% for tag_post in tag[1] %}
{% if tag_post.title != null %}
{% if page.url == tag_post.url %}
<li class="active"><a href="#" class="active">{{tag_post.title}}</a></li>
{% else %}
<li>{{ tag_post.date | date: "%B %e, %Y" }} &raquo; <a href="{{tag_post.url}}">{{tag_post.title}}</a></li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
{% endfor %}
Loading…
Cancel
Save