From ae693b9b27f653342c0adb6bb6244b5c87760581 Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Mon, 12 Feb 2018 01:47:29 -0500 Subject: [PATCH] Allow inheritance of date and slug properties --- ox-hugo.el | 2 ++ test/site/content-org/all-posts.org | 23 +++++++++++++++++++ .../posts/en/date-and-slug-inheritance.en.md | 12 ++++++++++ .../posts/es/date-and-slug-inheritance.es.md | 12 ++++++++++ test/site/themes/bare_min | 2 +- 5 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 test/site/content/posts/en/date-and-slug-inheritance.en.md create mode 100644 test/site/content/posts/es/date-and-slug-inheritance.es.md diff --git a/ox-hugo.el b/ox-hugo.el index b122bfc..44f2e16 100644 --- a/ox-hugo.el +++ b/ox-hugo.el @@ -2938,6 +2938,8 @@ are \"toml\" and \"yaml\"." "HUGO_WITH_LOCALE" "HUGO_LOCALE" "HUGO_PAIRED_SHORTCODES" + "DATE" ;Useful for inheriting same date to same posts in different languages + "HUGO_SLUG" ;Useful for inheriting same slug to same posts in different languages "HUGO_AUTO_SET_LASTMOD"))) (mapcar (lambda (str) (concat "EXPORT_" str)) diff --git a/test/site/content-org/all-posts.org b/test/site/content-org/all-posts.org index bb4c70c..421d892 100644 --- a/test/site/content-org/all-posts.org +++ b/test/site/content-org/all-posts.org @@ -4497,6 +4497,29 @@ This post will have the =foo= key in front-matter replaced with :END: Here, attempt is made to replace a non-existing key =toto=, but still, there shouldn't be any error. +* Date and slug inheritance :inheritance:date:slug: +:PROPERTIES: +:EXPORT_DATE: 2018-02-12 +:EXPORT_HUGO_SLUG: data-and-slug-inheritance +:END: +** Date and slug inheritance (English) +:PROPERTIES: +:EXPORT_HUGO_SECTION: posts/en +:EXPORT_FILE_NAME: date-and-slug-inheritance.en.md +:END: +Date and slug inheritance is useful when you want to use the same data +and slug for multiple posts, but in different languages. + +[[/posts/es/data-and-slug-inheritance][Spanish version]] +** Date and slug inheritance (Spanish) +:PROPERTIES: +:EXPORT_HUGO_SECTION: posts/es +:EXPORT_FILE_NAME: date-and-slug-inheritance.es.md +:END: +La herencia de fecha y slug es útil cuando desea usar los mismos datos +y slug para múltiples publicaciones, pero en diferentes idiomas. + +[[/posts/en/data-and-slug-inheritance][English version]] * Real Examples :real_examples: :PROPERTIES: :EXPORT_HUGO_SECTION: real-examples diff --git a/test/site/content/posts/en/date-and-slug-inheritance.en.md b/test/site/content/posts/en/date-and-slug-inheritance.en.md new file mode 100644 index 0000000..6de8a01 --- /dev/null +++ b/test/site/content/posts/en/date-and-slug-inheritance.en.md @@ -0,0 +1,12 @@ ++++ +title = "Date and slug inheritance (English)" +date = 2018-02-12 +slug = "data-and-slug-inheritance" +tags = ["inheritance", "date", "slug"] +draft = false ++++ + +Date and slug inheritance is useful when you want to use the same data +and slug for multiple posts, but in different languages. + +[Spanish version](/posts/es/data-and-slug-inheritance) diff --git a/test/site/content/posts/es/date-and-slug-inheritance.es.md b/test/site/content/posts/es/date-and-slug-inheritance.es.md new file mode 100644 index 0000000..450ccdf --- /dev/null +++ b/test/site/content/posts/es/date-and-slug-inheritance.es.md @@ -0,0 +1,12 @@ ++++ +title = "Date and slug inheritance (Spanish)" +date = 2018-02-12 +slug = "data-and-slug-inheritance" +tags = ["inheritance", "date", "slug"] +draft = false ++++ + +La herencia de fecha y slug es útil cuando desea usar los mismos datos +y slug para múltiples publicaciones, pero en diferentes idiomas. + +[English version](/posts/en/data-and-slug-inheritance) diff --git a/test/site/themes/bare_min b/test/site/themes/bare_min index 46bbd29..4e952f9 160000 --- a/test/site/themes/bare_min +++ b/test/site/themes/bare_min @@ -1 +1 @@ -Subproject commit 46bbd294e1109fc0368b2cfdadc6af020ba5d19e +Subproject commit 4e952f997f16a7a2fcbc68b538a74f69921c3b5d