public void Prepend()
        {
            var input = new StringValue("World");

            var arguments = new FilterArguments().Add(new StringValue("Hello "));
            var context   = new TemplateContext();

            var result = StringFilters.Prepend(input, arguments, context);

            Assert.Equal("Hello World", result.ToStringValue());
        }
Exemplo n.º 2
0
        public static async Task <FluidValue> RelativeUrl(FluidValue input, FilterArguments arguments, TemplateContext context)
        {
            var site = context.GetValue("site");
            //var config = await site.GetValueAsync("configuration", context);
            var baseUrl = await site.GetValueAsync("baseUrl", context);

            if (baseUrl.IsNil())
            {
                return(input);
            }

            return(StringFilters.Prepend(input, new FilterArguments(new StringValue(baseUrl.ToStringValue())), context));
        }