middleman

How do I create root-relative links in a static site?

蓝咒 提交于 2021-02-06 09:01:21
问题 When building a static HTML site, you can set the base url like so <base url="http://localhost:8888/mysite" /> . Supposedly when you insert, say, an image, you can do so from that base url like so <img src="/img/logo.png" /> , which is equivalent to <img src="http://localhost:8888/mysite/img/logo.png" /> My problem is that these relative links don't work when I move the site around, which is a pain because I'm trying to share it with someone on Dropbox. I thought I could just chage the base

How do I create root-relative links in a static site?

喜欢而已 提交于 2021-02-06 08:59:12
问题 When building a static HTML site, you can set the base url like so <base url="http://localhost:8888/mysite" /> . Supposedly when you insert, say, an image, you can do so from that base url like so <img src="/img/logo.png" /> , which is equivalent to <img src="http://localhost:8888/mysite/img/logo.png" /> My problem is that these relative links don't work when I move the site around, which is a pain because I'm trying to share it with someone on Dropbox. I thought I could just chage the base

微服务架构下的测试策略

主宰稳场 提交于 2020-10-01 02:55:26
源宝导读: 最近几年,微服务架构越来越火爆,逐渐被企业所采用。随着软件架构的变化,对应的软件测试策略需要作何调整呢?本文将介绍云客在微服务架构下的测试策略。 一、云客测试策略模型 策略分析 行业内的测试策略 是一个先底层再上层、从局部到整体的一个过程: 从行业内的演进过程可以看到,项目测试策略在不同阶段结合参考了不同的策略模型:金字塔->近似钻石->蜂巢。 基于行业经验,结合我们实际的架构特点,云客同样划分为不同的层级进行测试:客户端、BFF层、服务层,跟钻石型的过程是类似的。 各层测试侧重点 服务层不正常可能会影响BFF,BFF不正常可能会影响客户端,但每一层级各自验证的侧重点是不同的: 1 客户端 检查客户端(APP、小程序、WEB站点)操作以及操作后的界面呈现。 2 BFF层 不考虑服务层的实现规则和数据库存储,只关注用户在客户端的不同操作场景下,业务逻辑是否达到预期,确保衔接客户端和服务层是否正确。 3 服务层 对单个服务接口逐个测试,需要考虑入参和出参、数据库存储是否符合预期。 二、BFF层测试策略 BFF层测试面临的问题 由于BFF层的接口通常会调用到多个底层服务接口,由此暴露出一系列问题: 涉及业务场景多 涉及多种缓存 自动化用例设计难度大 工具的缺失 BFF层测试策略分析 针对以上问题,考虑云客的BFF层测试策略需要达到以下效果: 解决用例设计困难:

Middleman blog - How to ensure that article.path translates to an absolute path?

夙愿已清 提交于 2020-01-24 15:02:50
问题 I hope somebody can help - In my Middleman project, I want the blog articles to be in a subdirectory inside /source/ (so for instance '/source/webdev/blog/). I've followed the instructions, and muddled through (I'm new to Middleman and a complete Ruby newbie) and got the links to appear when calling: article.path HOWEVER - the links appear as relative urls, regardless of what I set in config.rb. I've disabled :relative_assets (didn't seem to make any difference anyway), and I'm not using

Middleman: undefined method `link_to' when rendering markdown from data file

筅森魡賤 提交于 2020-01-06 21:40:08
问题 I am using Markdown written in data file to render HTML in HAML template with Middleman static page generator. My data file, data/faq.yaml looks like this: dog: question: I want to know more about a dog. answerA: (HTML in data) Just <a href="https://google.com">Google</a> it! answerB: (Markdown link in data) Just [Google](https://google.com) it! To convert this markdown to HTML, I am using custom helper defined in config.rb : helpers do def markdown(text) Tilt['markdown'].new { text }.render

Passing local data variables between layout and template

眉间皱痕 提交于 2020-01-04 06:18:25
问题 I need to be able to share local data (in a yaml file) from templates with a layout. I want to be able to load relevant YAML data in the template then have that data be accessible from the layout (and associated partials). Is this possible? I found this blog post which seems to indicate that this is possible through some shennaigans but I can't get it to work and this seems hacky. Is there a built in way to pass data between templates and layouts? And if not, can the hack in this blog post be

Passing local data variables between layout and template

谁说胖子不能爱 提交于 2020-01-04 06:18:10
问题 I need to be able to share local data (in a yaml file) from templates with a layout. I want to be able to load relevant YAML data in the template then have that data be accessible from the layout (and associated partials). Is this possible? I found this blog post which seems to indicate that this is possible through some shennaigans but I can't get it to work and this seems hacky. Is there a built in way to pass data between templates and layouts? And if not, can the hack in this blog post be

Error FOR gem install nokogiri AND bundle install FOR Middleman app

。_饼干妹妹 提交于 2019-12-25 13:15:15
问题 I’m starting a Middleman app from scratch. Whenever I attempt to run the server, i.e. middleman server I get an error (below) that tells me “error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue.” However, when I attempt to install nokogiri (1.6.6.2), I get another error (below) that says me “ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension.” I then attempt to bundle install my gemfile but receive another error. Can anyone tell me what I

error in `install bundler` while installing ruby gems on windows machine

喜夏-厌秋 提交于 2019-12-24 00:58:17
问题 I am trying to intsall middleman - a static site generator, which uses ruby gems. It is able to build all native extensions but not wdm. I am getting the below error message when I run install bundler command in my command prompt. Gem::Ext::BuildError: ERROR: Failed to build gem native extension. C:/Ruby200/bin/ruby.exe -r ./siteconf20140814-4200-t0fvuf.rb extconf.rb checking for main() in -lkernel32... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of

How to get YAML files to render in middleman with erb

允我心安 提交于 2019-12-22 00:15:00
问题 I have a file written in yaml that I would like to render with middleman using erb. How do I render this so that the yaml file will be translated to HTML. I would later like to style it using CSS. I have found no information of how to do this basic task online anywhere. For example say I have the yaml file: main_title: 'Ruby Operators' sections: - section_title: 'Arithmetic' items: - title: '[ + ] Addition: ' value: 'Adds values on either side of the operator' - title: '[ − ] Subtraction: '