### Makefile Variables for Org Installation Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Shows examples of setting variables like 'prefix', 'infodir', 'ORG_MAKE_DOC', and 'ORG_ADD_CONTRIB' in a Makefile for Org installation and documentation. ```makefile prefix = /dir/where/you/want/to/install/org # Default: /usr/share ``` ```makefile infodir = $(prefix)/org/info # Default: $(prefix)/info ``` ```makefile # Define below you only need info documentation, the default includes html and pdf ORG_MAKE_DOC = info pdf card # html ``` ```makefile # Define if you want to include some (or all) files from contrib/lisp ``` -------------------------------- ### Install Pandoc binary from repository Source: https://github.com/kaushalmodi/ox-hugo/blob/main/CHANGELOG.org Installs the specified Pandoc binary from its repository, fixing issues related to dependency installation. ```bash install -d /tmp/${USER}/ox-hugo-dev cd /tmp/${USER}/ox-hugo-dev ``` -------------------------------- ### Serve Example Site with Make Source: https://github.com/kaushalmodi/ox-hugo/wiki/Example Hugo site.org Use this command to serve the example site locally. Requires Hugo 0.25+. ```bash make serve ``` -------------------------------- ### Add Real World Example Site Source: https://github.com/kaushalmodi/ox-hugo/blob/main/CHANGELOG.org Adds a specific real-world example site to the documentation. ```markdown https://zcl.space ``` -------------------------------- ### Enable Line Numbers with Default Start Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/example-block-with-line-numbers.md Use `linenos=true` and `linenostart=1` to enable line numbers starting from 1. This is useful for standard code examples. ```text line 1 line 2 ``` -------------------------------- ### Set Org Installation Directory (Makefile) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/code-fenced-src-blocks-default.md Configure the installation directory for Org mode. The default is `/usr/share/`. ```makefile prefix = /dir/where/you/want/to/install/org # Default: /usr/share ``` -------------------------------- ### Continued Line Numbers in Example Block Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org This example block demonstrates continued line numbering, starting from the previous number. ```org #+begin_example +n line 22 line 23 #+end_example ``` -------------------------------- ### Org Example Block with Custom Line Numbers and Highlighting Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org This Org example block demonstrates custom line numbering starting from 20, reverse numbering, and highlighting line 2 using ':hl_lines 2'. ```org (save-excursion (goto-char (point-min)) (ref:jump5) ``` -------------------------------- ### Serve Example Site with Hugo CLI Source: https://github.com/kaushalmodi/ox-hugo/wiki/Example Hugo site.org Alternative method to serve the example site using the Hugo CLI. Requires Hugo 0.25+ for the --navigateToChanged flag. ```bash hugo server -D --navigateToChanged ``` -------------------------------- ### Add Real World Examples Source: https://github.com/kaushalmodi/ox-hugo/blob/main/CHANGELOG.org Introduces a section for real-world examples of ox-hugo usage, linking to a dedicated documentation page. ```markdown See https://ox-hugo.scripter.co/doc/examples/ ``` -------------------------------- ### Org Example Block with Line Numbers Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Demonstrates an Org example block with line number annotation enabled. The '-n' flag starts numbering from 1. ```org #+begin_example -n line 1 line 2 #+end_example ``` -------------------------------- ### Org Mode: List Value Front Matter Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Provides examples of various list types (strings, integers, floats, booleans) configured via Org properties. ```org :PROPERTIES: :EXPORT_HUGO_CUSTOM_FRONT_MATTER: :animals '(dog cat "penguin" "mountain gorilla") :EXPORT_HUGO_CUSTOM_FRONT_MATTER+: :integers '(123 -5 17 1_234) :EXPORT_HUGO_CUSTOM_FRONT_MATTER+: :floats '(12.3 -5.0 -17E-6) :EXPORT_HUGO_CUSTOM_FRONT_MATTER+: :booleans '(true false) :END: ``` -------------------------------- ### Add Real World Example Site (Elisp) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/CHANGELOG.org Adds a specific real-world example site related to Emacs Lisp. ```markdown https://cadadr.github.io/elisp/index.html ``` -------------------------------- ### Org Mode Gopher Link Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/external-links.md An example of how to write a gopher link in Org mode after the necessary Emacs Lisp configuration has been applied. ```org [[gopher://some.gopher.site][Dummy gopher link]] ``` -------------------------------- ### Basic Example Code Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org A simple code line example, likely for testing purposes or as a placeholder. ```text code line ``` -------------------------------- ### Start Hugo Server for Live Preview Source: https://github.com/kaushalmodi/ox-hugo/wiki/Auto-export on Saving.org Run this command in your Hugo site's root directory to start the development server. The `-D` flag includes draft posts, and `--navigateToChanged` ensures the browser navigates to the changed post. ```bash hugo server -D --navigateToChanged ``` -------------------------------- ### Org-mode Directory Structure Example for Post 2 Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/images-in-content/images-in-content.org Provides a file structure example specific to 'Post 2', highlighting the location of 'org.png' relative to the Org source file. This helps in understanding image path resolution for different posts. ```org ./content-org ├── images-in-content/ │ ├── images-in-content.org │ │ * Post 1 (Org subtree) → ./content/images-in-content/post1.md │ │ * Post 2 (Org subtree) → ./content/images-in-content/post2.md **THIS POST** │ ├── gnu.png → ./static/ox-hugo/gnu.png │ └── org.png → ./static/ox-hugo/org.png **BELOW IMAGE** ├── post3/ │ ├── post3.org → ./content/images-in-content/post3.md │ └── gnu-copy.png → ./static/ox-hugo/gnu-copy.png └── post4/ ├── post4.org → ./content/images-in-content/post4.md └── org-copy.png → ./static/ox-hugo/org-copy.png ``` -------------------------------- ### Example: Wrap Org Headings in HTML Tags Source: https://github.com/kaushalmodi/ox-hugo/blob/main/CHANGELOG.org Provides an example demonstrating how to wrap Org headings in HTML tags, addressing issue #160. ```emacs-lisp #+OPTIONS: toc:nil #+HUGO_CUSTOM_FRONT_MATTER: :PROPERTIES: :ID: wrap-org-headings-in-html-tags :END: * My Heading This is a test. #+begin_src elisp (setq org-hugo-wrap-heading-tags "

