The VMware Tanzu Developer Center uses Hugo to build the site from Markdown files. You'll need to get Hugo if you want to build and run the site locally.
To install the latest version of hugo
you can use brew install hugo
if you are on a Mac. However, this site currently requires a specific version (0.69.2) to build successfully. To install this version of hugo
, use one of the following two commands:
Using brew
:
wget "https://github.com/Homebrew/homebrew-core/blob/5c50ad9cf3b3145b293edbc01e7fa88583dd0024/Formula/hugo.rb"
brew install hugo.rb
# To keep this version around if you upgrade
brew pin hugo
Or to directly download:
wget "https://github.com/gohugoio/hugo/releases/download/v0.69.2/hugo_extended_0.69.2_Linux-64bit.tar.gz"
tar -zxvf "hugo_extended_0.69.2_Linux-64bit.tar.gz"
mv ./hugo /usr/local/bin/
Now you're ready to build locally:
git clone https://github.com/vmware-tanzu-private/tanzu-dev-portal
cd tanzu-dev-portal
git submodule update --init --recursive
hugo server
You may wish to explicitly set baseURL
to http://localhost:1313/developer in order to mimic what happens in production at https://tanzu.vmware.com/developer. Use the following command to do this:
hugo server -b http://localhost:1313/developer
Note: requires Docker to be running (On Mac OS X requires Docker Desktop 2.4 or newer)
- Install act (
brew install act
) - Run
act pull_request
After running and testing locally, opened Pull Requests will be automatically staged by Netlify.
You may contribute content by creating a branch (or fork) and submitting a pull request. Content should be written in Markdown with metadata included in the front matter. Here are some guidelines to get you started:
You can use the Archetypes feature of Hugo to create new content as follows:
Use one of the following commands to create either a "What Is...?" or "Getting Started" guide. Guides should be written in second person (the "you" voice).
hugo new guides/spring/spring-boot-what-is.md -k guide-what-is
hugo new guides/spring/spring-boot-gs.md -k guide-gs
The following command will create a blog post. Blog posts require a title, date, and author (see more about authors in the Taxonomy section above). If you use a future date for publishing, you will need to use the -F
flag to see the post when running hugo
or hugo server
to build the site on your local machine.
hugo new blog/my-post.md -k blog-post
The following command will create a code sample. Along with a title, description, and other taxonomy metadata in the front matter, code sample pages require the full URL to a public GitHub repository in the repo
parameter and a boolean value for readme
that will determine whether to fetch (at build-time) and render the README content from that repo (true
) or to render the content of the page itself instead (false
).
hugo new samples/my-sample.md -k sample
Your video should be uploaded to the VMwareTanzu YouTubechannel first. For help with this reach out in the #tanzu-dev-portal channel. Once on YouTube, run the following command and make sure to set youtube_id
in the front matter to the string that appears after /watch?v=
in the video's URL, along with a title, description, and other taxonomy metadata.
hugo new videos/my-video.md -k video
All images are stored under static/images
. Images should be placed in the directory that matches the content that they'll be displayed in (ie. a Spring guide would have images in static/images/guides/spring
). Finally, an image placed in diagrams
will have a border added around it for visibility. If the image is not a diagram, they should be placed in screenshots
.
Hugo defines Taxonomies that may be used in the front matter of Markdown documents. This site uses the following taxonomies
Use the team
taxonomy to attribute one or more authors to a piece of content.
Topics should always be included in the topics
section of the front matter, must be one of the following options and must appear exactly as follows:
- Agile
- CI-CD
- Containers
- Event Streaming
- Kubernetes
- Messaging and Integration
- Microservices
- Python
- Reactive
- Serverless
- Spring
Patterns may be added in a patterns
section of the front matter and must refer to the title of an existing section within the patterns
directory under content
.
Tags may appear in a tags
section of the front matter. Usually tags refer to a specific technology within a topic such as Spring Boot
within Spring
.
Content may be tagged as featured: true
along with a weight
in the front matter to appear in the Featured section on the home page. Only three will appear at once.
Hugo allows the use of shortcodes in Markdown files to render specific templates for content like YouTube videos and Tweets. Use them as follows to add to your content.
{{< youtube id="YOUR_VIDEO_ID" class="youtube-video-shortcode" >}}
YOUR_VIDEO_ID
should be replaced with the 11-character GUID from your video which appears after the ?v=
parameter in the URL. Please be sure to include the class as shown.
{{< tweet YOUR_TWEET_ID >}}
YOUR_TWEET_ID
should be replaced with the ID that appears after /status/
in the tweet's URL.
- For an – (--) use two hyphens in a row
- For an — (---) use three hyphens in a row