Hugo - multiple sections of website with their own local taxonomies? - hugo

I'm building a website that has "blog" section and and "guide" section, like this:
mywebsite.com/blog/
mywebsite.com/guide/
Both blog and guide contain their own multiple posts. I'd like to add independent tags (taxonomies) to both blog and guide, so that I could list posts by specific tags, for example:
mywebsite.com/blog/tags/some_blog_tag
mywebsite.com/guide/tags/some_guide_tag
What should be my project's folder and file structure - both content folder and layouts folder - to implement this? It seems that hugo is built around the idea that the taxonomy should be global for the entire website. However, there are also "page bundles" in hugo. Can hugo define local taxonomies inside page bundles? I find the docs very confusing on this topic.
Also, what should be added to the config.json file to create such section local taxonomies?
I tried the following folder structure, but I get "page not found" when I access mywebsite.com/blog/tags/some_blog_tag or mywebsite.com/guide/tags/some_guide_tag
- content
- blog
_index.md
blog_content1.md
blog_content2.md
blog_content3.md
- guide
_index.md
guide_content1.md
guide_content2.md
guide_content3.md
- layouts
- blog
list.html
taxonomy.html
- guide
list.html
taxonomy.html

One way to achieve that would be to use a multilingual site, with three languages:
one language named en (default)
one language named blog
the last one named guide
and adding the parameter defaultContentLanguageInSubdir: false
By doing so, you can host all your non blog/guide pages in the en language, and each blog/guide pages will have their own taxonomy as required.
See documentation for more information
https://gohugo.io/content-management/multilingual/

Related

How can I create a deeper level of detail page for single list content in HUGO

I’m building our job posting pages with Hugo. So we will have a “Join Us” section with the list of job postings there and then we will need a detailed page for each job post, something like /join/software_engineer/. Hugo works well for this part, I created a section page template and single page template, with all the job posts in the content folder.
But now we need a deeper level of the detail page, like /join/software_engineer/submit/ to submit the resume and other info. The detail page may look very similar for every job post and will need some info from the single list content and a structured URL. Is there any way I can achieve this in a “HUGO way”? (Right now I’m coding the submit section with a modal, but still very curious if this kind of detail page is achievable.)
Any suggestions? Thank you in advance :).
if you like to go deeper your last folder needs to have an _index.md file (note the underscore). Then set the type in your frontmatter and create a custom layout e.g.
type: software_engineer
layouts/software_engineer/list.html
I have a site where I go many levels deep and that works well.

Is there a way to embed a bookdown document as a blogdown post?

I have created a tutorial using Bookdown (which I think is a great format for it), and am currently in the process of creating a website using Blogdown (hugo-academic theme). I would like to be able to add this tutorial to a tutorials page as a Bookdown post, but I don't know if that's possible.
I'm new to Blogdown, so I haven't been able to find any solutions to this. If it's not possible, is there a way of changing the post link to a hyperlink that takes the user to a published Bookdown file (perhaps to bookdown.org)?
From my point of view it makes more sense to keep the tutorials (written with bookdown) separate from the rest of the website (written with blogdown). One possible solution is to use the "portfolio" widget together with content that uses external_link, similar to how "external projects" work. Since you do not want the tutorials widget on the home page, you need to do the following:
Create a directory content/tutorial containing directories for every individual tutorial. Each of these directories contains an index.md modeled after "external project", i.e. with an external_link attribute.
Create a second directory content/tutorials with an index.md widget page, c.f. https://sourcethemes.com/academic/docs/managing-content/#create-a-widget-page
Create in the second directory a portfolio widget, e.g. by copying projects.md, where you set page_type to tutorial (the name of the first directory).
The crucial point is that you need two directories. One for the tutorials and one for the widgets. Full example is on GitHub. Of course, it would make sense to add a link to /tutorials/ (not /tutorial/!) to your sites menu.

How to create a custom list page with only draft posts in Hugo?

So, theme is in place, I can list all posts and access each one of them when Hugo server is running, being draft or not.
I'm trying to create a custom list but, after some research, I couldn't find how to list only draft posts.
Can you help me to create a custom Hugo page that list only draft posts when it's config has draft: true?
Check if the newly released Hugo 0.65.0 (Feb. 2020) could help:
The front matter fields that control when and if to publish a piece of content (draft, publishDate, expiryDate) now also works for list pages (like sections and the home page), and is recursive.
For some purposes it is useful just to have a catalog of the drafts in the content directory. A list of drafts is easy to obtain by issuing in the command line:
hugo list drafts

How to build single page site from Markdown?

Hugo is for people building a blog, company site, portfolio, tumblog, documentation, single page site or a site with thousands of pages.
http://gohugo.io/overview/introduction/
I'd like to make a single page site. My content is written in Markdown index.md. How do I build it?
It's necessary to build with Hugo (rather than pandoc) because I want to use its csv templating feature http://gohugo.io/extras/dynamiccontent/
I tried hugo new to create a blank site. If I create _layouts/index.html then hugo server will show that. But I want to write content in Markdown.
As of Hugo 0.18, this is now possible by creating a content/_index.md file, if the theme you are using supports it. You can create this file with the command hugo new _index.md. See the Hugo docs for more details.
Just write a post example.md as usual, Hugo will build it public/example/index.html. Then rather than push public to your web host, publish public/example. Voila, single page site.
the hugo quickstart should have everything you need to get started, including adding markdown posts. Specifically, hugo new POSTNAME.md will create a markdown post with proper header at content/POSTNAME.md.

How do i reference other blogpost in a blog content - drupal 7 with views

I create blog posts in drupal 7 with the module "view" to display the content items as a blog.
However I would like to be able to reference old posts inline so as to reuse content and add traffic.
But my current workflow is to go and look at the old post and copy the url, like it was an external link.
This seems quite silly to do internal and would also break links if links changed.
How can I add these dynamically instead?
These two plugins does the trick:
CKeditor link - if you use the ckeditor
LinkIt integreates into other wysiwyg modules

Resources