") #+end_src ``` -------------------------------- ### Org Simple Example Block Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org A basic Org example block used for displaying literal content. ```org #+begin_example This is an example #+end_example ``` -------------------------------- ### Org Mode Mailto Link Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Example of an Org mode mailto link. ```org [[mailto:abc@xyz.com][My email]] ``` -------------------------------- ### Org Cite Basic Example with CSL Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org A minimal example demonstrating the use of ~org-cite~ with CSL-formatted exports enabled. It includes setting the bibliography file and printing the bibliography section. ```org #+title: Citation using ~org-cite~ #+hugo_base_dir: ../ #+bibliography: /path/to/file.bib #+cite_export: csl [cite:@SomeCitation] Below, the "References" heading will be auto-inserted. #+print_bibliography: ``` -------------------------------- ### Example Block with HTML and CSS Attributes and Line Numbers (Blackfriday) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org This example block includes ATTR_HTML, ATTR_CSS, and line numbers, rendered with Blackfriday. ```org #+attr_html: :class heavy #+attr_css: :font-weight bold #+begin_example -n This is an example Line 2 Line 3 #+end_example ``` -------------------------------- ### Example Block with HTML and CSS Attributes (Goldmark) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org This example block uses ATTR_HTML and ATTR_CSS for styling, specifically with the Goldmark renderer. ```org #+attr_html: :class indent-block #+attr_css: :padding-left 50px #+begin_example This is an example Line 2 Line 3 #+end_example ``` -------------------------------- ### Org Mode: Map Value Front Matter Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Example showcasing complex nested map structures for front matter, including maps of lists. ```org :PROPERTIES: :EXPORT_HUGO_CUSTOM_FRONT_MATTER: :versions '((emacs . "27.0.50") (hugo . "0.48")) :EXPORT_HUGO_CUSTOM_FRONT_MATTER+: :header '((image . "projects/Readingabook.jpg") (caption . "stay hungry, stay foolish")) :EXPORT_HUGO_CUSTOM_FRONT_MATTER+: :collection '((animals . (dog cat "penguin" "mountain gorilla")) (integers . (123 -5 17 1_234)) (floats . (12.3 -5.0 -17E-6)) (booleans . (true false))) :END: ``` -------------------------------- ### Example Block with HTML and CSS Attributes and Line Numbers (Goldmark) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org This example block includes ATTR_HTML, ATTR_CSS, and line numbers, rendered with Goldmark. ```org #+attr_html: :class heavy :title some code block #+attr_css: :font-weight bold #+begin_example -n This is an example Line 2 Line 3 #+end_example ``` -------------------------------- ### Org Mode Front Matter Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/custom-front-matter-multiple-lines.md This example shows how to define custom front matter using Org mode's PROPERTIES drawer. The ':GENRES+: Baroque' line demonstrates appending to an existing property. ```org * CD collection ** Classic :PROPERTIES: :GENRES: Classic :END: *** Goldberg Variations :PROPERTIES: :Title: Goldberg Variations :Composer: J.S. Bach :Artist: Glen Gould :Publisher: Deutsche Grammophon :NDisks: 1 :GENRES+: Baroque :END: ``` -------------------------------- ### Multiple Example Blocks Inside Quote Block Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Illustrates rendering multiple example blocks within a single quote block. ```quote Some quoted text. #+begin_example (some-example) #+end_example #+begin_example (some-other-example) #+end_example ``` -------------------------------- ### Set Org Info Installation Directory (Makefile) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/code-fenced-src-blocks-default.md Specify the installation directory for Org mode's Info files. This allows for separate Info file management for development versions. ```makefile infodir = $(prefix)/org/info # Default: $(prefix)/info ``` -------------------------------- ### Pandoc Citations Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org An example demonstrating the configuration of Pandoc citations, including enabling the feature, specifying bibliographies, and using 'nocite', 'link-citations', and 'csl' meta-data. ```org ,* Citations Example :PROPERTIES: :EXPORT_FILE_NAME: citations-example :EXPORT_HUGO_PANDOC_CITATIONS: t :EXPORT_BIBLIOGRAPHY: cite/bib/bib1.bib, cite/bib/bib2.bib :EXPORT_HUGO_CUSTOM_FRONT_MATTER: :nocite '(@cite3 @cite4) :EXPORT_HUGO_CUSTOM_FRONT_MATTER+: :link-citations true :EXPORT_HUGO_CUSTOM_FRONT_MATTER+: :csl cite/csl/my-custom-csl-format.csl :END: Here is a test example file with an in-text citation where someone important says something important (e.g. @cite1). And here is another bit of blah with a footnote citation.[fn:1] ,* Footnotes [fn:1] See [@cite2]. ``` -------------------------------- ### Initialize Hugo Module Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Initialize your Hugo site as a Hugo Module. This is the preferred method for adding themes and requires Go to be installed. ```shell hugo mod init # example: hugo mod init github.com/user/reponame ``` -------------------------------- ### Org Source Block with Default Line Number Start Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Demonstrates an Org source block where line numbers start from the default (usually 1). ```org <> ``` -------------------------------- ### Org mode LOGBOOK example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/parsing-notes-from-logbook.md This is an example of a LOGBOOK section in an Org mode file. It includes notes and state changes. Only the notes are exported to front-matter. ```org :LOGBOOK: - Note taken on [2018-09-06 Thu 11:45] \ Another note. - Note taken on [2018-09-06 Thu 11:37] \ A note - State "DONE" from "DRAFT" [2018-09-06 Thu 11:25] - State "DRAFT" from "TODO" [2018-09-06 Thu 11:25] - State "TODO" from [2018-09-06 Thu 11:25] :END: ``` -------------------------------- ### Default Line Numbers in Example Block Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org This example block displays code with default line numbers enabled. ```org #+begin_example -n 20 line 20 line 21 #+end_example ``` -------------------------------- ### Update Description Special Block Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/CHANGELOG.org Updates the example for description special blocks to reflect current usage or syntax. ```emacs-lisp (setq org-hugo-description-special-block-example "#+begin_description This is a description. #+end_description") ``` -------------------------------- ### Render Text Example Block Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/example-block-following-a-list.md This code block demonstrates rendering plain text content within an example block. It is used to verify display after a list. ```text something in example block ``` -------------------------------- ### Table with Column Groups Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org This example demonstrates a table with column groups, which is typically implemented using raw HTML export in Org mode. It includes a formula for calculating powers and roots. ```org | N | N^2 | N^3 | N^4 | ~sqrt(n)~ | ~sqrt[4](N)~ | |---+-----+-----+-----+-----------+--------------| | / | < | | > | < | > | | 1 | 1 | 1 | 1 | 1 | 1 | | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 | | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 | |---+-----+-----+-----+-----------+--------------| #+tblfm: $2=$1^2::$3=$1^3::$4=$1^4::$5=sqrt($1)::$6=sqrt(sqrt(($1))) ``` -------------------------------- ### Check Hugo Installation Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Verify that the Hugo executable is available in your system's PATH. This is a prerequisite for using Hugo. ```shell hugo version ``` -------------------------------- ### Inline Code Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Demonstrates the use of inline code formatting within the text. ```text inline code 1 ``` ```text inline code 2 ``` -------------------------------- ### Render Text Example Block After Heading Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/example-block-following-a-list.md This code block shows rendering plain text content within an example block, following a heading. It verifies display in different structural contexts. ```text another example block ``` -------------------------------- ### Org Source Block with Custom Line Number Start Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Shows an Org source block where line numbering is explicitly started from a custom number. Uses `:noweb yes`. ```org #+begin_src org :noweb yes <> #+end_src ``` ```org #+begin_src org :noweb yes :exports results :results output replace :eval yes <> #+end_src ``` -------------------------------- ### Paired Markdown Shortcode Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Demonstrates a paired markdown shortcode that renders content with emphasis characters. This example shows how to define and use a shortcode that processes Markdown within its content. ```org ,#+begin_mdshortcode Content *with* /emphasis/ characters is rendered. ,#+end_mdshortcode ``` ```md {{% mdshortcode %}} Content *with* /emphasis/ characters is rendered. {{% /mdshortcode %}} ``` ```mdshortcode Content *with* /emphasis/ characters is rendered. ``` -------------------------------- ### Org Source Block with Custom Line Number Start Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Shows an Org source block where line numbers are explicitly set to start from a custom number. ```org <> ``` -------------------------------- ### Org Special Block: Article Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Use #+begin_article to create an article block. This is a basic example without specific attributes. ```org #+begin_article This is /an article/. #+end_article ``` -------------------------------- ### Enable Line Numbers with Custom Start Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/example-block-with-line-numbers.md Use `linenos=true` and `linenostart=20` to enable line numbers starting from a specific number, like 20. This is helpful for continuing numbering across multiple blocks. ```text line 20 line 21 ``` -------------------------------- ### Emacs Lisp Source Block with Line Numbers and Custom Start Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/source-block-with-highlighting.md Example of an Emacs Lisp source block with line numbers enabled and starting from a custom number. Highlighting is relative to the displayed line numbers, not the code's actual line count. ```org #+begin_src emacs-lisp -n 7 :hl_lines 1,3-5 (message "This is line 7 in code, but line 1 for highlighting reference") (message "This is line 8 in code, but line 2 for highlighting reference") (message "This is line 9 in code, but line 3 for highlighting reference") (message "This is line 10 in code, but line 4 for highlighting reference") (message "This is line 11 in code, but line 5 for highlighting reference") (message "This is line 12 in code, but line 6 for highlighting reference") #+end_src ``` ```emacs-lisp (message "This is line 7 in code, but line 1 for highlighting reference") (message "This is line 8 in code, but line 2 for highlighting reference") (message "This is line 9 in code, but line 3 for highlighting reference") (message "This is line 10 in code, but line 4 for highlighting reference") (message "This is line 11 in code, but line 5 for highlighting reference") (message "This is line 12 in code, but line 6 for highlighting reference") ``` -------------------------------- ### Configure Hugo base directory and section Source: https://github.com/kaushalmodi/ox-hugo/blob/main/CHANGELOG.org Example configuration for `hugo_base_dir` and `hugo_section` to support concatenation of section paths. ```emacs-lisp #+hugo_base_dir: . #+hugo_section: posts ``` -------------------------------- ### Hugo Server Running Message Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Example output from the `hugo server` command indicating the local address where the site is accessible. ```text Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) ``` -------------------------------- ### Org Example Block with Name Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org An Org example block with a name attribute. This is used for defining reusable examples or snippets within Org mode. ```org ,#+name: some_example (some-example) ``` -------------------------------- ### Serve Hugo Test Site Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Build and serve the local Hugo test site using make. Ensure Go and Pandoc are installed. ```bash make serve HUGO_BASE_DIR=test/site ``` -------------------------------- ### Configure Menu in Front-Matter (TOML) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Example of setting up menu items in the front-matter of a post using TOML format. This snippet demonstrates how to define a menu entry with an identifier, parent, and weight. ```toml [menu] [menu."something here"] identifier = "post-2" parent = "posts" weight = 1 ``` -------------------------------- ### Configure Org Documentation Build (Makefile) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/code-fenced-src-blocks-default.md Define which types of Org documentation to build by default. The default includes HTML, Info, and PDF. ```makefile # Define below you only need info documentation, the default includes html and pdf ORG_MAKE_DOC = info pdf card # html ``` -------------------------------- ### Neural Network Training Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Demonstrates how to initialize and train the Network class using MNIST data. Loads data using 'mnist_loader' and sets training parameters. ```python if __name__ == '__main__': import mnist_loader train_data, valid_data, test_data = mnist_loader.load_data_wrapper() net = Network([784, 100, 10]) net.gradient_descent(train_data, test_data, epoches=50, m=10, eta=0.1, lmd=5.0) ``` -------------------------------- ### Example Block Inside Quote Block Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Shows an example block rendered within a quote block. ```quote Some quoted text. #+begin_example (some-example) #+end_example ``` -------------------------------- ### Nested lists example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Demonstrates a complex structure of nested lists, including unordered, ordered, and deeply nested levels. ```org + L1 -- foo1 + L1 -- foo2 - L2 -- bar1 - L2 -- bar2 + L3 -- baz1 + L3 -- baz2 - L4 -- zoo1 - L4 -- zoo2 1. L5 -- numbered1 2. L5 -- numbered2 - L4 -- zoo1 - L4 -- zoo2 + L3 -- baz1 + L3 -- baz2 - L2 -- bar1 - L2 -- bar2 + L1 -- foo1 + L1 -- foo2 ``` -------------------------------- ### Example Book Directory Structure Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/book1/_index.md Illustrates the expected directory and file structure for a book organized into chapters and sections within the `content/` directory. ```text > tree book1 book1 ├── chapter1 │ ├── _index.md │ ├── section1.md │ └── section2.md ├── chapter2 │ ├── _index.md │ ├── section1.md │ └── section2.md └── _index.md ``` -------------------------------- ### Org Example Block without Line Numbers Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org An Org example block without line number annotation. ```org #+begin_example foo bar #+end_example ``` -------------------------------- ### Start Hugo Server Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Run the Hugo server with draft builds enabled and live reload for changed content. Navigate to the provided URL in your browser. ```shell hugo server --buildDrafts --navigateToChanged ``` -------------------------------- ### Org Time Stamp Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org An example of an Org mode time stamp, which can also be used for date parameters. ```Org-mode <2020-05-17 Sun> ``` -------------------------------- ### YAML Code Block Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/list-has-src-block-with-list-syntax.md A simple YAML code block example, illustrating structure within a list item. ```yaml ports: foo: bar ``` -------------------------------- ### Configure Blackfriday Fractions (TOML) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/deprecated-tests/blackfriday_options.org Enable Blackfriday fractions by setting the option to t or true. This example shows the TOML format for enabling fractions. ```toml :EXPORT_HUGO_BLACKFRIDAY: :fractions t ``` -------------------------------- ### Disable Line Numbers in Example Block Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org This example block shows how to disable line numbers by setting ':linenos false' in the header. ```org #+begin_example :linenos false This is line 1 This is line 2 This is line 3 #+end_example ``` -------------------------------- ### Org Source Block with Line Numbers (Default Start) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Demonstrates an Org source block with default line number behavior. The `:noweb yes` argument is used. ```org #+begin_src org :noweb yes <> #+end_src ``` ```org #+begin_src org :noweb yes :exports results :results output replace :eval yes <> #+end_src ``` -------------------------------- ### Configure Multiple Blackfriday Extensions and Options (TOML) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/deprecated-tests/blackfriday_options.org Configure multiple Blackfriday extensions and options, including disabling fractions and enabling smart dashes, hard line breaks, and target blank for links. This example uses TOML format. ```toml :EXPORT_HUGO_BLACKFRIDAY: :smartdashes :fractions nil :plainidanchors false ``` ```toml :EXPORT_HUGO_BLACKFRIDAY+: :angledquotes t :hrefTargetBlank true ``` ```toml :EXPORT_HUGO_BLACKFRIDAY+: :extensions tabsizeeight hardlinebreak ``` -------------------------------- ### RFC3339 Date Format Examples for org-hugo-date-format Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Examples of date format strings compatible with RFC3339, used to configure the `org-hugo-date-format` variable. ```Plain text %Y-%m-%dT%T%z ``` ```Plain text %Y-%m-%dT%T ``` ```Plain text %Y-%m-%d ``` -------------------------------- ### Example of tags and categories in #+filetags + headings Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Demonstrates combining #+filetags keyword and heading tags/categories for comprehensive Hugo front matter generation in subtree-based exports. Ensure org-use-tag-inheritance is enabled for inheritance. ```org ,#+filetags: tag1 tag2 @cat1 @cat2 ,* My post :tag3:@cat3: ``` -------------------------------- ### Key Binding Formatting Options Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Shows how key bindings are translated to Markdown, with options for using `` tags or `` tags based on configuration. ```Org-mode =~key-binding~= ``` ```Markdown `key-binding` ``` ```Markdown key-binding ``` -------------------------------- ### Output with Specified Line Number Start Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/source-block-with-line-numbers.md The output shows line numbers starting from the specified number when '-n ' is used in the Org source. ```emacs-lisp ;; this will export with line number 20 (message "This is line 21") ``` -------------------------------- ### Org Source with Specified Line Number Start Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/source-block-with-line-numbers.md Use '-n ' in Org source blocks to specify the starting line number for annotations. ```org #+begin_src emacs-lisp -n 20 ;; this will export with line number 20 (message "This is line 21") #+end_src ``` -------------------------------- ### Org Source Block with Highlighting and Line Numbers Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org An Org source block example that includes both syntax highlighting and line numbers. ```org <> ``` -------------------------------- ### Example Tags and Categories in #+filetags Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Demonstrates how to define tags and categories using the `#+filetags` keyword for file-based exports. Tags without the '@' prefix are treated as tags, while those with '@' are treated as categories. ```org #+filetags: tag1 tag2 @cat1 @cat2 ``` -------------------------------- ### Common Menu Setting Style in Org Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Demonstrates a common way to set the 'menu' front-matter for a group of posts using Org property inheritance. ```org ,* Posts under the ~main~ Menu :PROPERTIES: :EXPORT_HUGO_MENU: :menu main :END: ,** Post 1 :PROPERTIES: :EXPORT_FILE_NAME: post-1 :END: ,** Post 2 :PROPERTIES: :EXPORT_FILE_NAME: post-2 :END: ``` -------------------------------- ### Python Print Statement Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/source-block-replace-langs-in-exported-md.md A basic Python code snippet demonstrating a print statement. This example is useful for testing syntax highlighting and language identification in Markdown. ```python (print "hello") ``` ```python (print "hello") ``` -------------------------------- ### Hugo Figure Shortcode Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/issues/470/index.md Example of using the Hugo figure shortcode to embed an SVG with a link. Ensure the SVG does not contain a DOCTYPE tag for proper rendering. ```html {{< figure src="https://user-images.githubusercontent.com/3578197/143625834-4548e998-0d45-4c9f-85bb-3d56456d3200.png" link="https://github.com/kaushalmodi/ox-hugo/issues/470#issuecomment-980385275" >}} ``` -------------------------------- ### Org Source Block Highlighting With Line Numbers (Not Starting from 1) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org An Org source block with highlighting and line numbers that do not start from 1. Uses `:noweb yes`. ```org #+begin_src org :noweb yes <> #+end_src ``` ```org #+begin_src org :noweb yes :exports results :results output replace :eval yes <> #+end_src ``` -------------------------------- ### Org-mode Directory Structure Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/images-in-content/images-in-content.org Illustrates the file structure for an Org-mode export, showing the relationship between Org source files, exported Markdown files, and image assets. This structure is relevant for understanding how relative image paths are resolved. ```org ./content-org ├── images-in-content/ │ ├── images-in-content.org │ │ * Post 1 (Org subtree) → ./content/images-in-content/post1.md **THIS POST** │ │ * Post 2 (Org subtree) → ./content/images-in-content/post2.md │ ├── gnu.png → ./static/ox-hugo/gnu.png **BELOW IMAGE** │ └── org.png → ./static/ox-hugo/org.png ├── post3/ │ ├── post3.org → ./content/images-in-content/post3.md │ └── gnu-copy.png → ./static/ox-hugo/gnu-copy.png └── post4/ ├── post4.org → ./content/images-in-content/post4.md └── org-copy.png → ./static/ox-hugo/org-copy.png ``` -------------------------------- ### Example of Org Capture Output with CLOSED Property Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org An example of an Org heading after being marked as DONE, showing the auto-inserted CLOSED timestamp property, which ox-hugo uses for the post date. ```org ,*** DONE Narrowing the Author column in Magit :org:log: CLOSED: [2017-12-18 Mon 16:36] ``` -------------------------------- ### Org Mode Source Block with Line Highlighting and Custom Start Line Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Exports an Emacs Lisp source block with line highlighting, starting line numbering from 7. ```emacs-lisp #+begin_src emacs-lisp -n 7 :hl_lines 1,3-5 (message "This is line 7 in code, but line 1 for highlighting reference") (message "This is line 8 in code, but line 2 for highlighting reference") (message "This is line 9 in code, but line 3 for highlighting reference") (message "This is line 10 in code, but line 4 for highlighting reference") (message "This is line 11 in code, but line 5 for highlighting reference") (message "This is line 12 in code, but line 6 for highlighting reference") #+end_src ``` -------------------------------- ### Highlight Lines with Default Starting Line Number Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/source-block-with-highlighting-blackfriday.md Enable line numbers for an Emacs Lisp code block and highlight specific lines, with line numbering starting from 1. ```org #+begin_src emacs-lisp -n :hl_lines 1,3-5 (message "This is line 1") (message "This is line 2") (message "This is line 3") (message "This is line 4") (message "This is line 5") (message "This is line 6") #+end_src ``` ```html {{< highlight emacs-lisp "linenos=true, linenostart=1, hl_lines=1 3-5" >}} (message "This is line 1") (message "This is line 2") (message "This is line 3") (message "This is line 4") (message "This is line 5") (message "This is line 6") {{< /highlight >}} ``` -------------------------------- ### Generate Documentation Site Source: https://github.com/kaushalmodi/ox-hugo/blob/main/CONTRIBUTING.org Run this command to generate Markdown files for the documentation site and .org files for GitHub. This is part of the documentation contribution workflow. ```shell make doc ``` -------------------------------- ### Hugo Highlight Shortcode with Specified Line Number Start Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/source-block-with-line-numbers-blackfriday.md Represents the Hugo `highlight` shortcode for the previous Org mode block, setting line numbers to start from 20. ```html {{< highlight emacs-lisp "linenos=true, linenostart=20" >}} ;; this will export with line number 20 (message "This is line 21") {{< /highlight >}} ``` -------------------------------- ### Neural Network Initialization and Training Execution Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/real-examples/nn-intro.md This snippet demonstrates how to initialize a Network object with specified layer sizes and then initiate the gradient descent training process using provided training and testing data. It assumes the existence of a `mnist_loader` module. ```python if __name__ == '__main__': import mnist_loader train_data, valid_data, test_data = mnist_loader.load_data_wrapper() net = Network([784, 100, 10]) net.gradient_descent(train_data, test_data, epoches=100, m=10, eta=2.0) ``` -------------------------------- ### Org Source Block Highlighting With Line Numbers (Starting from 1) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org This Org source block includes both highlighting and line numbers, with numbering starting from 1. Uses `:noweb yes`. ```org #+begin_src org :noweb yes <> #+end_src ``` ```org #+begin_src org :noweb yes :exports results :results output replace :eval yes <> #+end_src ``` -------------------------------- ### Build Markdown Tree with Make Source: https://github.com/kaushalmodi/ox-hugo/wiki/Example Hugo site.org Use this command to build the Markdown tree from an Org file. Specify the Org file using the ORG variable. ```bash make mdtree ORG=content-org/all-posts.org ``` -------------------------------- ### Wrap Debug Info in Org Example Blocks Source: https://github.com/kaushalmodi/ox-hugo/blob/main/CHANGELOG.org Wraps debug information containing file paths in Org Example blocks to prevent forward slashes from being interpreted as Org italics. ```Emacs Lisp ;; Wrap the debug info containing file paths in Org Example blocks ;; That way the forward slashes in the paths don't get interpreted as Org ;; /italics/. ``` -------------------------------- ### Org Special Block Example in Ox-Hugo Source: https://github.com/kaushalmodi/ox-hugo/blob/main/doc/ox-hugo-manual.org Demonstrates the usage of Org Special Blocks in Ox-Hugo, similar to HTML and LaTeX export capabilities. This example shows how to mark text with custom delimiters. ```org #+begin_mark /Some/ *marked* text #+end_mark ``` -------------------------------- ### Resources in Front Matter (TOML) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Example of including resources within the front matter of a post, specifically configured for TOML export. ```org :PROPERTIES: :EXPORT_FILE_NAME: resources-in-front-matter-toml :END: ``` -------------------------------- ### Org Mode Source Block with Line Highlighting and Default Start Line Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Exports an Emacs Lisp source block with line highlighting, using default line numbering starting from 1. ```emacs-lisp #+begin_src emacs-lisp -n :hl_lines 1,3-5 (message "This is line 1") (message "This is line 2") (message "This is line 3") (message "This is line 4") (message "This is line 5") (message "This is line 6") #+end_src ``` -------------------------------- ### Hugo Summary Splitter Example Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Demonstrates the use of the '#+hugo: more' keyword to manually split content for summaries in Hugo. This is useful for controlling how much content appears before the 'read more' link. ```org #+hugo: more ``` -------------------------------- ### Linking to an Image in the Same Directory (Org-mode) Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/images-in-content/images-in-content.org Demonstrates how to link to an image file located in the same directory as the Org source file. This is a common scenario for including local assets. ```org [[file:gnu.png]] ``` -------------------------------- ### Highlight Lines with Custom Starting Line Number Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content/posts/source-block-with-highlighting-blackfriday.md Configure highlighting for specific lines in an Emacs Lisp code block while also displaying line numbers that start from a custom number (e.g., 7). ```org #+begin_src emacs-lisp -n 7 :hl_lines 1,3-5 (message "This is line 7 in code, but line 1 for highlighting reference") (message "This is line 8 in code, but line 2 for highlighting reference") (message "This is line 9 in code, but line 3 for highlighting reference") (message "This is line 10 in code, but line 4 for highlighting reference") (message "This is line 11 in code, but line 5 for highlighting reference") (message "This is line 12 in code, but line 6 for highlighting reference") #+end_src ``` ```html {{< highlight emacs-lisp "linenos=true, linenostart=7, hl_lines=1 3-5" >}} (message "This is line 7 in code, but line 1 for highlighting reference") (message "This is line 8 in code, but line 2 for highlighting reference") (message "This is line 9 in code, but line 3 for highlighting reference") (message "This is line 10 in code, but line 4 for highlighting reference") (message "This is line 11 in code, but line 5 for highlighting reference") (message "This is line 12 in code, but line 6 for highlighting reference") {{< /highlight >}} ``` -------------------------------- ### Generate Markdown and Documentation Source: https://github.com/kaushalmodi/ox-hugo/blob/main/CONTRIBUTING.org Execute this command to generate both Markdown files for the documentation site and .org files. This is used when contributing to code. ```shell make md doc ``` -------------------------------- ### Render Markdown List in Code Block Source: https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/all-posts.org Demonstrates rendering Markdown list syntax within an example block. This is a workaround for an upstream bug. ```markdown - list 1 ``` ```example - List item 1.1 in code block - List item 1.2 in code block ``` ```example + List item 2.1 in code block + List item 2.2 in code block ``` ```example - List item 1.1 in code block - List item 1.2 in code block ``` ```example + List item 2.1 in code block + List item 2.2 in code block ```