Skip to content

Commit

Permalink
Init source repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
dim0627 committed Jan 9, 2015
1 parent e98723d commit fb6b66f
Show file tree
Hide file tree
Showing 7 changed files with 203 additions and 139 deletions.
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Aglaus
# Beg

Sorry, I do not have a good at English.
It is naive English, but please acknowledge.

Aglaus is a single-column theme for [Hugo](http://gohugo.io/).
Beg is a single-column theme for [Hugo](http://gohugo.io/).

![Aglaus Screenshot](https://raw.githubusercontent.com/dim0627/hugo_theme_aglaus/master/images/top.png)

Expand All @@ -14,11 +11,9 @@ Aglaus is a single-column theme for [Hugo](http://gohugo.io/).
## Features

* Google Analytics
* Gravatar Profile
* Disqus
* SNS Links(Facebook, Twitter, GitHub)
* Share Button
* Eye-catching Image
* Tagging
* Related Post

Expand All @@ -36,11 +31,11 @@ If you would like to install all of the available hugo themes, simply clone the

mkdir themes
cd themes
git clone https://github.com/dim0627/hugo_theme_aglaus aglaus
git clone https://github.com/dim0627/hugo_theme_beg beg

## Build with Aglaus
## Build with Beg

hugo server -t aglaus
hugo server -t beg

# Configuration

Expand Down
3 changes: 2 additions & 1 deletion layouts/post/li.html → layouts/_default/li.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ <h1 class="post-title">
{{ .Summary }}
</div>
<footer class="readon">
<a href="{{ .Permalink }}">
<a href="{{ .Permalink }}" class="btn btn-default">
READ ON
</a>
</footer>
</article>
<hr>
169 changes: 87 additions & 82 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
{{ partial "default_head.html" . }}

<article class="post">

<header>
<div class="post-date">
<span class="glyphicon glyphicon-calendar"></span>
<time datetime="{{ .Date.Format .Site.Params.DateForm }}">
{{ .Date.Format .Site.Params.DateForm }}
</time>
</div>
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title }}</a>
</h1>
</header>

<div class="post-content">
{{ .Content }}
</div>

{{ if .Site.Params.ShowRelatedPost }}
<aside>
<!-- Related post. -->
<h3>Related Post</h3>

{{ $baseurl := .Site.BaseUrl }}
<ul class="post-tags">
{{ range .Params.tags }}
<li>
<a href="{{ $baseurl }}/tags/{{ . | urlize }}">
<i class="fa fa-tags"></i>
{{ . }}
</a>
</li>
<div class="row">
<div class="col-md-8">
<article class="post">

<header>
<div class="post-date">
<span class="glyphicon glyphicon-calendar"></span>
<time datetime="{{ .Date.Format .Site.Params.DateForm }}">
{{ .Date.Format .Site.Params.DateForm }}
</time>
</div>
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title }}</a>
</h1>
</header>

<div class="post-content">
{{ .Content }}
</div>

<aside>
{{ $baseurl := .Site.BaseUrl }}
<ul class="list-inline post-tags">
{{ range .Params.tags }}
<li>
<a href="{{ $baseurl }}/tags/{{ . | urlize }}">
<i class="fa fa-tags"></i>
{{ . }}
</a>
</li>
{{ end }}
</ul>

{{ if .Site.Params.ShowRelatedPost }}
<!-- Related post. -->
<h3>Related Post</h3>
<ul class="post-rels">
{{ $page_link := .Permalink }}
{{ $tags := .Params.tags }}
{{ range .Site.Recent }}
{{ $page := . }}
{{ $has_common_tags := intersect $tags .Params.tags | len | lt 0 }}
{{ if and $has_common_tags (ne $page_link $page.Permalink) }}
<li><a href="{{ $page.Permalink }}">{{ $page.Title }}</a></li>
{{ end }}
{{ end }}
</ul>
</aside>
{{ end }}
</ul>

<ul class="post-rels">
{{ $page_link := .Permalink }}
{{ $tags := .Params.tags }}
{{ range .Site.Recent }}
{{ $page := . }}
{{ $has_common_tags := intersect $tags .Params.tags | len | lt 0 }}
{{ if and $has_common_tags (ne $page_link $page.Permalink) }}
<li><a href="{{ $page.Permalink }}">{{ $page.Title }}</a></li>
{{ end }}
{{ end }}
</ul>
</aside>
{{ end }}

<!-- Pagination. -->
<footer>

<nav>
<ul class="pager">

{{ if .Prev }}
<li class="previous"><a href="{{ .Prev.Permalink }}"><span aria-hidden="true">&larr;</span> Older</a></li>
{{ else }}
<li class="previous disabled"><a href="#"><span aria-hidden="true">&larr;</span> Older</a></li>
{{ end }}

<li><a href="{{ .Site.BaseUrl }}/post">All Posts</a></li>

{{ if .Next }}
<li class="next"><a href="{{ .Next.Permalink }}">Newer <span aria-hidden="true">&rarr;</span></a></li>
{{ else }}
<li class="next disabled"><a href="#">Newer <span aria-hidden="true">&rarr;</span></a></li>
{{ end }}

</ul>
</nav>

{{ if isset .Site.Params "Disqus" }}
{{ if .Params.comments }}
<!-- disqus. -->
<div id="disqus_thread"></div>
<script type="text/javascript">
<!-- Pagination. -->
<footer>

<nav>
<ul class="pager">

