Hugothemes: Theme submission: PaperMod

Created on 28 Aug 2020  路  14Comments  路  Source: gohugoio/hugoThemes

Theme submission: PaperMod

Link to my theme repository: https://github.com/adityatelange/hugo-PaperMod

I made sure that...

  • [x] the repository contains a good README.md describing my theme and details in Wiki section
  • [x] an open source license has been added to LICENSE
  • [x] all metadata have been added to theme.toml
  • [x] screenshots have been added in the images/ folder with the required dimensions
  • [x] in case I'm using a customized demo via the exampleSite branch that
  • [x] I tested my theme against the gohugoio/HugoBasicExample

    • [x] I've checked the developer tools' console in my browser for error messages

  • [x] in case my theme is using Hugo Pipes features like toCSS and PostCSS that I have committed the /resources directory with all generated assets, for my theme to work in the basic version of Hugo

Link to my Twitter account (optional): adityatelange

Let me know if I have missed something

Most helpful comment

Your theme is already live on Hugo's theme site. Next, I'll promote your theme on Hugo's official Twitter account.

All 14 comments

@digitalcraftsman can you please review theme PaperMod ? Let me know if I have missed something = )

Hello Aditya,

thank you for sharing this theme with the Hugo community. Your theme builds fine and content files provided by https://github.com/gohugoio/HugoBasicExample itself have been rendered. They're however not listed on the homepage or under similar pages such as /tags/.

They're however not listed on the homepage or under similar pages such as /tags/.

This is because the posts should be under content/posts directory to be displayed (separating from other pages such as archives, about, etc) but HugoBasicExample's posts are located in content/post .

In the current state your theme can't be rendered by the hugoBasicExample due to the assumption about the "posts" content type and a missing config file. The config options to your theme are very custom and can't / should'nt be predicted by the config file provided by the hugoBasicExample.

By accident I noticed the exampleSite branch in the theme repo. However, it refers to a two months old commit / version of your theme. I assume that you would rather want to showcase a more up to date version of your theme on www.themes.gohugo.io.

Hence I created a fork of your theme and modified your theme slightly. The modifications are explained in more detail in https://github.com/digitalcraftsman/hugo-PaperMod/commit/88bf9e210655bbddb70a1df36e3ea15973f30b1a.

The modifications make your theme more flexible for users by lifting the constrain about the assumed "posts" content type. Furthermore, by utilizing .site.Params.mainSections the hugoBasicExample works without problems. The exampleSite folder on the exampleSite brach works as well. Last but not least an issue with menu links has been fixed.

While testing the refactoring I didn't note any unintended changes to your theme. I suggest to incorporate the modifications of my aforementioned commit into your theme.

@digitalcraftsman Thank you for helping me with this :)

Also should I add exampleSite as a _submodule_ pointing to branch exampleSite, here https://github.com/adityatelange/hugo-PaperMod/tree/exampleSite , for https://github.com/digitalcraftsman/hugo-PaperMod/commit/88bf9e210655bbddb70a1df36e3ea15973f30b1a#diff-991d2a2fe208cdee83955ad6e9a323a7 ?

[submodule "exampleSite"]
    path = exampleSite
    url = https://github.com/adityatelange/hugo-PaperMod.git
        branch = exampleSite

By accident I noticed the exampleSite branch in the theme repo. However, it refers to a two months old commit / version of your theme. I assume that you would rather want to showcase a more up to date version of your theme on www.themes.gohugo.io.

and I have updated that too

Also should I add exampleSite as a submodule pointing to branch exampleSite, here https://github.com/adityatelange/hugo-PaperMod/tree/exampleSite , for digitalcraftsman/hugo-PaperMod@88bf9e2#diff-991d2a2fe208cdee83955ad6e9a323a7 ?

I'm not a 100% sure what you mean above.

Which branch of your repository would like to have as a source for the theme demo on www.themes.gohugo.io? The master or exampleSite branch?

The master branch is only a missing a config file provided by you located at exampleSite/config.toml. There's no need to add extra stuff in the exampleSite folder since the hugoBasicExample provides the rest.

Alternatively, we could choose the exampleSite branch as source. Then it would be used both for your demo (gh-pages branch) and for the demo on www.themes.gohugo.io. A config file is already present here. But you should update the submodule for the theme again in order to use the modifications made in https://github.com/adityatelange/hugo-PaperMod/commit/ab14f2f2753e33063f57d9cf664b81b22c28affe.~~

