I’ve moved our blog from WordPress to Hugo and Github pages and I’m still in the process of cleaning things up. I’ve been going through the Googlebot errors and I’m missing http://blog.sensr.net/archives
I can’t seem to figure out how to create this. I see that on http://spf13.com/post/ there is a nice page with all the blog posts. I’ve cloned the git repo but can’t figure out what is generating this page.
layouts/post/summary.html seems to generate the homepage…
content/post/ doesn’t seem to have an index.html so that’s not where this is created.
the data from /post/ comes from list.html file in your theme.
for /archives , create content/archives.md with layout=‘archive’ and create a file layout/archive.html . Copy the content from your theme/_default/list.html to copy the same content and use .Site.Posts to loop through your archives
I feel that there should be a cleaner way to do this as well. I don’t know if aliases work on index.md or index.html files.
A couple different ways, but first, I want to make sure you aren’t asking about how spf breaks up the blog posts by year. This assumes you are trying to group by publish date rather than date, but here is the basic idea:
Now, if you want to create a specific page (ie, www.yoursite.com/archives/), you’re going to have to create a separate layout for that and a separate file.
For example, for all my single pages (eg, /about, /colophon,/contact), I created a content directory called: content/singles. Then create “layouts/singles” and create a new layout at “layouts/singles/archives.html”. Now when you create a document at “content/singles/archives.md”, just put the following in your front matter:
Or if you don’t want to use the slug, you can do what I do, which is in my config.toml, I set the following:
[permalinks]
singles = "/:title/"
…since I know that each individual markdown file in singles is going to be available at the root, but this depends entirely on the source organization and site architecture for your site.
My brain is having trouble connecting what shows up at http://spf13.com/post/ and what is in the repo. What’s the rule for what generates content for a url from a file in Hugo?
@adamb I tried a pull request but I guess you’re not accepting them Keep in mind there is more than one way to do what I’m about to show you.
The following changes will you get almost to where you want to be, but you’re probably going to want to fiddle with the presentation (ie, css).
Change your config.toml. Note the addition of singles. With this, you can remove the slug from archives.md altogether. Keep in mind that the “singles” directory is just my preference. I think you might more commonly see “pages” or “page”.
[permalinks]
post = "/:year/:month/:slug/"
page = "/:slug/"
singles = "/:title/"
New layouts/singles/archives.html. This assumes you want to group by month. If you want to group by something else, look at the docs for grouping content.
I added front matter to your archives.md. You might not need this, but there is no harm in it. I’m assuming that you’re going to want to add metadata and other parameters to this page.
---
title: Archives
date: 2011-11-16
description: The blog archive for sensrnet.
type: singles
layout: archives
---
From this point, your best bet is to do the following:
Read the docs. It will take some time, but you’ll find just about everything you need.
Reach out to the theme’s creator for additional feedback. You’re already veering a bit from the original theme, so it’s up to you to work with the creator of the theme to make future fixes.
I did notice that if I change the permalink from archive to archives2 and don’t restart the server (hugo version 0.17) that both http://localhost:1313/archives/ and http://localhost:1313/archives2/ will work. This seems like a (minor) bug. But it’s confusing if you’re trying to understand things.