Skip to content

Commit 997c707

Browse files
author
Vicky
committed
Update templates (fix #59, close #61, close #60)
+ Add functionality to limit projects shown on main page + Improve projects display columns + List pages show content from _index.md files + Add GetPage logic to index.html and nav menus
1 parent 4a1380f commit 997c707

18 files changed

+531
-411
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
env:
2-
- HUGO_VERSION="0.41"
2+
- HUGO_VERSION="0.42.1"
33

44
install:
5-
- wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz
5+
- wget -q https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz
66
- tar xf hugo_${HUGO_VERSION}_Linux-64bit.tar.gz
77
- mv hugo ~/bin/
88

CHANGELOG.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
## Version 3.4.0 - Jun 24 2018
2+
3+
Changes to Projects display options:
4+
5+
- Add functionality to limit number of projects shown on index page
6+
- Projects will automatically display in 2 or 3 columns for even or odd numbers respectively
7+
- Create new template for projects list page
8+
9+
Improve list templates:
10+
11+
- List pages will display content from `_index.md`
12+
13+
Housecleaning:
14+
15+
- Remove dead code
16+
- Use GetPage logic on index.html and in nav menus
17+
- Site still builds with no content
18+
19+
*Thank you to @Hanzei for your feature work and @Setherizor for the great suggestion.*
20+
121
## Version 3.3.2 - Jun 10 2018
222

323
Travis CI integration, why not.

README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# <a href="https://vickylai.com/introduction/" target="_blank" rel="noopener">Introduction theme for Hugo</a>
22
[![Build Status](https://travis-ci.com/vickylai/hugo-theme-introduction.svg?branch=master)](https://travis-ci.com/vickylai/hugo-theme-introduction)
33

4-
A minimal, single page, smooth scrolling theme for Hugo.
4+
A minimal, smooth-scrolling theme for Hugo. Can be configured as a single page site or full-featured site with many sections.
55

66
![Main page screenshot](https://github.com/vickylai/hugo-theme-introduction/blob/master/images/screenshot.png)
77

88
Features:
9-
- Single scrolling home page
9+
- Minimalist home page
1010
- About section with profile photo
1111
- Contact section with option to show your local timezone
1212
- Optional Projects and Blog sections
@@ -15,32 +15,32 @@ Features:
1515
- Smooth scroll-to-section navigation
1616
- Responsive and fast
1717

18-
## Quick start
18+
# Quick start
1919

20-
### Get the theme
20+
## Get the theme
2121

2222
From the root of your Hugo site:
2323
```sh
2424
$ cd themes
2525
$ git clone https://github.com/vickylai/hugo-theme-introduction.git introduction
2626
```
2727

28-
### Configure your site
28+
## Configure your site
2929

3030
From the exampleSite, copy `config.toml` to the root folder of your Hugo site and change the fields as you like.
3131

32-
Start with:
32+
Important bits:
3333

34-
1. Set your baseurl to your site's domain
35-
1. Set your blog's title and your first name
36-
1. Set your introduction header height (use "medium", "large", or "fullheight")
37-
1. Choose "light" or "dark" theme
38-
1. Set your avatar image
39-
1. Set your timezone, if you choose to show it
40-
1. Choose whether or not to show the Blog and Projects sections, and configure them to your liking
34+
1. Set `baseURL` to your site's domain and give your site a `title`
35+
1. Add your `firstName` and `tagLine`
36+
1. Set the desired `introHeight` for your main page (use "medium", "large", or "fullheight")
37+
1. Choose a "light" or "dark" `themeStyle`
38+
1. Set your `avatar` image
39+
1. Choose whether or not to `showBlog` on the main page
40+
1. Choose whether or not to `showProjects` on the main page
4141
1. Input your social site urls and font-awesome icon names - use as many as you like
4242

43-
### Create About and Contact pages
43+
## Create About and Contact pages
4444

4545
Run:
4646
```sh
@@ -94,13 +94,13 @@ If you don't specify a `title`, only the photo will show. You can still add cont
9494

9595
If you leave `external_link` empty, clicking on a project on your main page will pop up a window with the project's details. If you specify a url instead, clicking on the project on your main page will take you to that url.
9696

97-
## Contributing
97+
# Contributing
9898

9999
Pull requests for bug fixes and suggestions are welcome.
100100

101101
Contributors are listed in [CHANGELOG.md](https://github.com/vickylai/hugo-theme-introduction/blob/master/CHANGELOG.md). Thank you so much! 🖤
102102

103-
## License
103+
# License
104104
Copyright (C) 2018 Vicky Lai
105105

106106
This program is free software: you can redistribute it and/or modify

exampleSite/config.toml

+38-39
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,44 @@
1-
baseURL = "https://example.org/" # Your domain name. Must end with "/"
2-
languageCode = "en-us" # languageCode
3-
title = "Introduction" # Site title
4-
theme = "introduction"
5-
pygmentsStyle = "monokai" # https://help.farbox.com/pygments.html
6-
pygmentsCodefences = true
7-
enforce_ssl = false
8-
# disqusshortname = "" # Enable Disqus for comments https://gohugo.io/content-management/comments
9-
# googleAnalytics = "" # Enable Google Analytics https://gohugo.io/templates/internal/#google-analytics
1+
baseURL = "https://example.org/" # Your domain name. Must end with "/"
2+
languageCode = "en-us" # languageCode
3+
title = "Introduction" # Site title
4+
theme = "introduction"
5+
pygmentsStyle = "monokai" # https://help.farbox.com/pygments.html
6+
pygmentsCodefences = true
7+
enforce_ssl = false
8+
# disqusshortname = "" # Enable Disqus for comments https://gohugo.io/content-management/comments
9+
# googleAnalytics = "" # Enable Google Analytics https://gohugo.io/templates/internal/#google-analytics
1010

1111
[params]
12-
blogHead = "Blog" # Full name shows on blog post pages
13-
firstName = "Introduction" # First name shows in introduction on main page
14-
tagLine = "I'm a theme for Hugo." # Appears after the introduction
15-
introHeight = "large" # Input either 'medium' or 'large' or 'fullheight'
16-
themeStyle = "light" # Choose 'light' or 'dark'
17-
avatar = "img/profile.jpg" # Path to image in static folder eg. img/avatar.png, or comment out to remove
18-
email = "[email protected]" # Shows in contact section, or leave blank to omit
19-
localTime = true # Show your current local time in contact section
20-
timeZone = "America/Los_Angeles" # Your timezone as in the TZ* column of this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
21-
dateForm = "Jan 2, 2006"
22-
dateFormFull = "Mon Jan 2 2006 15:04:05 EST"
23-
cacheBuster = false # Add the current unix timestamp in query string for cache busting css assets (relevant in development mode)
24-
description = "Website Description" # Max 160 characters show in search results
25-
faviconFile = "img/fav.ico"
26-
footerText = "" # Text to override default footer text (markdown allowed)
27-
fadeIn = true # Turn on/off the fade-in effect
28-
customCSS = [] # Include custom css files e.g. ["css/foo.css", "css/bar.css"]
12+
firstName = "Introduction" # First name shows in introduction on main page
13+
tagLine = "I'm a theme for Hugo." # Appears after the introduction
14+
introHeight = "large" # Input either 'medium' or 'large' or 'fullheight'
15+
themeStyle = "light" # Choose 'light' or 'dark'
16+
avatar = "img/profile.jpg" # Path to image in static folder eg. img/avatar.png, or comment out to remove
17+
email = "[email protected]" # Shows in contact section, or leave blank to omit
18+
localTime = true # Show your current local time in contact section
19+
timeZone = "America/Los_Angeles" # Your timezone as in the TZ* column of this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
20+
dateForm = "Jan 2, 2006"
21+
dateFormFull = "Mon Jan 2 2006 15:04:05 EST"
22+
cacheBuster = false # Add the current unix timestamp in query string for cache busting css assets (relevant in development mode)
23+
description = "Website Description" # Max 160 characters show in search results
24+
faviconFile = "img/fav.ico"
25+
footerText = "" # Text to override default footer text (markdown allowed)
26+
fadeIn = true # Turn on/off the fade-in effect
27+
customCSS = [] # Include custom css files e.g. ["css/foo.css", "css/bar.css"]
2928

30-
showBlog = true # Show Blog section on home page
31-
showProjects = true # Show Projects section on home page
32-
projectColumns = "3" # Choose "2" or "3" columns for projects section
33-
placeHolderimg = "/img/workday.jpg" # For Projects without image
34-
showAllPosts = false # Set 'true' to list all posts on home page, or set 'false' to link to separate blog list page
35-
showLatest = true # Show latest blog post summary
36-
shareButtons = true # On post pages, show share this social buttons
37-
38-
# Share buttons
39-
shareTwitter = true
40-
shareFacebook = true
41-
sharePinterest = false
42-
shareGooglePlus = true
29+
showBlog = true # Show Blog section on home page
30+
showAllPosts = false # Set 'true' to list all posts on home page, or set 'false' to link to separate blog list page
31+
showLatest = true # Show latest blog post summary
32+
# Share buttons on blog post pages
33+
shareButtons = true # Show "Share this:" social buttons
34+
shareTwitter = true
35+
shareFacebook = true
36+
sharePinterest = false
37+
shareGooglePlus = true
38+
39+
showProjects = true # Show Projects section on home page
40+
numberOfProjectsToShow = 3 # Maximum number of projects to show on home page. Unset or comment out to show all projects.
41+
placeHolderimg = "/img/workday.jpg" # For Projects without image
4342

4443
# Social icons appear in introduction and contact section. Add as many more as you like.
4544
# Find icon names here: http://fontawesome.io/cheatsheet/

layouts/_default/list.html

+57-59
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,63 @@
11
{{ partial "header.html" . }}
2-
<body>
3-
4-
<div class="section" id="top">
5-
<!-- Parent section -->
6-
<div class="container hero {{ if .Site.Params.fadeIn }} fade-in one {{ end }}">
7-
<!-- Begin Title -->
8-
<h1 class="bold-title is-1">{{ .Title }}</h1>
9-
</div>
10-
<!-- End Title -->
11-
12-
<!-- Everything below fades in two! -->
13-
<div class="section no-padding {{ if .Site.Params.fadeIn }} fade-in two {{ end }}">
14-
15-
<div class="container">
16-
<!-- Begin Nav bar -->
17-
{{ partial "nav-list.html" . }}
18-
</div>
19-
<!-- End Nav bar -->
20-
<article>
21-
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
22-
{{ .Content }}
23-
</article>
242

3+
<body>
254

26-
<div class="container">
27-
<!-- Begin Blog container -->
28-
<ul>
29-
<!-- Ranges through content/post/*.md -->
30-
{{ range .Data.Pages.ByPublishDate }} {{ if not (eq .Section "blog") }}
31-
<li>
32-
<a href="{{.Permalink}}">{{.Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }} | {{.Title}}</a>
33-
</li>
34-
{{ end }} {{ end }}
35-
</ul>
5+
<div class="section" id="top">
6+
<!-- Parent section -->
7+
<div class="container hero {{ if .Site.Params.fadeIn }} fade-in one {{ end }}">
8+
<!-- Begin Title -->
9+
<h1 class="bold-title is-1">{{ .Title }}</h1>
3610
</div>
37-
<!-- End Blog container -->
38-
39-
<div class="container has-text-centered top-pad">
40-
<hr>
41-
<a href="#top">
42-
<i class="fa fa-arrow-up"></i>
43-
</a>
44-
<hr>
11+
<!-- End Title -->
12+
13+
<!-- Everything below fades in two! -->
14+
<div class="section no-padding {{ if .Site.Params.fadeIn }} fade-in two {{ end }}">
15+
16+
<div class="container">
17+
<!-- Begin Nav bar -->
18+
{{ partial "nav-list.html" . }}
19+
</div>
20+
<!-- End Nav bar -->
21+
22+
<div class="container markdown {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }} top-pad">
23+
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
24+
{{ .Content }}
25+
</div>
26+
<div class="container">
27+
<ul>
28+
<!-- Ranges through content/*/*.md -->
29+
{{ range .Data.Pages.ByPublishDate }} {{ if not (eq .Section "blog") }}
30+
<li>
31+
<a href="{{.Permalink}}">{{.Date.Format (.Site.Params.dateform | default "Jan 02, 2006") }} | {{.Title}}</a>
32+
</li>
33+
{{ end }} {{ end }}
34+
</ul>
35+
</div>
36+
37+
<div class="container has-text-centered top-pad">
38+
<hr>
39+
<a href="#top">
40+
<i class="fa fa-arrow-up"></i>
41+
</a>
42+
<hr>
43+
</div>
44+
45+
{{ partial "footer.html" . }}
4546
</div>
46-
47-
{{ partial "footer.html" . }}
47+
<!-- End fade in two -->
4848
</div>
49-
<!-- End fade in two -->
50-
</div>
51-
<!-- End parent section -->
52-
53-
<!-- Bitty scrolling links script -->
54-
<script>
55-
$('a[href^="{{ .Permalink }}#"]').click(function (e) {
56-
e.preventDefault();
57-
var target = this.hash;
58-
$('html, body').animate({
59-
scrollTop: $(target).offset().top
60-
}, 500);
61-
return false;
62-
})
63-
</script>
64-
65-
</body>
49+
<!-- End parent section -->
50+
51+
<!-- Bitty scrolling links script -->
52+
<script>
53+
$('a[href^="{{ .Permalink }}#"]').click(function (e) {
54+
e.preventDefault();
55+
var target = this.hash;
56+
$('html, body').animate({
57+
scrollTop: $(target).offset().top
58+
}, 500);
59+
return false;
60+
})
61+
</script>
62+
63+
</body>

0 commit comments

Comments
 (0)