Skip to content

Commit

Permalink
Merge pull request #13 from MansoorMajeed/create-improve-page
Browse files Browse the repository at this point in the history
Create improve page button
  • Loading branch information
MansoorMajeed authored Jan 6, 2024
2 parents 951d593 + 5959b18 commit 7d906e3
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
4 changes: 4 additions & 0 deletions assets/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.centered-improve-link {
text-align: center;
margin-top: 15px;
}
3 changes: 3 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ style = "github-dark"

favicon_32 = "images/favicon.png"
# favicon_16 = "/img/favicon-16x16.png"
gitRepo = "https://github.com/MansoorMajeed/esc.sh"

customCSS = ["/css/custom.css"]

since = 2012

Expand Down
62 changes: 62 additions & 0 deletions layouts/posts/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{ define "title" }}
{{ .Title }} · {{ .Site.Title }}
{{ end }}
{{ define "content" }}
<section class="container post">
<article>
<header>
<div class="post-title">
<h1 class="title">
<a class="title-link" href="{{ .Permalink | safeURL }}">
{{ .Title }}
</a>
</h1>
</div>
<div class="post-meta">
<div class="date">
<span class="posted-on">
<i class="fa fa-calendar" aria-hidden="true"></i>
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{ .Date | time.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}
</time>
</span>
<span class="reading-time">
<i class="fa fa-clock-o" aria-hidden="true"></i>
{{ i18n "reading_time" .ReadingTime }}
</span>
</div>
{{ with .GetTerms "authors" }}{{ partial "taxonomy/authors.html" . }}{{ end }}
{{ with .GetTerms "categories" }}{{ partial "taxonomy/categories.html" . }}{{ end }}
{{ with .GetTerms "tags" }}{{ partial "taxonomy/tags.html" . }}{{ end }}
<!-- Improve this page link -->
<div class="centered-improve-link">
{{ if .Site.Params.gitRepo }}
<span class="improve-link">
<a href="{{ .Site.Params.gitRepo }}/edit/{{ .Site.Params.gitBranch | default "main" }}/content/{{ path.Clean .File.Path }}">
<i class="fa fa-github"></i> Improve this page
</a>
</span>
{{ end }}
</div>
</div>
</header>
<div class="post-content">
{{ if .Params.featuredImage }}
<img src="{{ .Params.featuredImage | relURL }}" alt="Featured image"/>
{{ end }}
{{ .Content }}
</div>


<footer>
{{ partial "posts/series.html" . }}
{{ partial "posts/disqus.html" . }}
{{ partial "posts/commento.html" . }}
{{ partial "posts/utterances.html" . }}
{{ partial "posts/giscus.html" . }}
</footer>
</article>

{{ partial "posts/math.html" . }}
</section>
{{ end }}

0 comments on commit 7d906e3

Please sign in to comment.