Giter VIP home page Giter VIP logo

hugo-theme-mini's Introduction

Hugo Theme Mini

English | 简体中文

A fast, minimalist and responsive hugo theme.

./images/screenshot.png

Features:

  • Fast
  • Minimalist
  • Responsive
  • Archive
  • Tags

1. Installation

1.1 As a Hugo Module (recommended)

⚠️ If you installed a Hugo binary, you may not have Go installed on your machine. To check if Go is installed:

$ go version

Go modules were considered production ready in v1.14. Download Go.

  1. From your project's root directory, initiate the hugo module system if you haven't already:

    $ hugo mod init github.com/<your_user>/<your_project>
  2. Add the theme's repo to your config.yaml:

    theme: 
       - github.com/nodejh/hugo-theme-mini

1.2 As Git Submodule

  1. Inside the folder of your Hugo site run:

    $ git submodule add https://github.com/nodejh/hugo-theme-mini.git themes/mini
  2. Add the theme's directory to your config.yaml:

    theme: mini

For more information read the official setup guide of Hugo.

2. Getting started

After installing the theme successfully it requires a just a few more steps to get your site running.

2.1 The config file

Take a look inside the exampleSite folder of this theme. You'll find a file called config.yaml. To use it, copy the config.yaml in the root folder of your Hugo site. Feel free to change the strings in this theme.

⚠️ You may need to delete the line: themesDir: ../../

2.2 Default Content Language

You can set default content language by defaultContentLanguage:

defaultContentLanguage: en

Default is en. Now support:

  • en: English
  • zh: Chinese
  • nl: Dutch
  • fr: French
  • es: Spanish
  • da: Danish

More about multiple languages: Multilingual Mode.

2.3 Add Comments

To enable comments, add following to your config file:

  • Disqus shortname: disqusShortname: your-disqus-shortname

  • Enable Comment:

    params:
      enableComments: true

2.4 Google Analytics

To enable google analytics, add following to your config file:

  • Google Analytics ID: googleAnalytics: your-google-analytics-id

  • Enable Google Analytics:

    params:
      enableGoogleAnalytics: true

2.5 Logo and favicon

You can replace the log in the top of each page and favicon with your own images. To do that put your own logo and favicon into the images directory of your website static directory, then named them avatar.png and favicon.ico. For example:

- content
- static
└── images
    ├── avatar.png
    └── favicon.ico

2.6 Nearly finished

In order to see your site in action, run Hugo's built-in local server.

$ hugo server

Now enter http://localhost:1313 in the address bar of your browser.

2.7 Production

To run in production (e.g. to have Google Analytics show up), run HUGO_ENV=production before your build command. For example:

HUGO_ENV=production hugo

Note: The above command will not work on Windows. If you are running a Windows OS, use the below command:

set HUGO_ENV=production
hugo

3. Optional Configuration

3.1 Table of Content

To enable table of content, you could set showToc to true.

For example:

showToc: true

3.2 Disable Comments on a single post

You can set enableComments to false in front matter to disable disqus comments on a single post.

For example:

---
title: Some title
enableComments: false
---

3.3 Custom CSS and JS

You can put your custom css and js files to static directory, or use remote css and js files which start with http:// or https://.

For example:

customCSS:
  - css/custom.css # local css in `static/css/custom.css`
  - https://example.com/custom.css # remote css
customJS:
  - js/custom.js # local js in `static/js/custom.js`
  - https://example.com/custom.js # remote js

3.4 Math Typesetting

Mathematical notation is enabled by KaTeX.

  • To enable KaTex globally set the parameter math to true in project’s configuration
  • To enable KaTex on a per page basis include the parameter math to true in content files

3.5 Hidden Post Summary in Home Page

To hidden post summary in home page, you could set hiddenPostSummaryInHomePage to true, default is false.

For example:

hiddenPostSummaryInHomePage: true

License

MIT

hugo-theme-mini's People

Contributors

acpmasquerade avatar bdhu avatar betner avatar chalkpe avatar deining avatar digitalblossom avatar dotkarl avatar dvejmz avatar eddturtle avatar henrikhoyer avatar hezhizhen avatar himanshu54 avatar iooner avatar josephearl avatar kamomechan avatar kevinjiao avatar localmin avatar masato-hi avatar mdogucu avatar mfridman avatar nindalf avatar nodejh avatar sornars avatar suhjohn avatar tommorris avatar v-zhuravlev avatar wwsean08 avatar yihui avatar yoric avatar zzh8829 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hugo-theme-mini's Issues

Better Post Description

