New Header Type
Create a config for the type of the header used in the site, if the header type is drawer then a sidebar is loaded else use a simple material nav
This commit is contained in:
parent
aa439b98d3
commit
c0ee41733f
7 changed files with 122 additions and 1 deletions
|
|
@ -10,5 +10,7 @@ url: "http://yourdomain.com" # the base hostname & protocol for your site
|
|||
twitter_username: jekyllrb
|
||||
github_username: jekyll
|
||||
|
||||
# Layout settings
|
||||
header_type: fixed
|
||||
# Build settings
|
||||
markdown: kramdown
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
</header>
|
||||
|
||||
<div class="mdl-layout__drawer">
|
||||
<span class="mdl-layout-title">{{ site.title }}</span>
|
||||
<span class="mdl-layout-title"><a href="#">{{ site.title }}</a></span>
|
||||
|
||||
<nav class="mdl-navigation">
|
||||
{% for page in site.pages %}
|
||||
|
|
|
|||
39
_includes/header_fixed.html
Normal file
39
_includes/header_fixed.html
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<header class="mdl-layout__header">
|
||||
<div class="mdl-layout__header-row">
|
||||
<div class="mdl-layout-spacer"></div>
|
||||
<div class="mdl-textfield mdl-js-textfield mdl-textfield--expandable
|
||||
mdl-textfield--floating-label mdl-textfield--align-right">
|
||||
<label class="mdl-button mdl-js-button mdl-button--icon"
|
||||
for="fixed-header-drawer-exp">
|
||||
<i class="material-icons">search</i>
|
||||
</label>
|
||||
<div class="mdl-textfield__expandable-holder">
|
||||
<input class="mdl-textfield__input" type="text" name="sample"
|
||||
id="fixed-header-drawer-exp" />
|
||||
</div>
|
||||
|
||||
<button id="demo-menu-lower-left" class="mdl-button mdl-js-button mdl-button--icon">
|
||||
<i class="material-icons">more_vert</i>
|
||||
</button>
|
||||
|
||||
<ul class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect"
|
||||
for="demo-menu-lower-left">
|
||||
<li class="mdl-menu__item">Some Action</li>
|
||||
<li class="mdl-menu__item">Another Action</li>
|
||||
<li disabled class="mdl-menu__item">Disabled Action</li>
|
||||
<li class="mdl-menu__item">Yet Another Action</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="mdl-layout__drawer">
|
||||
<span class="mdl-layout-title"><a href="{{ site.url }}">{{ site.title }}</a></span>
|
||||
<nav class="mdl-navigation">
|
||||
{% for page in site.pages %}
|
||||
{% if page.title %}
|
||||
<a class="mdl-navigation__link" href="{{ page.url | prepend: site.baseurl }}">{{ page.title }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</nav>
|
||||
</div>
|
||||
|
|
@ -5,8 +5,13 @@
|
|||
|
||||
<body>
|
||||
|
||||
{% if site.header_type == 'drawer' %}
|
||||
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header mdl-layout--fixed-drawer">
|
||||
{% include header_fixed.html %}
|
||||
{% else %}
|
||||
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
|
||||
{% include header.html %}
|
||||
{% endif %}
|
||||
|
||||
<main class="mdl-layout__content">
|
||||
<div class="page-content">
|
||||
|
|
|
|||
25
_posts/2015-07-11-using-jekyll-themes.markdown
Normal file
25
_posts/2015-07-11-using-jekyll-themes.markdown
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
layout: post
|
||||
title: "Welcome to Jekyll!"
|
||||
date: 2015-07-11 11:34:20
|
||||
categories: jekyll update
|
||||
---
|
||||
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
|
||||
|
||||
To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
|
||||
|
||||
Jekyll also offers powerful support for code snippets:
|
||||
|
||||
{% highlight ruby %}
|
||||
def print_hi(name)
|
||||
puts "Hi, #{name}"
|
||||
end
|
||||
print_hi('Tom')
|
||||
#=> prints 'Hi, Tom' to STDOUT.
|
||||
{% endhighlight %}
|
||||
|
||||
Check out the [Jekyll docs][jekyll] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll’s dedicated Help repository][jekyll-help].
|
||||
|
||||
[jekyll]: http://jekyllrb.com
|
||||
[jekyll-gh]: https://github.com/jekyll/jekyll
|
||||
[jekyll-help]: https://github.com/jekyll/jekyll-help
|
||||
25
_posts/2015-07-11-using-nicaragua-svg.markdown
Normal file
25
_posts/2015-07-11-using-nicaragua-svg.markdown
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
layout: post
|
||||
title: "Welcome to Jekyll!"
|
||||
date: 2015-07-11 11:34:20
|
||||
categories: jekyll update
|
||||
---
|
||||
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
|
||||
|
||||
To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
|
||||
|
||||
Jekyll also offers powerful support for code snippets:
|
||||
|
||||
{% highlight ruby %}
|
||||
def print_hi(name)
|
||||
puts "Hi, #{name}"
|
||||
end
|
||||
print_hi('Tom')
|
||||
#=> prints 'Hi, Tom' to STDOUT.
|
||||
{% endhighlight %}
|
||||
|
||||
Check out the [Jekyll docs][jekyll] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll’s dedicated Help repository][jekyll-help].
|
||||
|
||||
[jekyll]: http://jekyllrb.com
|
||||
[jekyll-gh]: https://github.com/jekyll/jekyll
|
||||
[jekyll-help]: https://github.com/jekyll/jekyll-help
|
||||
25
_posts/2015-07-11-welcome-to-mdl.markdown
Normal file
25
_posts/2015-07-11-welcome-to-mdl.markdown
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
layout: post
|
||||
title: "Welcome to Jekyll!"
|
||||
date: 2015-07-11 11:34:20
|
||||
categories: jekyll update
|
||||
---
|
||||
You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
|
||||
|
||||
To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.
|
||||
|
||||
Jekyll also offers powerful support for code snippets:
|
||||
|
||||
{% highlight ruby %}
|
||||
def print_hi(name)
|
||||
puts "Hi, #{name}"
|
||||
end
|
||||
print_hi('Tom')
|
||||
#=> prints 'Hi, Tom' to STDOUT.
|
||||
{% endhighlight %}
|
||||
|
||||
Check out the [Jekyll docs][jekyll] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll’s dedicated Help repository][jekyll-help].
|
||||
|
||||
[jekyll]: http://jekyllrb.com
|
||||
[jekyll-gh]: https://github.com/jekyll/jekyll
|
||||
[jekyll-help]: https://github.com/jekyll/jekyll-help
|
||||
Loading…
Add table
Add a link
Reference in a new issue