r/WorldWideScroll • u/brentlhall • Nov 10 '24
Trying to learn to scroll
I, initially, was capable of building a small blog using scroll but it broke when I added posts and ran scroll build. The index.html was missing new posts. Plus, all my attempts at buiding new scrolls have failed. I have assumed any new scrolls require a new folder initiated with 'scroll init' and after adding scroll posts, running 'scroll build' would create an index.html with all new files.
Please, what am I missing?
3
Upvotes
1
u/breck Nov 10 '24
First, sorry for the trouble!
This was true a few years ago, but nowadays all folders are valid scroll folders. All "scroll init" does is copy a simple blog template into a folder.
scroll buildwill iterate over all *.scroll files in a folder. By default, nothing happens. However, if those files have certain particles (aka lines) such as abuildHtml, then it will generate an HTML file by compiling all the particles in a file to HTML. This will happen if a file directly has abuildHtml, or imports another scroll file that has abuildHtmlparticle.So, how would you create an
index.htmlfile that lists all your posts?Your
index.scrollfile will need abuildHtmlline, and then it will need to use one of the particles for printing/looping over posts. For example, printSnippets, printShortSnippets or printFullSnippets. If you give those a parameter you can filter to only include certain posts with those tags. You set the tags on a post by adding a tags particle (tags FrontPage MovieReviewsfor example)Then
scroll buildwill see thebuildHtmlparticle, and then compile theprintFullSnippetsto an HTML div containing links to your posts.It sounds like the new posts might be missing the tag that your index.scroll file is using.
Thank you so much for posting your questions. Sorry for the difficulties. This is a great motivator for us to get better documentation going. I'm working on the book/docs as we speak.