diff options
Diffstat (limited to 'syte/templates')
-rw-r--r-- | syte/templates/404.html | 10 | ||||
-rw-r--r-- | syte/templates/analytics.html | 17 | ||||
-rw-r--r-- | syte/templates/article.html | 19 | ||||
-rw-r--r-- | syte/templates/base.html | 96 | ||||
-rw-r--r-- | syte/templates/github.html | 5 | ||||
-rw-r--r-- | syte/templates/google_plusone.html | 3 | ||||
-rw-r--r-- | syte/templates/hacker_news.html | 7 | ||||
-rw-r--r-- | syte/templates/index.html | 2 | ||||
-rw-r--r-- | syte/templates/instagram_auth.html | 21 | ||||
-rw-r--r-- | syte/templates/page.html | 11 | ||||
-rw-r--r-- | syte/templates/tag.html | 4 | ||||
-rw-r--r-- | syte/templates/translations.html | 16 |
12 files changed, 129 insertions, 82 deletions
diff --git a/syte/templates/404.html b/syte/templates/404.html deleted file mode 100644 index d4071bc..0000000 --- a/syte/templates/404.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends 'base.html' %} -{% block pagetitle %}404 Not Found{% endblock %} -{% block main_section %} -<section class="main-section"> - <article> - <h2>The page you are looking for was not found.</h2> - <p>Please use the links on the left to navigate to your desired destination.</p> - </article> -</section> -{% endblock %} diff --git a/syte/templates/analytics.html b/syte/templates/analytics.html index ba174fc..8194366 100644 --- a/syte/templates/analytics.html +++ b/syte/templates/analytics.html @@ -1,11 +1,12 @@ {% if GOOGLE_ANALYTICS %} <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); + var _gaq = _gaq || []; + _gaq.push(['_setAccount', '{{GOOGLE_ANALYTICS}}']); + _gaq.push(['_trackPageview']); + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("{{GOOGLE_ANALYTICS}}"); - pageTracker._trackPageview(); - } catch(err) {}</script> -{% endif %}
\ No newline at end of file +{% endif %} diff --git a/syte/templates/article.html b/syte/templates/article.html index 756a738..93dded9 100644 --- a/syte/templates/article.html +++ b/syte/templates/article.html @@ -1,5 +1,14 @@ +{% import 'translations.html' as translations with context %} {% extends 'base.html' %} -{% block title %}{{article.title}} | Samrat Man Singh{% endblock %} + +{% block title %}{{article.title}}{% endblock %} + +{% block head %} + {% if GOOGLE_PLUSONE %} + <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> + {% endif %} +{% endblock %} + {% block main_section %} <section class="main-section blog-section" id="blog-posts"> <h3 class="date">{{article.locale_date}}</h3> @@ -8,15 +17,11 @@ <h2><a href="{{SITEURL}}/{{article.url}}">{{article.title}}</a></h2> {% include "twitter.html" %} - <a href="http://news.ycombinator.com/submit" class="hn-share-button">Vote on HN</a> - <!--<script type="text/javascript" src="http://hnapiwrapper.herokuapp.com/static/js/button.js"></script>--> - {% include "hacker_news.html" %} + {% include "google_plusone.html" %} + {{ translations.translate(article) }} </hgroup> {{article.content}} - <p> - If you liked this post, you should <a href="http://twitter.com/samratmansingh">follow me on Twitter.</a> - </p> <br/> <footer> {% if article.tags %} diff --git a/syte/templates/base.html b/syte/templates/base.html index a0d769a..fe42127 100644 --- a/syte/templates/base.html +++ b/syte/templates/base.html @@ -1,34 +1,48 @@ <!DOCTYPE html> <html lang="en"> -{% block head %} <head> <meta charset="utf-8" /> - <meta name="description" content="Personal website and blog of Samrat Man Singh. Follow him at @samratmansingh" /> - <meta name="keywords" content="Samrat Man Singh, python, flask, computers, technology, nepal" /> + <meta name="description" content="{{ SITE_DESCRIPTION }}" /> + <meta name="keywords" content="{{ SITE_KEYWORDS }}" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>{% block title %}{{SITENAME}}{% endblock %}</title> <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> - <link rel="stylesheet" href="{{SITEURL}}/{{ MEDIA_URL }}css/styles.min.css" type="text/css" media="screen, projection"> - +{% assets filters="cssmin", output="css/styles.min.css", "css/styles.css", "css/pygments.css" %} + <link rel="stylesheet" href="{{ ASSET_URL }}"> +{% endassets %} + + <link rel="shortcut icon" type="image/png" href="{{ GRAVATAR }}" /> + {% block head %}{% endblock %} </head> -{% endblock %} <body> <header class="main-header"> + {% include 'github.html' %} <hgroup> - <div class="picture"> - <a href="/" rel="home"></a> + <div> + <img src="{{ GRAVATAR }}" style="margin-left: 34px; margin-top: 30px;"> </div> - <h1>{{ SITENAME }}</h1> - <h2>18 year-old from Nepal interested in computers and technology.</h2> + <h1><a href="/" id="home-link">{{ SITENAME }}</a></h1> + <h2>{{ ABOUT }}</h2> </hgroup> <nav> <ul class="main-nav"> - <li><a href="/" id="home-link">Home</a></li> - <li><a href="http://twitter.com/#!/samratmansingh" id="twitter-link">Twitter</a></li> - <li><a href="http://github.com/samrat" id="github-link">Github</a></li> - <li><a href="http://feeds.feedburner.com/SamratManSingh" id="github-link">Feed</a></li> - <li><a href="mailto:samratmansingh@gmail.com?subject=Hello" id="contact-link">Contact</a></li> + {% if DISPLAY_HOME_ON_MENU %} + <li><a href="{{ SITEURL }}/">Home</a></li> + {% endif %} + + {% if DISPLAY_PAGES_ON_MENU %} + {% for current_page in PAGES %} + <li><a href="{{ SITEURL }}/{{ current_page.url }}">{{ current_page.title }}</a></li> + {% endfor %} + {% endif %} + + {% for title, url in SOCIAL %} + <li><a href="{{ url }}" id="{{ title }}-link">{{ title }}</a></li> + {% endfor %} + + <li><a href="{{ SITEURL }}/{{ FEED_RSS }}" id="feed-link">Feed</a></li> + <li><a href="mailto:{{ CONTACT }}?subject=Hello" id="contact-link">Contact</a></li> </ul> </nav> <a href="http://pelican.notmyidea.org" class="fork-me">Powered by Pelican.</a> @@ -41,19 +55,49 @@ <span class="nav-btn-bar"></span> <span class="nav-btn-bar"></span> </span> - <h3><a href="/">samrat.github.com</a></h3> + <h3> + <a href="{{ SITEURL }}/" id="mobile-title">{{ SITEURL }}</a> + </h3> </div> -<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> -<script type="text/javascript"> -/*<![CDATA[*/ -var twitter_integration_enabled = {% if TWITTER_INTEGRATION_ENABLED %}true{% else %}false{% endif %}, - github_integration_enabled = {% if GITHUB_INTEGRATION_ENABLED %}true{% else %}false{% endif %}, - dribbble_integration_enabled = {% if DRIBBBLE_INTEGRATION_ENABLED %}true{% else %}false{% endif %}, - instagram_integration_enabled = {% if INSTAGRAM_INTEGRATION_ENABLED %}true{% else %}false{% endif %}; -/*]]>*/ -</script> -<script src="{{ SITEURL }}/{{ MEDIA_URL }}js/min/scripts.min.js"></script> +{% assets filters="rjsmin", output="gen/packed.js", "js/libs/jquery-1.7.2.min.js", "js/libs/jquery.url.js", "js/libs/bootstrap-modal.js", "js/libs/handlebars.js", "js/libs/spin.min.js", "js/libs/moment.min.js", "js/common.js", "js/libs/github.js", "js/libs/google+.js", "js/libs/twitter.js", "js/libs/instagram.js" %} + <script src="{{ ASSET_URL }}"></script> +{% endassets %} + +<script> + // Function to get the Maximam value in Array + Array.max = function( array ) { + return Math.max.apply( Math, array ); + }; + + var heights = []; + heights.push($('.main-header').height()); + heights.push($('.main-section').height()); + heights.push($(window).height()); + + var max_height = Array.max(heights); + $('.main-header').height(max_height+80); + + $('#mobile-title').text(window.location.hostname); + +{% if GITHUB_INTEGRATION_ENABLED %} + var github_username = '{{ GITHUB_USERNAME }}'; +{% endif %} + +{% if GPLUS_INTEGRATION_ENABLED %} + var google_username = '{{ GPLUS_USERNAME }}'; + var google_accesskey = '{{ GPLUS_API_ACCESS }}'; +{% endif %} + +{% if TWITTER_INTEGRATION_ENABLED %} + var twitter_username = '{{ TWITTER_USERNAME }}'; +{% endif %} + +{% if INSTAGRAM_INTEGRATION_ENABLED %} + var instagram_username = '{{ INSTAGRAM_USERNAME }}'; + var instagram_accesskey = '{{ INSTAGRAM_API_ACCESS }}'; +{% endif %} +</script> {% include "analytics.html" %} </body> diff --git a/syte/templates/github.html b/syte/templates/github.html new file mode 100644 index 0000000..87a6b10 --- /dev/null +++ b/syte/templates/github.html @@ -0,0 +1,5 @@ +{% if GITHUB_URL %} +<a href="{{ GITHUB_URL }}"> +<img style="position: absolute; top: 0; left: 128px; border: 0; height: 119px;" src="http://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub" /> +</a> +{% endif %} diff --git a/syte/templates/google_plusone.html b/syte/templates/google_plusone.html new file mode 100644 index 0000000..f9e36ed --- /dev/null +++ b/syte/templates/google_plusone.html @@ -0,0 +1,3 @@ +{% if GOOGLE_PLUSONE %} +<g:plusone size="medium"></g:plusone> +{% endif %} diff --git a/syte/templates/hacker_news.html b/syte/templates/hacker_news.html deleted file mode 100644 index b0fef97..0000000 --- a/syte/templates/hacker_news.html +++ /dev/null @@ -1,7 +0,0 @@ -<script> - (function() { - var hn = document.createElement('script'); hn.type = 'text/javascript'; - hn.async = true; hn.src = 'http://hnbutton.appspot.com/static/hn.js'; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(hn, s); - })(); -</script> diff --git a/syte/templates/index.html b/syte/templates/index.html index 9f42064..365fa72 100644 --- a/syte/templates/index.html +++ b/syte/templates/index.html @@ -8,7 +8,7 @@ <h2><a href="{{article.url}}" title="Permalink to {{article.title}}">{{article.title}}</a></h2> </hgroup> - {{article.content}} + {{article.summary}} </article> {% endfor %} diff --git a/syte/templates/instagram_auth.html b/syte/templates/instagram_auth.html deleted file mode 100644 index d864641..0000000 --- a/syte/templates/instagram_auth.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends 'base.html' %} -{% block pagetitle %}Instagram Auth{% endblock %} -{% block main_section %} -<section class="main-section"> - <article> - {% if error %} - <h2>Unable to get Access Token</h2> - <p>{{ error }}</p> - {% else %} - <h2>Instagram Access Token</h2> - <p>Go to your syte_settings.py and enter the token under <code>INSTAGRAM_ACCESS_TOKEN</code> and the user id under <code>INSTAGRAM_USER_ID</code>.</p> - <dl> - <dt>User Name</dt><dd> {{ user_name }}</dd> - <dt>User ID</dt><dd>{{ user_id }}</dd> - <dt>Access Token</dt><dd>{{ token }}</dd> - </dl> - {% endif %} - </article> -</section> -{% endblock %} - diff --git a/syte/templates/page.html b/syte/templates/page.html new file mode 100644 index 0000000..d5ae0e0 --- /dev/null +++ b/syte/templates/page.html @@ -0,0 +1,11 @@ +{% import 'translations.html' as translations with context %} +{% extends "base.html" %} +{% block title %}{{ page.title }}{% endblock %} +{% block main_section %} +<section class="main-section"> + <h1 class="entry-title">{{ page.title }}</h1> + {{ translations.translate(page, 'pages') }} + <br /><br /> + {{ page.content }} +</section> +{% endblock %} diff --git a/syte/templates/tag.html b/syte/templates/tag.html index ae97414..6c9937f 100644 --- a/syte/templates/tag.html +++ b/syte/templates/tag.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% block title %}Posts tagged '{{tag}}' | Samrat Man Singh {% endblock %} +{% block title %}Posts tagged '{{tag}}' | {{ SITENAME }} {% endblock %} {% block main_section %} <section class="main-section blog-section" id="blog-posts"> {% for article in articles[:5] %} @@ -9,7 +9,7 @@ <h2><a href="{{article.url}}" title="Permalink to {{article.title}}">{{article.title}}</a></h2> </hgroup> - {{article.content}} + {{article.summary}} </article> {% endfor %} </section> diff --git a/syte/templates/translations.html b/syte/templates/translations.html new file mode 100644 index 0000000..2a83aa7 --- /dev/null +++ b/syte/templates/translations.html @@ -0,0 +1,16 @@ +<!-- Takes a content (page, article,...) and translate it if possible--> +{% macro translate(content, sub_destination=None) -%} + {% if content.translations %} + Also available in: + {% for translation in content.translations %} + {% if sub_destination %} + {% if sub_destination.endswith('/') %} + sub_destination = sub_destination[:-1] + {% endif %} + <a href="{{ SITEURL }}/{{ sub_destination }}/{{ translation.url }}">{{ translation.lang }}</a> + {% else %} + <a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a> + {% endif %} + {% endfor %} + {% endif %} +{%- endmacro %} |