Portfolio mode
Projects, research with a PDF reader, articles, search and a timeline.
Portfolio mode turns the theme into a personal site. The demo shows all of it.
Set it up#
- In
content/_index.md, addportfolio: true,name,role,introand optionallyart,buttonsandnow. - Make three folders in
content/:projects,researchandarticles, each with an_index.mdholding a title and a one-line description. - Add
home = ["HTML", "JSON"]under[outputs]inhugo.toml, andsearch = trueunder[params]. This turns on search.
Projects#
A project is a folder with an index.md and an image called cover.svg, cover.png or cover.jpg.
| Field | What it does |
|---|---|
description | The line on the card and under the title |
year, status, role, stack | Shown in the facts row |
tags | Chips on the card and the page |
featured: true | Puts it on the home page |
links | A list of label and url pairs |
related | Pages this one connects to |
Research#
A paper is a folder with an index.md and a PDF. Name the PDF anything ending in .pdf.
| Field | What it does |
|---|---|
authors | A list of full names |
year, kind, venue, doi | Used in the facts row, the citation and the Google Scholar tags |
abstract | Shown on the page and in the search |
code | A link to the repository |
The page gets four things for free: the PDF reader, a Cite this paper box with BibTeX and plain text, Google Scholar tags in the page head, and a ScholarlyArticle record for search engines.
The PDF reader#
To put a PDF in any page, use the shortcode with the file name of a file in the same folder, or a full address:
{{< pdf src="paper.pdf" title="The paper" >}}
The reader loads pdf.js from your own site, only on pages that have a PDF. It shows pages as you scroll to them, lets you select text, zoom and jump to a page, and always leaves a download button.
Articles#
An article is a Markdown file in articles/ with a title, a description, a date and optional tags. The page shows the reading time and a thin progress bar.
Connected work#
List other pages in related, like research/my-paper or projects/my-project. Each page shows the pages it points to and the pages that point back at it, under Connected work.
Footer, colours and search#
| Setting | What it does |
|---|---|
params.palette | jade, clay, ink or sea |
params.paletteSwitcher | Shows colour squares in the footer so visitors can pick |
params.footer | A headline, a line of text, a button and columns of links |
params.search | Adds a search button and the / shortcut |
Dark mode follows the visitor’s device. Printing a page hides the menus and buttons and shows each link’s address.