Single Post with TOML front matter
tags: single toml cross-link
Description/Summary
Some description for this post.Content
This is a single post. You do not need to set the EXPORT_FILE_NAME
property in here. But then you also lose the tag and property
inheritance Org awesomeness.
First heading in this post #
This is a under first heading.
Second heading in this post #
This is a under second heading.
Cross-linking #
All of the below linked Org files have to have exported posts using
the per-file flow, and they cannot be page bundles or have set a
different #+export_file_name
— See ox-hugo
Issue #131 for
requirements for this basic cross-linking to work as expected.
Link to file in the same directory #
This file will export the front-matter in TOML (default). See /singles/post-yaml/ that exports that in YAML.
Link + Description #
Here’s the same link with description: Post exported with YAML front-matter.
Link to file in a different directory #
Link to file that has a Hugo slug set #
This one is magic! You can link to the Org file, no matter what slug is set in the exported file.. Hugo will do the job of translating from the Markdown file name to the actual link/slug.
Link to the CUSTOM_ID of a different file #
/singles/post-yaml/#first-heading
Page (Debug)
Page Variable | Value | |
---|---|---|
Name | "Single Post with TOML front matter" | |
Title | "Single Post with TOML front matter" | |
ResourceType | "page" | |
Kind | "page" | |
Section | "singles" | |
Draft | false | |
Type | "singles" | |
Layout | "" | |
Permalink | "https://ox-hugo.scripter.co/test/singles/post-toml/" | |
RelPermalink | "/singles/post-toml/" | |
Data |
| |
NextPage | Post with underscore in name | |
PrevPage | Single Post with YAML front matter | |
NextInSection | Post with underscore in name | |
PrevInSection | Single Post with YAML front matter |
Page Params (Debug)
Key | Type | Value | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
categories | []string | "cat1" "cat2" | ||||||||||||||||||
date | time.Time | 2017-07-20 00:00:00 +0000 UTC | ||||||||||||||||||
description | string | "Some description for this post." | ||||||||||||||||||
draft | bool | false | ||||||||||||||||||
iscjklanguage | bool | false | ||||||||||||||||||
lastmod | time.Time | 2022-05-03 00:48:15 -0400 -0400 | ||||||||||||||||||
menu | maps.Params |
| ||||||||||||||||||
publishdate | time.Time | 2017-07-20 00:00:00 +0000 UTC | ||||||||||||||||||
tags | []string | "single" "toml" "cross-link" | ||||||||||||||||||
title | string | "Single Post with TOML front matter" |
File Object (Debug)
FileInfo Variable | Value |
---|---|
UniqueID | "a91f824341930fa38f5a018c49777739" |
BaseFileName | "post-toml" |
TranslationBaseName | "post-toml" |
Lang | "en" |
Section | "singles" |
LogicalName | "post-toml.md" |
Dir | "singles/" |
Ext | "md" |
Path | "singles/post-toml.md" |