staticman | 💪 User-generated content for Git-powered websites | Static Site Generator library
kandi X-RAY | staticman Summary
kandi X-RAY | staticman Summary
Staticman is a Node.js application that receives user-generated content and uploads it as data files to a GitHub and/or GitLab repository. In practice, this allows you to have dynamic content (e.g. blog post comments) as part of a fully static website, as long as your site automatically deploys on every push to GitHub and/or GitLab, as seen on GitHub Pages, GitLab Pages, Netlify and others. It consists of a small web service that handles the POST requests from your forms, runs various forms of validation and manipulation defined by you and finally pushes them to your repository as data files. You can choose to enable moderation, which means files will be pushed to a separate branch and a pull request will be created for your approval, or disable it completely, meaning that files will be pushed to the main branch automatically. You can download and run the Staticman API on your own infrastructure. The easiest way to get a personal Staticman API instance up and running is to use the free tier of Heroku. If deploying to Heroku you can simply click the button below and enter your config variables directly into Heroku as environment variables.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of staticman
staticman Key Features
staticman Examples and Code Snippets
Community Discussions
Trending Discussions on staticman
QUESTION
I'm creating a webpage using markdown hosted by github.io. I really don't like the blue color of the hyperlink automatically generated by markdown and I'm wondering if it's possible to change it. More specifically, I'd like the text to stay black and the solid underline to become dashed underline. Here is a sample code:
...ANSWER
Answered 2021-Mar-31 at 11:41Since GitHub uses its own styling after it processes your markdown file, any custom stylings will be overwritten. However, in a broader case, you can always use HTML elements in your markdown files. Take this example:
QUESTION
I'm trying to achieve something in the vein of Staticman: a static website on GitHub Pages that can use javascript and the GitHub API in order to commit to the repository it is based on, thereby acting somewhat as though it were a non-static site.
Accessing the underlying repository obviously requires the name of that repository. I could hard-code this, but that's not ideal, as I intend to fork/clone this repository, and I'd have to change that hard-code in each fork.
So I want to know if there's some way for JavaScript in a GitHub Pages website to automatically determine which repository it's been built from. Or, alternatively, to use Jekyll to insert the repository name during the static site construction.
...ANSWER
Answered 2020-Jul-02 at 05:31You can do this with {{ site.github.repository_nwo }}
to get /
(name with owner) or {{ site.github.repository_name }}
to get just . These Jekyll variables come from the Github Metadata plugin, which exists by default on Github Pages. The relevant part of the documentation is here.
It seems like you might want the entire repository URL, which can be extracted using {{ site.github.repository_url }}
. The plugin also provides {{ site.github.clone_url }}
(repositoryURL + ".git") which is the URL from which you clone the repo if it were bare.
QUESTION
I'm building a review site in Gatsby. My pages are created at build time from a remote API source.
I've integrated Staticman with my Gatsby build I can successfully submit a form which is then stored in /src/data/review/property-[listing_id]/review-[listing_id]-[timestamp].yml
The form submissions are yaml and I'm using gatsby-transformer-yaml with gatsby-source-filesystem to access the data through graphql.
I can query the data easily enough using staticquery
but this returns all the submissions.
What I'm struggling with is to filter the submissions to the respective page ie the page where they were submitted.
Using graphiql with this query I get back exactly the data I want but am unable to map over it I get 'Cannot read property 'edges' of undefined'.
...ANSWER
Answered 2020-Apr-09 at 21:12I looked into your repository, let me try to summarize what you've tried so far:
- You are creating property pages using in
gatsby-node.js
, passing apropertyId
via context to yourproperty.js
page template - In the
property.js
template, you're querying property data and its reviews using a Gatsby page query - In the
reviews.js
component, you're rendering reviews based on thepropertyId
using the Gatsby useStaticQuery hook
Cannot read property 'edges' of undefined
Back to your question:
Perhaps I'm approaching this the wrong way?
Good news: your approach is fine!
Using graphiql with this query I get back exactly the data I want but am unable to map over it I get 'Cannot read property 'edges' of undefined'.
After looking at your code, I assume you're talking about these lines. Here's a simplified reproduction:
QUESTION
As said here https://github.com/eduardoboucas/staticman/issues/243
, staticman
through their centralized API is not working due to having reached certain quotas
As such, staticman
is becoming a github app to extend these quotas, but there's still no official documentation to get it running.
How is this made?
...ANSWER
Answered 2019-Mar-17 at 19:43Based on https://github.com/robinmetral/eaudepoisson
- Create a github repository
- Install the staticman app in that repository, found here https://github.com/apps/staticman-net
- Create a configuration file
staticman.yml
in the root of the repository, look at the docs for configuration https://staticman.net/docs/configuration and at the repo https://github.com/robinmetral/eaudepoisson
Important, the name of the property of staticman.yml
is comments:
, this property is what goes to the direction of your repo. So, if you want to send the comments to your_repo/markdown/website_comments
then your path
in staticman.yml
should be path: "markdown/website_comments"
), but see below that your url does not refer to the folder structure but to the staticman.yml
property
- Create a
/markdown/website_comments
folder in your repo (not really necessary, the folder structure will be created with the first comment) - Create a
form
, I've done it with forms provided byreact.semantic-ui.com
QUESTION
I use Staticman (staticman.net) for comments on my Gatsby (gatsbyjs.org) site.
I've been using a classic HTML form with method="POST"
and action="https://api.staticman.net/..."
parameter, as this is what Staticman expects (docs).
However I'd like to make this more "React", and I've changed the form action to a handleSumbit()
function:
ANSWER
Answered 2019-Jan-20 at 22:00I'd rebuild that POST data from your component state using something like the query-string
package. Not sure on the specifics of staticman, but I presume you have form values in your react component's state so you could do something like:
QUESTION
I'm using staticman to enable comments on my blog. It puts the comments in the _data
folder. My folder structure then looks like this:
ANSWER
Answered 2018-Nov-22 at 14:13Solved the problem!
The issue is when the folder does not exist. I circumvent this by moving the sort filter:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install staticman
Clone the repository and install the dependencies via npm. git clone git@github.com:eduardoboucas/staticman.git cd staticman npm install
Create a development config file from the sample file. cp config.sample.json config.development.json
Edit the newly-created config file with your GitHub and/or GitLab access token, SSH private key and the port to run the server. Click here for the list of available configuration parameters.
Start the server. npm start
Staticman runs as a bot using a GitHub and/or GitLab account, as opposed to accessing your account using the traditional OAuth flow. This means that you can give it access to just the repositories you're planning on using it on, instead of exposing all your repositories.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page