Hello,

based on https://yihui.name/en/2017/08/hugo-post-summary/ I changed \layouts\partials\post_list.
This results in a more natural feeling description of the single posts if no manual description can be found.

The length of the single posts can be changed inside the config via summary_length.


<ul id="post-list">
   {{ range where .Paginator.Pages "Params.hidden" "ne" "true" }}
   {{ $url := replace .Permalink .Site.BaseURL "" }}
       {{ if ne $url "about/" }}
           <li>
               <aside class="dates">{{ .Date.Format "Jan 2" }}</aside>
               <a href='{{ .Permalink }}'>
                   {{ .Title }}
   				
                   {{ if .Site.Params.enableSummary }}
   	         {{ with .Description }}
   			{{ $.Scratch.Set "summary" (markdownify .) }}
   		{{ else }}
   			{{ $.Scratch.Set "summary" ((delimit (findRE "(<p.*?>(.|\n)*?</p>\\s*)+" .Content) "[&hellip;] ") | plainify | truncate (default 200 .Site.Params.summary_length) (default " &hellip;" .Site.Params.text.truncated ) | replaceRE "&amp;" "&" | safeHTML) }}
   		{{ end }}
   		<h2>{{ $.Scratch.Get "summary" }}</h2>
                   {{ end }}
               </a>
           </li>
       {{ end }}
   {{ end }}
</ul>

Before
image

Afterwards
image

Incorrect ordering of blog posts on index.html

The blog posts on the home page (index.html) are ordered by day of the year, but not by year. If you change one of your example blog posts to be in year 2017, for example, you will see it mixes the years. This is not a problem on the archive page though.

Failed to deploy with Netlify as submodule

First of all, thanks a lot for this very nice theme.

I try to install the theme as a submodule, in order to use deployment with netlify. But it failed at deployment.

I let you some output from netlify log

7:44:29 PM: Error: Unable to find theme Directory: /opt/build/repo/site/themes/hugo-theme-cactus-plus
7:44:29 PM: [18:44:29] 'build' errored after 35 ms
7:44:29 PM: [18:44:29] Error: Hugo build failed
7:44:29 PM: at formatError (/opt/build/repo/node_modules/gulp/bin/gulp.js:169:10)
7:44:29 PM: at Gulp. (/opt/build/repo/node_modules/gulp/bin/gulp.js:195:15)
7:44:29 PM: at emitOne (events.js:96:13)
7:44:29 PM: at Gulp.emit (events.js:188:7)
7:44:29 PM: at Gulp.Orchestrator._emitTaskDone (/opt/build/repo/node_modules/orchestrator/index.js:264:8)
7:44:29 PM: at /opt/build/repo/node_modules/orchestrator/index.js:275:23
7:44:29 PM: at finish (/opt/build/repo/node_modules/orchestrator/lib/runTask.js:21:8)
7:44:29 PM: at cb (/opt/build/repo/node_modules/orchestrator/lib/runTask.js:29:3)
7:44:29 PM: at ChildProcess. (/opt/build/repo/gulpfile.babel.js:85:7)
7:44:29 PM: at emitTwo (events.js:106:13)
7:44:30 PM: npm
7:44:30 PM: ERR! Linux 4.4.86+
7:44:30 PM: npm ERR! argv "/opt/buildhome/.nvm/versions/node/v6.11.1/bin/node" "/opt/buildhome/.nvm/versions/node/v6.11.1/bin/npm" "run" "build"
7:44:30 PM: npm ERR! node v6.11.1
7:44:30 PM: npm ERR! npm v3.10.10
7:44:30 PM: npm ERR! code ELIFECYCLE
7:44:30 PM: npm ERR! [email protected] build: gulp build
7:44:30 PM: npm ERR! Exit status 1
7:44:30 PM: npm ERR!
7:44:30 PM: npm ERR! Failed at the [email protected] build script 'gulp build'.
7:44:30 PM: npm ERR! Make sure you have the latest version of node.js and npm installed.
7:44:30 PM: npm ERR! If you do, this is most likely a problem with the victor-hugo package,
7:44:30 PM: npm ERR! not with npm itself.
7:44:30 PM: npm ERR! Tell the author that this fails on your system:
7:44:30 PM: npm ERR! gulp build
7:44:30 PM: npm ERR! You can get information on how to open an issue for this project with:
7:44:30 PM: npm ERR! npm bugs victor-hugo
7:44:30 PM: npm ERR! Or if that isn't available, you can get their info via:
7:44:30 PM: npm ERR! npm owner ls victor-hugo
7:44:30 PM: npm ERR! There is likely additional logging output above.
7:44:30 PM: npm ERR! Please include the following file with any support request:
7:44:30 PM: npm ERR! /opt/build/repo/npm-debug.log
7:44:30 PM: Caching artifacts

As a workaround I download the theme manually, and it work this way to deployed

All the best,
Hugues

关于文章导航的建议

文章开头的导航建议做成菜单悬浮,加一个返回顶部的按钮这样对阅读会更友好一点,不知道您是否认同我的观点

Failed to initialize github pages

Failed to initialize github pages

I got this error when I initialize this theme.
I've added this theme as submodule, but I faced this warning.

Your site is having problems building: The tag image on line 136 in themes/hugo-theme-cactus-plus/exampleSite/content/posts/migrate-from-jekyll.md is not a recognized Liquid tag. For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error/.

default

How can I solve this error? I need some help.

Having some trouble changing the avatar...

Hey there,

I've tried a handful of things but have had no success changing the avatar for my site. Only way I've been able to stably change it is locally, adding my desired image to the themes/hugo-theme-cactus-plus/static/images, and duplicating it, renaming both files as the avatar and avatar retina pngs.

I'm not using twitter integration, also.

So any idea how to reliably change my site's avatar? Any help would be much appreciated.

Template Customization

Hi @nodejh ,

Thanks a ton for creating this beautiful template. I'm simply in love.

I need to customize the template.

  1. How do I display post excerpts of posts on home page?
  2. What's the cost for tags page?
  3. How to add "about" under a post?

You may find more appropriate to update the theme 'docs' file with such general thingies.

Thank you!

Is there a way of making the content layout wider?

Hello,
Thanks for opening-source this theme. It is really nice!
I'm trying to make the content layout wider. I feel like the white spaces on both sides are too wide. Is there a way of reducing the white space? Thank you!

Template does no longer render /posts path

commit ID 5c83c15

The file /layouts/partials/nav.html contains this snippet:

<a href='{{ .Site.BaseURL }}posts'>{{ with .Site.Params.archive }}{{ . }}{{ else }}Archive{{ end }}</a>

It seems the /posts path is no longer rendered by the template though. When I click the link I get a 404 error.

/post works though, but I can't override it in the config due to its static nature ;)

Really love this theme

I am a real Hugo newbie and have been really enjoying setting up a blog using this theme. I have a really dumb question, hopefully someone will be willing to take a moment to answer it: I can't figure out how to change to the appearance in my site to what is seen in the example front page which shows both the subject line and a bit of sample text, whereas the default has a really big font for the list of posts and no text; even just being able to reduce the default font size would be great! Thanks for your patience :-)

excerpt enable/disable switch

me again :) . I really like that you still improve on the theme (I thought it was dead for a while ...). still i liked it more without pst previews on the main page, could you add an enableFrontPagePreview parameter (or something similar) which toggles them? (still loving the theme though)

Trying to add more pages

Hi!

Is it possible to add custom pages to my Hugo blog using this theme? Just like the "Projects" page on http://nodejh.com/. Is that easily possible or is it more of a hack?

I've tried copying the content/about directory to content/projects and adding projects = "" to the navigation links in config.toml, but that didn't help.

Thank you!

"Subscribe" doesn't work - any idea?

I love this theme. Kudos to @nodejh - thanks a lot for taking time and putting this together. Really easy to use and without having programming background, I was able to just build the website pretty quickly which was amazing for me.

I have a question around Subscribe button - is there a way to make it work or should I just delete it from config.toml?

Archive page not updating

Dear nodejh
Thanks very much for creating this theme. I very much like its appearance and the ease of navigation and use by visitors. Well done!

I would like to have the Archive page/section update. All the posts on that page are from 2019 and are of format '.md'. They are also found in the posts directory.

I migrated to this theme a week ago, and have some posts from 2020. They have the extension .Rmd. After build_sites is run, there is a matching html file. None of these are listed in the Archive page. Noteworthy also is that there are other default posts there in .md and they do not show in the Archive despite having a date in 2015.

Thanks for having a think about the issue. Glad to zip up the blog folder and send if that is useful.
David

.Now will be deprecated with Hugo v0.20

.Now will be deprecated replaced with the now template function in Hugo v0.20 which eventually will be released on Monday. It's likely that the deprecation will cause builds to fail.

Need to update the highlight.js

You should update the highlight.js for supporting the more languages. Current one does not support Go and other some langs.

Tag-cloud Taxonomy Base URL Issue

