[tw] Re: Static files configuration
Is there a way of writing a macro so dashes (-) are used rather than %-encoded spaces for the static site pages? On Wednesday, July 1, 2015 at 11:54:32 AM UTC+10, Devin Weaver wrote: Wait this feature seems to already be there: http://tiddlywiki.com/#tv-get-export-path%20Variable -- You received this message because you are subscribed to the Google Groups TiddlyWiki group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c4ee1337-ce4a-4630-a8bb-cbb123816643%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: Static files configuration
Yes, try adding this as a tiddler: /*\ title: $:/core/macros/tv-get-export-path type: application/javascript module-type: macro Customize the static output. \*/ (function() { /*jshint node: true, browser: true */ /*global $tw: false */ use strict; exports.name = tv-get-export-path; exports.params = [{name: title}]; exports.run = function(title) { return encodeURIComponent(title.replace(/\s/g, -)); }; })(); On Tuesday, June 30, 2015 at 10:52:57 PM UTC-4, Suzanne McHale wrote: Is there a way of writing a macro so dashes (-) are used rather than %-encoded spaces for the static site pages? -- You received this message because you are subscribed to the Google Groups TiddlyWiki group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/7a06af2f-3f66-4125-bb84-d95ece74ebd8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: Static files configuration
The proof is in the pudding. Huzah! /*\ title: $:/core/macros/tv-get-export-path type: application/javascript module-type: macro Customize the static output. \*/ (function() { /*jshint node: true, browser: true, sub: true */ /*global $tw: false */ use strict; exports.name = tv-get-export-path; exports.params = [{name: title}]; exports.run = function(title) { // A falsey return value means use the default path. return $tw.wiki.getTiddler(title).fields[_static_path]; }; })(); On Tuesday, June 30, 2015 at 9:54:32 PM UTC-4, Devin Weaver wrote: Wait this feature seems to already be there: http://tiddlywiki.com/#tv-get-export-path%20Variable On Tuesday, June 30, 2015 at 5:47:30 PM UTC-4, Devin Weaver wrote: So here is my use case and I'd like to propose a feature (obviously I would implement and send a pull request). I have a static site blog (http://tritarget.org/) And to be honest the build is way to complicated for my liking. Jekyl kept fighting me and using metelsmith now is like a 10 minute deploy step. It's silly. None of which takes in to account JavaScript. I'm a JS developer by day. I love frameworks like Ember.JS and such. But these frameworks are not so useful as a blog because search engines can't crawl it well. Then I saw hoe tiddlywiki.com does it! Perfect a fully fledged (and I'll admit, beautiful) single page app that does everything I want including writing out tiddlers to static files. Perfect! The gotcha: the current site already has several back links to it. Changing the names and file structure of those static HTML files would trash the current search results and break a lot of other people's links. So what I want to to recreate the site in TiddlyWiki and have my build process also render the static files but use a field to determine the outputs file/directory names. This way new content can easily be managed and created while old content can keep it's legacy paths. I'd propose to add a feature to look at a tiddlers fields for something like _static_path and use that (kinda like how external images use _cononical_url). I'd like to work on this and would be happy to send a PR. Is it worth it for the community? On Sunday, June 21, 2015 at 9:28:40 PM UTC-4, Devin Weaver wrote: The documentation is a little sparse on this. When attempting to render static files http://tiddlywiki.com/#Generating%20Static%20Sites%20with%20TiddlyWiki is there a way to choose the output path/filename or is is based on the tiddlers directory structure or the tiddler titles? -- You received this message because you are subscribed to the Google Groups TiddlyWiki group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/ef6096da-993a-45ee-9eab-51445be7d5a2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: Static files configuration
Wait this feature seems to already be there: http://tiddlywiki.com/#tv-get-export-path%20Variable On Tuesday, June 30, 2015 at 5:47:30 PM UTC-4, Devin Weaver wrote: So here is my use case and I'd like to propose a feature (obviously I would implement and send a pull request). I have a static site blog (http://tritarget.org/) And to be honest the build is way to complicated for my liking. Jekyl kept fighting me and using metelsmith now is like a 10 minute deploy step. It's silly. None of which takes in to account JavaScript. I'm a JS developer by day. I love frameworks like Ember.JS and such. But these frameworks are not so useful as a blog because search engines can't crawl it well. Then I saw hoe tiddlywiki.com does it! Perfect a fully fledged (and I'll admit, beautiful) single page app that does everything I want including writing out tiddlers to static files. Perfect! The gotcha: the current site already has several back links to it. Changing the names and file structure of those static HTML files would trash the current search results and break a lot of other people's links. So what I want to to recreate the site in TiddlyWiki and have my build process also render the static files but use a field to determine the outputs file/directory names. This way new content can easily be managed and created while old content can keep it's legacy paths. I'd propose to add a feature to look at a tiddlers fields for something like _static_path and use that (kinda like how external images use _cononical_url). I'd like to work on this and would be happy to send a PR. Is it worth it for the community? On Sunday, June 21, 2015 at 9:28:40 PM UTC-4, Devin Weaver wrote: The documentation is a little sparse on this. When attempting to render static files http://tiddlywiki.com/#Generating%20Static%20Sites%20with%20TiddlyWiki is there a way to choose the output path/filename or is is based on the tiddlers directory structure or the tiddler titles? -- You received this message because you are subscribed to the Google Groups TiddlyWiki group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/ac04d7fe-5f89-497e-b717-9dd051713e5e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: Static files configuration
So here is my use case and I'd like to propose a feature (obviously I would implement and send a pull request). I have a static site blog (http://tritarget.org/) And to be honest the build is way to complicated for my liking. Jekyl kept fighting me and using metelsmith now is like a 10 minute deploy step. It's silly. None of which takes in to account JavaScript. I'm a JS developer by day. I love frameworks like Ember.JS and such. But these frameworks are not so useful as a blog because search engines can't crawl it well. Then I saw hoe tiddlywiki.com does it! Perfect a fully fledged (and I'll admit, beautiful) single page app that does everything I want including writing out tiddlers to static files. Perfect! The gotcha: the current site already has several back links to it. Changing the names and file structure of those static HTML files would trash the current search results and break a lot of other people's links. So what I want to to recreate the site in TiddlyWiki and have my build process also render the static files but use a field to determine the outputs file/directory names. This way new content can easily be managed and created while old content can keep it's legacy paths. I'd propose to add a feature to look at a tiddlers fields for something like _static_path and use that (kinda like how external images use _cononical_url). I'd like to work on this and would be happy to send a PR. Is it worth it for the community? On Sunday, June 21, 2015 at 9:28:40 PM UTC-4, Devin Weaver wrote: The documentation is a little sparse on this. When attempting to render static files http://tiddlywiki.com/#Generating%20Static%20Sites%20with%20TiddlyWiki is there a way to choose the output path/filename or is is based on the tiddlers directory structure or the tiddler titles? -- You received this message because you are subscribed to the Google Groups TiddlyWiki group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f881e857-3b07-4cc8-9e88-4141b407c84c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [tw] Re: Static files configuration
On Thursday, June 25, 2015 at 1:29:19 PM UTC+2, Jeremy Ruston wrote: I'd considered extending the mechanism with some kind of filter-based cascading rules. For example: /tasks/$encoded-title$: [tag[Task]] /ideas/$encoded-title$: [tag[Ideas]] /archive/$encoded-title$: [is[tiddler]] That example would save tiddlers tagged task to /tasks, and those tagged ideas to /ideas, with the remainder getting an /archive URL. I like this idea. But what if a tiddler has 2 tags eg: Task Ideas ? -m -- You received this message because you are subscribed to the Google Groups TiddlyWiki group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/3304fda5-b781-4a79-98f4-38c00666a56e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [tw] Re: Static files configuration
Hi Devin On Tue, Jun 23, 2015 at 1:52 AM, Devin Weaver weaver.de...@gmail.com wrote: The tiddler files however could have any title. So the real question is how does the rendertiddler command know what path and filename to output to? Is it the tiddler title? or the original tiddler path with .tid turned to .html? The rendertiddlers command uses the URI encoded tiddler title for the filename: https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/commands/rendertiddlers.js#L60 I'd considered extending the mechanism with some kind of filter-based cascading rules. For example: /tasks/$encoded-title$: [tag[Task]] /ideas/$encoded-title$: [tag[Ideas]] /archive/$encoded-title$: [is[tiddler]] That example would save tiddlers tagged task to /tasks, and those tagged ideas to /ideas, with the remainder getting an /archive URL. Best wishes Jeremy. And Finally does TiddlyWiki have a way to customize that path? Can the file tiddlers/foo/bar.tid with a title: baz bar froboz be outputted to output/static/all/the/good/stuff/baz-bar-froboz.html ? On Monday, June 22, 2015 at 3:09:16 PM UTC-4, PMario wrote: IMO can be defined with the output parameter. see: http://tiddlywiki.com/#OutputCommand, http://tiddlywiki.com/# http://tiddlywiki.com/#CommandsCommands http://tiddlywiki.com/#Commands How does you command look like? -m -- You received this message because you are subscribed to the Google Groups TiddlyWiki group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/97af8ea8-0184-4bd8-adeb-a21dfb880415%40googlegroups.com https://groups.google.com/d/msgid/tiddlywiki/97af8ea8-0184-4bd8-adeb-a21dfb880415%40googlegroups.com?utm_medium=emailutm_source=footer . For more options, visit https://groups.google.com/d/optout. -- Jeremy Ruston mailto:jeremy.rus...@gmail.com -- You received this message because you are subscribed to the Google Groups TiddlyWiki group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/CAPKKYJZbUwRkwaY1RcYLx1AccrFAdGmobi5HQ7Eq98aqOpSmQQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [tw] Re: Static files configuration
Hi Mario I like this idea. But what if a tiddler has 2 tags eg: Task Ideas ? The cascading part of the idea would be to use the first matching rule. Best wishes Jeremy -m -- Jeremy Ruston mailto:jeremy.rus...@gmail.com -- You received this message because you are subscribed to the Google Groups TiddlyWiki group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/CAPKKYJbqN6uY0UA2ea0KFUa7hJMq6zO9n78dQt%2B90qxSCEyBZA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: Static files configuration
I just did build editions/tw5.com, where the tiddlers are grouped in paths. Creating the static tiddlers, didn't preserve the path structure. I did rename About.tid to aa.tid it was still rendered to About.html So It uses the tiddler name inside of TW to create the .html files. There are some character substitutions eg space - %20 and so on. So at the moment, IMO the core doesn't know a way to create a directory structure and define the exported html names. TW has a parameter for tiddlywiki.info config: { retain-original-tiddler-path: true } So it should be possible to recreate the directory structure, but it's not used atm. -mario -- You received this message because you are subscribed to the Google Groups TiddlyWiki group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/7311a5f7-fb91-44aa-9dd5-c840afb0e743%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: Static files configuration
I appreciate your reply but that isn't quite the question I was attempting to ask. Perhaps a little context: When a static rendertiddler command is run (with out --output) it will save the static files to output/static/balh/blah/blah.html The tiddler files however could have any title. So the real question is how does the rendertiddler command know what path and filename to output to? Is it the tiddler title? or the original tiddler path with .tid turned to .html? And Finally does TiddlyWiki have a way to customize that path? Can the file tiddlers/foo/bar.tid with a title: baz bar froboz be outputted to output/static/all/the/good/stuff/baz-bar-froboz.html ? On Monday, June 22, 2015 at 3:09:16 PM UTC-4, PMario wrote: IMO can be defined with the output parameter. see: http://tiddlywiki.com/#OutputCommand, http://tiddlywiki.com/# http://tiddlywiki.com/#CommandsCommands http://tiddlywiki.com/#Commands How does you command look like? -m -- You received this message because you are subscribed to the Google Groups TiddlyWiki group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/97af8ea8-0184-4bd8-adeb-a21dfb880415%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[tw] Re: Static files configuration
IMO can be defined with the output parameter. see: http://tiddlywiki.com/#OutputCommand How does you command look like? -m -- You received this message because you are subscribed to the Google Groups TiddlyWiki group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at http://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/8987150a-cf82-4eaa-bcad-2434ffe9e486%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.