Skip to content

Commit

Permalink
add edit this page button
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengchun committed Nov 17, 2023
1 parent e9f28db commit e36d5e8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title = "Awesome Bootstrap Theme with Atlassian Design - FastBootstrap"

enableRobotsTXT = true
disableKinds = ["404", "taxonomy", "term", "RSS"]
enableGitInfo = true

publishDir = "public"
enableInlineShortcodes = true
Expand All @@ -16,6 +17,7 @@ description = "FastBootstrap is a beautiful Bootstrap theme for your next projec
page_title_suffix = "FastBootstrap Theme"
github_org = "https://github.com/fastbootstrap"
repo = "https://github.com/fastbootstrap/atlassian-design-for-bootstrap"
docs_repo = "https://github.com/fastbootstrap/docs"
current_version = "2.0.0"

[params.download]
Expand Down
1 change: 1 addition & 0 deletions layouts/_default/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ <h1 class="fw-semibold fs-2">{{ .Title | markdownify }}</h1>
</div>
<div class="bd-content px-4 px-md-6 px-lg-10 px-xl-20 py-8" data-bs-spy="scroll" id="doc-content" data-bs-target=".doc-nav-content" data-bs-smooth-scroll="true" tabindex="0">
{{ .Content }}
{{ partial "docs-footer" . }}
</div>
</div>
{{ end }}
Expand Down
10 changes: 10 additions & 0 deletions layouts/partials/docs-footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{ with .GitInfo }}
<div class="mt-6 mt-lg-8 mt-xl-16 py-8 border-top">
<div class="d-flex flex-column gap-5 gap-lg-6">
<a href="{{ printf "%s/edit/main/content/%s" $.Site.Params.docs_repo (path.Clean $.File.Path) | safeURL }}"><i class="fa-solid fa-pencil me-2"></i> Edit this page on Github</a>
<div class="fs-sm">
<span class="text-body-tertiary">Last edited by <a href="{{ printf "https://github.com/%s" .AuthorName }}">{{ .AuthorName }}</a> on <a href="{{ printf "%s/commit/%s" $.Site.Params.docs_repo .Hash }}">{{ .AuthorDate | time.Format ":date_long" }}</a></span>
</div>
</div>
</div>
{{ end }}
1 change: 1 addition & 0 deletions layouts/shortcodes/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ <h1 class="fw-semibold fs-2">{{ .Page.Title | markdownify }}</h1>

<div class="bd-content px-4 px-md-6 px-lg-10 px-xl-20 py-8" data-bs-spy="scroll" data-bs-target="#doc-nav-{{ $index }}" data-bs-smooth-scroll="true" tabindex="0">
{{ $content }}
{{ partial "docs-footer" $.Page }}
</div>
</div>
</div>
Expand Down

0 comments on commit e36d5e8

Please sign in to comment.