{{ if .Prev }}
<li class="previous"><a href="{{ .Prev.Permalink }}"><span aria-hidden="true">&larr;</span> Older</a></li>
{{ else }}
<li class="previous disabled"><a href="#"><span aria-hidden="true">&larr;</span> Older</a></li>
{{ end }}

<li><a href="{{ .Site.BaseUrl }}/post">All Posts</a></li>

{{ if .Next }}
<li class="next"><a href="{{ .Next.Permalink }}">Newer <span aria-hidden="true">&rarr;</span></a></li>
{{ else }}
<li class="next disabled"><a href="#">Newer <span aria-hidden="true">&rarr;</span></a></li>
{{ end }}

</ul>
</nav>

{{ if isset .Site.Params "Disqus" }}
{{ if .Params.comments }}
<!-- disqus. -->
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = '{{ .Site.Params.Disqus }}'; // required: replace example with your forum shortname

Expand All @@ -86,12 +86,17 @@ <h3>Related Post</h3>
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{{ end }}
{{ end }}
</footer>
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{{ end }}
{{ end }}
</footer>

</article>
</article>
</div>
<div class="col-md-4">
{{ partial "sidebar.html" . }}
</div>
</div>

{{ partial "default_foot.html" . }}
20 changes: 2 additions & 18 deletions layouts/partials/default_foot.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
</div>

<footer class="copy">
<hr>
<footer class="container copy">
<p>&copy; {{ .Site.LastChange.Year }} {{ if isset .Site.Params "Author" }} {{ .Site.Params.Author }} {{ else }} {{ .Site.Title }} {{ end }}</p>
<p>Powered by <a href="http://gohugo.io" target="_blank">Hugo</a></p>
<p>Theme <a href="https://github.com/dim0627/hugo_theme_hugostrap" target="_blank">Hugostrap</a> designed by <a href="http://yet.unresolved.xyz" target="_blank">Daisuke Tsuji</a>, Inspired from <a href="https://github.com/kAworu/octostrap3" target="_blank">Octostrap3</a></p>
Expand All @@ -22,23 +23,6 @@

</script>

<script>
$(function() {
var url = "https://ja.gravatar.com/{{ .Site.Params.GravatarHash }}.json?callback=?";
$.getJSON(url)
.done(function(data) {
var entry = data.entry[0];
$("#photo").attr("src", entry.photos[0].value);
$("#username").html(entry.name.familyName + " " + entry.name.givenName);
$("#description").html(entry.aboutMe);
entry.urls.forEach(function(el){
$("#urls").append($("<li><a href='" + el.value + "'>" + el.title + "</a></li>"));
});
$("#profile").show();
});
});
</script>

<script>
document.write('<script src="//sharebutton.net/plugin/sharebutton.php?type=horizontal&u=' + encodeURIComponent(document.location.href) + '"></scr' + 'ipt>');
</script>
71 changes: 48 additions & 23 deletions layouts/partials/default_head.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,53 @@

{{ partial "head.html" . }}

<div class="container">
<header>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
<header class="nav">
<nav class="navbar navbar-default">
<div class="container container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ .Site.BaseUrl }}">{{ .Site.Title }}</a>
</div>

<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#">All Posts</a></li>
{{ where .Data.Pages "Type" "page" }}
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="{{ .Site.BaseUrl }}/post">All Posts</a></li>
{{ range where .Site.Recent "Type" "page" }}
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>

<ul class="nav navbar-nav navbar-right">
{{ if isset .Site.Params "Facebook" }}
<li>
<a href="https://www.facebook.com/{{ .Site.Params.Facebook }}" target="_blank">
<i class="fa fa-facebook-square"></i>
Facebook</a>
</li>
{{ end }}
{{ if isset .Site.Params "Twitter" }}
<li>
<a href="https://twitter.com/{{ .Site.Params.Twitter }}" target="_blank">
<i class="fa fa-twitter-square"></i>
Twitter</a>
</li>
{{ end }}
{{ if isset .Site.Params "Github" }}
<li>
<a href="https://github.com/{{ .Site.Params.Github }}" target="_blank">
<i class="fa fa-github-square"></i>
GitHub
</a>
</li>
{{ end }}
</ul>
</div>
</nav>
</header>
</div>
</nav>
</header>
<div class="container">
36 changes: 31 additions & 5 deletions layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@

<aside>
<div class="panel panel-default">
<div class="panel-heading">
Panel heading without title
<div class="row">

<div class="col-xs-12 col-sm-4 col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">Recent Posts</h2>
</div>
<div class="list-group">
{{range first 10 .Site.Recent}}
<a href="{{.RelPermalink}}" class="list-group-item">{{ .Title }}</a>
{{ end }}
</div>
</div>
</div>
<div class="panel-body">
Panel content

<div class="col-xs-12 col-sm-4 col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">Tags</h2>
</div>
<div class="list-group">
{{ $baseurl := .Site.BaseUrl }}
{{ range $name, $value := .Site.Taxonomies.tags }}
<!--a href="{{ $baseurl }}/tags/{{ $name | urlize }}" style="font-size: {{ add 8 (mul 3 $value.Count) }}px;"-->
<a href="{{ $baseurl }}/tags/{{ $name | urlize }}" class="list-group-item">
<span class="badge">{{ .Count }}</span>
{{ $name }}
</a>
{{ end }}
</div>
</div>
</div>

</div>
</aside>
Loading

0 comments on commit fb6b66f

Please sign in to comment.