GithubHelp home page GithubHelp logo

mitrichius / hugo-theme-anubis Goto Github PK

View Code? Open in Web Editor NEW
404.0 9.0 147.0 803 KB

Anubis is a simple minimalist theme for Hugo blog engine

Home Page: https://hugo-theme-anubis.netlify.app/

License: MIT License

HTML 63.44% CSS 31.32% JavaScript 5.24%

hugo-theme-anubis's Introduction

Anubis Theme for Hugo License: MIT

⚠️ Theme is no longer maintained

Thank you all.
More info: https://mitrich.me/en/posts/anubis-closed/


Anubis is a simple minimalist theme for Hugo blog engine.
Demo

Anubis Screenshot

Features

  • Dark mode (automatic / by switcher)
  • Pagination
  • Multiple taxonomies: tags, categories, authors
  • Multiple sections: posts, notes, etc with customization
  • Archive
  • Table of Contents
  • Open Graph and Twitter Cards support
  • Mobile support
  • Social icons
  • Google Analytics
  • Umami Analytics
  • Comment systems: Disqus, ISSO, Utteranc.es, GraphComment, Giscus
  • RSS feeds
  • Related posts (Read Next section)
  • Deploy via Netlify (config included in example site)
  • Hiding posts from the RSS feed
  • Hidden posts (available only by link)
  • Translations (en, ru, fr, pl)
  • Custom CSS/JS
  • Multilingual mode
  • Robots.txt
  • Favorite posts
  • Pagination on post single page
  • Optional "Read more" link
  • webmentions

Installation

You need to install an extended version of Hugo to run this theme.

As Hugo Module (easier and recommended)

Initiate a hugo module system from your project's root directory

hugo mod init github.com/<your_user>/<your_project>

Add the following to your config.toml or config.yaml

theme =  ["github.com/Mitrichius/hugo-theme-anubis"]

As Git Submodule

Inside the folder of your Hugo site run:

$ git submodule add https://github.com/mitrichius/hugo-theme-anubis.git themes/anubis

For more information read the official setup guide of Hugo.

Getting started

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

Update config file

If you have toml config (which is by default), you should rename it to config.yaml or adapt this config for toml syntax.

Example of config.yaml:

languageCode: "en-us"
baseUrl: ""
title: "Anubis"
theme: "anubis"
paginate: 10
disqusShortname: "yourdiscussshortname"
googleAnalytics: "G-12345"
enableRobotsTXT: true

menu:
  main:
  - identifier: archive
    name: Archive
    title: Archive
    url: /posts/
    weight: 0

params:
  author: "John Doe"
  email: [email protected] # used for microformats
  avatar: "/images/me.png" # used for microformats
  description: ""
  # Uncomment if you need this
  # images:
  #   - images/og-featured.png # relative path to "static" directory
  # customCSS:
  #   - css/my.css # relative path to "assets" directory (don't use main.css filename)
  # customJS:
  #   - js/main.js # relative path to "assets" directory
  dateFormat: "2006-01-02"
  paginationSinglePost: true
  style: light-without-switcher
  mainSections: [ "posts" ] # which sections should be on index/main page
  sectionsWithFullContentOnListPage: [ "notes" ] # for which sections content should be displayed on list pages
  readMore: false # show read more button
  readNextPosts: 5  # show 5 related posts, 0 by default
  disableSummary: false
  toc: true # display Table of Contents
  tocWordCount: 300 # ...when a post is longer than 300 words
  copyCodeButton: true # true by default
  rssAsSocialIcon: true
  mathjax: false # https://www.mathjax.org/
  # utteranc.es support
  utterancesRepo: ""  # mandatory
  utterancesTheme: "" # optional
  utterancesIssue: "" # optional
  utterancesLabel: "" # optional
  # isso support
  isso:
    enabled: true # mandatory
    data: "https://comments.example.com/" # mandatory
    jsLocation: "https://comments.example.com/js/embed.min.js" # mandatory
    css: true # optional
    lang: "de" # optional
    replyToSelf: true # mandatory
    requireAuthor: true # mandatory
    requireEmail: true # mandatory
    id: "thread-id" # optional
    avatar: true # optional
    avatar-bg: "#f0f0f0" # optional
    feed: false # optional
  UmamiAnalytics:
    enabled: true # mandatory
    dnt: true # optional
    id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # mandatory
    datacache: false # optional
    url: "https://abc.example.com/umami.js" # mandatory
  graphcommentId: ""
  # giscus support
  GiscusRepo: "" # mandatory
  GiscusRepoId: "" # mandatory
  GiscusCategory: "Announcements" # mandatory
  GiscusCategoryId: "" # mandatory
  GiscusLazyLoad: false # optional
  webmentions:
    url: https://yourdomain.com/webemntions/receive
    login: hugo-theme-anubis
    pingback: true
  social:
  - id: github
    name: gohugoio
#  - id: hugo
#    url: "https://gohugo.io/"
#    icon: "hugo"

markup:
  goldmark:
    renderer:
      unsafe: true # enable raw HTML in Markdown

Check your site

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

$ hugo server

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

Feature Settings

Dark Mode

Customize via style param in params section of config. Options:

  • light-without-switcher - light theme, without switcher (by default)
  • dark-without-switcher - dark theme, without switcher
  • auto-without-switcher - theme based on user system settings, without switcher
  • light - light theme by default, can be switched by user to dark theme and back. Theme settings are saved for user
  • dark - dark theme by default, can be switched by user to light theme and back. Theme settings are saved for user
  • auto - theme based on user system settings by default, can be switched by user to dark/light theme. Theme settings are saved for user (by default in example sites)

Table of Contents

If toc param in params section of the config file is set to true, Table of Contents is generated for every post that is at least tocWordCount words long (0 by default, also belongs to the params section of the config).

This behavior can be overridden on per-post basis by setting toc to either true or false in the front matter of a post.

Social icons

Predefined icons

To add icon from predefined list, add to params.social config:

  • id of social network
  • name for placeholder (usually it's your nickname or login)

Predefined list:

  • email
  • facebook
  • github
  • instagram
  • linkedin
  • mastodon (need full url)
  • patreon
  • reddit
  • snapchat
  • soundcloud
  • spotify
  • telegram
  • twitch
  • twitter
  • vk
  • youtube

Example:

  - id: github
    name: gohugoio

Config like this generate github icon with "https://github.com/gohugoio" url.

Predefined icons with custom url

To add predefined icon with custom url, add to params.social config:

  • id of social network
  • full url to your network

Example:

  - id: github
    url: "https://github.com/gohugoio/hugo"

Config like this generate github icon with "https://github.com/gohugoio/hugo" url.

Custom icons

To add custom icon, add to params.social config:

  • id of social network/site
  • full url to your network/site

Also you need to create directory static/fa-icons and add svg icon of your network/site with name equals to id from config.

Example:

  - id: google
    url: "https://www.google.com/search?q=I'm+lucky"

Icon should be "static/fa-icons/google.svg"

If you want font awesome icons, download "Font Awesome For Desktop" and open svg directory.

Google Analytics

Only works for production environment.

Multilingual mode

Check config/example usage in exampleSiteMultilingual directory and documentation on Hugo site.

RSS

RSS is available by site url + /index.xml. Also available for specific language, section, taxonomy.
rssAsSocialIcon parameter enables rss social icon with link to site current language RSS.

Robots.txt

Based on environment.
For production — allow all, for other — disallow all.

Favorite posts

Add favorite: true to post front matter. It adds a "★" icon nearby post's title.

Related posts (Read Next section)

Based on readNextPosts config parameter. Check this article for configuration details.

Hiding posts from RSS

Add disable_feed: true to post front matter.

Make post available only by link

Add hidden: true to post front matter. Post also is not available in RSS feed.

Pagination on post single page

Enabled by paginationSinglePost param in params section of config.

Webmentions

To provide webmention support you can either specify your webmention.io username with login: webmentionusername or specify a link to your custom webmention endpoint with url: https://yourdomain.com/webemntions/receive. If you use webmention.io you can also enable pingback with pingback: true

Disabling comments per-page basis

Add disableComments: true to post front matter.

Custom shortcodes

Video (for local videofiles)

Example: {{< video src="/media/movie.mp4" type="video/mp4" preload="auto" caption="Some caption" alt="Some alt" >}}

Contributing

If you find a bug or have an idea for a feature, feel free to write an issue or make a PR.

TODO

See issues.

License

MIT

© Dmitry Kolosov 2020

hugo-theme-anubis's People

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

hugo-theme-anubis's Issues

Error on building

Building sites … ERROR 2020/05/15 12:23:32 render of "section" failed: execute of template failed: template: _default/list.html:15:15: executing "main" at <partial "articleInfo...>: error calling partial: "/home/huzaifahj29/quickstart/themes/anubis/layouts/partials/articleInfoFull.html:3:44": execute of template failed: template: partials/articleInfoFull.html:3:44: executing "partials/articleInfoFull.html" at <.Params.date.format>: can't evaluate field format in type interface {}

I'm getting this. I've just set up a quickstart Hugo project, and activated Anubis as the theme in the .yaml. I've done nothing else so I'm unsure what happened

Deploy problem

Hi all, I have installed theme and in locally if I launch

hugo server

It works all fine.
Now I would like to deploy my site with github following the hugo documentation.
this is my deploy script:

#!/bin/bash

echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"

# Build the project.
hugo -t anubis # if using a theme, replace with `hugo -t hugo-nuo`

# Go To Public folder
cd public
# Add changes to git.
git add .

# Commit changes.
msg="rebuilding site `date`"
if [ $# -eq 1 ]
  then msg="$1"
fi
git commit -m "$msg"

# Push source and build repos.
git push origin master

# Come Back up to the Project Root
cd ..

homepage works fine but pages videos and post don't have css style.
Do you know why?

this is the URL:
My site

Thanks

Shift From rnd Unix Now to a Hashing Algorithm

Currently, this theme uses many unix.now's to fool browsers into refreshing their cache. This has the unfortunate downside of changing every html file in a built website after every build. Maybe we can use resources.Fingerprint and Data.Integrity instead. Then, not every html file would be changed after each build.

Google Analytics

Hey,
you've create a great theme.
I have one question though - I'm trying to setup Google Analytics in the config, I pasted the the code, starting with UA-<number>. Unfortunately, it doesn't work. Should I do anything else?

github site error

It can't express right at github site page service,especially for about file and post files ,seems hugo service can't generate that.

Links to categories are not correct

Hi,

the links to categories apparantly are not correct. E.g.:
http://localhost:1313/categories/Ale
http://localhost:1313/categories/Red%20Ale

But actually they should be:
http://localhost:1313/categories/ale/
http://localhost:1313/categories/red-ale/

Submenu problem

Submenus do not build in Hugo when included in front matter of submenu documents: Hugo throws errors of duplicate identifier entries when building site.

I was able to build locally in spite of the errors but Netlify will not deploy with the same Hugo version (0.72.0) as environment.

Make google font optional

Hello,

I'm using your great theme, thanks!

the only modification I have left now is that I drop the Google font import (I'm sure this specific font is great for some reasons, but I'm not very comfortable of having google tracking everything on the web, my website included). It's not a lot, but I still need to rebase it regularly :)

Do you think a theme parameter could be added to make it optional (like noGoogleFont, which would be false by default so people would still get it by default)

I'm happy to try to make the PR if you are interested.

Incorrect Rendering of Mardown Features that Require Tags

Hi,

First, great theme! Thanks for making this.

Now, I noticed that in the demo site, the other elements section of the Markdown Syntax Introduction article doesn't render properly. In my browser, the text just renders as plain content text. I observe the same problem in my personal website running Anubis. I know this isn't purely a browser issue because the elements do render with the correct formatting when I use or demo other themes. Do you have the same problem?

I'm very new to Hugo, so I have no idea what might cause this. But I'll try to look into it and let you know if I find anything.

Custom Css

I'm trying to activate my custom css but i have this error:

Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:5:11: executing "head" at <partial "head.html" .>: error calling partial: "D:\Projetos\teste-1\themes\anubis\layouts\partials\head.html:19:14": execute of template failed: template: partials/head.html:19:14: executing "partials/head.html" at <.Site.Params.customCSS>: range can't iterate over css/my.css

My config.toml:
[params] author = "Dmitry Kolosov" description = "Anubis is a simple minimalist theme for Hugo blog engine." customCSS = "css/my.css"

I tried to save my css files in different ways, such:

root
  | - css
  |   | - my.css

or

root
| - static
|  | - css
|  |  | - my.css

hugo version: Hugo Static Site Generator v0.71.1-A301F6B2 windows/amd64 BuildDate: 2020-05-25T09:12:07Z

Missing _internal file

Hi! I have downloaded now for the first time, after launching hugo server, the terminal return this error:
Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:5:11: executing "head" at <partial "head.html" .>: error calling partial: execute of template failed: template: _internal/opengraph.html:41:17: executing "_internal/opengraph.html" at <index $siteSeries $name>: error calling index: index of untyped nil

Scrollbars in code blocks.

Liked your theme and want to make it better.
If you replace overflow: scroll to overflow: auto for pre then those ugly scrollbars would be visible only when they are needed.

It makes the look even more minimal.

Please add a footer menu

Hi,

in EU it is mandatory for a website to have a imprint page and a privacy policy page. These pages must be reachable by a link, but not necessarily from the main menu. Therefore most websites place these links in the footer.

So please add a footer menu to do the same.

Add Margin to Bottom of Theme Switcher

When viewing a site on mobile devices, the theme switcher will move below the copyright div. However, the theme switcher has no margin-bottom and so touches the bottom of the screen. I think it would look better if there was 1em of margin (the same margin as is on the right of the theme switcher) below it. I'll make a small pull request for the proposed change.

Before:
image

After:
image

Accessibility Additions

Hi! Thanks for the theme - I've been adapting it for my purposes, and thought I'd share a couple of the changes I made for accessibility:

Added a skip link that is only visible to screen readers or when you tab to it

changes to baseof.html:

<body>
<a class="skip-main" href="#main">Skip to main content</a> <!-- added skip link at very top-->
    <div class="container">
        <header> 
            {{ block "header" . }}
                {{ partial "header.html" . }}
            {{ end }}
        </header>
        <main id="main" tabindex="-1"> <!-- added target for skip link and tabindex -->
            {{ block "main" . }}{{ end }}
        </main>

changes to styles.css:

a.skip-main {
    left:-999px;
    position:absolute;
    top:auto;
    width:1px;
    height:1px;
    overflow:hidden;
    z-index:-999;
}
a.skip-main:focus, 
a.skip-main:active {
    left: auto;
    top: 0px;
    width: auto;
    height: auto;
    overflow:auto;
    z-index:999;
    padding: 4px 6px 4px 6px;
    color: #ffffff;
    text-decoration: underline;
    border: none;
    background: #871d6a;
}
main {
    outline:none;
}

(Look of focus and active varies based on theme; this is just what matches the changes I've made.)

Added lang to html for screen readers
changes to baseof.html:

<html lang="{{ .Site.LanguageCode }}">

I also made the links in the footer open in the same window, since opening links in a new window is less accessible, and made various changes to link styling (making hover/active links more visible and underlining all links so they are not just denoted by color). But those are more specific to a particular implementation of a theme.

Where is the RSS?

I'm sure I'm going something stupid, but I can't find the RSS feed. In my production site it states it is at: https://www.brandonbohling.com/rss/, but it is not. Looking into the layouts/_default I see the rss.xml template.

What am I missing?

Unable to transform style.css, resource not found in file cache

Commit db7e625 causes Hugo to error out with

Total in 37 ms
Error: Error building site: TOCSS: failed to transform "css/style.css" (text/css): resource "css/css/main.css_b5616ad8043936b93a403785b10b2b88" not found in file cache

printed to the console. Rolling back to the previous commit, 9e524ff, resolves the issue. In case it's helpful, the repository I'm using Anubis in is https://github.com/TheDocTrier/disjoint-union.

Side note: I saw that my previous issue #63 was just fixed (thank you!) in the latest merge, so I decided to try it out.

Issue with images when baseUrl has a path

I have set my baseUrl to be: https:example.com/test
This works fine for posts. But for the images under in any post, it still looks for the static repository without the "test".
For example, if I have an image file image.jpg located in the static repository, I can access it using example.com/test/image.jpg. But in the post, the URL is expanded as: example.com/test/image.jpg

Am I missing some setting?

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.