Closed Ainali closed 7 months ago
I've dug a bit into this, and perhaps a way to do it would be: 1) include front matter tags on all activity indices, like
---
type: activity index
title: title-of-activity
---
2) Pull them up in the activities index
{% assign activity = site.activities | where:"type", "activity index" %}
3) Output them as a list (note - I'm not sure this pathing works)
<ul>
{% for activity in site.activities %}
<li><a href="{{ activity.url | relative_url }}">{{ activity.title }}</a></li>
{% endfor %}
</ul>
However - I am wondering whether this a useful change. There is still the risk of human error, as if someone forgets the front matter, it won't render into the list.
So it will add some complexity and make the markdown harder to read, without necessarily reducing the risk of error.
For adding an activity, we'd still need to remember to add the front matter, instead of adding it to the index For removing an activity, the link checker should return an error that the destination file is no longer there
Any time we add something (resource, guide, etc) it needs to be manually added to the parent directory anyway -> so it's perhaps good to just keep that practice and awareness.
Writing out all of this, I wonder whether it might not be easier to check the other way around -> would it be possible to scan for unlinked files (so pages that are not linked to from anywhere else inside the repo)? Did a quick search and found this
Writing out all of this, I wonder whether it might not be easier to check the other way around -> would it be possible to scan for unlinked files (so pages that are not linked to from anywhere else inside the repo)? Did a quick search and found this
Checking the other way around is certainly possible, but we're going to get a lot of false hits because we host many files which are not linked, for example, every redirect_from
entry.
I hacked up a script to see, and out of the box there are A LOT of unlinked files:
404.html
CNAME
Gemfile
Gemfile.lock
LICENSE.md
README.md
activities/activities/tool-management/g-suite.html
activities/codebase-stewardship/activities.html
activities/codebase-stewardship/community-calls.html
activities/codebase-stewardship/community-calls/post-process-community-call.html
activities/codebase-stewardship/community-calls/preparing-community-call.html
activities/codebase-stewardship/community-calls/running-community-call.html
activities/codebase-stewardship/explaining-stewardship.html
activities/codebase-stewardship/explaining-stewardship/codebase-community.html
activities/codebase-stewardship/explaining-stewardship/codebase-product.html
activities/codebase-stewardship/explaining-stewardship/codebase-quality.html
activities/codebase-stewardship/explaining-stewardship/codebase-scale.html
activities/codebase-stewardship/explaining-stewardship/codebase-stewardship.html
activities/codebase-stewardship/explaining-stewardship/codebase-support.html
activities/codebase-stewardship/explaining-stewardship/codebases-shared.html
activities/codebase-stewardship/explaining-stewardship/components-shared.html
activities/codebase-stewardship/explaining-stewardship/components.html
activities/codebase-stewardship/lifecycle.bpmn
activities/codebase-stewardship/lifecycle.html
activities/codebase-stewardship/product-development.html
activities/codebase-stewardship/supporting-governance.html
activities/codebase-stewardship/supporting-governance/governance-template.html
activities/communication/basic-tweet-template.html
activities/communication/blogging.html
activities/communication/communication-principles.html
activities/communication/community-call-blogposts.html
activities/communication/how-to-post-to-social-media.html
activities/documentation/merge-develop-into-master.html
activities/readme.md
activities/staff-information/request-professional-development.html
activities/tool-management/jitsi_admin_django_approve_user.png
activities/tool-management/jitsi_admin_django_approve_user_final.png
activities/tool-management/jitsi_admin_django_save_user_after_approval.png
activities/tool-management/jitsi_admin_django_set_permission_type.png
activities/tool-management/jitsi_admin_django_set_permission_type_final.png
activities/tool-management/jitsi_user_sign_up.png
activities/trainings/github-for-newcomers.html
activities/trainings/writing-issues.html
activities/value-and-impact/pain-points/index.html
activities/value-and-impact/pain-points/public-organizations.html
activities/value-and-impact/sustainable-development-goals.html
activities/value-and-impact/user-mapping/developers-and-designers.html
activities/value-and-impact/user-mapping/index.html
activities/value-and-impact/user-mapping/management-and-procurement.html
activities/value-and-impact/user-mapping/political.html
activities/value-and-impact/user-mapping/senior-civil-servants.html
activities/value-and-impact/user-mapping/structural-funding-philanthropy.html
activities/workshops/governance-exercise.html
activities/workshops/governance-game.html
activities/workshops/governance-game/index.html
activities/workshops/governance-game/session-proposal.html
activities/workshops/run-governance-game-workshop.html
feed.xml
glossary/general-public-definition.md
glossary/open-source-definition.md
glossary/open-standard-definition.md
glossary/public-member-definition.html
glossary/readme.md
members/index.html
organization/annual-reports/images/ar-19-20-b01.jpg
organization/annual-reports/images/openzaak-community-wave.gif
organization/annual-reports/index.html
organization/data-processing-tools.html
organization/finance-updates/index.html
organization/measurable-goals.html
redirects.json
roles/community.html
roles/index.html
roles/intern.html
roles/product-marketing.html
roles/quality.html
roles/support.html
script/check-new-links.sh
script/find-missing-spdx.sh
script/find-unlinked-files.sh
script/serve.sh
script/test-markdown.sh
script/test-with-link-check.sh
script/test-without-link-check.sh
script/test.sh
sitemap.xml
staff-management/expense.html
staff-management/index.html
staff-management/leave.html
staff-management/parental-leave.html
staff-management/remote-working.html
staff-management/sickness.html
staff-management/travel.html
stewardship-badges/stewardedbadge.svg
stewardship-badges/stewardedbadge_2x.png
Granted, some of these we probably should tell jekyll to exclude (like the scripts) and we could certainly make a pass-list for the rest, however I wonder if that is more maintenance than we wish to bother with.
The script I used: https://gist.github.com/ericherman/4a25aae0ef862ec3fc04e30aaf233a69
Think I found an unlisted page #1404, so might indeed be relevant to set up some kind of checking
On https://about.publiccode.net/activities/ we list all our activities. In order to not miss any, perhaps we could add something to the front matter of an activity that identifies it as such so that we could generate the list automatically when we build. That way, there is one less thing to think of when adding or removing activities.