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 a test for "index.md" frontmatter and fix the repo to match #2377

Merged
merged 11 commits into from
May 15, 2020

Conversation

evankanderson
Copy link
Member

Hugo expects page bundles to have an _index.md or index.md file, but GitHub expects README.md. Until gohugoio/hugo#4691 is fixed (still in flight, negotiating with hugo owner), it seems simplest to simply create index.md files for these leaf bundles with appropriate frontmatter and a {{% readfile file="README.md" %}} shortcode.

Proposed Changes

  • Migrates frontmatter in about 50 directories into index.md files.
  • Adds the _index.html frontpage that is in the website, so that we can eventually stop copying the file during website build.
  • Adds a test to prevent backsliding

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Apr 9, 2020
@evankanderson
Copy link
Member Author

Here is a script which does not work for some cases which I used to start the conversion (just for reference):

#!/bin/bash

echo Working on $1

INDEX="${1%README.md}index.md"

awk '/^---/, /^$/' "$1" > "$INDEX"
echo '{{% readfile file="README.md" %}}' >> "$INDEX"

awk '/^---/, /^$/ {next}; {print}' "$1" > "$1.tmp" && mv "$1.tmp" "$1"

echo Wrote $INDEX and $1

@evankanderson
Copy link
Member Author

Verified TestHugoBundles is run, will fix the markdown issue.

@evankanderson
Copy link
Member Author

The test failure is fixed by knative/test-infra#1898

evankanderson pushed a commit to evankanderson/docs that referenced this pull request Apr 9, 2020
knative-prow-robot pushed a commit that referenced this pull request Apr 10, 2020
@evankanderson
Copy link
Member Author

/retest pull-knative-docs-integration-tests

@evankanderson
Copy link
Member Author

/hold

I just found some odd rendering that I need to investigate.

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 10, 2020
@evankanderson
Copy link
Member Author

@evankanderson
Copy link
Member Author

/hold cancel

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 15, 2020
@evankanderson
Copy link
Member Author

/retest

@evankanderson
Copy link
Member Author

The rendering works with knative/website#161 merged and applied on the website side.

I'll still need to update the other branches after this before we can drop the find -exec if ... ; then mv ..., but this gets us closer.

@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 29, 2020
@abrennan89 abrennan89 requested review from abrennan89 and removed request for samodell May 15, 2020 15:27
@abrennan89
Copy link
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label May 15, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abrennan89, evankanderson

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants