by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Joshua Tyree
    @Josh_Tyree_twitter
    I’m experiencing an issue where some assets are served using the asset host (both forced via initializer config and the site-specific asset host override) are not being served through the asset host.
    Any idea why that would be the case?
    Joshua Tyree
    @Josh_Tyree_twitter
    Sorted it out.
    Peter Salomon
    @patternpoints
    Again another question from my side… its about scope_with and tags. Can i use scope_with and Regex on tags? What i want is a case insensitive search for tags...
    {% with_scope tags.in: ["/startup/i“] %} doesn´t do the job.
    Manu
    @manuchap
    @facemapper Nope. {% with_scope tags: ["startup“,"Startup"] %} will.
    But it would be a nice feature
    Peter Salomon
    @patternpoints
    @manuchap - thank you! So simple… why didn’t that idea come into my mind by itself? Instead i used coal to retrieve all records, downcase all tags and save them back… worked as well but will never be safe for editors not taking care...
    Nikolay Bonev
    @DonKoko
    @facemapper @manuchap, actually you can scope with regex, but i think it doesnt work with an array.
    Manu
    @manuchap
    @DonKoko Didn't know that... Would you have an example?
    Nikolay Bonev
    @DonKoko
    @manuchap took some digging around as i didnt use this in a long time
      {% capture filter_name_query %}/{{ params.search_query }}/i{% endcapture %}
      {% with_scope name: filter_name_query %}
    Manu
    @manuchap

    @DonKoko Well It doesn't work (anymore?). So I came up with a very ugly attempt at doing it in liquid only (out of boredom) when an action would be much simpler:

    - "Post 1":
        tags:
        - az
        - er
    - "Post 2":
        tags:
        - Az
        - yu
    - "Post 3":
        tags:
        - AZ
        - pq
    {% for post in contents.posts %}
      {% for tag in post.tags %}
        <a href="results?filter={{ tag }}">{{ tag }}</a><br>
      {% endfor %}
    {% endfor %}
    ---
    title: Results
    published: true
    ---
    Filter : {{ params.filter }}<br>
    {% capture scope1 %}{{ params.filter | downcase }}{% endcapture %}
    {% capture scope2 %}{{ params.filter | capitalize }}{% endcapture %}
    {% capture scope3 %}{{ params.filter | upcase }}{% endcapture %}
    {% with_scope tags: scope1 %}
    {% for post in contents.posts %}
    {{ post.title }} - {{ post.tags | join }}<br>
    {% endfor %}
    {% endwith_scope %}
    {% with_scope tags: scope2 %}
    {% for post in contents.posts %}
    {{ post.title }} - {{ post.tags | join }}<br>
    {% endfor %}
    {% endwith_scope %}
    {% with_scope tags: scope3 %}
    {% for post in contents.posts %}
    {{ post.title }} - {{ post.tags | join }}<br>
    {% endfor %}
    {% endwith_scope %}

    Renders:
    Filter : AZ
    Post 1 - az er
    Post 2 - Az yu
    Post 3 - AZ pq

    Actually {% with_scope tags: ["az","Az","AZ"] %}works when hardcoded but after many attempts I couln't figure out how to pass the quotes properly to the query.
    Nikolay Bonev
    @DonKoko
    thanks @manuchap
    that is very strange tho. I am curious why functionality like this would be removed
    Manu
    @manuchap
    I was about to suggest facemapper to create a model for tags (a la wordpress taxonomies) with a relationship to posts but then it makes the tags field irrelevant... I wish tags would return an array instead of a string so that we could use the long awaited uniq liquid filter along with them...
    Peter Salomon
    @patternpoints
    @manuchap yes, that would make the tags field irrelevant. And - what do you mean with „i wish tags would return an array instead of a string …“ It certainly does and you treat them also as such in your scripts. So i guess i didnt get the point.
    Peter Salomon
    @patternpoints
    Anyway, it would be a great feature if we could have {% with_scope tags: [„tag1“, „tag2“], case_sensitive: false %}
    Manu
    @manuchap
    @facemapper I might have been wrong on that point. I'm not much of a coder and go by trial and error and sometimes get confused...
    Peter Salomon
    @patternpoints
    @manuchap Ah, okay, i know these head banging moments too well :D
    Peter Salomon
    @patternpoints
    But i like the power of scoping by regex expression. As i tried before .. although using liquid to setup that: {% with_scope tags.in: ["/startup/i“] %}really is a pain.
    Manu
    @manuchap
    Especially if you want to set the tag programatically
    Peter Salomon
    @patternpoints
    Yes - you would need to prepend „/„ and append „/i“ or capture the string parts. Its possible, but far from elegant
    Manu
    @manuchap
    I've tried with no success. For some reason prepending or appending cancels the upcase or downcase arguments.
    in a oneliner
    Peter Salomon
    @patternpoints
    in very early versions of liquid it was possible to do: {% assign regexstring = ‚/' | append: mytag | append: ‚/i' %}.
    and regexstring would be „/startup/i“. ( given that mytag is „startup“)
    But i haven´t tested if thats still possible
    Peter Salomon
    @patternpoints
    I am having another problem right now, maybe you know how to do this:
    When you upload an image, locomotive automatically converts the image url to the AWS S3 path. But now i have videos uploaded in the assets backend.
    Question is: how to i create the path to S3 files that are not images?
    i am missing something like a „asset_file_path“ filter...
    Manu
    @manuchap
    Dunno about that. I never upload videos to the assets backend and don't use s3 except on an old backup engine. What's the use case?
    Peter Salomon
    @patternpoints
    i am playing around with video backgrounds and overlays. I just wanted to upload a bunch of highly compressed videos as mp4, webm and ogv and let the editor choose one of them with a select. Not letting them upload them, because i guess editors would not be able to prepare videos for that. And my production asset storage is S3. I guess i have to upload them via the „file“ field type and fetch the url with post.video.url.
    Peter Salomon
    @patternpoints

    Ooops.. interesting: the sections don´t support files: Resource invalid: definition The property '#/settings/0/type' value "file" did not match one of the following values: text, image_picker, checkbox, select, url, radio, content_type, hint

    SO, you can´t use type file in sections directly. Ony content_types do have that option...

    Joshua Tyree
    @Josh_Tyree_twitter
    My best / most performant solution was to host videos off-platform making the end user responsible for sorting that out then lazy load the videos after doc ready
    Storing the video as a localizable string in the event of bi-ligual videos
    It’s on my rainy day list to extend engine to support our video transcoding service
    Joshua Tyree
    @Josh_Tyree_twitter
    Since we started using Locomotive several years ago, I’ve gone through many ideas/implementations on hosting engine in a clustered environment. Some worked “good”, but not great, some pretty bad. What have others done to host Locomotive in a cluster or load-balanced configuration? How have you managed synchronization between the nodes without requiring a deploy to each node?
    Peter Salomon
    @patternpoints
    @Josh_Tyree_twitter Maybe i am not really the right person to answer your question due to lack of experience, however by concept i think that locomotive comes already with pretty much everything you need: under the hood it uses mongodb, which is easily scalable. It´s default setup is heroku-ready, which is as well already a load balanced environment. Since assets are hosted on S3, i don´t see any extra configuration with that. The only thing i haven´t read much about is caching, but i remember, it uses racks caching methods, and i will add memcache to my project and give that a try, because i made once extremely good experiences with it. But maybe this is all pure therory. I am runnig locomotivecms on a single instance right now. Worth mentioning maybe that the memory consumption has become way less since version 4.
    Joshua Tyree
    @Josh_Tyree_twitter
    My questions pertain more towards the hyper-optimized distrobution rather than default. You can roll out a deployment like you’ve described, but there you’re going to find large pockets of slow down which then leads to your websites being way slower than they need to be. MongoDB while scalable, is slow, so if you use a lot of snippets, use heavy data-binding like is common in large enterprise websites, you’re going to see very slow load speeds.
    What I’ve found with Mongo is that if it’s not running on the same node, it’s way too slow.
    Joshua Tyree
    @Josh_Tyree_twitter
    Our operating parameters dictate that all pages / sites that we build and host must be able to have a fully-loaded time at a max of 1s. Part of that is solved by indexing data and lazy-loading all content outside of the first viewport, heavy caching implementations, and extremely optimized VPSs/Kubernetes configs. All these extra steps create problems with continuous integration / deployment because the margin for error if not done perfectly is too high. So being able to deploy to all nodes in a cluster simultaneously without issues would be a good start at fixing our CI/CD pipeline.
    Peter Salomon
    @patternpoints
    I have no clue about running locomotivecms in larger scales honestly. So, sorry, no experiences to share here from my side. But its an interesting scenario that you are dealing with. About how many nodes are we talking and what are the issues you are experiencing with simultaneous deployments?
    Alex Wellnitz
    @alexohneander
    Hello, how can I read the metafields from my Gem?
    I have built an Instagram Client and now I want to read the apikey from the metafields
    Peter Salomon
    @patternpoints
    @alexohneander „gem“ ?
    @alexohneander But i guess this answers your question: https://doc.locomotivecms.com/docs/site-metafields
    Alex Wellnitz
    @alexohneander

    @patternpoints I built an Instagram client as Ruby-Gem.
    I linked this Gem to my Locomotive page.

    The Ruby-Gem serves as a plugin and provides a Liquid-Drop, with these drop I can display my Instagram Postings.
    In this gem I would like to access the metafields. If I see it right, this only works with Coal?

    ProgrammerGuy
    @guy_programmer_twitter
    I'm trying to deploy a project to multiple sites. Lets say I have 100 sites and 1 project. All 100 sites are identical, except the content for each is different. I made a change to the project, added a section. Thus I would have to deploy the changes to all sites.... I don't want to 'wagon deploy' 100 times lol is there away that i can deploy to all sites at once ?
    Nikolay Bonev
    @DonKoko
    I dont think wagon has such a feature
    you can make a simple ruby script that loops over the your deploy file and runs wagon deploy for each