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 To personalize the theme
`cp themes/lekh/.personalize.toml data/personalize.toml` `cp themes/lekh/exampleSite/config.toml config.toml`
And then customize accordingly. 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 ```toml
baseURL = "http://rtiwari.me/"
languageCode = "en-us"
title = "Rahul Tiwari"
theme = "lekh"
[params]
Name = "" Name = ""
# Supports markdown
About = ""
Email = "" 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. [[params.profiles]]
Resume = ""
# Sets the number of posts to display on the front page
PostLimit = 4
[[profiles]]
name = "GitHub" name = "GitHub"
url = "" url = ""
[[profiles]] [[params.profiles]]
name = "Twitter" name = "Twitter"
url = "" url = ""
[[profiles]] [[params.profiles]]
name = "Goodreads" name = "Goodreads"
url = "" url = ""
[[profiles]] [[params.profiles]]
name = "LinkedIn" name = "LinkedIn"
url = "" url = ""
# This is the endpoint under the integrations section of the Site Code
GoatCounterCode = ""
``` ```
## Posts ## 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> <body>
<h1>{{ .Site.Data.personalize.Name }}</h1> <h1>{{ .Site.Params.Name }}</h1>
<h4>{{ .Site.Data.personalize.About| markdownify }}</h4> <div>{{ .Content }}</div>
<table> <table>
{{ range .Site.Data.personalize.profiles }} {{ range .Site.Params.profiles }}
{{ partial "profile_link.html" . }} {{ partial "profile_link.html" . }}
{{ end }} {{ end }}
<tr> <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><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 }} {{ end }}
</tr> </tr>
<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><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 }} {{ end }}
</tr> </tr>
</table> </table>
@ -31,21 +31,19 @@
<div> <div>
<!-- orders content according to the "publishdate" field in front matter --> <!-- orders content according to the "publishdate" field in front matter -->
{{ with .Site.Data.personalize.PostLimit }} {{ range first (.Site.Params.PostLimit | default 4) (where .Site.RegularPages.ByPublishDate "Section" "posts") }}
{{ range first .Site.Data.personalize.PostLimit .Pages.ByPublishDate }}
<div> <div>
<a href="{{ .Permalink }}">{{ .Title }}</a><br /> <a href="{{ .Permalink }}">{{ .Title }}</a><br />
<time>{{ .Date.Format "January 2, 2006" }}</time> <time>{{ .Date.Format "January 2, 2006" }}</time>
</div> </div>
<br /> <br />
{{ end }} {{ end }}
{{ end }}
<h3><a href="posts/">View all posts</a></h3> <h3><a href="posts/">View all posts</a></h3>
</div> </div>
{{ if ne .Site.Data.personalize.GoatCounterCode "" }} {{ if ne .Site.Params.GoatCounterCode "" }}
<script data-goatcounter="{{ .Site.Data.personalize.GoatCounterCode }}" async src="//gc.zgo.at/count.js"></script> <script data-goatcounter="{{ .Site.Params.GoatCounterCode }}" async src="//gc.zgo.at/count.js"></script>
{{ end }} {{ end }}
</body> </body>

View File

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

View File

@ -5,7 +5,7 @@
<header class="site-header"> <header class="site-header">
<div class="wrapper"> <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> </div>
</header> </header>
</body> </body>