Hugo rendering not properly rendering markdown in {{ .Summary }} on Github pages but is rendering it properly on localhost

I recently created a new hugo theme (here is a link to the repo GitHub - kishenarayan/drishtikon) and I have successfully been able to use it as a submodule for the theme of my personal blog (which I am hosting through github pages linked here: https://kishenarayan.github.io/).

The main issue is that when I use hugo server to see my site on localhost, the links on the writing page under research to ArXiv and Google Scholar render as links. These links are the summary for a project which is written in markdown (you can find the file in content/writings). However, when I then push the changes to github and deploy using github pages, none of the markup which was defined in the markdown files comes through. I have attached the images below of this discrepancy.


Here is what it should look like and what is being shown in the localhost.


Here is what I am seeing on github pages.

When browsing through past topics, I first thought it was a CRLF vs LF issue, but after changing those settings on my editor (I am using IntelliJ IDEA Community Edition on a Windows laptop), nothing changed. Any ideas on how to resolve this?

Your github action builds with v0.128.0, so the .Summary returns plain text.
guess you are building locally with a more recent version.

HTML rendering has been added in v0.134.0

update your github action to use the same version you use in development.

Some other things:

  • don’t use quotes in markdown links: [ArXiv]("https://arxiv.org/") instead use: [ArXiv](https://arxiv.org/)
  • you have content in repo and theme (dunno if that’s for testing but usually your theme should not have a content folder) → move needed content from theme to content repo
  • using github actions to build and publish, there’s no need (and it may have unexpected results) to commit public, resources, … and others
    I would cleanup that in both the content and the theme repo
    git rm -rf public/   
    git rm -rf resources/*   
    git rm .hugo_build.lock
    
    create or add this to your .gitignore (both repos) (typical content for hugo)
    .hugo_build.lock
    node_modules/
    public/
    resources/
    
    commit and push (both repos)
    git add -A
    git commit -m "cleanup build generated stuff"
    git push
    
1 Like

Thank you so much! This resolved my issue.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.