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

Add slug check #831

Merged
merged 6 commits into from
Jul 10, 2024
Merged

Add slug check #831

merged 6 commits into from
Jul 10, 2024

Conversation

froggleston
Copy link
Contributor

@froggleston froggleston commented Jun 27, 2024

Currently when building a workshop website, there is no check to validate a repository name as a slug. This PR adds a check that will fail if the repo name does not match YYYY-MM-DD-[site][-format] if the carpentry specified in the _config.yaml is one of our official lesson programs. This will mean the workshop website will fail to build completely, and the user is guided to rename their repo in the Settings menu.

When using cp or incubator as the carpentry option, the check will only warn about the slug as this could be an incubator lesson-based workshop.

@froggleston
Copy link
Contributor Author

For added context, carpentries/styles#551 should no longer apply - this template should only now be used for workshop websites and not lessons.

@tobyhodges
Copy link
Member

@froggleston thanks for contributing this. The equivalent check should also be added to https://github.com/carpentries/training-template/, I think?

@froggleston froggleston closed this Jul 9, 2024
@froggleston froggleston reopened this Jul 9, 2024
Copy link

netlify bot commented Jul 9, 2024

Deploy Preview for workshop-template-previews ready!

Name Link
🔨 Latest commit cc0987e
🔍 Latest deploy log https://app.netlify.com/sites/workshop-template-previews/deploys/668e7b401021ed0008cd5110
😎 Deploy Preview https://deploy-preview-831--workshop-template-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@froggleston
Copy link
Contributor Author

cp carpentries workshops can be used for incubator workshops, which may or may not have a valid slug. So, when using cp give a warning if the slug isn't valid, but do not fail.

@froggleston
Copy link
Contributor Author

@froggleston thanks for contributing this. The equivalent check should also be added to https://github.com/carpentries/training-template/, I think?

Yup, I'll work on this tomorrow!

Copy link
Member

@tobyhodges tobyhodges left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @froggleston 🙌

@froggleston froggleston merged commit a3ecbdc into gh-pages Jul 10, 2024
6 checks passed
@froggleston froggleston deleted the frog-slugcheck-1 branch July 10, 2024 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants