Skip to content

Commit c505ec8

Browse files
authored
[#153] Add survey/symposium buttons (#154)
* add featuredButton parameters to dynamically add a button on featured posts * add documentation for featuredButtonTitle and featuredButtonLink * adjust featured buttons sizes * make buttons even smaller * adjust titles for the featured buttons * reduce padding, place buttons on the same line as list items
1 parent da7de3c commit c505ec8

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed

archetypes/post.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title: "{{ replace .Name "-" " " | title }}" # Title of the blog post.
33
date: {{ .Date }} # Date of post creation.
44
description: "Article description." # Description used for search engine.
55
featured: true # Sets if post is a featured post, making it appear on the sidebar. A featured post won't be listed on the sidebar if it's the current page
6+
# featuredButtonTitle: #featuredButtonTitle and featuredButtonLink adds a button next to a featured Post, both must be
7+
# featuredButtonLink: #set to add the button
68
draft: true # Sets whether to render this page. Draft of true will not be rendered.
79
toc: false # Controls if a table of contents should be generated for first-level links automatically.
810
# menu: main

assets/sass/_custom.sass

+8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838
.button_tally
3939
margin-left: 1em
4040

41+
.featured.button
42+
text-transform: none
43+
font-size: 0.6rem
44+
padding: 1rem
45+
padding-top: 0.35rem
46+
padding-bottom: 0.35rem
47+
font-weight: bold
48+
4149
a[title="join us"]
4250
border: solid
4351
border-radius: 0.5rem

content/news/2024-11-20-dhtech-survey-2024.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: Digital Humanities Research Software Engineering Survey
44
slug: dhtech-survey-2024
55
date: 2024-11-20T10:00:00
66
author: DHTech
7+
featuredButtonTitle: Take the Survey
8+
featuredButtonLink: https://forms.gle/WhK4wyh62ruiGqXy5
79
thumbnail: /images/posts/dhtech-survey-2024.jpg
810
# featureImage: /images/posts/dhrescu-hippo.png
911
summary: DHTech is running a survey to better understand the experiences and needs of anyone doing technical work in the digital humanities! [Click here to take the survey](https://forms.gle/WhK4wyh62ruiGqXy5)

content/news/2025-02-19-call-for-presentations.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ slug: Digital Humanities Tech Symposium
55
date: 2025-02-19
66
author: DHTech
77
featured: true
8+
featuredButtonTitle: Submit a Talk
9+
featuredButtonLink: https://form.jotform.com/250346227323147
810
thumbnail:
911

1012
tags:

layouts/partials/sidebar.html

+13-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,19 @@ <h2 class="mt-4">{{ T "featured_posts" }}</h2>
6666
{{- range . }}
6767
<li>
6868
<img class="icon" src="/icons/star.svg" alt="Post Icon">
69-
<a href="{{ .RelPermalink }}" class="nav-link" title="{{ .Title }}">{{ .Title | markdownify }}</a>
69+
<div class="nav-link">
70+
<a href="{{ .RelPermalink }}" title="{{ .Title }}">{{ .Title | markdownify }}</a>
71+
{{- if .Params.featuredButtonTitle}}
72+
{{- if .Params.featuredButtonLink}}
73+
74+
<button class="featured button">
75+
<a href="{{ .Params.featuredButtonLink}}" class="nav-link"
76+
title="{{ .Params.featuredButtonTitle}}">{{.Params.featuredButtonTitle | markdownify}}</a>
77+
</button>
78+
{{- end}}
79+
{{- end}}
80+
81+
</div>
7082
</li>
7183
{{- end }}
7284
</ul>

0 commit comments

Comments
 (0)