Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit85d8c7f

Browse files
author
root
committed
support an image logo instead of title in the navbar
1 parent67aeb12 commit85d8c7f

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

‎README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,18 @@ Change these values to match the pages on your site. Each menu item is composed
166166

167167
#### Displaying an image in the navigation bar
168168

169-
You can add an image to the navigation bar by defining the `avatar` parameter in `_config.yml`. The image should be a square (width = height).
169+
You can add an image to themiddle of thenavigation bar by defining the `avatar` parameter in `_config.yml`. The image should be a square (width = height). This image will disappear once the user scrolls down in the page.
170170

171171
```yaml
172172
avatar: "/path/to/image.png"
173173
```
174174

175+
You can also place an image in the top-left corner of the navigation bar instead of your website's title. This is done with the `title-img` parameter in `_config.yml`:
176+
177+
```yaml
178+
title-img: "/path/to/image.png"
179+
```
180+
175181
### Add your name/email/social media links to the footer
176182

177183
You can add contact information and social media links in the footer. They will be displayed as nice little logos, to give the footer a clean feel. Add the following to your `_config.yml` file:

‎_includes/nav.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
<spanclass="icon-bar"></span>
88
<spanclass="icon-bar"></span>
99
</button>
10-
<aclass="navbar-brand"href="{{ site.url }}">{{ site.title }}</a>
10+
{% if site.title-img %}
11+
<aclass="navbar-brand navbar-brand-logo"href="{{ site.url }}"><imgsrc="{{ site.title-img }}"/></a>
12+
{% else %}
13+
<aclass="navbar-brand"href="{{ site.url }}">{{ site.title }}</a>
14+
{% endif %}
1115
</div>
1216

1317
<divclass="collapse navbar-collapse"id="main-navbar">

‎assets/css/main.css

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,25 @@ img {
121121
color:#0085a1;
122122
}
123123

124+
.navbar-custom .navbar-brand-logo {
125+
padding-top:0;
126+
-webkit-transition: padding.5s ease-in-out;
127+
-moz-transition: padding.5s ease-in-out;
128+
transition: padding.5s ease-in-out;
129+
}
130+
.navbar-custom .navbar-brand-logoimg {
131+
height:50px;
132+
-webkit-transition: height.5s ease-in-out;
133+
-moz-transition: height.5s ease-in-out;
134+
transition: height.5s ease-in-out;
135+
}
136+
.navbar-custom.top-nav-short .navbar-brand-logo {
137+
padding-top:5px;
138+
}
139+
.navbar-custom.top-nav-short .navbar-brand-logoimg {
140+
height:40px;
141+
}
142+
124143
@mediaonly screenand (min-width:768px) {
125144
.navbar-custom {
126145
padding:20px0;
@@ -625,4 +644,4 @@ td.gutter {
625644

626645
#social-share-section {
627646
margin-bottom:30px;
628-
}
647+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp