Comments (15)
I have a workaround for this feature, I'm sending the values using options[name]
hidden fields, everything is preformatted on the client's side with JS, date and dashed file name, my staticman config file looks like this:
filename: "{options.submitdate}-{options.dashedtitle}"
Additionally it would be great that commitMessage:
accepts placeholders too, if so we can include a title or something more related to what was submitted/sent.
from staticman.
@Twentytwoo Well, it took a while to land this feature, so thanks for your patience and for your help with testing. I've deployed the feature to the live API. Will close the issue as soon as I add this to the documentation.
from staticman.
@usrix I opened a separate issue for the commitMessage thing here #79
from staticman.
I'd be incredibly interested in something like this. I'm working on a news site that users can post on for my neighborhood. It would be great if people could share links to individual articles.
from staticman.
We want this for @opensourcedesign as well. How would we go about adding this feature to staticman?
from staticman.
I think we could add a special placeholder that formats a date with Moment.js (we're using it already). This should give people enough flexibility to format the path according to their requirements.
Placeholders are resolved here, so I think this should go somewhere in there.
I will try to look into this in the next couple of days, but if anyone wants to have a go at it I'm happy to assist!
from staticman.
Any update on being able to set the file to a .html
instead of .md
, @eduardoboucas ?
from staticman.
@Twentytwoo I've added this to the preview instance. Can you help test it? Here's how:
- In your site config, add an
extension
property with the extension you want to use (e.g."html"
) - Temporarily post your forms to
dev.staticman.net
instead ofapi.staticman.net
Thanks!
from staticman.
https://github.com/twentytwoo/startpages.cf/pull/42
That works great :) Thanks @eduardoboucas
from staticman.
Done, it's now available on the live API. So all we're missing from this issue now is the ability to manipulate the filename to include that date format, right?
from staticman.
Thanks a lot - That's right, I'm looking forward to it 👍
from staticman.
Okay, @Twentytwoo here's another one for you to test. 😄
I've added a special placeholder that renders the current date in any format supported by Moment.js. Here's how to test this:
- Change your URL to
dev.staticman.net
instead ofapi.staticman.net
- Change your config to:
filename: "{@date:YYYY-MM-DD}-{fields.title}"
Let me know how you get on. Thanks!
from staticman.
Looks like it's working well, https://github.com/twentytwoo/startpages.cf/pull/43 - Thanks again for all your hard work.
from staticman.
@eduardoboucas is it possible to configure the timezone? and re-format the fields.title? i.e. to lowercase and change spaces for a dash
thanks
from staticman.
Finally documented placeholders: https://staticman.net/docs/placeholders
@usrix could you open a separate issue for that, please?
Thanks all!
from staticman.
Related Issues (20)
- code: 'ERR_OSSL_UNSUPPORTED' HOT 3
- Prevent javascript injection
- Supporting a more secure hash for email addresses
- Error: Require an `oauthToken` or `token` option HOT 1
- How can you change the Time Zone HOT 1
- Improve documentation for self-hosted staticman + gitlab HOT 6
- "INVALID VERSION" HOT 2
- Support for email servers other than Mailgun HOT 5
- Error: error:02000079:rsa routines::oaep decoding error HOT 1
- [GITHUB_READING_FILE]
- Gitlab and Heroku deployment
- run on vercel
- Heroku shutting down their free tier HOT 40
- Is this project still active? HOT 8
- Unexpected End of JSON Input
- Error 500 [InvalidAsn1Error]: encoding too long HOT 1
- errorCode: INVALID_VERSION when trying to accept the GitHub bot invitation HOT 3
- "errorCode":"GITLAB_READING_FILE"} HOT 2
- RSA private key encoding too long HOT 2
- Staticman for Hugo ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from staticman.