The /layouts/taxonomy/tag.terms.html file uses /tags/ prefix which breaks (HTTP 404) the tag-cloud links when using a baseURL such as "https://www.example.com/blog/" where tag links are then pointing to "https://www.example.com/tags/tag"

Removing the "/tags/" portion in my own layouts/taxonomy/tag.terms.html resolved the issue:

11c11
<                     <a href="/tags/{{ $name | urlize }}" rel="{{ len $taxonomy }}">{{ $name }}({{ len $taxonomy }})</a>
---
>                     <a href="{{ $name | urlize }}" rel="{{ len $taxonomy }}">{{ $name }}({{ len $taxonomy }})</a>

However now this is a relative link, not sure that is how you want to handle this. Thought I'd let you know though!

Ordered lists not rendered correctly

Cannot render an Ordered list with line breaks in between, or code snippets.

This:

1. One

2. Two

3. Three

Outputs this

1. 
One

2.
Two

3.
Three

My goal is to have some multi-line code inside each list item.
If I try to use this:

1. One<br><br>

/```
testing
some
code
/```

2. Two<br><br>
3. Three<br><br>

(added / on purpose so the code ticks are displayed)

I get

screen shot 2017-08-17 at 18 44 25

Which contains wrong numeration.

Staticman support

Hi,
Thank you for the amazing theme! It is well-designed and equipped with useful features 👏
The theme now only supports Disqus, I wonder if there's any possibilities to use staticman as comment-system in the future?
I tried to modify the current theme following https://gohugohq.com/howto/staticman-hugo-comment-system/ and the repo provided by staticman.
Unfortunately, I cannot make it work...😢
I found that Beautiful Hugo supports staticman, so it may be possible to integrate staticman with Hugo theme.
Disqus is easy-to-use, but I think staticman would be a good alternative for static websites!

From Hugo 0.24 this must be provided in the archetype file itself

$ hugo new post/blah.md WARNING: date and/or title missing from archetype file "/home/user/site/themes/hugo-theme- cactus-plus/archetypes/default.md". From Hugo 0.24 this must be provided in the archetype file itself, if needed. Example: +++ title = "{{ replace .TranslationBaseName "-" " " | title }}" date = {{ .Date }} draft = true +++

Tag page is missing?

I am using this theme for my personal website and I just noticed that all tag related pages (tag cloud and single tags) are not functional.

Furthermore the pages mentioned in previous issues do not seem to be in the repository anymore.
How do I fix it?

Override partials in templates

Hi there!

Great theme 👍 -- Is there a programmatic way (config, file structure) to override partials that are being included in the theme-layouts/ folder without having to copy up the whole file and the partials (with a couple edits) into the base folder?

Thanks

Personal avatar does not always replace default avatar although deleted

Thanks for this wonderful theme, I really like it. However, I changed all avatar images but when I check the website on my phone, I still see the default avatar. During loading though, the right avatar is displayed. The problem only occurs on my mobile device, not on my desktop. But it occurs on some other desktop computer too. Any ideas what the problem could be? I am not using plain Hugo, but blogdown, which extends Hugo to work with Rmarkdown files, among other things.

Any help appreciated.

Metadata description is for site not page

Describe the issue

The metadata attribute description used in the HTML <head> is defined in the HTML Living Standard as:

a free-form string that describes the page. The value must be appropriate for use in a directory of pages, e.g. in a search engine.

However the attribute currently uses the description for the site. If the author provides a description value within the front matter for the page, this is ignored.

To Reproduce

Add the following line to the front matter of a page where you wish to provide a description:

description: "Lorem ipsum dolor sit amet"

Run hugo: hugo server -D

Expected behaviour

The HTML outputted should be:

<head>
<!-- More html here... -->
<meta name="description" content="Lorem ipsum dolor sit amet" />
<!-- More html here... -->
</head>

Screenshots

None.

Configuration:

  • OS: Ubuntu 20.04.1 LTS
  • Hugo: v0.80.0

Additional context

I am happy to submit a pull request to fix this. I suspect however that this repo is no longer maintained, but adding the issue anyway just in case.

I've blogged on how I fixed this issue in my clone of this repo:

On metadata in Hugo - or turning tags to keywords

This also includes how I added metadata for keywords and canonical links (probably less of an issue for most people).

Change the default colouring scheme for blocks of code

Is there an easy way to change the default coloring scheme of block of code?

Looks the theme defaults to highlight: zenburn from RMakrdown documents but I'm not 100%sure.
In a regular RMarkdownw document I would change html output in yaml to:

output:
  html_document:
    theme: united
    highlight: tango

But with hugo themes and blogdown I'm not sure where and how make these changes.

(this is most likely my last issue :) )
thank you for all the help

PS. same question is posted at stack: https://stackoverflow.com/questions/48075493/change-style-color-of-blocks-of-code-in-blogdown

Missing Archive section

Forgive me so many questions but I really like your template and prefer to spend more time configuring it than start looking for alternatives.
Your site http://nodejh.com/post/ has a nice archive section that is missing after setting up an empty site (with Rstudio blogdown).
Im not sure which parts of code I should modify to make it look like yours. Any hint would be very appreciated.
If that is of any help my source is here: https://github.com/b1azk0/blog

Mathematics in Cactus Plus

Hi,

Thanks for your amazing theme. I'm trying to render mathematical notation and I've stumbled upon a few issues.

As a note, I'm using RStudio and the Blogdown package.

R version 3.5.1 (2018-07-02) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.6

I first started looking at a tutorial from another user of your theme, here.

Then I managed to sort out part of the problem using this resource. So now the mathematical notation appears when I use the $$ sign. However, there's some strange formatting around it that I don't understand where it comes from or how to clean up, is it that the theme treats the math snippets as code snippets? And if so, is it possible to do something about it?

screen shot 2018-10-30 at 14 29 30

Thanks

Favicon Gone Missing

At my website, wasim.blog, favicon has gone missing. Please have a look and recommend a solution.

Setting up Table of Content for posts

Could you please tell me how can I set a TOC for posts? I write my stuff in RMarkdown (Rstudio) and push pandoc compiled htmls to github so that netlify can take care of the rest.

Is the TOC something I should set up in config.toml? I can't figure out how to make it work properly.

Multi word titles are capitalised

creating new post with
hugo new my-first-post.md
created a post My First Post, where each word is capitalised.
Any workaround for this, or is this a hugo issue ?

Custom CSS

hi @nodejh , another long-time user here :) . I would like to have the ability to introduce custom CSS stuff into the theme so I can tweak a bit to my wishes. as far as I can see this is not possible yet.

a mechanism like this would be awesome. think you could make this possible?

Any idea why Disqus don't show up?

Hi, I'm trying to setup my website with this theme. I'm coming from #Ghost and I can't find how to activate disqus here. I migrate all this yesterday and I probably miss something. Any help is welcome. Thanks :)

An Article as Example

my config.

# Site settings
baseurl = "/"
# HTML Language Code Reference, such as en, zh-cn
languageCode = "en"
title = "Experiments"
theme = "hugo-theme-cactus-plus"

# Enter your tracking code to enable Google Analytics
googleAnalytics = "UA-73551613-1"
hasCJKLanguage = false

[permalinks]
    post = "/:year/:month/:day/:slug/"
    code = "/:slug/"

[params]
	name = "Experiments"
	description = "Experiments around Coding, Android, Architecture, and what goes through my mind"
	bio = "Human vs Android"

  # Enter optionally your twitter account
  # twitter = "your_twitter"
  enableRSS = true

  # Disqus comment
  disqusShortname = "vi-blog"
  # Disable disqus comments by set `enableDisqus = "false"`
  enableDisqus = true

  # Duoshuo comment
  # duoshuoShortname = "your_duoshuo_short_name"
  # Disable duoshuo comments by set `enableDuoshuo = "false"`
  enableDuoshuo = false

  enableGithubIssuesTips = false

  # Enable googleAnalytics
  enableGoogleAnalytics = true

Disqus does not seem to be working on Github pages

hugo version: Hugo Static Site Generator v0.53/extended darwin/amd64 BuildDate: unknown

config.toml:

baseURL = "/"
languageCode = "en"
title = "fberrez.com"
theme = "cactus-plus"
googleAnalytics = ""

# Set the value to true if your site include CJK (Chinese, Japanese, and Korean languages) characters
hasCJKLanguage = false

[params]
        [...]
	enableDisqus = true
	disqusShortname = "fberrez"
[...]

What?

Disqus cannot be loaded on a github pages website. It returns the error We were unable to load Disqus. If you are a moderator please see our [troubleshooting guide](https://help.disqus.com/troubleshooting/im-receiving-the-message-we-were-unable-to-load-disqus)..

It does not help to read the troubleshooting guide. See my Disqus config below:

image

image

still problems with tags

hello - I saw the previous (closed) issue with the 'about' page, and make the file change to /layouts/section/about.html worked great. Thanks.

I still cannot get the Tags page to render. Are there any possible suggestions for that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.