Created
January 4, 2023 17:30
-
-
Save davidmlentz/1bd045d0dd8340900cf6ac3cc73fc73a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
THIS_YEAR=$(date "+%Y") | |
LAST_YEAR=$(($THIS_YEAR-1)) | |
# The path to where you checked out corp-hugo: | |
MY_USERNAME='david.lentz' | |
CORP_HUGO_PATH="/Users/$MY_USERNAME/corp-hugo/site" | |
# The slug of the report we're staging | |
SLUG='container-report' | |
echo "The following command will locate files that may contain links to last year's report. Run the command, then review each file and update links as necessary. For example, links that currently point to \"container-report\" may need to be updated to point instead to \"container-report-$LAST_YEAR\"." | |
echo "" | |
# Print a grep statement that'll find all the pages with links to '/$SLUG/': | |
echo "grep -Rl '\/$SLUG' $CORP_HUGO_PATH/content/en/* | sed -E 's/^(.*)\/content\/en\/(.*)\.md$/https:\/\/www.datadoghq.com\/\2\//g'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment