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.
This commit is contained in:
Suyash Belekar 2021-05-02 13:47:50 +05:30 committed by GitHub
parent 314d8cd5a4
commit dbd85bc12c
7 changed files with 56 additions and 95 deletions

View File

@ -1,30 +0,0 @@
Name = ""
# Supports markdown
About = ""
Email = ""
# Add the filename with file extension.
Resume = ""
# Sets the number of posts to display on the front page
PostLimit = 4
GoatCounterCode = ""
[[profiles]]
name = "GitHub"
url = ""
[[profiles]]
name = "Twitter"
url = ""
[[profiles]]
name = "Goodreads"
url = ""
[[profiles]]
name = "LinkedIn"
url = ""

View File

@ -29,46 +29,42 @@ For more information read the [official setup guide](https://gohugo.io/overview/
To personalize the theme
`cp themes/lekh/.personalize.toml data/personalize.toml`
`cp themes/lekh/exampleSite/config.toml config.toml`
And then customize accordingly.
Or simply copy the below into a new file called `data/personalize.toml` and customize accordingly.
Or simply copy the below config and customize accordingly.
```toml
baseURL = "http://rtiwari.me/"
languageCode = "en-us"
title = "Rahul Tiwari"
theme = "lekh"
[params]
Name = ""
# Supports markdown
About = ""
Email = ""
Resume = "" # Add the filename with file extension.
PostLimit = 4 # Sets the number of posts to display on the front page
GoatCounterCode = ""
# Add the filename with file extension.
Resume = ""
# Sets the number of posts to display on the front page
PostLimit = 4
[[profiles]]
[[params.profiles]]
name = "GitHub"
url = ""
[[profiles]]
[[params.profiles]]
name = "Twitter"
url = ""
[[profiles]]
[[params.profiles]]
name = "Goodreads"
url = ""
[[profiles]]
[[params.profiles]]
name = "LinkedIn"
url = ""
# This is the endpoint under the integrations section of the Site Code
GoatCounterCode = ""
```
## Posts

27
exampleSite/config.toml Normal file
View File

@ -0,0 +1,27 @@
baseURL = "http://rtiwari.me/"
languageCode = "en-us"
title = "Rahul Tiwari"
theme = "lekh"
[params]
Name = ""
Email = ""
Resume = "" # Add the filename with file extension.
PostLimit = 4 # Sets the number of posts to display on the front page
GoatCounterCode = ""
[[params.profiles]]
name = "GitHub"
url = ""
[[params.profiles]]
name = "Twitter"
url = ""
[[params.profiles]]
name = "Goodreads"
url = ""
[[params.profiles]]
name = "LinkedIn"
url = ""

View File

@ -1,30 +0,0 @@
Name = "Agent Smith"
# Supports markdown
About = "We're not here because we're free. We're here because we're __not__ free. There's no escaping reason. No denying purpose. Because as we both know without purpose, we would not exist.<br/> Read more [here](https://matrix.fandom.com/wiki/Agent_Smith)"
Email = "agent.smith@thematrix.com"
# Add the filename with file extension.
Resume = ""
# Sets the number of posts to display on the front page
PostLimit = 4
GoatCounterCode = ""
[[profiles]]
name = "GitHub"
url = "https://github.com/invinciblycool"
[[profiles]]
name = "Twitter"
url = "https://twitter.com/getFANDOM"
[[profiles]]
name = "Goodreads"
url = "https://www.goodreads.com/user/show/91520565-rahul-tiwari"
[[profiles]]
name = "LinkedIn"
url = "https://www.linkedin.com/in/rahul-tiwari-43708b128/"

View File

@ -4,24 +4,24 @@
<body>
<h1>{{ .Site.Data.personalize.Name }}</h1>
<h1>{{ .Site.Params.Name }}</h1>
<h4>{{ .Site.Data.personalize.About| markdownify }}</h4>
<div>{{ .Content }}</div>
<table>
{{ range .Site.Data.personalize.profiles }}
{{ range .Site.Params.profiles }}
{{ partial "profile_link.html" . }}
{{ end }}
<tr>
{{ if ne .Site.Data.personalize.Resume "" }}
{{ if ne .Site.Params.Resume "" }}
<td><i class="fas fa-file-alt" aria-hidden="true"></i></td>
<td>&nbsp;<a href="/resume/{{ .Site.Data.personalize.Resume }}" target="_blank">Resume</a></td>
<td>&nbsp;<a href="/resume/{{ .Site.Params.Resume }}" target="_blank">Resume</a></td>
{{ end }}
</tr>
<tr>
{{ if ne .Site.Data.personalize.Email "" }}
{{ if ne .Site.Params.Email "" }}
<td><i class="fas fa-envelope" aria-hidden="true"></i></td>
<td>&nbsp;<code>{{ .Site.Data.personalize.Email }}</code></td>
<td>&nbsp;<code>{{ .Site.Params.Email }}</code></td>
{{ end }}
</tr>
</table>
@ -31,21 +31,19 @@
<div>
<!-- orders content according to the "publishdate" field in front matter -->
{{ with .Site.Data.personalize.PostLimit }}
{{ range first .Site.Data.personalize.PostLimit .Pages.ByPublishDate }}
{{ range first (.Site.Params.PostLimit | default 4) (where .Site.RegularPages.ByPublishDate "Section" "posts") }}
<div>
<a href="{{ .Permalink }}">{{ .Title }}</a><br />
<time>{{ .Date.Format "January 2, 2006" }}</time>
</div>
<br />
{{ end }}
{{ end }}
<h3><a href="posts/">View all posts</a></h3>
</div>
{{ if ne .Site.Data.personalize.GoatCounterCode "" }}
<script data-goatcounter="{{ .Site.Data.personalize.GoatCounterCode }}" async src="//gc.zgo.at/count.js"></script>
{{ if ne .Site.Params.GoatCounterCode "" }}
<script data-goatcounter="{{ .Site.Params.GoatCounterCode }}" async src="//gc.zgo.at/count.js"></script>
{{ end }}
</body>

View File

@ -6,7 +6,7 @@
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/fonts.css">
<!-- End stylesheets -->
<title>{{ .Site.Data.personalize.Name }}</title>
<title>{{ .Site.Params.Name }}</title>
<link rel="icon" type="image/png" href="/assets/img/favicon.ico" />
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">

View File

@ -5,7 +5,7 @@
<header class="site-header">
<div class="wrapper">
<a class="muted small" href="{{ .Site.BaseURL }}">{{ .Site.Data.personalize.Name }}</a>
<a class="muted small" href="{{ .Site.BaseURL }}">{{ .Site.Params.Name }}</a>
</div>
</header>
</body>