Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding footer and img shortcode integration #88

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ To change theme colors, add the following lines in `params`:

If you want the above theme colors, you can see the [exampleSite/config.toml](/exampleSite/config.toml) file.

### Add Image in Post

In your markdown:
```md
{{< img src="images/my-cool-picture.png" alt="my cool picture">}}
```
### Styling

To override styles using scss, add a file called `_extra.scss` to `[path]/assets/css/`
Expand Down
8 changes: 8 additions & 0 deletions assets/css/components/_app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
text-align: center;
}

.app-footer {
background: $darkest-color;
text-align: center;
position: fixed;
bottom: 0;
width: 100%;
}

.app-header-avatar {
width: 15rem;
height: 15rem;
Expand Down
5 changes: 5 additions & 0 deletions exampleSite/content/impressum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+++
title = "About"
+++

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent lacinia lorem quis sodales auctor. Donec bibendum odio leo, bibendum iaculis lectus dapibus sit amet. Etiam ut euismod lectus, vel finibus metus. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer quis vestibulum justo. Duis scelerisque ullamcorper sem, eget congue lorem ultrices mattis. Nam ut mollis tellus, id facilisis turpis. Duis ac egestas mi, a mattis dolor. Curabitur vestibulum est nec tortor hendrerit, vehicula malesuada quam tempor. Duis ornare tortor dapibus, scelerisque est lacinia, aliquet mi. Vivamus convallis malesuada augue ac viverra. Sed molestie erat at sem dapibus porttitor. Vestibulum lacinia, enim id feugiat varius, felis erat sollicitudin nisl, sit amet semper nisi nunc in nisl. Sed dapibus ullamcorper nulla, et molestie lacus accumsan ac.
3 changes: 3 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,8 @@ <h1>{{ .Site.Title }}</h1>
{{ .Content }}
{{ end }}
</main>
<footer class="app-footer">
{{ partial "footer.html" . }}
</footer>
Comment on lines +49 to +51
Copy link
Contributor Author

@flo-kn flo-kn Sep 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's better to make the footer integration optional. Would appreciate any kind of directions or guidance.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My previous theme did this:

    <footer>
      {{ block "footer" . }}
      {{ end }}
    </footer>

Then you can define the footer in your other templates and pages.

</body>
</html>
4 changes: 4 additions & 0 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

<div>
<a href="/impressum/">Impressum</a>
</div>
4 changes: 4 additions & 0 deletions layouts/shortcodes/img.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{ $image := resources.GetMatch (.Get "src") }}

<img src="{{ $image.RelPermalink }}">