Skip to content

Commit 1b445a0

Browse files
authored
Remove data/personalize.toml and shift all params to config.toml (#9)
* Remove data/personalize.toml and shift all params to config.toml. Change "About" section in index page to be fetched from content/_index.md. * Fix twitter profile param key in config.toml. * Fix twitter profile param key in README.md.
1 parent dc836bd commit 1b445a0

File tree

7 files changed

+56
-95
lines changed

7 files changed

+56
-95
lines changed

.personalize.toml

-30
This file was deleted.

README.md

+15-19
Original file line numberDiff line numberDiff line change
@@ -29,46 +29,42 @@ For more information read the [official setup guide](https://gohugo.io/overview/
2929

3030
To personalize the theme
3131

32-
`cp themes/lekh/.personalize.toml data/personalize.toml`
32+
`cp themes/lekh/exampleSite/config.toml config.toml`
3333

3434
And then customize accordingly.
3535

36-
Or simply copy the below into a new file called `data/personalize.toml` and customize accordingly.
36+
Or simply copy the below config and customize accordingly.
3737

3838
```toml
3939

40-
Name = ""
41-
42-
# Supports markdown
43-
About = ""
40+
baseURL = "http://rtiwari.me/"
41+
languageCode = "en-us"
42+
title = "Rahul Tiwari"
43+
theme = "lekh"
4444

45+
[params]
46+
Name = ""
4547
Email = ""
48+
Resume = "" # Add the filename with file extension.
49+
PostLimit = 4 # Sets the number of posts to display on the front page
50+
GoatCounterCode = ""
4651

47-
# Add the filename with file extension.
48-
Resume = ""
49-
50-
# Sets the number of posts to display on the front page
51-
PostLimit = 4
52-
53-
[[profiles]]
52+
[[params.profiles]]
5453
name = "GitHub"
5554
url = ""
5655

57-
[[profiles]]
56+
[[params.profiles]]
5857
name = "Twitter"
5958
url = ""
6059

61-
[[profiles]]
60+
[[params.profiles]]
6261
name = "Goodreads"
6362
url = ""
6463

65-
[[profiles]]
64+
[[params.profiles]]
6665
name = "LinkedIn"
6766
url = ""
6867

69-
# This is the endpoint under the integrations section of the Site Code
70-
GoatCounterCode = ""
71-
7268
```
7369

7470
## Posts

exampleSite/config.toml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
baseURL = "http://rtiwari.me/"
2+
languageCode = "en-us"
3+
title = "Rahul Tiwari"
4+
theme = "lekh"
5+
6+
[params]
7+
Name = ""
8+
Email = ""
9+
Resume = "" # Add the filename with file extension.
10+
PostLimit = 4 # Sets the number of posts to display on the front page
11+
GoatCounterCode = ""
12+
13+
[[params.profiles]]
14+
name = "GitHub"
15+
url = ""
16+
17+
[[params.profiles]]
18+
name = "Twitter"
19+
url = ""
20+
21+
[[params.profiles]]
22+
name = "Goodreads"
23+
url = ""
24+
25+
[[params.profiles]]
26+
name = "LinkedIn"
27+
url = ""

exampleSite/data/personalize.toml

-30
This file was deleted.

layouts/index.html

+10-12
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44

55
<body>
66

7-
<h1>{{ .Site.Data.personalize.Name }}</h1>
7+
<h1>{{ .Site.Params.Name }}</h1>
88

9-
<h4>{{ .Site.Data.personalize.About| markdownify }}</h4>
9+
<div>{{ .Content }}</div>
1010

1111
<table>
12-
{{ range .Site.Data.personalize.profiles }}
12+
{{ range .Site.Params.profiles }}
1313
{{ partial "profile_link.html" . }}
1414
{{ end }}
1515
<tr>
16-
{{ if ne .Site.Data.personalize.Resume "" }}
16+
{{ if ne .Site.Params.Resume "" }}
1717
<td><i class="fas fa-file-alt" aria-hidden="true"></i></td>
18-
<td>&nbsp;<a href="/resume/{{ .Site.Data.personalize.Resume }}" target="_blank">Resume</a></td>
18+
<td>&nbsp;<a href="/resume/{{ .Site.Params.Resume }}" target="_blank">Resume</a></td>
1919
{{ end }}
2020
</tr>
2121
<tr>
22-
{{ if ne .Site.Data.personalize.Email "" }}
22+
{{ if ne .Site.Params.Email "" }}
2323
<td><i class="fas fa-envelope" aria-hidden="true"></i></td>
24-
<td>&nbsp;<code>{{ .Site.Data.personalize.Email }}</code></td>
24+
<td>&nbsp;<code>{{ .Site.Params.Email }}</code></td>
2525
{{ end }}
2626
</tr>
2727
</table>
@@ -31,21 +31,19 @@ <h3>Posts</h3>
3131
<div>
3232

3333
<!-- orders content according to the "publishdate" field in front matter -->
34-
{{ with .Site.Data.personalize.PostLimit }}
35-
{{ range first .Site.Data.personalize.PostLimit .Pages.ByPublishDate }}
34+
{{ range first (.Site.Params.PostLimit | default 4) (where .Site.RegularPages.ByPublishDate "Section" "posts") }}
3635
<div>
3736
<a href="{{ .Permalink }}">{{ .Title }}</a><br />
3837
<time>{{ .Date.Format "January 2, 2006" }}</time>
3938
</div>
4039
<br />
4140
{{ end }}
42-
{{ end }}
4341

4442

4543
<h3><a href="posts/">View all posts</a></h3>
4644
</div>
47-
{{ if ne .Site.Data.personalize.GoatCounterCode "" }}
48-
<script data-goatcounter="{{ .Site.Data.personalize.GoatCounterCode }}" async src="//gc.zgo.at/count.js"></script>
45+
{{ if ne .Site.Params.GoatCounterCode "" }}
46+
<script data-goatcounter="{{ .Site.Params.GoatCounterCode }}" async src="//gc.zgo.at/count.js"></script>
4947
{{ end }}
5048
</body>
5149

layouts/partials/head.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
<link rel="stylesheet" href="/css/style.css">
77
<link rel="stylesheet" href="/css/fonts.css">
88
<!-- End stylesheets -->
9-
<title>{{ .Site.Data.personalize.Name }}</title>
9+
<title>{{ .Site.Params.Name }}</title>
1010
<link rel="icon" type="image/png" href="/assets/img/favicon.ico" />
1111
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
1212
integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
1313
<script src="/js/dark.js" defer=""></script>
1414

15-
</head>
15+
</head>

layouts/partials/page_header.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<header class="site-header">
66

77
<div class="wrapper">
8-
<a class="muted small" href="{{ .Site.BaseURL }}">{{ .Site.Data.personalize.Name }}</a>
8+
<a class="muted small" href="{{ .Site.BaseURL }}">{{ .Site.Params.Name }}</a>
99
</div>
1010
</header>
1111
</body>
1212

13-
</html>
13+
</html>

0 commit comments

Comments
 (0)