Skip to content

Commit

Permalink
Make new release (#10)
Browse files Browse the repository at this point in the history
* Fixes issue raise by gohugoio/hugoThemes#682 (comment)

* Use Hugo pipe for assets management
  • Loading branch information
yursan9 authored Aug 17, 2019
1 parent ef5eff8 commit 30ff78a
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 78 deletions.
50 changes: 16 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ mkdir name_of_web
cd name_of_web
git clone https://github.com/yursan9/manis-hugo-theme themes/manis
cp themes/manis/exampleSite/config.toml config.toml
hugo new blog/_index.md
hugo new work/_index.md
hugo new blog/hello.md
```

Edit the `config.toml` according to your preference. Then edit `content/blog/_index.md` and `content/work/_index.md` by following [this section](#making-own-navigation-bar). (Look at the `exampleSite/content` for example.)
Edit the `config.toml` according to your preference. Then edit `content/blog/hello.md` to
start writing your first post. (Look at the `exampleSite/content` for example.)

### Theme Only

Expand All @@ -62,13 +62,13 @@ For configuration example you can look at the `exampleSite/config.toml` (and cop

### Change Latest Section

By default this theme needs `blog` and `work` section to works. You can edit which sections show up as latest posts and latest works by editing `postSection` and `workSection`. `workSection` is optional.
You can edit which sections show up as latest posts and latest works by editing `mainSections` and `workSections`. `workSections` is optional.

```toml
# Configure which section for Latest Posts
postSection = "blog"
# Configure which section for Latest Works
workSection = "work"
# Configure which sections for Latest Posts
mainSections = ["blog", "post"]
# Configure which sections for Latest Works
workSections = ["work"]
```

### Disqus Configuration
Expand All @@ -83,38 +83,20 @@ disqusShortname = "your-disqus-shortname"

### Making Own Navigation Bar

Top navigation bar in Manis is made automatically by making new `section/_index.md`. Example if you want to add new `about` section, you can do the following command:
Top navigation bar in Manis is made by configuring the navigation bar in `config.toml` with the following code:

```
hugo new about/_index.md
```

Edit the file `content/about/_index.md` and make sure the front matter is formatted like this:

```toml
+++
title = "Get To Know Me"
menu = "main"
+++
```

`title` will be the string that is shown in navigation bar and the page's title (the title doesn't need to be the same as section's directory name). `menu = "main"` is the one who make Hugo know, it's need to add a new item in navigation bar.
[menu]
[[menu.main]]
name = "Blog"
url = "/post/"
**Alternative navigation bar:**
[[menu.main]]
name = "About"
url = "/about"
Or you can configure the navigation bar in `config.toml` with the following code:
```

[menu]
[[menu.main]]
name = "Blog"
url = "/post/"
[[menu.main]]
name = "About"
url = "/about"
```
### Other Language

Manis already translated to Bahasa Indonesia. But, if you want to translate this theme to your own language, look for the example in `i18n/en.yaml` and `i18n/in.yaml`.
Expand Down
File renamed without changes.
File renamed without changes.
20 changes: 19 additions & 1 deletion static/css/ui.css → assets/css/template.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- #Media Queries
*/


/* #Container
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.container {
Expand Down Expand Up @@ -131,7 +132,10 @@ p { margin-top: 0; }

/* #Links
–––––––––––––––––––––––––––––––––––––––––––––––––– */
a { text-decoration: none; }
a {
text-decoration: none;
color: {{ .Site.Params.ColorTheme }};
}
a:hover { text-decoration: underline; }


Expand Down Expand Up @@ -236,13 +240,15 @@ blockquote {
margin: 1.75em 0 1.75em 0;
padding: 0 1em 0 1em;
border-left:0.4em solid;
border-left-color: {{ .Site.Params.ColorTheme }};
}

@media (min-width: 55rem) {
blockquote {
margin: 1.75em -2em 1.75em -2em;
padding: 0 1.5em 0 1.5em;
border-right:0.4em solid;
border-right-color: {{ .Site.Params.ColorTheme }};
}
}

Expand All @@ -262,6 +268,10 @@ blockquote cite a {
/* #Navigation
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.bar a { color: #777; }
.bar a:hover {
color: {{ .Site.Params.ColorTheme }};
text-decoration: none;
}
.bar ul {
list-style: none;
margin: 0;
Expand Down Expand Up @@ -339,6 +349,14 @@ hr {
border-top: 1px solid #e1e1e1;
}

.sep {
margin-top: 2rem;
margin-bottom: 1rem;
margin-left:0;
width: 24rem;
border-top: 2px solid {{ .Site.Params.ColorTheme }};
}

img {
max-width: 100%
}
Expand Down
14 changes: 7 additions & 7 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pygmentsUseClasses = true

[menu]
[[menu.main]]
name = "Blog"
name = "Post"
url = "/post/"

[[menu.main]]
Expand All @@ -37,7 +37,7 @@ pygmentsUseClasses = true
# Custom CSS
customCSS = []

# List of sections support disqus comments
# List of sections that support disqus comments
disqusSections = [ "blog" ]
# Site meta description
description = "Sweet little Hugo's theme for personal website or blog."
Expand All @@ -48,17 +48,17 @@ pygmentsUseClasses = true
# URL to license file, can be outside of your domain
licenseURL = "/about/license"

# Configure which section for Latest Posts
postSection = "post"
# Configure which section for Latest Works
workSection = ""
# Configure which sections for Latest Posts
mainSections = ["blog", "post"]
# Configure which sections for Latest Works
workSections = ["work"]

# 404 Configuration
head404 = "Sorry, I can't find what you want."
sub404 = "Back to <a href='/'>Home</a>."

# Color of your website's accent
colorTheme = "#ff8181"
colorTheme = "#ff6565"
# Maximum number of item in Latest Posts or Works
latestCount = 3
# Path to site's favicon image
Expand Down
1 change: 0 additions & 1 deletion exampleSite/content/about/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
+++
title = "About"
date = "2017-06-24T18:57:12+07:00"
menu = "main"
+++
It's a minimalist and responsive theme for Hugo Static Site Generator. It's
name taken from Indonesian Language for *Sweet*.
1 change: 0 additions & 1 deletion exampleSite/content/blog/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
+++
title = "Blog"
date = "2017-07-02T08:14:51+07:00"
menu = "main"
+++
1 change: 0 additions & 1 deletion exampleSite/content/work/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
+++
title = "Work"
date = "2017-07-02T08:15:25+07:00"
menu = "main"
+++
10 changes: 5 additions & 5 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
{{ with .Content }}{{.}}{{ end }}
</header>
{{ $latestcount := .Site.Params.LatestCount | default 3 }}
{{ $postsection := .Site.Params.PostSection | default "post" }}
<section>
<h4>{{ T "latestPost" }}</h4>
<ul class="no-bullet">
{{- range (first $latestcount (where .Pages "Section" $postsection)) -}}
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{- range (first $latestcount $pages) -}}
{{ partial "li" . }}
{{- end -}}
</ul>
</section>

{{ $worksection := .Site.Params.WorkSection | default "work" }}
{{ with .Site.GetPage "section" $worksection }}
{{ $pages := where site.RegularPages "Type" "in" .Site.Params.WorkSections }}
{{ if ne (len $pages) 0 }}
<section>
<h4>{{ T "latestWork" }}</h4>
<ul class="no-bullet">
{{- range (first $latestcount (where .Pages "Section" $worksection)) -}}
{{- range (first $latestcount $pages) -}}
{{ partial "li" . }}
{{- end -}}
</ul>
Expand Down
14 changes: 3 additions & 11 deletions layouts/partials/meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@
{{ with .Site.Params.FaviconImg }}
<link rel="shortcut icon" href="{{.}}">
{{ end }}

{{ if .Site.Params.DebugCSS }}
<link rel="stylesheet" href="/css/normalize.css"/>
<link rel="stylesheet" href="/css/ui.css"/>
<link rel="stylesheet" href="/css/syntax.css"/>
{{ else }}
<link rel="stylesheet" href="/css/ui.min.css"/>
{{ end }}


{{ partial "style" . }}

{{ range .Site.Params.CustomCSS }}
<link rel="stylesheet" href="{{ . }}"/>
{{ end }}
Expand All @@ -30,6 +24,4 @@
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/languages/{{- . -}}.min.js"></script>
{{ end }}
{{ end }}

{{ partial "style" . }}
</head>
21 changes: 6 additions & 15 deletions layouts/partials/style.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
<style>
a { color: {{ .Site.Params.ColorTheme }}; }
blockquote {
border-left-color: {{ .Site.Params.ColorTheme }};
border-right-color: {{ .Site.Params.ColorTheme }}; }
.bar a:hover {
color: {{ .Site.Params.ColorTheme }};
text-decoration: none; }
.sep {
margin-top: 2rem;
margin-bottom: 1rem;
margin-left:0;
width: 24rem;
border-top: 2px solid {{ .Site.Params.ColorTheme }}; }
</style>
{{ $normalize := resources.Get "css/normalize.css" }}
{{ $syntax := resources.Get "css/syntax.css" }}
{{ $template := resources.Get "css/template.css" }}
{{ $ui := $template | resources.ExecuteAsTemplate "main.css" . }}
{{ $css := slice $normalize $ui $syntax | resources.Concat "css/ui.css" }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
1 change: 0 additions & 1 deletion static/css/ui.min.css

This file was deleted.

2 changes: 1 addition & 1 deletion theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Sweet little theme for personal website or blog"
homepage = "https://github.com/yursan9/manis-hugo-theme"
tags = ["blog", "personal", "minimal", "simple", "clean", "light"]
features = ["responsive", "simple", "higlight.js", "discus"]
min_version = "0.30"
min_version = "0.57"

[author]
name = "Yurizal Susanto"
Expand Down

0 comments on commit 30ff78a

Please sign in to comment.