In either case please remove the leading slashes in the urls for the menu links. The reason for this is stated in the commit description of https://github.com/digitalcraftsman/hugo-PaperMod/commit/88bf9e210655bbddb70a1df36e3ea15973f30b1a.

Alternatively, we could choose the exampleSite branch as source. Then it would be used both for your demo (gh-pages branch) and for the demo on www.themes.gohugo.io.

Yeah that would be great !

A config file is already present here. But you should update the submodule for the theme again in order to use the modifications made in adityatelange/hugo-PaperMod@ab14f2f.

Okay I'll do that.
However what if when the bot updates all themes, git submodule update --remote --merge could be used to automatically pull the submodule's latest commit. What do you think ?

I do it here, so that i need not update the submodule in git repo, the build script pulls it while building into gh-pages


In either case please remove the leading slashes in the urls for the menu links. The reason for this is stated in the commit description of digitalcraftsman/hugo-PaperMod@88bf9e2.

Yes. Done

Alternatively, we could choose the exampleSite branch as source. Then it would be used both for your demo (gh-pages branch) and for the demo on www.themes.gohugo.io.

I have not thought this through. The build script for the Hugo theme site expects that the linked repository contains a theme, thus resembling the directory structure of the master branch. E.g. the build script expects theme theme.toml file and the images directory to be present in the root directory.

The exampleSite branch however doesn't follow this directory layout. In #908 there as a discussion to use a different branch than master as source. But this approach involved the duplication of files and keeping them in sync.

Contraint: at the end I need the directory structure of the master branch. I thought about using submodules / subtrees to add the files from the master branch to the root directory of the exampleSite branch. But submodules / subtrees require a prefix so that I can add them only in a subdirectory, i.e. ./hugo-PaperMod/. This however contradicts the aforementioned contraint. Using symbolic links to point to files in ./hugo-PaperMod/, e.g. ./theme.toml -> ./hugoPaperMod/.theme.toml doesn't work either because Hugo doesn't follow symbolic links (for security reasons I guess).

The only options I see for now are

a) we use the master branch and add a config file at exampleSite/config.toml
b) we follow the approach in #908 in
c) your theme will be added and no demo will be hosted on www.themes.gohugo.io. Instead the demo you're already hosting will be linked. It would look like this: https://themes.gohugo.io/hugo-geekdoc. This way you've complete control over the demo, its source files and you're not bound to any constraints of our build script.

I understood what you're trying to explain.
I would like to choose option c) and use the demo generated by gh-pages.

Your theme is already live on Hugo's theme site. Next, I'll promote your theme on Hugo's official Twitter account.

@digitalcraftsman Is there any way we could add Homepage like on https://themes.gohugo.io/hugo-profile/
for PaperMod ?
https://adityatelange.github.io/hugo-PaperMod/ could be the Homepage.

Hello @adityatelange,

Is there any way we could add Homepage like on themes.gohugo.io/hugo-profile
for PaperMod ?
adityatelange.github.io/hugo-PaperMod could be the Homepage.

Could you explain in more detail what you mean with "homepage" and how it relates to www.themes.gohugo.io/hugo-profile?

The Hugo theme site already links to https://adityatelange.github.io/hugo-PaperMod/ for the demo of your theme.

Could you explain in more detail what you mean with "homepage" and how it relates to www.themes.gohugo.io/hugo-profile?

The Hugo theme site already links to https://adityatelange.github.io/hugo-PaperMod/ for the demo of your theme.

@digitalcraftsman

https://themes.gohugo.io/hugo-profile/ has 3 buttons
image

of which Homepage links to theme's demo website hosted on netlify https://hugo-profile.netlify.com/

Can we add this on https://themes.gohugo.io/hugo-papermod/,
linking Homepage to https://adityatelange.github.io/hugo-PaperMod/ ?

Thanks for the clarification. All you have to do is to change the homepage variable in PaperMod's theme.toml file. Your change will be applied with the next build of the Hugo theme, which happens automatically every three days.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spech66 picture spech66  路  3Comments

sakibccr picture sakibccr  路  6Comments

heyarviind picture heyarviind  路  7Comments

DirtyF picture DirtyF  路  7Comments

onedrawingperday picture onedrawingperday  路  7Comments