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

Make website fully responsive #943

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.124.1'
hugo-version: '0.134.1'

- name: Install Dart Sass
run: sudo snap install dart-sass
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.124.1'
hugo-version: '0.134.1'

- name: Install Dart Sass
run: sudo snap install dart-sass
Expand Down
2 changes: 1 addition & 1 deletion content/download/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title: "Taskwarrior - What's next?"

**Taskwarrior {{< current_release "version" >}}** (Released {{< current_release "date" >}}):
[task-{{< current_release "version" >}}.tar.gz]({{< current_release "url" >}})
SHA256 {{< current_release "sha256" >}}
SHA256 {{< text-break >}}{{< current_release "sha256" >}}{{< /text-break >}}
[Changelog](https://github.com/GothenburgBitFactory/taskwarrior/blob/stable/ChangeLog)

Command reference taskwarrior 2.5.3:
Expand Down
37 changes: 37 additions & 0 deletions themes/bootstrap/layouts/_default/_markup/render-table.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{/*
Extends the defaul Hugo table rendering
(https://gohugo.io/render-hooks/tables/#example) to support Bootstrap 5's
responsive tables by adding a wrapper div with a "table-responsive" class and
by adding the class "table" to the table element.
*/}}
<div class="table-responsive">
<table class="table">
{{- range $k, $v := .Attributes }}
{{- if $v }}
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
{{- end }}
{{- end }}
<thead>
{{- range .THead }}
<tr>
{{- range . }}
<th {{ printf "style=%q" (printf "text-align: %s" .Alignment) | safeHTMLAttr }}>
{{- .Text -}}
</th>
{{- end }}
</tr>
{{- end }}
</thead>
<tbody>
{{- range .TBody }}
<tr>
{{- range . }}
<td {{ printf "style=%q" (printf "text-align: %s" .Alignment) | safeHTMLAttr }}>
{{- .Text -}}
</td>
{{- end }}
</tr>
{{- end }}
</tbody>
</table>
</div>
24 changes: 13 additions & 11 deletions themes/bootstrap/layouts/_default/tools.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,20 @@
<p class="lead" id="search-result-message">
Loading...
</p>
<table class="table table-striped" aria-label="tools table">
<thead>
<tr>
<th scope="col">Tool</th>
<th scope="col">Description</th>
<th scope="col">License</th>
</tr>
</thead>
<tbody id="tools-table">
<div class="table-responsive">
<table class="table table-striped" aria-label="tools table">
<thead>
<tr>
<th scope="col">Tool</th>
<th scope="col">Description</th>
<th scope="col">License</th>
</tr>
</thead>
<tbody id="tools-table">

</tbody>
</table>
</tbody>
</table>
</div>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions themes/bootstrap/layouts/shortcodes/text-break.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<span class="text-break">{{ .Inner }}</span>
40 changes: 0 additions & 40 deletions themes/bootstrap/static/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -237,43 +237,3 @@ h4 .callout-warning {
.goat svg {
font-size: 14px;
}

/**
* Bootsrap 5 has table styles as opt-in by adding the class .table to <table>.
* However Hugo converts Markdown tables to HTML directly, and there are
* currently no Hugo render hooks for tables. As a workaround, we copy the
* styles for .table in bootstrap.css to the table tag here.
*/
table {
--bs-table-color-type: initial;
--bs-table-bg-type: initial;
--bs-table-color-state: initial;
--bs-table-bg-state: initial;
--bs-table-color: var(--bs-emphasis-color);
--bs-table-bg: var(--bs-body-bg);
--bs-table-border-color: var(--bs-border-color);
--bs-table-accent-bg: transparent;
--bs-table-striped-color: var(--bs-emphasis-color);
--bs-table-striped-bg: rgba(var(--bs-emphasis-color-rgb), 0.05);
--bs-table-active-color: var(--bs-emphasis-color);
--bs-table-active-bg: rgba(var(--bs-emphasis-color-rgb), 0.1);
--bs-table-hover-color: var(--bs-emphasis-color);
--bs-table-hover-bg: rgba(var(--bs-emphasis-color-rgb), 0.075);
width: 100%;
margin-bottom: 1rem;
vertical-align: top;
border-color: var(--bs-table-border-color);
}
table > :not(caption) > * > * {
padding: 0.5rem 0.5rem;
color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));
background-color: var(--bs-table-bg);
border-bottom-width: var(--bs-border-width);
box-shadow: inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)));
}
table > tbody {
vertical-align: inherit;
}
table > thead {
vertical-align: bottom;
}