mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
98293eaa15
f59b3ab06 Fix typo in template lookup order 1e5536d6c Mutlilingual: Document "content directory per language" system (#509) 849a86048 Update index.md 0c24d229b Polish Hugo Next a4c9b0ee2 Polish bbec2c76e Some more in birthday post fc9681e21 More on contributors 09fe3ea31 Some more on the birthday post 8da357240 Content and images for the 5th birthday blog post fb45bb8dc Add draft for anniversary blog post 4666d0a18 Release 0.42.2 9b74d286a Merge branch 'temp422' 354e7b66b releaser: Add release notes to /docs for release of 0.42.2 57a617f34 releaser: Bump versions for release of 0.42.2 ccc3ac1b8 Update errorf.md 35706c21a Update errorf.md 1c0f35fd1 Update errorf.md b6170774b Add syntax highlighting gallery links for Chroma f91d9da47 Update usage.md c9a8f0190 Improve theme components documentation 3c4e39ddd Release 0.42.1 b45eb453f Merge branch 'temp421' c74682a10 releaser: Prepare repository for 0.43-DEV 321e07fa5 releaser: Add release notes to /docs for release of 0.42.1 7154271e0 releaser: Bump versions for release of 0.42.1 360d8244f Add link to Privacy Config 1f2454247 Fix typo a8f5f994e Fix typo d9f3f078c Update simple variants documentation (#500) f5cfd44e0 Release 0.42 fe604b321 releaser: Prepare repository for 0.43-DEV c3e5b3ca0 releaser: Add release notes to /docs for release of 0.42 3174d1b37 releaser: Bump versions for release of 0.42 48cc2d51f docs: Update theme documentation 1922fb1a6 docs: Remove some files now moved d7e4c453a Merge commit 'b239595af5a9fc1fc9a1ccc666c3ab06ccc32f04' c40964c1b tplimpl: Remove speakerdeck shortcode 081f8a0f9 tpl/strings: strings.RuneCount 828ea5f15 tpl: Add strings.Repeat a6b9f654a Add a BlackFriday option for rel="noreferrer" on external links edb786516 Add a BlackFriday option for rel="nofollow" on external links e4374971f releaser: Prepare repository for 0.42-DEV git-subtree-dir: docs git-subtree-split: f59b3ab06f282c26bce07263c8be6672cf8f7969
8.3 KiB
8.3 KiB
Blackfriday Options
taskLists
- default:
true
Blackfriday flag:
Purpose:false
turns off GitHub-style automatic task/TODO list generation. smartypants
- default:
true
Blackfriday flag:HTML_USE_SMARTYPANTS
Purpose:false
disables smart punctuation substitutions, including smart quotes, smart dashes, smart fractions, etc. Iftrue
, it may be fine-tuned with theangledQuotes
,fractions
,smartDashes
, andlatexDashes
flags (see below). smartypantsQuotesNBSP
- default:
false
Blackfriday flag:HTML_SMARTYPANTS_QUOTES_NBSP
Purpose:true
enables French style Guillemets with non-breaking space inside the quotes. angledQuotes
- default:
false
Blackfriday flag:HTML_SMARTYPANTS_ANGLED_QUOTES
Purpose:true
enables smart, angled double quotes. Example: "Hugo" renders to «Hugo» instead of “Hugo”. fractions
- default:
true
Blackfriday flag:HTML_SMARTYPANTS_FRACTIONS
Purpose:false
disables smart fractions.
Example:5/12
renders to 5⁄12(<sup>5</sup>⁄<sub>12</sub>
).
Caveat: Even withfractions = false
, Blackfriday still converts1/2
,1/4
, and3/4
respectively to ½ (½
), ¼ (¼
) and ¾ (¾
), but only these three. smartDashes
- default:
true
Blackfriday flag:HTML_SMARTY_DASHES
Purpose:false
disables smart dashes; i.e., the conversion of multiple hyphens into an en-dash or em-dash. Iftrue
, its behavior can be modified with thelatexDashes
flag below. latexDashes
- default:
true
Blackfriday flag:HTML_SMARTYPANTS_LATEX_DASHES
Purpose:false
disables LaTeX-style smart dashes and selects conventional smart dashes. AssumingsmartDashes
:
Iftrue
,--
is translated into – (–
), whereas---
is translated into — (—
).
However, spaced single hyphen between two words is translated into an en dash— e.g., "12 June - 3 July
" becomes12 June – 3 July
upon rendering. hrefTargetBlank
- default:
false
Blackfriday flag:HTML_HREF_TARGET_BLANK
Purpose:true
opensexternal linksabsolute links in a new window or tab. While thetarget="_blank"
attribute is typically used for external links, Blackfriday does that for all absolute links (ref). One needs to make note of this if they use absolute links throughout, for internal links too (for example, by settingcanonifyURLs
totrue
or viaabsURL
). nofollowLinks
- default:
false
Blackfriday flag:HTML_NOFOLLOW_LINKS
Purpose:true
createsexternal linksabsolute links withnofollow
being added to theirrel
attribute. Thereby crawlers are advised to not follow the link. While therel="nofollow"
attribute is typically used for external links, Blackfriday does that for all absolute links. One needs to make note of this if they use absolute links throughout, for internal links too (for example, by settingcanonifyURLs
totrue
or viaabsURL
). noreferrerLinks
- default:
false
Blackfriday flag:HTML_NOREFERRER_LINKS
Purpose:true
createsexternal linksabsolute links withnoreferrer
being added to theirrel
attribute. Thus when following the link no referrer information will be leaked. While therel="noreferrer"
attribute is typically used for external links, Blackfriday does that for all absolute links. One needs to make note of this if they use absolute links throughout, for internal links too (for example, by settingcanonifyURLs
totrue
or viaabsURL
). plainIDAnchors
- default
true
Blackfriday flag:FootnoteAnchorPrefix
andHeaderIDSuffix
Purpose:true
renders any heading and footnote IDs without the document ID.
Example: renders#my-heading
instead of#my-heading:bec3ed8ba720b970
extensions
- default:
[]
Purpose: Enable one or more Blackfriday's Markdown extensions (EXTENSION_*
).
Example: IncludehardLineBreak
in the list to enable Blackfriday'sEXTENSION_HARD_LINE_BREAK
.
See Blackfriday extensions section for information on all extensions. extensionsmask
- default:
[]
Purpose: Disable one or more of Blackfriday's Markdown extensions (EXTENSION_*
).
Example: IncludeautoHeaderIds
asfalse
in the list to disable Blackfriday'sEXTENSION_AUTO_HEADER_IDS
.
See Blackfriday extensions section for information on all extensions.
Blackfriday extensions
noIntraEmphasis
- default: enabled
Purpose: The "_" character is commonly used inside words when discussing code, so having Markdown interpret it as an emphasis command is usually the wrong thing. When enabled, Blackfriday lets you treat all emphasis markers as normal characters when they occur inside a word. tables
- default: enabled
Purpose: When enabled, tables can be created by drawing them in the input using the below syntax: Example:Name | Age --------|------ Bob | 27 Alice | 23
fencedCode
- default: enabled
Purpose: When enabled, in addition to the normal 4-space indentation to mark code blocks, you can explicitly mark them and supply a language (to make syntax highlighting simple).You can use 3 or more backticks to mark the beginning of the block, and the same number to mark the end of the block.
Example:
```md # Heading Level 1 Some test ## Heading Level 2 Some more test ```
autolink
- default: enabled
Purpose: When enabled, URLs that have not been explicitly marked as links will be converted into links. strikethrough
- default: enabled
Purpose: When enabled, text wrapped with two tildes will be crossed out.
Example:~~crossed-out~~
laxHtmlBlocks
- default: disabled
Purpose: When enabled, loosen up HTML block parsing rules. spaceHeaders
- default: enabled
Purpose: When enabled, be strict about prefix header rules. hardLineBreak
- default: disabled
Purpose: When enabled, newlines in the input translate into line breaks in the output. tabSizeEight
- default: disabled
Purpose: When enabled, expand tabs to eight spaces instead of four. footnotes
- default: enabled
Purpose: When enabled, Pandoc-style footnotes will be supported. The footnote marker in the text that will become a superscript text; the footnote definition will be placed in a list of footnotes at the end of the document.
Example:This is a footnote.[^1] [^1]: the footnote text.
noEmptyLineBeforeBlock
- default: disabled
Purpose: When enabled, no need to insert an empty line to start a (code, quote, ordered list, unordered list) block. headerIds
- default: enabled
Purpose: When enabled, allow specifying header IDs with{#id}
. titleblock
- default: disabled
Purpose: When enabled, support Pandoc-style title blocks. autoHeaderIds
- default: enabled
Purpose: When enabled, auto-create the header ID's from the headline text. backslashLineBreak
- default: enabled
Purpose: When enabled, translate trailing backslashes into line breaks. definitionLists
- default: enabled
Purpose: When enabled, a simple definition list is made of a single-line term followed by a colon and the definition for that term.
Example:Cat : Fluffy animal everyone likes Internet : Vector of transmission for pictures of cats
Terms must be separated from the previous definition by a blank line.
joinLines
- default: enabled
Purpose: When enabled, delete newlines and join the lines.