CINXE.COM

Https://staticman.net brings user-generated content to static sites - support - HUGO

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Https://staticman.net brings user-generated content to static sites - support - HUGO</title> <meta name="description" content="Can we use this to have our own commenting system instead of depending on third party services ? https://staticman.net/"> <meta name="generator" content="Discourse 3.5.0.beta1-dev - https://github.com/discourse/discourse version 2e10fe98a3cb93823b7a2e851c7e12e435434fdd"> <link rel="icon" type="image/png" href="https://canada1.discourse-cdn.com/flex036/uploads/gohugo/optimized/2X/6/66a05218f64425b2fa59ede30c1b4b7dc1fdf5f9_2_32x32.ico"> <link rel="apple-touch-icon" type="image/png" href="https://canada1.discourse-cdn.com/flex036/uploads/gohugo/optimized/2X/c/c2d3414c64e766d814100b32063948e604298a70_2_180x180.png"> <meta name="theme-color" media="all" content="#0a1922"> <meta name="color-scheme" content="light"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, viewport-fit=cover"> <link rel="canonical" href="https://discourse.gohugo.io/t/https-staticman-net-brings-user-generated-content-to-static-sites/2079" /> <link rel="search" type="application/opensearchdescription+xml" href="https://discourse.gohugo.io/opensearch.xml" title="HUGO Search"> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/color_definitions_hugo-light_1_3_7422c4612de15eed9913fa272be61741ca2fb638.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" class="light-scheme"/> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/desktop_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="desktop" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/checklist_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="checklist" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/discourse-adplugin_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="discourse-adplugin" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/discourse-ai_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="discourse-ai" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/discourse-akismet_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="discourse-akismet" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/discourse-cakeday_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="discourse-cakeday" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/discourse-details_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="discourse-details" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/discourse-lazy-videos_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="discourse-lazy-videos" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/discourse-local-dates_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="discourse-local-dates" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/discourse-narrative-bot_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="discourse-narrative-bot" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/discourse-presence_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="discourse-presence" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/discourse-solved_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="discourse-solved" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/footnote_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="footnote" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/hosted-site_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="hosted-site" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/poll_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="poll" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/spoiler-alert_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="spoiler-alert" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/discourse-ai_desktop_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="discourse-ai_desktop" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/poll_desktop_52dfd82b80c36235a1a8df0a72a9870cb3864658.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="poll_desktop" /> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/desktop_theme_2_b0b7ba5ce03d9d7dcecf85fee4c4e3d55590293d.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="desktop_theme" data-theme-id="2" data-theme-name="custom header links"/> <link href="https://yyz2.discourse-cdn.com/flex036/stylesheets/desktop_theme_3_b0b65929b21d150cf59d2a84d7ec757ad929a847.css?__ws=discourse.gohugo.io" media="all" rel="stylesheet" data-target="desktop_theme" data-theme-id="3" data-theme-name="hugo light"/> <meta id="data-ga-universal-analytics" data-tracking-code="UA-7131036-7" data-json="{&quot;cookieDomain&quot;:&quot;auto&quot;}" data-auto-link-domains=""> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-7131036-7" nonce="3j1diCc2OnGOLprfLeS9rk51R"></script> <script defer src="https://canada1.discourse-cdn.com/flex036/assets/google-universal-analytics-v4-9e072ae9f23d2cccab25fd7b2debde9018749ade5240fda6e25d27be6a95ed2e.gz.js" data-discourse-entrypoint="google-universal-analytics-v4" nonce="3j1diCc2OnGOLprfLeS9rk51R"></script> <link rel="alternate nofollow" type="application/rss+xml" title="RSS feed of &#39;Https://staticman.net brings user-generated content to static sites&#39;" href="https://discourse.gohugo.io/t/https-staticman-net-brings-user-generated-content-to-static-sites/2079.rss" /> <meta property="og:site_name" content="HUGO" /> <meta property="og:type" content="website" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:image" content="https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/b/b91c8ab3a3c1c8679127cf049b46fa919e9e0e5c.png" /> <meta property="og:image" content="https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/b/b91c8ab3a3c1c8679127cf049b46fa919e9e0e5c.png" /> <meta property="og:url" content="https://discourse.gohugo.io/t/https-staticman-net-brings-user-generated-content-to-static-sites/2079" /> <meta name="twitter:url" content="https://discourse.gohugo.io/t/https-staticman-net-brings-user-generated-content-to-static-sites/2079" /> <meta property="og:title" content="Https://staticman.net brings user-generated content to static sites" /> <meta name="twitter:title" content="Https://staticman.net brings user-generated content to static sites" /> <meta property="og:description" content="Can we use this to have our own commenting system instead of depending on third party services ?" /> <meta name="twitter:description" content="Can we use this to have our own commenting system instead of depending on third party services ?" /> <meta property="og:article:section" content="support" /> <meta property="og:article:section:color" content="652D90" /> <meta property="article:published_time" content="2015-11-12T06:15:47+00:00" /> <meta property="og:ignore_canonical" content="true" /> <script type="application/ld+json">{"@context":"http://schema.org","@type":"QAPage","name":"Https://staticman.net brings user-generated content to static sites","mainEntity":{"@type":"Question","name":"Https://staticman.net brings user-generated content to static sites","text":"Can we use this to have our own commenting system instead of depending on third party services ?\n\n[image]\n\n<a href=\"https://staticman.net/\" target=\"_blank\" rel=\"nofollow noopener\">Staticman<\/a>\n\nI bring user-generated content to static sites","upvoteCount":0,"answerCount":0,"datePublished":"2015-11-12T06:15:47.338Z","author":{"@type":"Person","name":"mseshachalam","url":"https://discourse.gohugo.io/u/mseshachalam"}}}</script> </head> <body class="crawler browser-update"> <script defer="" src="https://yyz2.discourse-cdn.com/flex036/theme-javascripts/417061e7eee24be4fb6a457975f0dce96a82d9e6.js?__ws=discourse.gohugo.io" data-theme-id="5" nonce="3j1diCc2OnGOLprfLeS9rk51R"></script> <header> <a href="/"> HUGO </a> </header> <div id="main-outlet" class="wrap" role="main"> <div id="topic-title"> <h1> <a href="/t/https-staticman-net-brings-user-generated-content-to-static-sites/2079">Https://staticman.net brings user-generated content to static sites</a> </h1> <div class="topic-category" itemscope itemtype="http://schema.org/BreadcrumbList"> <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> <a href="/c/support/34" class="badge-wrapper bullet" itemprop="item"> <span class='badge-category-bg' style='background-color: #652D90'></span> <span class='badge-category clear-badge'> <span class='category-name' itemprop='name'>support</span> </span> </a> <meta itemprop="position" content="1" /> </span> </div> </div> <div itemscope itemtype='http://schema.org/DiscussionForumPosting'> <meta itemprop='headline' content='Https://staticman.net brings user-generated content to static sites'> <link itemprop='url' href='https://discourse.gohugo.io/t/https-staticman-net-brings-user-generated-content-to-static-sites/2079'> <meta itemprop='datePublished' content='2015-11-12T06:15:47Z'> <meta itemprop='articleSection' content='support'> <meta itemprop='keywords' content=''> <div itemprop='publisher' itemscope itemtype="http://schema.org/Organization"> <meta itemprop='name' content='HUGO'> </div> <div id='post_1' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" rel='nofollow' href='https://discourse.gohugo.io/u/mseshachalam'><span itemprop='name'>mseshachalam</span></a> </span> <link itemprop="mainEntityOfPage" href="https://discourse.gohugo.io/t/https-staticman-net-brings-user-generated-content-to-static-sites/2079"> <span class="crawler-post-infos"> <time datetime='2015-11-12T06:15:47Z' class='post-time'> November 12, 2015, 6:15am </time> <meta itemprop='dateModified' content='2016-12-14T01:40:51Z'> <span itemprop='position'>1</span> </span> </div> <div class='post' itemprop='text'> <p>Can we use this to have our own commenting system instead of depending on third party services ?</p> <aside class="onebox whitelistedgeneric"> <header class="source"> <img src="https://staticman.net/assets/images/icons/favicon-32x32.png" class="site-icon" width="32" height="32"> <a href="https://staticman.net/" target="_blank" rel="nofollow noopener">Staticman</a> </header> <article class="onebox-body"> <img src="https://staticman.net/assets/images/staticman-avatar.png" class="thumbnail onebox-avatar" width="452" height="452"> <h3><a href="https://staticman.net/" target="_blank" rel="nofollow noopener">Staticman</a></h3> <p>I bring user-generated content to static sites</p> </article> <div class="onebox-metadata"> </div> <div style="clear: both"></div> </aside> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="0" /> <span class='post-likes'></span> </div> </div> <div id='post_2' itemprop='comment' itemscope itemtype='http://schema.org/Comment' class='topic-body crawler-post'> <div class='crawler-post-meta'> <span class="creator" itemprop="author" itemscope itemtype="http://schema.org/Person"> <a itemprop="url" rel='nofollow' href='https://discourse.gohugo.io/u/rwi'><span itemprop='name'>rwi</span></a> </span> <span class="crawler-post-infos"> <time itemprop='datePublished' datetime='2016-12-18T13:47:24Z' class='post-time'> December 18, 2016, 1:47pm </time> <meta itemprop='dateModified' content='2016-12-18T13:47:24Z'> <span itemprop='position'>2</span> </span> </div> <div class='post' itemprop='text'> <p>Cool service thanks for sharing.</p> <p>Even I did not test it yet but it should be pretty simple to use it for hugo as well.</p> <p>One thing you need to change from the <code>path</code> in the <code>staticman.yml</code> to the data-file:</p> <pre data-code-wrap="yaml"><code class="lang-yaml"> # (*) REQUIRED # # Destination path (directory) for the data files. Accepts placeholders. path: "data/comments/{options.page_id}" </code></pre> <p>in the comment form you can use it like:</p> <pre data-code-wrap="html"><code class="lang-html">&lt;form method="POST" action="https://api.staticman.net/v2/entry/{{ .Site.Params.staticman.username }}/{{{ .Site.Params.staticman.repository }}/{{ .Site.Params.staticman.branch }}/"&gt; &lt;input name="options[redirect]" type="hidden" value="/thanks-for-your-comment"&gt; &lt;input name="options[page_id]" type="hidden" value="{{ .UniqueID }}"&gt; &lt;label&gt;&lt;input name="fields[name]" type="text"&gt;Name&lt;/label&gt; &lt;label&gt;&lt;input name="fields[email]" type="email"&gt;E-mail&lt;/label&gt; &lt;label&gt;&lt;textarea name="fields[message]"&gt;&lt;/textarea&gt;Message&lt;/label&gt; &lt;button type="submit"&gt;Go!&lt;/button&gt; &lt;/form&gt; </code></pre> <p>Manage your staticman-configuration in <code>config.toml</code></p> <pre data-code-wrap="toml"><code class="lang-toml">[staticman] username = "yourgithubusername" repository = "reponame" branch = "master" </code></pre> <p>On a content page you can read the comments data like this:</p> <pre data-code-wrap="html"><code class="lang-html"> {{ range $key, $comments := .Site.Data.comments }} {{ if eq $key .UniqueID }} {{ range $comments }} &lt;blockquote&gt;{{ . | jsonify }}&lt;/blockquote&gt; {{ end }} {{ else }} Write the first comment for this page! {{ end }} {{ end }} </code></pre> <p>Hope this points you in the direction to make it possible using staticman.</p> <hr> <p>Edit: Just after I finished this reply I found this link with a hugo example - <a href="https://github.com/eduardoboucas/hugo-plus-staticman" class="inline-onebox" rel="noopener nofollow ugc">GitHub - eduardoboucas/hugo-plus-staticman: 鈿★笍 Demo site using Hugo + Staticman</a> <img src="https://emoji.discourse-cdn.com/twitter/slightly_smiling.png?v=12" title=":slightly_smiling:" class="emoji" alt=":slightly_smiling:" loading="lazy" width="20" height="20"></p> </div> <div itemprop="interactionStatistic" itemscope itemtype="http://schema.org/InteractionCounter"> <meta itemprop="interactionType" content="http://schema.org/LikeAction"/> <meta itemprop="userInteractionCount" content="0" /> <span class='post-likes'></span> </div> </div> </div> <div id="related-topics" class="more-topics__list " role="complementary" aria-labelledby="related-topics-title"> <h3 id="related-topics-title" class="more-topics__list-title"> Related topics </h3> <div class="topic-list-container" itemscope itemtype='http://schema.org/ItemList'> <meta itemprop='itemListOrder' content='http://schema.org/ItemListOrderDescending'> <table class='topic-list'> <thead> <tr> <th>Topic</th> <th></th> <th class="replies">Replies</th> <th class="views">Views</th> <th>Activity</th> </tr> </thead> <tbody> <tr class="topic-list-item" id="topic-list-item-4429"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='1'> <span class="link-top-line"> <a itemprop='url' href='https://discourse.gohugo.io/t/staticman-a-comments-system-for-hugo-site/4429' class='title raw-link raw-topic-link'>Staticman - A comments system for Hugo site</a> </span> <div class="link-bottom-line"> <a href='/c/support/34' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #652D90'></span> <span class='badge-category clear-badge'> <span class='category-name'>support</span> </span> </a> <div class="discourse-tags"> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>13</span> </td> <td class="views"> <span class='views' title='views'>7751</span> </td> <td> February 27, 2019 </td> </tr> <tr class="topic-list-item" id="topic-list-item-10203"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='2'> <span class="link-top-line"> <a itemprop='url' href='https://discourse.gohugo.io/t/how-i-implemented-comments-on-a-static-site-static-site-with-super-powers/10203' class='title raw-link raw-topic-link'>How I Implemented Comments on a Static Site - Static Site with Super-Powers</a> </span> <div class="link-bottom-line"> <a href='/c/tips-tricks/38' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #ED207B'></span> <span class='badge-category clear-badge'> <span class='category-name'>tips &amp; tricks</span> </span> </a> <div class="discourse-tags"> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>5</span> </td> <td class="views"> <span class='views' title='views'>1556</span> </td> <td> May 25, 2019 </td> </tr> <tr class="topic-list-item" id="topic-list-item-45849"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='3'> <span class="link-top-line"> <a itemprop='url' href='https://discourse.gohugo.io/t/porting-a-comments-system-based-off-of-google-sheets/45849' class='title raw-link raw-topic-link'>Porting a comments system based off of google sheets</a> </span> <div class="link-bottom-line"> <a href='/c/tips-tricks/38' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #ED207B'></span> <span class='badge-category clear-badge'> <span class='category-name'>tips &amp; tricks</span> </span> </a> <div class="discourse-tags"> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>1</span> </td> <td class="views"> <span class='views' title='views'>531</span> </td> <td> September 19, 2023 </td> </tr> <tr class="topic-list-item" id="topic-list-item-51924"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='4'> <span class="link-top-line"> <a itemprop='url' href='https://discourse.gohugo.io/t/static-comments-script-for-hugo-in-php/51924' class='title raw-link raw-topic-link'>Static comments script for Hugo (in PHP)</a> </span> <div class="link-bottom-line"> <a href='/c/tips-tricks/38' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #ED207B'></span> <span class='badge-category clear-badge'> <span class='category-name'>tips &amp; tricks</span> </span> </a> <div class="discourse-tags"> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>4</span> </td> <td class="views"> <span class='views' title='views'>257</span> </td> <td> November 13, 2024 </td> </tr> <tr class="topic-list-item" id="topic-list-item-4784"> <td class="main-link" itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'> <meta itemprop='position' content='5'> <span class="link-top-line"> <a itemprop='url' href='https://discourse.gohugo.io/t/a-comment-system-for-hugo/4784' class='title raw-link raw-topic-link'>A comment system for Hugo</a> </span> <div class="link-bottom-line"> <a href='/c/feature/36' class='badge-wrapper bullet'> <span class='badge-category-bg' style='background-color: #0E76BD'></span> <span class='badge-category clear-badge'> <span class='category-name'>feature</span> </span> </a> <div class="discourse-tags"> </div> </div> </td> <td class="replies"> <span class='posts' title='posts'>8</span> </td> <td class="views"> <span class='views' title='views'>2793</span> </td> <td> December 11, 2016 </td> </tr> </tbody> </table> </div> </div> </div> <footer class="container wrap"> <nav class='crawler-nav'> <ul> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/' itemprop="url">Home </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/categories' itemprop="url">Categories </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/guidelines' itemprop="url">Guidelines </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/tos' itemprop="url">Terms of Service </a> </span> </li> <li itemscope itemtype='http://schema.org/SiteNavigationElement'> <span itemprop='name'> <a href='/privacy' itemprop="url">Privacy Policy </a> </span> </li> </ul> </nav> <p class='powered-by-link'>Powered by <a href="https://www.discourse.org">Discourse</a>, best viewed with JavaScript enabled</p> </footer> <div class="buorg"><div>Unfortunately, <a href="https://www.discourse.org/faq/#browser">your browser is unsupported</a>. Please <a href="https://browsehappy.com">switch to a supported browser</a> to view rich content, log in and reply.</div></div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10