Git Product home page Git Product logo

hugo-octopress's Introduction

Hugo-Octopress

Hugo-Octopress is a port of the classic Octopress theme to Hugo.

Live demo using the unmodified theme:

My personal website with the compact index (see below):

Contents

screenshot

Quick start

Add the theme to your existing site or Hugo's quick start. All commands are run from the root directory of your website.

If using git to manage your website, add the theme as a git submodule:

git submodule add https://github.com/parsiya/Hugo-Octopress themes/Hugo-Octopress

Or you can clone it:

git clone https://github.com/parsiya/Hugo-Octopress themes/Hugo-Octopress

To view the theme with the example site:

cd themes/Hugo-Octopress/
hugo serve -vw --source=exampleSite

And view the example website at http://localhost:1313.

Example site was originally created by https://github.com/nonumeros. I reviewed the pull request almost two years late and had to copy/paste the website instead of resolving merge conflicts. The example website also has a page with the theme's shortcodes.

Configuration

Hugo-Octopress can be configured by modifying the parameters in the configuration file. sample-config.toml and exampleSite/config.toml are both working examples.

Code highlight

This theme uses the built-in Chroma highlighter with the solarized-dark theme. See all supported styles at https://xyproto.github.io/splash/docs/all.html. To change the style, change it in the config file like below to one of the supported styles.

Some options to control code highlighting post version 0.60.

[markup]
  [markup.tableOfContents]
    endLevel = 8
    startLevel = 1
  [markup.highlight]
    style = "solarized-dark"

For more configuration options please see https://gohugo.io/getting-started/configuration-markup/#highlight and https://gohugo.io/extras/highlighting/ in Hugo's documentation.

Goldmark vs. Blackfriday Markdown Engines

Prior to version 0.60, Hugo used Blackfriday. Now it uses Goldmark by default. See https://gohugo.io/getting-started/configuration-markup#highlight for information about setting it up.

There are trade-offs. Mainly, the hrefTargetBlank Blackfriday extension. It was set to true to open external links in a new browser tab. Unfortunately, Goldmark does not have this built-in. To make it happen, we need to use a render hook. I used the one in Hugo docs at

https://gohugo.io/getting-started/configuration-markup#link-with-title-markdown-example.

