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

Upgrade Hugo to 0.87.0, and netlify-cli to v6 #440

Merged
merged 1 commit into from
Aug 14, 2021

Conversation

chalin
Copy link
Contributor

@chalin chalin commented Aug 14, 2021

The following two features impact the page generation:

Modulo the changes induced by these two features, whitespace and date/time stamps, the generate site files contain only one diff:

--- a/blog/index.html
+++ b/blog/index.html
@@ -59,7 +59,7 @@
 				
 				
 				
-				<a class="nav-link active" href="/blog/" ><span class="active">Blog</span></a>
+				<a class="nav-link" href="/blog/" ><span>Blog</span></a>
 			</li>
 			
 			<li class="nav-item mr-4 mb-2 mb-lg-0">

Which is a bug, but this allowed me to note that we already had this bug, it's just now being more consistently applied -- i.e., the Blog top-nav entry isn't being shown as active when it should. For details, see #443.

@chalin chalin marked this pull request as draft August 14, 2021 16:50
@chalin chalin force-pushed the chalin-hugo-0.87.0-2021-08-14 branch from 45cb236 to 8c9252b Compare August 14, 2021 17:24
@chalin chalin added the infrastructure Categorizes issue or PR as related to site infrastructure. label Aug 14, 2021
@chalin
Copy link
Contributor Author

chalin commented Aug 14, 2021

This is the normalization script I used:

#!/bin/bash
#
# Make HTML files easier to diff.

set -x

pushd public

# Hugo version

find . -type f -name "*.html" \
     -exec perl -pi -e 's|<meta name="generator" content="Hugo .*?" />|<meta name="generator" content="Hugo X.Y.Z" />|' {} \;

# Ensure <meta ...> are on their own line
#
# Note: The while loop is necessary because s///g iterates only on the rest of the line, not the matched pattern (which is what we need).

find . -type f -name "*.html" \
    -exec perl -pi -e '1 while s|>(<meta [^>]+>)|>\n$1|g' {} \;

# Meta date or time

find . -type f -name "*.html" \
    -exec perl -pi -e 's!(<meta \w+="[^"]*(date|time).*?" content=").*?(" />)!$1HTML_NORMALIZED$3!' {} \;

# This is only for Hugo 0.86

# Strip all render-link hook additions

find . -type f -name "*.html" \
    -exec perl -pi -e 's| target="_blank" rel="noopener"||g' {} \;

# This is only for Hugo 0.87

find . -type f -name "*.html" \
    -exec perl -pi -e 's|pre tabindex="0"|pre|' {} \;

popd

@chalin chalin force-pushed the chalin-hugo-0.87.0-2021-08-14 branch from 8c9252b to 227d6e1 Compare August 14, 2021 18:49
@chalin
Copy link
Contributor Author

chalin commented Aug 14, 2021

Since this PR isn't introducing any new issues, I'm going to merge now. We can then address #443 for all top-nav entries.

/cc @nate-double-u

@chalin chalin marked this pull request as ready for review August 14, 2021 18:52
@chalin chalin merged commit dfe9342 into main Aug 14, 2021
@chalin chalin deleted the chalin-hugo-0.87.0-2021-08-14 branch August 14, 2021 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Categorizes issue or PR as related to site infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant