Skip to content

Commit 70b4143

Browse files
committed
theme: apply user supplied content footer below content matcornic#229
1 parent 2890b60 commit 70b4143

File tree

6 files changed

+31
-11
lines changed

6 files changed

+31
-11
lines changed

exampleSite/content/basics/customization/_index.en.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ In `themes/hugo-theme-relearn/layouts/partials/`, you will find all the partials
99

1010
This theme defines the following partials :
1111

12-
- `content.html`: the content page itself. This can be overridden if you wan't to display page's meta data above or below the content.
13-
- `header.html`: the header of the content page (contains the breadcrumbs). _Not meant to be overwritten_
14-
- `custom-header.html`: custom headers in page. Meant to be overwritten when adding CSS imports. Don't forget to include `style` HTML tag directive in your file
15-
- `footer.html`: the footer of the content page (contains the arrows). _Not meant to be overwritten_
16-
- `custom-footer.html`: custom footer in page. Meant to be overwritten when adding Javacript. Don't forget to include `javascript` HTML tag directive in your file
12+
- `header.html`: the header of the page. _Not meant to be overwritten_
13+
- `footer.html`: the footer of the page._Not meant to be overwritten_
14+
- `menu.html`: left menu. _Not meant to be overwritten_
15+
- `search.html`: search box. _Not meant to be overwritten_
16+
- `custom-header.html`: custom headers in page. Meant to be overwritten when adding CSS imports. Don't forget to include `style` HTML tag directive in your file.
17+
- `custom-footer.html`: custom footer in page. Meant to be overwritten when adding Javacript. Don't forget to include `javascript` HTML tag directive in your file.
1718
- `favicon.html`: the favicon
1819
- `logo.html`: the logo, on top left hand corner
1920
- `meta.html`: HTML meta tags, if you want to change default behavior
20-
- `menu.html`: left menu. _Not meant to be overwritten_
2121
- `menu-pre.html`: side-wide configuration to prepend to menu items. If you override this, it is your responsiblity to take the page's `pre` setting into account.
2222
- `menu-post.html`: side-wide configuration to append to menu items. If you override this, it is your responsiblity to take the page's `post` setting into account.
2323
- `menu-footer.html`: footer of the the left menu
24-
- `search.html`: search box. _Not meant to be overwritten_
2524
- `toc.html`: table of contents
26-
25+
- `content.html`: the content page itself. This can be overridden if you wan't to display page's meta data above or below the content.
26+
- `content-footer`: footer below the content, has a default implementation but you can overwrite it if you don't like it.
2727
## Change the logo
2828

2929
Create a new file in `layouts/partials/` named `logo.html`. Then write any HTML you want.

exampleSite/content/basics/migration/_index.en.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ This document shows you what's new in the latest release. For a detailed list of
1414

1515
---
1616

17+
## 3.4.0
18+
19+
- **Breaking**: If you had previously overwritten the `custom-footer.html` partial to add visual elements below the content of your page, you have to move this content to the new partial `content-footer.html`. `custom-footer.html` was never meant to contain HTML other than additional styles and JavaScript.
20+
21+
---
22+
1723
## 3.3.0
1824

1925
- **New**: Introduction of new CSS variables to set the font. The theme distinguishs between `--MAIN-font` for all content text and `--CODE-font` for inline or block code. There are additional overrides for all headings. See the [theme variant generator]({{%relref "basics/generator" %}}) of the exampleSite for all available variables.

layouts/partials/content-footer.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{- with .Params.LastModifierDisplayName }}
2+
<i class='fas fa-user'></i> {{ with $.Params.LastModifierEmail }}<a href="mailto:{{ . }}">{{ end }}{{ . }}{{ with $.Params.LastModifierEmail }}</a>{{ end }}
3+
{{- with $.Date }}
4+
<i class='fas fa-calendar'></i> {{ . | time.Format ":date_medium" }}
5+
{{- end }}
6+
{{- end }}

layouts/partials/footer.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<footer class="footline">
2-
{{- with .Params.LastModifierDisplayName }}
3-
<i class='fas fa-user'></i> <a href="mailto:{{ $.Params.LastModifierEmail }}">{{ . }}</a> {{ with $.Date }} <i class='fas fa-calendar'></i> {{ .Format "02/01/2006" }}{{ end }}
4-
{{- end }}
2+
{{- partial "content-footer.html" . }}
53
</footer>
64
</div>
75
</main><!-- #body-inner -->

static/css/print.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ body,
8989
margin-top: 1.5rem;
9090
padding-top: .75rem;
9191
}
92+
#body #body-inner .footline a {
93+
text-decoration: none;
94+
}
9295
#body #body-inner a {
9396
/* in print we want to distinguish links in our content from
9497
normal text even if printed black/white;

static/css/theme.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,13 @@ option {
11961196
margin-top: 2rem;
11971197
}
11981198

1199+
.footline i{
1200+
margin-left: .5rem;
1201+
}
1202+
.footline i:first-child{
1203+
margin-left: 0;
1204+
}
1205+
11991206
.mermaid {
12001207
margin-bottom: 1.7rem;
12011208
margin-top: 1.7rem;

0 commit comments

Comments
 (0)