This works for markdown links but not linkify or image links. Linkify links are straight URLs pasted into the document (e.g., https://example.net). A workaround is not having links similar to this (which is not in the markdown standard anyways) and use normal links. For example, [example.net](https://example.net) or reference links.

You can keep using Blackfriday like this:

[markup]
  defaultMarkdownHandler = "blackfriday"
  [markup.blackFriday]
    hrefTargetBlank = true

CSS override

You can override the built-in CSS and add your own. Put your CSS files in the static directory of your website. While storing them inside the themes/Hugo-Octopress/static directory works, it's not recommended (keep your website and theme as separated as possible to be able to switch themes easily). Then modify the customCSS parameter. The path should be relative to the static folder. These CSS files will be added through the header partial after the built-in CSS file.

For example, if custom CSS files are static/css/custom.css and static/css/custom2.css then customCSS will look like this:

[params]
  customCSS = ["css/custom.css","css/custom2.css"]

Navigation menu

Links in the navigation menu (everything other than Google search and RSS icon) can be customized. The navigation menu is generated using the layouts/partials/navigation.html partial.

By default, navigation menu links will open in the same window. You can change this behavior by setting the navigationNewWindow parameter to true. Links to root ("/") will always open in the same window. Currently, Hugo does not support adding custom attributes to menus.

Links are sorted according to weight from left to right. For example, a link with weight of -10 will appear to the left of links with weights 0 or 10. Links can be added to the config file:

[[menu.main]]
  Name = "Blog"
  URL = "/"
  weight = -10

[[menu.main]]
  Name = "The other guy from Wham!"
  URL = "https://www.google.com/search?q=andrew+ridgeley"
  weight = -5

[[menu.main]]
  Name = "This theme - add link"
  URL = "https://www.github.com"

[params]
  # If set to true, navigation menu links will open in a new window with the exception of links to root ("/")
  # If this item does not exist or is set to false, then navigation menu links will open in the same window
  navigationNewWindow = true

Search engine customization:

[params]
  searchEngineURL = "https://www.google.com/search"

Extending Headers and Footers

Copy these files from theme/Hugo-Octopress/layouts/partials/ into your-site/layouts/partials and modify them:

  • extend_header.html: Everything will be added to the end of the head tag on every page.
  • extend_footer.html: Everything will be added after the footer tag on every page.

Sidebar

The sidebar has four sections, from top to bottom:

  • Sidebar header and text (optional).
  • Social network icons (optional): Icons and links to GitHub, Mastodon, and more.
  • Sidebar menu (optional): Links in sidebar.
  • Recent posts: Displays last X posts (default is 5).

The sidebar is generated using the partial at layouts/partials/sidebar.html.

Sidebar text

The sidebar text has two parts and both can be configured. Both are passed to markdownify so you can use markdown (e.g. add links or new lines).

  • Sidebar header appears first in an <h1> tag. It can be configured with sidebarHeader.
  • Sidebar text appears under the header and is in sidebarText.

You can add new lines can be added with two spaces at the end of line. New paragraphs can be added with two an empty line. when adding two new lines, remember to remove the indentation otherwise the new line will be treated as a codeblock.

sidebarHeader = "Sidebar Header"

sidebarText = """Here's a [link to google](https://www.google.com)

New paragraph

Another paragraph which has two spaces in the end to create a new line using markdown  
New line but not a new paragraph
"""

If you want to use </br> here and not just markdown, you need to enable unsafe rendering of HTML in Goldmark. You can do this like this.

[markup]
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true

Blackfriday renders the </br> tags and does not need extra configuration.

Social network icons

Sidebar social network icons are configured as follows:

[params]
  github = "https://github.com/parsiya/Hugo-Octopress/"
  bitbucket = ""
  gitlab = ""
  twitter = ""
  keybase = ""
  linkedin = ""
  mastodon = ""
  stackoverflow = ""
  youtube = ""
  facebook = ""
  instagram = ""
  bitcoin = ""

Icon sequence is unfortunately hardcoded. To modify, copy your-website/themes/Hugo-Octopress/layouts/partials/social.html to your-website/layouts/partials/social.html and modify the sequence. Use </br> to create a new line.

Code to display links (and the idea to use these icons) is from Hyde-x.

Icons are from Font Awesome and Fork Awesome. To use icons with square dark backgrounds add -square. For example, <i class="fa fa-twitter-square fa-3x"></i>. Size can be from 1 to 5 use fa-lg to make them adaptive.

Sidebar menu

This menu can be enabled by setting sidebarMenuEnabled to true. It has two sections:

  • A header that appears inside the <h1> tag on top. It can be set by sidebarMenuHeader. This part only supports text.
  • A set of links. They can be configured similar to the navigation menu items by using the [[menu.sidebar]] tag. Set sidebarNewWindow to true to open these links in a new window
[[menu.sidebar]]
  Name = "Google"
  URL = "https://www.google.com"
  weight = 0

[[menu.sidebar]]
  Name = "Hugo"
  URL = "/categories/hugo/"
  weight = 1

Recent posts

Last x posts can be displayed in the sidebar. This number is controlled by sidebarRecentLimit. To hide this section you can remove sidebarRecentLimit from the config file or set it to zero.

Shortcodes

Creating shortcodes in Hugo is very easy and one of the reasons I switched to it. I recreated a few plugins from Octopress. They add captions to code blocks and images. These shortcodes are in layouts/shortcodes/.

For all my Hugo shortcodes see https://github.com/parsiya/Hugo-Shortcodes.

Code caption

This shortcode adds a caption to codeblocks. The codeblock is wrapped in a <figure> tag and caption is added using <figcaption>. It has two parameters, title which is the caption of the code block and lang which is the language that is passed to the Hugo's highlight function along with linenos=true to enable line numbers.

Usage and source (parameters are named and not positional):

{{< codecaption lang="html" title="Code caption shortcode" >}}
<figure class="code">
  <figcaption>
    <span>{{ .Get "title" }}</span>
  </figcaption>
  <div class="codewrapper">
    {{ highlight .Inner (.Get "lang") "linenos=true" }}
  </div>
</figure>
{{< /codecaption >}}

And will look like:

picture.

If the code inside the tag overflows, a horizontal sidebar will be added to the table. It took me a while to achieve this as the highlight function created tables that were out of my control. The output from highlight is wrapped in <div class="codewrapper"> and the scroll bar will be added for the whole div. The following in the CSS file (starting from line 2225) enables this behavior:

div.codewrapper {
    overflow-x: auto;
    overflow-y: hidden;
    background-color: #002B36;
}

Image caption

This shortcode adds captions to pictures. Due to the way the original CSS file was organized, this shortcode does not use <figure> and <figcaption>. Alt tag is also set to title.

Usage (parameters are named and not positional):

{{< imgcap title="Sample caption" src="/images/2016/thetheme/1.png" >}}

Results in:

<span class="caption-wrapper">
  <img class="caption" src="/images/2016/thetheme/1.png" title="Sample caption" alt="Sample caption">
  <span class="caption-text">Sample caption</span>
</span>

Table of Contents

This shortcode adds table of contents to the theme. You can use it to add the toc to anywhere in the page with {{< toc >}}.

Pages

This section discusses the different kind of pages that are supported by the theme.

License page

License page address is baseurl/license/. Create a markdown file containing the text for the license page under content and set its type to license in frontmatter:

---
title: "License"
type: license
---

License text

License page template is: layouts/license/single.html.

Not Found or 404.html

The 404.html page has two optional parameters and both support markdown:

  • notFoundHeader: 404 page title
  • notFoundText: 404 page text

If they are not set in the config file, theme's default page is used (layouts/404.html).

Taxonomy pages

You can create taxonomy lists (e.g. categories and tags). Set generateTaxonomyList = true to get generate them at baseURL/tags/ and baseURL/categories. By default items are sorted by count. sortTaxonomyAlphabetical = true changes the sort to alphabetical.

[Params]
  generateTaxonomyList = true

  # Alphabetical sort
  # sortTaxonomyAlphabetical = true

To revert, remove sortTaxonomyAlphabetical or set it to false.

Note: As of Hugo 0.33, indexes has been removed. If your taxonomy pages are not rendered, please update to the latest version of Hugo. Templates are now at:

  • /layouts/category/category.html
  • /layouts/tag/tag.html

Individual pages

You can create individual pages in at least two ways:

  • Create a new content file in content/page.
  • Create a page anywhere inside content and set the type to page in frontmatter. E.g. type: page.

The template for individual pages is at Hugo-Octopress/layouts/page/single.html. It can be overridden by a file in the website's layouts/page/single.html. For more information see Single Page Templates in Hugodocs.

Table of contents

There are three ways to add Table of Contents (ToC) to pages.

toc configuration

With Goldmark, you need to change the defaults for the table of contents renderer in your site's config. The defaults only render markdown headings level 2 and 3.

[markup]
  [markup.tableOfContents]
    endLevel = 8
    startLevel = 1

Please see more at https://gohugo.io/getting-started/configuration-markup/#table-of-contents.

Use toc in Frontmatter

This ToC is on top of the page and does not appear in the summary. You can customize the ToC for each page or globally:

  1. Add a variable named toc to the frontmatter of the post/page and set it to true.

    title: "title"
    date: 2016-04-01T20:22:37-04:00
    draft: false
    toc: true
  2. Enable it globally by setting tableOfContents under [Params] to true.

    [Params]
      tableOfContents = true

The toc variable in the frontmatter has priority. If it is set to false the global setting is ignored for that page.

Use the toc Shortcode

If you want the table to appear in a different location use the shortcode. For example, in the cheatsheet on my website it appears after the summary.

---
frontmatter
---

summary or whatever.

{{< toc >}}

Editor Plugins

There are various editor plugins that create a table of contents in markdown using markdown links. This approach is self-contained and not reliant on the theme or the shortcode. I used the VS Code plugins Markdown All in One.

Disqus

Hugo supports Disqus. Note Disqus shortname is directly in the config file (and not under params):

disqusShortname = "whatever"

You can disable comments for individual pages by adding comments: false to the frontmatter.

Twitter Card

Twitter card support can be enabled in the config file under Params:

[params]
  # Twitter card config
  # Enable.
  twitterCardEnabled = true
  # Don't include the @.
  # twitterCardSite = 
  twitterCardDomain = "parsiya.net"
  # Don't include the @.
  twitterCardAuthor = "CryptoGangsta"

After Twitter card is enabled, you can add summary images to your posts in front matter with twitterImage:

twitterImage: 02-fuzzer-crash.png

Note: Image URL should be relative to the page, otherwise the final URL will not be correct. In short, image URL should be part of the page bundle. In this case, both index.md and 02-fuzzer-crash.png are in the same root directory. If the image is in a subdirectory of page bundle, it can be added like this:

twitterImage: images/02-fuzzer-crash.png

To modify this template, copy your-website/themes/Hugo-Octopress/layouts/partials/custom_twitter_card.html to your-website/layouts/partials/custom-twitter-card.html and make changes.

Compact Index

The original theme renders each post's summary in the main page. I prefer a more compact index and use it for my own website. You can enable it by adding this to the config file:

[params]
  # Set to true to enable compact index. Set to false or remove to go back to classic view.
  compactIndex = true

Compare the views (classic - compact) - click for full-size image:

classic index compact index

mainSections

Hugo-Octopress supports using the mainSections property in the config file to display different kinds of posts on the main page. If not defined, mainSection will default to the section with the most number of pages. In a vanilla Hugo-Octopress setup, it will be under post. But, you can add your own sections in the config file:

[params]
  mainSections = ["posts", "blogs"]

See the code in layouts/partials/classic_index.html:

<div class="blog-index">
  {{ $paginator := where site.RegularPages "Type" "in" site.Params.mainSections | .Paginate }}
  {{ range $paginator.Pages }}
  <article>
  ...

Custom Favicon

The theme uses the default Octopress favicon. You can modify it:

  1. Add favicon to the config file under params. This path is relative to the static directory.
    [params]
      favicon = "myicon.png"
  2. Store the file in your site's static directory: your-site/static/myicon.png.

Troubleshooting

Common issues when dealing with the theme.

Hugo page summary bug

Without a summary divider <!--more-->, Hugo uses the first 70 words of the post. The result is usually not pretty and contains raw HTML. Always use the summary divider <!--more--> in your posts. This does not matter if you use the compact index because it does not use the summary.

Hugo does not display render style links in the page summary if the link is also not before the summary divider. You can read more here.

Reference style links look like this:

This is a link to [Example][example-link].

[example-link]: https://www.example.com

There are two workarounds:

  1. Do not use reference style links in summary. Use normal links like [Example](https://www.example.com).
  2. Put the reference links before the summary divider.

Empty Posts Link on Homepage

After rebuilding the blog with Hugo 0.57, you may see a single Posts link in the classic index. Update to Hugo 0.57.2+ (there is an issue with 0.57.1) and it should work.

For more information please see:

This should not be an issue anymore because the theme's minimum version of Hugo has been bumped.

Issues/TODO

If you discover any issues/bugs or want new features please use the GitHub issue tracker. Please keep in my mind that development has not been my day job for quite a while and I may be slow in fixing things (don't be surprised if I ask you about details).

The css is a mess. The CSS file is taken directly from the classic Octopress theme. I found it easier to just modify the templates to generate HTML code similar to Octopress' output and use the existing CSS file. It's bulky (around 53KBs and 2300 lines) and it probably has code for elements that are never used (also duplicates).

Attribution

Ported by

Ported by Parsia.

Theme license

Open sourced under the MIT license.

hugo-octopress's People

Contributors

erethon avatar nickdesaulniers avatar nonumeros avatar parsiya avatar robbkidd avatar simonszu avatar sit avatar zhiburt 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

hugo-octopress's Issues

Support adding optional table of contents to posts

Templates can use {{ .TableOfContents }} to add Table of Contents to pages and posts. It has some limitations (it cannot be used inside pages via shortcodes because it is populated after the page is rendered). It's BlackFriday issue.

Table of Contents can be added either in the config file or in the front matter.

Modify the theme README.md and add instructions on how to use this feature.

color theme

Thank you for developing this hugo theme.

Is it possible to support color theme similar to hyde-x?

Add a new parameter to navigation menu items to open in a new window

Currently only the link to the root of the site is not opened in a new window. Everything else opens in a new window. Add support for a parameter in the config file.

Currently it works like this:

[[menu.main]]
    Name = "Blog"
    URL = "/"
    weight = -6

Add a parameter and then act accordingly in navigation.html.

[[menu.main]]
    Name = "Blog"
    URL = "/"
    weight = -6
    new_window = true

If new_window is true then open the menu item in a new window. If not set or if set to false, create a normal link.

Add Piwik support

Hi,

it would be great if your theme could support Piwik for Google-Analytics-like analytics, but self hosted. Technically it is just some JS code with a custom ID like disqus has. I'd love to provide you with some more details, but piwik.org is down right now :(

Recent Posts lists tags and website title

This won't be a problem once I generate more posts. Plus in the meantime I can set the recent-post-limit in the config to a lower number so it only displays my actual posts but it's something that doesn't seem right so I thought I'd go ahead and create an issue. For some reason, the index.html files getting generated in the public folder have (under id="recent_posts") categories, tags, and the title of my blog have <li class="post". I've tried to figured where and how this is created but have had no luck.

Compatibility with GDPR

In the European Union we get a new law, known as the GDPR, next month. It regulates all data protection issues for online media, especially including tracking stuff and polling external APIs without the user's consent. This affects fetching fonts and CSS from external servers as well.

Currently this theme queries fonts.googleapis.com for fetching some fonts, and also the Bootstrap CDN for fetching fontawesome.css. This violates the GDPR.

To make this theme GDPR compliant, i am asking you to modify this theme so that these fonts and CSS files are available locally, so all queries a reader's browser makes are only going to my server where hugo is hosted, and not elsewhere. I think it's not much work, but it allows european bloggers to continue using this theme.

Yes, i know how stupid this may sound to you, and the computer guys (TM) in europe know this as well, but data protection is a big issue in europe, and the law has passed and has to be implemented until May 25th 2018, or site administrators have to face fees up to 2 million euros.

Overhaul config file

I have noticed that Hugo now contains a lot of site variables in the config file that the theme has under params. For example Author and Title.

See site variables here: https://gohugo.io/templates/variables/#site-variables

Some are as follows:

  • .SiteTitle
  • .Site.Author
  • .Site.GoogleAnalytics
  • .Site.Copyright (Use this instead of the static copyright).

Tables only have left borders

The culprit is in the CSS. I have removed the right border to prevent it from being displayed when an overflow happens.

Change it back to border from border-left. See.

table,
th,
td
 {
    border-left: 1px solid black; /* remove the right border for when overflow happens */
    padding: 3px;
}

Unable to find archetypes directory

When creating a new post with hugo new, hugo spawns an error when using this theme:

ERROR 2017/05/17 10:23:44 Unable to find archetypes directory for theme "hugo-octopress" at "/home/simonszu/blog/themes/hugo-octopress/archetypes"

Although, the post file is created. However, this error is ugly.

Tag/Category sidebar menu page isn't generating links to posts

On the tag menu page (for example), the tags and counts are displayed but if you click a tag, it doesn't take you to a page with all the posts corresponding to that tag. I've tried working on this but I'm barely HTML literate and haven't made any headway. Was hoping you could help.

ability to override theme's favicon

Looks like in layouts/partials/header.html we have the following hardcoded:

<link href="{{ "/favicon.png" | absURL }}" rel="icon">

I'm guessing if that was

<link href="{{ $.Site.Favicon }}" rel="icon">

then in my config file I could do:

favicon="/favicon.ico"

Customize 404 header and text in the config file

Currently users have to modify the themes\hugo-octopress\layouts\404.html file to customize the 404.html page.

This should be moved to the config file and support markdown, similar to the sidebar.
README.md and sample-config should be modified too.

Modifying site tree

I'm new to Hugo so this may be a lack of education, but I don't seem to be able to add an "About" page and map it to "/about" in my config.toml. For the life of me I don't know what I'm doing wrong or does it require theme modification.

Move sidebar text to the config file

Currently sidebar customization is done by manually editing the themes/Hugo-Octopress/layouts/partials/sidebar.html.

Customization should happen in the config file.

disqusShortname in the config file: sample-config.toml

    # Disqus shortcode
    # Disable comments for a specific post by adding "comments: false" in its frontmatter
    disqusShortname = "Your Google Analytics tracking code"

A small mistake in the example config file, the var: disqusShortname sample is not correct I think.

Error: While parsing config: (80, 19): unescaped control character U+0009

Thank you for developing this hugo theme.

I used the sample-config.toml to configure my hugo website, and then ran hugo server --watch, but following error was produced.

Error: While parsing config: (80, 19): unescaped control character U+0009

The error seems like from the Sidebar text param. How to fix this problem?

Switch to goldmark

Hugo v0.60 and up uses goldmark, we can switch to it and see how it holds up.

Note: remember to modify the readme and the sample config. Mention the goldmark switch.

Goldmark does not have a setting to open links in a new tab unlike Blackfriday. We can use render hooks, but the render-link from the Hugo docs website does not work on linkify links. E.g., if I have [example.net](https://example.net) in my page, it will open it in a new tab but just https://example.net (which is turned into a link by Goldmark's linkify extension) does not open in a new tab. Need to figure out a way to fix it. Maybe, as on Hugo forums?

I gave up and said we can use Blackfriday if we want that functionality in the readme.

RSS: "submit feed with full content"

I'm trying to get my blog registered on a site called R-Bloggers and it requires jumping through a few hoops. One of those hoops is that I need my RSS feed to have "full content". They give some advice on how to make this happen, "On Hugo blogs (blogdown blogs) you can try the following:
Configure the default RSS template given here: https://gohugo.io/templates/rss/#the-embedded-rss-xml , replacing {{ .Summary | html }} with {{ .Content | html }}" I didn't find that template but I did find this in layouts/partials/header.html,

<!-- RSS -->
  {{ $siteTitle := .Site.Title }}
  {{ $authorName := .Site.Author.name }}

  {{ with .RSSLink }}<link href="{{ . }}" rel="alternate" type="application/rss+xml" title="{{ $siteTitle }}" />{{ end }}

I didn't know if the template they linked was a hugo update or what, but I thought I'd check with you before I starting messing with this on my end. Thanks for all your help.

config file changes

Seems like a lot of config file stuff has changed in Hugo.

For example, syntax highlighting: https://gohugo.io/getting-started/configuration-markup#highlight

Blackfriday is not the default engine anymore: https://gohugo.io/getting-started/configuration-markup#blackfriday

I need to change the sample config.toml and the readme to reflect this.

Before that, I need to figure out which Hugo version changed these, we are now at 0.57.2 and I would like to keep the version as low as possible for compatibility reasons.

LIst of taxonomies

Thanks for the Octopress theme for Hugo. I like it very much.

Before I used the theme Hyde Y. It could make a list of taxonomies and how often one was used. I am missing that in Octopress. Is it possible to add this, or could you give me a hint how to do this?
Sample

disqus not included

I have noticed that, although "disqusShortname" was defined, the disqus code isn't included at the bottom of each post. There is a "Comments" link at the top of the post, which links to an anchor which is undefined.
How comes?

Submenu page

I had spent hours trying to find a working example of a Hugo theme that handles submenus, and a working example how to arrange the content so that I see a working submenu. As far as I understand your theme handles submenues.

Would it be possible to include an inserted submenu with a static page under the Individual Page 1 item?

Mixed Content in the Hugo-Octopress demo on the Hugo website

Hello @parsiya I am one of the maintainers of the Hugo Themes repository.

Recently I reviewed the deploy log of the Hugo Themes website and apparently line 4 of your theme's header partial causes a Mixed Content browser warning on the Hugo website because it references an insecure URL. The Hugo website is served under HTTPS.

To fix this warning please change line 4 of the header partial to <link href="https://gmpg.org/xfn/11" rel="profile">

Once you do the above please let me know.

Thanks

<a href> with an <img> as content causes underscores

I am testing hugo's new image resource feature, and noticed this little bug:

I have the following setup: An image is put into a post's resources and included in a way that in the post a scaled version of the image is shown, which is a hyperlink to a full-sized version of the image, so basically:

<a href="fullsize.jpg>
<img src="scaled.jpg">
</a>

I have noticed that in this situation some underscores appear next to the scaled image (which are no text chars, since they don't appear in the HTML source), which are clickable as a hyperlink to the fullsize image, so they seem to be a part of the content. The only way to make them disappear was to remove the , which takes the ability to link to the fullsize image.

An example can be seen here with Google Chrome and Internet Explorer under the bottom-left corner of the movie poster. I think this is an issue of the hugo-octopress template, since there is a discussion thread about the new image resource feature, with a screenshot with the same setup from another template, where these underscores don't seem to appear.

Error range sidebar.html

<section class="even">
    <h1>Recent Posts</h1>

    <!-- check if the number of recent posts is set in config file, otherwise use 5 -->
    <ul id="recent_posts">
      {{ $numberofrecentposts := 5 }}
      {{ if isset .Site.Params "SidebarRecentLimit" }}
        {{ $numberofrecentpost := .Site.Params.SidebarRecentLimit }}
      {{ end }}
      {{range first $numberofrecentposts .Site.Pages }}
      <li class="post">
        <a href="{{.RelPermalink}}">{{.Title}}</a>
      </li>
      {{ end }}
    </ul>
  </section>

No change SidebarRecentLimit, please add {{$numberofrecentposts}} on li for tests

<section class="even">
    <h1>Recent Posts</h1>

    <!-- check if the number of recent posts is set in config file, otherwise use 5 -->
    <ul id="recent_posts">
      {{ $numberofrecentposts := 5 }}
      {{ if isset .Site.Params "SidebarRecentLimit" }}
        {{ $numberofrecentpost := .Site.Params.SidebarRecentLimit }}
      {{ end }}
      {{range first $numberofrecentposts .Site.Pages }}
      <li class="post">
        {{$numberofrecentposts}}
        <a href="{{.RelPermalink}}">{{.Title}}</a>
      </li>
      {{ end }}
    </ul>
  </section>

wrong pagenagviate

thanks for this great theme.

I build a blog with baseurl = "http://guangchuangyu.github.io/cn/", all the links (tags, categories, etc) are OK except paginator. Paginator link e.g. page2 to http://guangchuangyu.github.io/page/2 instead of http://guangchuangyu.github.io/cn/page/2

Gist shortcode layout seems broken

Hi,
either this theme does not support it, or gist's delivery method changed. However, the output of the gist shortcode looks incomplete and broken. For reference, see here (at the bottom). Notice the missing syntax highlighting, and the serif font.

How could anybody fix this?

Replace "isset" with "with"

It seems like config file variables are now stored in lower case.

See link from pull request.

Replace all "isset" with "with" per bep's suggestion.

{{ with .Site.Params.fooBar }}
{{ . }}
{{ end }}

Is there a way to override part of the CSS in my own site?

Hi there, thanks so much for your work on porting this theme over to Hugo ๐Ÿ˜„

I noticed that all of the CSS for this theme is in a file called hugo-octopress.css. I hope to override a few lines of this CSS file to change a few colours and spacing.

Is there a way to do this without making a full copy of the original CSS file to my static directory?

Thanks
Fotis

Google search not getting the query search parameter while searching the blog.

Google search when enabled in the navigation is taking to a new page with search parameter as site: but doesn't append the q parameter to the query after site:<sitenavigation>.

{{ if isset .Site.Params "search_engine_url" }}
<form action="{{ .Site.Params.search_engine_url }}" method="get" target="_blank">
  <fieldset role="search">
    <input class="search" type="text" name="q" results="0" placeholder="Search"/>
    <input type="hidden" name="q" value="site:{{ "/" | absURL }}" />
  </fieldset>
</form>
{{end}}

Might need to re-visit code ?

Warning with Hugo v0.57.2

I am getting the following warning:

Module "Hugo-Octopress" is not compatible with this Hugo version; run "hugo mod graph" for more information.

Further, the index page is not listing any of my posts. Unsure if the two issues are related, some help will be appreciated.

FYI, I did not update since de3a76b on Nov 13, 2016, but now trying to rebuild using master.

.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.

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.