Building an academic web site with Hugo

Create the web site

Find errors

If there are errors, run on command line hugo -v in the root of the web site * If there is no error, the site should compile and give the stats of the site * If there is an error then hugo will point to the file that causes problem (and the line) with a description (sometimes cryptic) of the error * In this case, the error was caused by a missing comma between two tags (keywords)

Images

  • Images for project vignettes are 150 px high

  • Customize the header image size to 800 px by using the a custom css copied to /static/css/ and modifying the config.toml. This template needs only to contain the code that has been changed in my case:

    img,
    video {
    height: auto;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    }
    
  • Add these lines to config.toml console [permalinks] post = "/:year/:month/:day/:slug"
    • Add at top of blog entry (change web-site to whatever) console slug: "web-site"

Bibliography imported from Mendeley

  • In Mendeley export using bibtex style (do not use the bibtex export because this will result in escaped caracters that do not work)

  • Use function from Lorenzo to import the bibtex file and trasnform to MD files.

  • Must correct quite a few things before however

    1. change bibtex reference name that may contain space or other characters causing problems for import

    2. change accentuated characters

    3. remove {} that are around composite names

    4. In the bibtex_2academic comment out lines that correspond to field that do not exist (e.g. for submitted)

    5. Add tags and projects

    6. Add abstracts and short abstracts (short abstracts are need for the home page)

    7. Add images

  • There is also a special library recently developped for R devtools::install_github("petzi53/bib2academic", build_vignettes = TRUE) - See https://github.com/gcushen/hugo-academic/issues/146

Rmd files

There is definite problem with Rmd files.

1. Include in the header the R code below

2. They need to be knitted to an html file  

3. At each knitting iteration the yaml header is added again and again....

4. Still not working... so stick with md files...  
        output:
           blogdown::html_page