tag
+ if (!hasLink) {
+ figure.className = 'gallery-image';
+
+ const a = document.createElement('a');
+ a.href = img.src;
+ a.setAttribute('target', '_blank');
+ img.parentNode.insertBefore(a, img);
+ a.appendChild(img);
+ }
}
- else if (figure.previousElementSibling === currentGallery[currentGallery.length - 1]) {
- /// Adjacent figures
- currentGallery.push(figure);
+
+ const figuresEl = container.querySelectorAll('figure.gallery-image');
+
+ let currentGallery = [];
+
+ for (const figure of figuresEl) {
+ if (!currentGallery.length) {
+ /// First iteration
+ currentGallery = [figure];
+ }
+ else if (figure.previousElementSibling === currentGallery[currentGallery.length - 1]) {
+ /// Adjacent figures
+ currentGallery.push(figure);
+ }
+ else if (currentGallery.length) {
+ /// End gallery
+ StackGallery.wrap(currentGallery);
+ currentGallery = [figure];
+ }
}
- else if (currentGallery.length) {
- /// End gallery
- wrap(currentGallery);
- currentGallery = [figure];
+
+ if (currentGallery.length > 0) {
+ StackGallery.wrap(currentGallery);
}
}
- if (currentGallery.length > 0) {
- wrap(currentGallery);
+ /**
+ * Wrap adjacent figure tags with div.gallery
+ * @param figures
+ */
+ public static wrap(figures: HTMLElement[]) {
+ const galleryContainer = document.createElement('div');
+ galleryContainer.className = 'gallery';
+
+ const parentNode = figures[0].parentNode,
+ first = figures[0];
+
+ parentNode.insertBefore(galleryContainer, first)
+
+ for (const figure of figures) {
+ galleryContainer.appendChild(figure);
+ }
}
-};
\ No newline at end of file
+
+ public open(index: number) {
+ const pswp = document.querySelector('.pswp') as HTMLDivElement;
+ const ps = new window.PhotoSwipe(pswp, window.PhotoSwipeUI_Default, this.items, {
+ index: index,
+ galleryUID: this.galleryUID,
+ getThumbBoundsFn: (index) => {
+ const thumbnail = this.items[index].el.getElementsByTagName('img')[0],
+ pageYScroll = window.pageYOffset || document.documentElement.scrollTop,
+ rect = thumbnail.getBoundingClientRect();
+
+ return { x: rect.left, y: rect.top + pageYScroll, w: rect.width };
+ }
+ });
+
+ ps.init();
+ }
+
+ private bindClick() {
+ for (const [index, item] of this.items.entries()) {
+ const a = item.el.querySelector('a');
+
+ a.addEventListener('click', (e) => {
+ e.preventDefault();
+ this.open(index);
+ })
+ }
+ }
+}
+
+export default StackGallery;
\ No newline at end of file
diff --git a/assets/ts/main.ts b/assets/ts/main.ts
index 0668c7c..f3160ae 100644
--- a/assets/ts/main.ts
+++ b/assets/ts/main.ts
@@ -5,7 +5,8 @@
* @website: https://jimmycai.com
* @link: https://github.com/CaiJimmy/hugo-theme-stack
*/
-import StackCodeBlock from "ts/codeblock";
+import StackGallery from "ts/gallery";
+import { getColor } from 'ts/color';
import menu from 'ts/menu';
import createElement from 'ts/createElement';
import StackColorScheme from 'ts/colorScheme';
@@ -21,12 +22,76 @@ let Stack = {
const articleContent = document.querySelector('.article-content') as HTMLElement;
if (articleContent) {
+ new StackGallery(articleContent);
setupSmoothAnchors();
setupScrollspy();
}
+ /**
+ * Add linear gradient background to tile style article
+ */
+ const articleTile = document.querySelector('.article-list--tile');
+ if (articleTile) {
+ let observer = new IntersectionObserver(async (entries, observer) => {
+ entries.forEach(entry => {
+ if (!entry.isIntersecting) return;
+ observer.unobserve(entry.target);
+
+ const articles = entry.target.querySelectorAll('article.has-image');
+ articles.forEach(async articles => {
+ const image = articles.querySelector('img'),
+ imageURL = image.src,
+ key = image.getAttribute('data-key'),
+ hash = image.getAttribute('data-hash'),
+ articleDetails: HTMLDivElement = articles.querySelector('.article-details');
+
+ const colors = await getColor(key, hash, imageURL);
+
+ articleDetails.style.background = `
+ linear-gradient(0deg,
+ rgba(${colors.DarkMuted.rgb[0]}, ${colors.DarkMuted.rgb[1]}, ${colors.DarkMuted.rgb[2]}, 0.5) 0%,
+ rgba(${colors.Vibrant.rgb[0]}, ${colors.Vibrant.rgb[1]}, ${colors.Vibrant.rgb[2]}, 0.75) 100%)`;
+ })
+ })
+ });
+
+ observer.observe(articleTile)
+ }
+
+
+ /**
+ * Add copy button to code block
+ */
+ const highlights = document.querySelectorAll('.article-content div.highlight');
+ const copyText = `Copy`,
+ copiedText = `Copied!`;
+
+ highlights.forEach(highlight => {
+ const copyButton = document.createElement('button');
+ copyButton.innerHTML = copyText;
+ copyButton.classList.add('copyCodeButton');
+ highlight.appendChild(copyButton);
+
+ const codeBlock = highlight.querySelector('code[data-lang]');
+ if (!codeBlock) return;
+
+ copyButton.addEventListener('click', () => {
+ navigator.clipboard.writeText(codeBlock.textContent)
+ .then(() => {
+ copyButton.textContent = copiedText;
+
+ setTimeout(() => {
+ copyButton.textContent = copyText;
+ }, 1000);
+ })
+ .catch(err => {
+ alert(err)
+ console.log('Something went wrong', err);
+ });
+ });
+ });
+
new StackColorScheme(document.getElementById('dark-mode-toggle'));
- StackCodeBlock();
}
}
diff --git a/config.yaml b/config.yaml
new file mode 100644
index 0000000..fcb4bcb
--- /dev/null
+++ b/config.yaml
@@ -0,0 +1,143 @@
+module:
+ hugoVersion:
+ extended: true
+ min: "0.87.0"
+
+params:
+ mainSections:
+ - post
+ featuredImageField: image
+ rssFullContent: true
+ favicon:
+
+ footer:
+ since:
+ customText:
+
+ dateFormat:
+ published: Jan 02, 2006
+ lastUpdated: Jan 02, 2006 15:04 MST
+
+ sidebar:
+ compact: false
+ emoji:
+ subtitle:
+ avatar:
+ enabled: true
+ local: true
+ src: img/avatar.png
+
+ article:
+ math: false
+ toc: true
+ readingTime: true
+ license:
+ enabled: false
+ default: Licensed under CC BY-NC-SA 4.0
+
+ comments:
+ enabled: false
+ provider: disqus
+
+ disqusjs:
+ shortname:
+ apiUrl:
+ apiKey:
+ admin:
+ adminLabel:
+
+ utterances:
+ repo:
+ issueTerm: pathname
+ label:
+
+ remark42:
+ host:
+ site:
+ locale:
+
+ vssue:
+ platform:
+ owner:
+ repo:
+ clientId:
+ clientSecret:
+ autoCreateIssue: false
+
+ # Waline client configuration see: https://waline.js.org/en/reference/client.html
+ waline:
+ serverURL:
+ lang:
+ visitor:
+ avatar:
+ emoji:
+ - https://cdn.jsdelivr.net/gh/walinejs/emojis/weibo
+ requiredMeta:
+ - name
+ - email
+ - url
+ placeholder:
+ locale:
+ admin: Admin
+
+ twikoo:
+ envId:
+ region:
+ path:
+ lang:
+
+ giscus:
+ repo:
+ repoID:
+ category:
+ categoryID:
+ mapping:
+ strict:
+ lightTheme:
+ darkTheme:
+ reactionsEnabled: 1
+ emitMetadata: 0
+ inputPosition:
+ lang:
+
+ gitalk:
+ owner:
+ admin:
+ repo:
+ clientID:
+ clientSecret:
+
+ cusdis:
+ host:
+ id:
+
+ widgets:
+ homepage: []
+ page: []
+
+ opengraph:
+ twitter:
+ # Your Twitter username
+ site:
+
+ # Available values: summary, summary_large_image
+ card: summary_large_image
+
+ defaultImage:
+ opengraph:
+ enabled: false
+ local: false
+ src:
+
+ colorScheme:
+ # Display toggle
+ toggle: true
+
+ # Available values: auto, light, dark
+ default: auto
+
+ imageProcessing:
+ cover:
+ enabled: true
+ content:
+ enabled: true
diff --git a/config/_default/module.toml b/config/_default/module.toml
deleted file mode 100644
index cc14cd5..0000000
--- a/config/_default/module.toml
+++ /dev/null
@@ -1,3 +0,0 @@
-[hugoVersion]
-extended = true
-min = "0.100.0"
\ No newline at end of file
diff --git a/config/_default/params.toml b/config/_default/params.toml
deleted file mode 100644
index a6bd7ce..0000000
--- a/config/_default/params.toml
+++ /dev/null
@@ -1,52 +0,0 @@
-# Theme's default configuration
-mainSections = ["post"]
-featuredImageField = "image"
-rssFullContent = true
-
-[footer]
-
-[dateFormat]
-published = "Jan 02, 2006"
-lastUpdated = "Jan 02, 2006 15:04 MST"
-
-[sidebar]
-compact = false
-
-[sidebar.avatar]
-enabled = true
-local = true
-src = "img/avatar.png"
-
-[article]
-math = false
-toc = true
-readingTime = true
-
-[article.license]
-enabled = false
-default = "Licensed under CC BY-NC-SA 4.0"
-
-[comments]
-enabled = false
-provider = "disqus"
-
-[widgets]
-homepage = []
-page = []
-
-[opengraph.twitter]
-card = "summary_large_image"
-
-[defaultImage.opengraph]
-enabled = false
-local = false
-
-[colorScheme]
-toggle = true
-default = "auto"
-
-[imageProcessing.cover]
-enabled = true
-
-[imageProcessing.content]
-enabled = true
diff --git a/data/external.yaml b/data/external.yaml
index 269ef4c..777620d 100644
--- a/data/external.yaml
+++ b/data/external.yaml
@@ -1,3 +1,25 @@
+Vibrant:
+ - src: https://cdn.jsdelivr.net/npm/node-vibrant@3.1.6/dist/vibrant.min.js
+ integrity: sha256-awcR2jno4kI5X0zL8ex0vi2z+KMkF24hUW8WePSA9HM=
+ type: script
+
+PhotoSwipe:
+ - src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js
+ integrity: sha256-ePwmChbbvXbsO02lbM3HoHbSHTHFAeChekF1xKJdleo=
+ type: script
+ defer: true
+
+ - src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js
+ integrity: sha256-UKkzOn/w1mBxRmLLGrSeyB4e1xbrp4xylgAWb3M42pU=
+ type: script
+ defer: true
+
+ - src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css
+ type: style
+
+ - src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css
+ type: style
+
KaTeX:
- src: https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.min.css
integrity: sha256-J+iAE0sgH8QSz9hpcDxXIftnj65JEZgNhGcgReTTK9s=
diff --git a/exampleSite/README.md b/exampleSite/README.md
new file mode 100644
index 0000000..1b6d403
--- /dev/null
+++ b/exampleSite/README.md
@@ -0,0 +1 @@
+Example site modified from https://github.com/gohugoio/hugoBasicExample
\ No newline at end of file
diff --git a/exampleSite/assets/img/favicon.png b/exampleSite/assets/img/favicon.png
deleted file mode 100644
index 74e8efa..0000000
Binary files a/exampleSite/assets/img/favicon.png and /dev/null differ
diff --git a/exampleSite/assets/img/logo.jpg b/exampleSite/assets/img/logo.jpg
deleted file mode 100644
index 145804e..0000000
Binary files a/exampleSite/assets/img/logo.jpg and /dev/null differ
diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml
new file mode 100644
index 0000000..c1b48dd
--- /dev/null
+++ b/exampleSite/config.yaml
@@ -0,0 +1,239 @@
+baseurl: https://example.com
+languageCode: en-us
+theme: hugo-theme-stack
+paginate: 5
+title: Example Site
+
+languages:
+ en:
+ languageName: English
+ title: Example Site
+ description: Example description
+ weight: 1
+ zh-cn:
+ languageName: 中文
+ title: 演示站点
+ description: 演示说明
+ weight: 2
+ ar:
+ languageName: عربي
+ languagedirection: rtl
+ title: موقع تجريبي
+ description: وصف تجريبي
+ weight: 3
+
+# Change it to your Disqus shortname before using
+disqusShortname: hugo-theme-stack
+
+# GA Tracking ID
+googleAnalytics:
+
+# Theme i18n support
+# Available values: ar, bn, ca, de, el, en, es, fr, hu, id, it, ja, ko, nl, pt-br, th, uk, zh-cn, zh-hk, zh-tw
+DefaultContentLanguage: en
+
+# Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko]
+# This will make .Summary and .WordCount behave correctly for CJK languages.
+hasCJKLanguage: false
+
+permalinks:
+ post: /p/:slug/
+ page: /:slug/
+
+params:
+ mainSections:
+ - post
+ featuredImageField: image
+ rssFullContent: true
+ favicon: # e.g.: favicon placed in `static/favicon.ico` of your site folder, then set this field to `/favicon.ico` (`/` is necessary)
+
+ footer:
+ since: 2020
+ customText:
+
+ dateFormat:
+ published: Jan 02, 2006
+ lastUpdated: Jan 02, 2006 15:04 MST
+
+ sidebar:
+ emoji: 🍥
+ subtitle: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+ avatar:
+ enabled: true
+ local: true
+ src: img/avatar.png
+
+ article:
+ math: false
+ toc: true
+ readingTime: true
+ license:
+ enabled: true
+ default: Licensed under CC BY-NC-SA 4.0
+
+ comments:
+ enabled: true
+ provider: disqus
+
+ disqusjs:
+ shortname:
+ apiUrl:
+ apiKey:
+ admin:
+ adminLabel:
+
+ utterances:
+ repo:
+ issueTerm: pathname
+ label:
+
+ remark42:
+ host:
+ site:
+ locale:
+
+ vssue:
+ platform:
+ owner:
+ repo:
+ clientId:
+ clientSecret:
+ autoCreateIssue: false
+
+ # Waline client configuration see: https://waline.js.org/en/reference/component.html
+ waline:
+ serverURL:
+ lang:
+ pageview:
+ emoji:
+ - https://unpkg.com/@waline/emojis@1.0.1/weibo
+ requiredMeta:
+ - name
+ - email
+ - url
+ locale:
+ admin: Admin
+ placeholder:
+
+ twikoo:
+ envId:
+ region:
+ path:
+ lang:
+
+ # See https://cactus.chat/docs/reference/web-client/#configuration for description of the various options
+ cactus:
+ defaultHomeserverUrl: "https://matrix.cactus.chat:8448"
+ serverName: "cactus.chat"
+ siteName: "" # You must insert a unique identifier here matching the one you registered (See https://cactus.chat/docs/getting-started/quick-start/#register-your-site)
+
+ giscus:
+ repo:
+ repoID:
+ category:
+ categoryID:
+ mapping:
+ lightTheme:
+ darkTheme:
+ reactionsEnabled: 1
+ emitMetadata: 0
+
+ gitalk:
+ owner:
+ admin:
+ repo:
+ clientID:
+ clientSecret:
+
+ cusdis:
+ host:
+ id:
+ widgets:
+ homepage:
+ - type: search
+ - type: archives
+ params:
+ limit: 5
+ - type: categories
+ params:
+ limit: 10
+ - type: tag-cloud
+ params:
+ limit: 10
+ page:
+ - type: toc
+
+ opengraph:
+ twitter:
+ # Your Twitter username
+ site:
+
+ # Available values: summary, summary_large_image
+ card: summary_large_image
+
+ defaultImage:
+ opengraph:
+ enabled: false
+ local: false
+ src:
+
+ colorScheme:
+ # Display toggle
+ toggle: true
+
+ # Available values: auto, light, dark
+ default: auto
+
+ imageProcessing:
+ cover:
+ enabled: true
+ content:
+ enabled: true
+
+### Custom menu
+### See https://docs.stack.jimmycai.com/configuration/custom-menu.html
+### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter
+menu:
+ main: []
+
+ social:
+ - identifier: github
+ name: GitHub
+ url: https://github.com/CaiJimmy/hugo-theme-stack
+ params:
+ icon: brand-github
+
+ - identifier: twitter
+ name: Twitter
+ url: https://twitter.com
+ params:
+ icon: brand-twitter
+
+related:
+ includeNewer: true
+ threshold: 60
+ toLower: false
+ indices:
+ - name: tags
+ weight: 100
+
+ - name: categories
+ weight: 200
+
+markup:
+ goldmark:
+ renderer:
+ ## Set to true if you have HTML content inside Markdown
+ unsafe: false
+ tableOfContents:
+ endLevel: 4
+ ordered: true
+ startLevel: 2
+ highlight:
+ noClasses: false
+ codeFences: true
+ guessSyntax: true
+ lineNoStart: 1
+ lineNos: true
+ lineNumbersInTable: true
+ tabWidth: 4
diff --git a/exampleSite/config/_default/config.toml b/exampleSite/config/_default/config.toml
deleted file mode 100644
index 548975a..0000000
--- a/exampleSite/config/_default/config.toml
+++ /dev/null
@@ -1,20 +0,0 @@
-# Change baseurl before deploy
-baseurl = "https://demo.stack.jimmycai.com"
-languageCode = "en-us"
-paginate = 5
-title = "Hugo Theme Stack Starter"
-theme = "hugo-theme-stack"
-
-# Theme i18n support
-# Available values: ar, bn, ca, de, el, en, es, fr, hu, id, it, ja, ko, nl, pt-br, th, uk, zh-cn, zh-hk, zh-tw
-DefaultContentLanguage = "en"
-
-# Set hasCJKLanguage to true if DefaultContentLanguage is in [zh-cn ja ko]
-# This will make .Summary and .WordCount behave correctly for CJK languages.
-hasCJKLanguage = false
-
-# Change it to your Disqus shortname before using
-disqusShortname = "hugo-theme-stack"
-
-# GA Tracking ID
-googleAnalytics = ""
diff --git a/exampleSite/config/_default/languages.toml b/exampleSite/config/_default/languages.toml
deleted file mode 100644
index ad80c20..0000000
--- a/exampleSite/config/_default/languages.toml
+++ /dev/null
@@ -1,16 +0,0 @@
-# Enable multilanguage site support
-[en]
-languageName = "English"
-title = "Hugo Theme Stack Example Site"
-weight = 1
-
-[zh-cn]
-languageName = "中文"
-title = "Hugo 主题 Stack 演示站点"
-weight = 2
-
-[ar]
-languageName = "عربي"
-languagedirection = "rtl"
-title = "موقع تجريبي"
-weight = 3
diff --git a/exampleSite/config/_default/markup.toml b/exampleSite/config/_default/markup.toml
deleted file mode 100644
index 591ce9e..0000000
--- a/exampleSite/config/_default/markup.toml
+++ /dev/null
@@ -1,18 +0,0 @@
-# Markdown renderer configuration
-[goldmark.renderer]
-# Set it to true if you have HTML content inside Markdown
-unsafe = false
-
-[tableOfContents]
-endLevel = 4
-ordered = true
-startLevel = 2
-
-[highlight]
-noClasses = false
-codeFences = true
-guessSyntax = true
-lineNoStart = 1
-lineNos = true
-lineNumbersInTable = true
-tabWidth = 4
diff --git a/exampleSite/config/_default/menu.toml b/exampleSite/config/_default/menu.toml
deleted file mode 100644
index e01b4f7..0000000
--- a/exampleSite/config/_default/menu.toml
+++ /dev/null
@@ -1,20 +0,0 @@
-### Custom menu
-### See https://docs.stack.jimmycai.com/configuration/custom-menu.html
-### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter
-main = []
-
-[[social]]
-identifier = "github"
-name = "GitHub"
-url = "https://github.com/CaiJimmy/hugo-theme-stack"
-
-[social.params]
-icon = "brand-github"
-
-[[social]]
-identifier = "twitter"
-name = "Twitter"
-url = "https://twitter.com"
-
-[social.params]
-icon = "brand-twitter"
diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml
deleted file mode 100644
index a87c986..0000000
--- a/exampleSite/config/_default/params.toml
+++ /dev/null
@@ -1,106 +0,0 @@
-mainSections = ["post"]
-featuredImageField = "image"
-rssFullContent = true
-favicon = "img/favicon.png"
-
-[footer]
-since = 2020
-
-[dateFormat]
-published = "Jan 02, 2006"
-lastUpdated = "Jan 02, 2006 15:04 MST"
-
-[sidebar]
-emoji = "🍥"
-subtitle = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
-
-[sidebar.avatar]
-enabled = true
-local = true
-src = "img/logo.jpg"
-
-[article]
-math = false
-toc = true
-readingTime = true
-
-[article.license]
-enabled = true
-default = "Licensed under CC BY-NC-SA 4.0"
-
-[comments]
-enabled = true
-provider = "disqus"
-
-[comments.disqusjs]
-
-[comments.utterances]
-issueTerm = "pathname"
-
-[comments.remark42]
-
-[comments.vssue]
-autoCreateIssue = false
-
-[comments.waline]
-emoji = ["https://unpkg.com/@waline/emojis@1.0.1/weibo"]
-requiredMeta = ["name", "email", "url"]
-
-[comments.waline.locale]
-admin = "Admin"
-
-[comments.twikoo]
-
-[comments.cactus]
-defaultHomeserverUrl = "https://matrix.cactus.chat:8448"
-serverName = "cactus.chat"
-siteName = ""
-
-[comments.giscus]
-reactionsEnabled = 1
-emitMetadata = 0
-
-[comments.gitalk]
-
-[comments.cusdis]
-
-[[widgets.homepage]]
-type = "search"
-
-[[widgets.homepage]]
-type = "archives"
-
-[widgets.homepage.params]
-limit = 5
-
-[[widgets.homepage]]
-type = "categories"
-
-[widgets.homepage.params]
-limit = 10
-
-[[widgets.homepage]]
-type = "tag-cloud"
-
-[widgets.homepage.params]
-limit = 10
-
-[[widgets.page]]
-type = "toc"
-
-[opengraph.twitter]
-card = "summary_large_image"
-
-[defaultImage.opengraph]
-enabled = false
-local = false
-
-[colorScheme]
-toggle = true
-default = "auto"
-
-[imageProcessing.cover]
-enabled = true
-
-[imageProcessing.content]
-enabled = true
\ No newline at end of file
diff --git a/exampleSite/config/_default/permalinks.toml b/exampleSite/config/_default/permalinks.toml
deleted file mode 100644
index 2499a7e..0000000
--- a/exampleSite/config/_default/permalinks.toml
+++ /dev/null
@@ -1,3 +0,0 @@
-# Permalinks format of each content section
-post = "/p/:slug/"
-page = "/:slug/"
\ No newline at end of file
diff --git a/exampleSite/config/_default/related.toml b/exampleSite/config/_default/related.toml
deleted file mode 100644
index be52654..0000000
--- a/exampleSite/config/_default/related.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-# Related contents configuration
-includeNewer = true
-threshold = 60
-toLower = false
-
-[[indices]]
-name = "tags"
-weight = 100
-
-[[indices]]
-name = "categories"
-weight = 200
\ No newline at end of file
diff --git a/exampleSite/content/post/emoji-support/index.md b/exampleSite/content/post/emoji-support/index.md
new file mode 100644
index 0000000..bc3e348
--- /dev/null
+++ b/exampleSite/content/post/emoji-support/index.md
@@ -0,0 +1,50 @@
++++
+author = "Hugo Authors"
+title = "Emoji Support"
+date = "2019-03-05"
+description = "Guide to emoji usage in Hugo"
+categories = [
+ "Test"
+]
+tags = [
+ "emoji",
+]
+image = "the-creative-exchange-d2zvqp3fpro-unsplash.jpg"
++++
+
+Emoji can be enabled in a Hugo project in a number of ways.
+
+The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes).
+
+To enable emoji globally, set `enableEmoji` to `true` in your site's [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g.
+
+🙈 :see_no_evil:
🙉 :hear_no_evil:
🙊 :speak_no_evil:
+
+
+The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes.
+
+***
+
+**N.B.** The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack; e.g.
+
+{{< highlight html >}}
+.emoji {
+ font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols;
+}
+{{< /highlight >}}
+
+{{< css.inline >}}
+
+{{< /css.inline >}}
diff --git a/exampleSite/content/post/emoji-support/the-creative-exchange-d2zvqp3fpro-unsplash.jpg b/exampleSite/content/post/emoji-support/the-creative-exchange-d2zvqp3fpro-unsplash.jpg
new file mode 100644
index 0000000..e34a59d
Binary files /dev/null and b/exampleSite/content/post/emoji-support/the-creative-exchange-d2zvqp3fpro-unsplash.jpg differ
diff --git a/exampleSite/content/post/markdown-syntax/index.md b/exampleSite/content/post/markdown-syntax/index.md
index 752a655..0254cca 100644
--- a/exampleSite/content/post/markdown-syntax/index.md
+++ b/exampleSite/content/post/markdown-syntax/index.md
@@ -42,12 +42,12 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap
The blockquote element represents content that is quoted from another source, optionally with a citation which must be within a `footer` or `cite` element, and optionally with in-line changes such as annotations and abbreviations.
-### Blockquote without attribution
+#### Blockquote without attribution
> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
> **Note** that you can use *Markdown syntax* within a blockquote.
-### Blockquote with attribution
+#### Blockquote with attribution
> Don't communicate by sharing memory, share memory by communicating.
> — Rob Pike[^1]
@@ -63,7 +63,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
Bob | 27
Alice | 23
-### Inline Markdown within tables
+#### Inline Markdown within tables
| Italics | Bold | Code |
| -------- | -------- | ------ |
@@ -74,7 +74,8 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
| Lorem ipsum dolor sit amet, consectetur adipiscing elit. | Phasellus ultricies, sapien non euismod aliquam, dui ligula tincidunt odio, at accumsan nulla sapien eget ex. | Proin eleifend dictum ipsum, non euismod ipsum pulvinar et. Vivamus sollicitudin, quam in pulvinar aliquam, metus elit pretium purus | Proin sit amet velit nec enim imperdiet vehicula. | Ut bibendum vestibulum quam, eu egestas turpis gravida nec | Sed scelerisque nec turpis vel viverra. Vivamus vitae pretium sapien |
## Code Blocks
-### Code block with backticks
+
+#### Code block with backticks
```html
@@ -89,7 +90,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou