Skip to content

Commit

Permalink
Fix size on docs/firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
spuder committed Nov 23, 2024
1 parent e22fea9 commit 2ad262b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/pages-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
- name: Setup yq
uses: vegardit/gha-setup-yq@v1

# Replace the badge with the latest version
# https://img.shields.io/badge/esp32s2-0.1.0-magenta
- name: Read manifest and update docs
run: |
# Read version from manifest.json
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
downloaded-artifacts/
.vscode/
.vscode/
artifacts/
9 changes: 9 additions & 0 deletions docs/_plugins/file_size.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Jekyll
module FileSize
def file_size(input)
File.size(input)
end
end
end

Liquid::Template.register_filter(Jekyll::FileSize)
10 changes: 9 additions & 1 deletion docs/firmware/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ search_exclude: true
<tr>
<td><a href="{{ file.path | relative_url }}">{{ file.name }}</a></td>
<td>{{ file.modified_time | date: "%Y-%m-%d %H:%M" }}</td>
<td class="size">{{ file.size | divided_by: 1024 }}KB</td>
<td class="size">
{% assign file_path = file.path | prepend: site.source %}
{% if file_path | file_exists %}
{% assign file_size = file_path | file_size | divided_by: 1024.0 %}
{{ file_size | round: 2 }} KB
{% else %}
N/A
{% endif %}
</td>
</tr>
{% endfor %}
</table>

0 comments on commit 2ad262b

Please sign in to comment.